Skip to content

Commit

Permalink
update petri poem
Browse files Browse the repository at this point in the history
  • Loading branch information
eyaler committed Jun 23, 2024
1 parent 28e0a35 commit 04d29dd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 24 deletions.
3 changes: 2 additions & 1 deletion resen/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ function make_link(url, label, cls, title, new_tab=false, force_new_tab_for_mail
}


function get_set_titles(page, lang='', elem) {
function get_set_titles(page, lang, elem) {
lang ??= get_lang()
const titles = {label: pages[page]?.title ?? page.split('/')[0], alt: ''}
if (pages[page]?.alt) {
titles.alt = pages[page].alt
Expand Down
4 changes: 2 additions & 2 deletions resen/petri/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@
<br>
<div class="petri" oncontextmenu="toggle_fullscreen(event)"></div>

<textarea id="poem" autocomplete="off" readonly rows="15" spellcheck="false" oncontextmenu="toggle_fullscreen(event)">
<textarea id="poem" dir="auto" readonly rows="15" spellcheck="false">

</textarea>
</textarea> <!-- Initial newline -->
<div class="refs">
<blockquote>Susan Stepney, <a href="https://susan-stepney.blogspot.com/2012/12/ode-to-petri-net.html">ODE to a Petri net</a> (2012).</blockquote>
<blockquote>Owen Lynch, <a href="https://owenlynch.org/posts/2019-12-13-petri-nets-in-action/">Petri Nets in Action</a> (2019).</blockquote>
Expand Down
12 changes: 3 additions & 9 deletions resen/petri/poem.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,11 @@
<noscript><style>body {visibility: visible}</style></noscript>
</head>
<body class="todark" onload="document.body.style.visibility = 'visible'">
<textarea id="title" dir="auto" readonly rows="1" spellcheck="false" style="margin-block: 4em -1em"></textarea>
<textarea id="poem" dir="auto" readonly rows="15" spellcheck="false"></textarea>
<script>
make_header()
let target_screen
// if (typeof getScreenDetails != 'undefined') // Only works in Chromium desktop
// getScreenDetails().then(result => target_screen = result.screens.find(s => !s.isPrimary))
</script>
<textarea id="poem" autocomplete="off" readonly rows="15" spellcheck="false" oncontextmenu="toggle_fullscreen(event, true, target_screen)"></textarea>
<script>
make_footer()
title.value = get_set_titles('petri/').label
new BroadcastChannel('bc').onmessage = e => textarea_writeln(poem, e.data)
toggle_fullscreen(poem, true, target_screen) // works only in Firefox, after setting: full-screen-api.allow-trusted-requests-only = false
</script>
</body>
</html>
16 changes: 4 additions & 12 deletions resen/petri/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
src: url('fonts/IBMPlexMono-Regular.woff2');
}

.petri, #poem {
.petri, textarea {
--fg: rgb(var(--whitish));
font-family: 'IBM Plex Mono', 'Courier New', var(--mono_font);
font-size: initial;
outline-style: none;
outline-style: none !important;
}

.petri {
Expand Down Expand Up @@ -100,24 +100,16 @@
bottom: var(--ver_offset);
}

#poem {
textarea {
background-color: white;
border: none;
box-sizing: border-box;
display: block;
line-height: 2.5;
line-height: 2.5 !important;
margin-block: 4em 6em;
margin-inline: auto;
padding-inline: 3em;
resize: none;
white-space: pre-line;
width: var(--media_width);
}

nav[dir=ltr] ~ #poem {
direction: ltr;
}

nav[dir=rtl] ~ #poem {
direction: rtl;
}

0 comments on commit 04d29dd

Please sign in to comment.