Skip to content

Commit

Permalink
fix footnotes
Browse files Browse the repository at this point in the history
  • Loading branch information
eyaler committed Dec 1, 2024
1 parent cb494f8 commit 0f6c2ae
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 34 deletions.
32 changes: 16 additions & 16 deletions resen/fateful/index.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions resen/fateful/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
html {
overflow-x: clip;
overscroll-behavior: none;
scroll-behavior: smooth;
}

body {
Expand Down
2 changes: 1 addition & 1 deletion resen/petri/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
<br>
<div class="petri" id="petri" oncontextmenu="toggle_fullscreen(event)" onmousemove="show_hide_cursor(this)"></div>

<textarea id="poem" autocomplete="off" dir="auto" readonly rows="15" spellcheck="false"></textarea>
<textarea id="thepoem" autocomplete="off" dir="auto" readonly rows="15" spellcheck="false"></textarea>

<br>
<div class="refs">
Expand Down
6 changes: 3 additions & 3 deletions resen/petri/poem.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
</head>
<body class="toblack" onload="document.body.style.visibility = 'visible'" onmousemove="show_hide_cursor(this)">
<textarea id="title" autocomplete="off" dir="auto" readonly rows="1" spellcheck="false"></textarea>
<textarea id="poem" autocomplete="off" dir="auto" readonly rows="32" spellcheck="false"></textarea>
<textarea id="thepoem" autocomplete="off" dir="auto" readonly rows="32" spellcheck="false"></textarea>
<script>
if (location.hash.slice(1).startsWith('full'))
toggle_fullscreen(document.documentElement); // works only in Firefox, after setting: full-screen-api.allow-trusted-requests-only = false

let prev_lang
new BroadcastChannel('bc').onmessage = e => {
if (e.data) {
textarea_writeln(poem, e.data.replace(/\n$/, ''))
textarea_writeln(thepoem, e.data.replace(/\n$/, ''))
const lang = e.data.localeCompare('z') > 0 ? '' : 'en'
if (lang != prev_lang)
title.value = get_set_titles('petri/', lang).label + ' / ' + get_make_author('/', lang)[0][0]
prev_lang = lang
} else
poem.value = '\n'
thepoem.value = '\n'
}
</script>
</body>
Expand Down
12 changes: 6 additions & 6 deletions resen/petri/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const lang = get_lang()
const bc = new BroadcastChannel('bc')

function reset_poem() {
if (typeof poem != 'undefined')
poem.value = '\n'
if (typeof thepoem != 'undefined')
thepoem.value = '\n'
if (typeof bc != 'undefined')
bc.postMessage('')
}
Expand Down Expand Up @@ -167,8 +167,8 @@ function fire(grid, json, steps, max_tokens, result_counter, reset_counter, toke
out.forEach(p => tokens[p] = (tokens[p] || 0) + 1)
if (!comp) {
const verse = poem_generator(json, trans, out[Math.random() * out.length | 0])
if (typeof poem != 'undefined')
textarea_writeln(poem, verse)
if (typeof thepoem != 'undefined')
textarea_writeln(thepoem, verse)
if (typeof bc != 'undefined')
bc.postMessage(verse)
}
Expand Down Expand Up @@ -346,8 +346,8 @@ function step(grid, json, steps=0, max_tokens={}, result_counter={}, reset_count
step(grid, json, 0, max_tokens, result_counter, reset_counter)
} else if (!enabled.length || comp && Object.values(tokens).some(n => n > place_max_tokens) || !comp && !json.require?.every(require => require.some(t => tokens[t]))) {
if (!comp) {
if (typeof poem != 'undefined')
textarea_writeln(poem)
if (typeof thepoem != 'undefined')
textarea_writeln(thepoem)
if (typeof bc != 'undefined')
bc.postMessage('\n')
if (stats) {
Expand Down
17 changes: 9 additions & 8 deletions resen/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -905,20 +905,23 @@ nav[dir=ltr] ~ * .preface_he {
}

.ref {
display: inline-block;
font-family: var(--font);
font-size: .7rem;
font-size: max(.7rem, .2em);
vertical-align: text-top;
text-underline-position: from-font;
unicode-bidi: plaintext;
}

.ref::after {
content: attr(href);
}

.refs {
margin-top: 6ex;
:is(.ref, .refs > blockquote[id])::first-letter {
font-size: 0;
}

.refs + p {
.refs, .refs + p {
margin-top: 6ex;
}

Expand All @@ -945,17 +948,15 @@ nav[dir=rtl] ~ :nth-last-child(1 of .refs):not([data-title]) {

.refs > blockquote {
font-size: initial;
position: relative;
}

.refs:not([dir=rtl]) > blockquote {
direction: ltr;
}

.refs > blockquote[id]::before {
content: attr(id);
margin-inline-start: -1.2em;
position: absolute;
content: attr(id) '.';
padding-inline-end: 1em;
}

.refs > blockquote a {
Expand Down

0 comments on commit 0f6c2ae

Please sign in to comment.