diff --git a/Dockerfile b/Dockerfile index 7340d81..eacd705 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ COPY assets/scenes /usr/share/nginx/html/assets/scenes COPY assets/characters /usr/share/nginx/html/assets/characters COPY assets/audio /usr/share/nginx/html/assets/audio COPY assets/icons /usr/share/nginx/html/assets/icons +COPY assets/fonts /usr/share/nginx/html/assets/fonts COPY assets/voices /usr/share/nginx/html/assets/voices EXPOSE 80 diff --git a/assets/fonts/OFL-press-start-2p.txt b/assets/fonts/OFL-press-start-2p.txt new file mode 100644 index 0000000..5891186 --- /dev/null +++ b/assets/fonts/OFL-press-start-2p.txt @@ -0,0 +1,93 @@ +Copyright 2012 The Press Start 2P Project Authors (cody@zone38.net), with Reserved Font Name "Press Start 2P" + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/fonts/press-start-2p-latin-ext.woff2 b/assets/fonts/press-start-2p-latin-ext.woff2 new file mode 100644 index 0000000..0919c5f Binary files /dev/null and b/assets/fonts/press-start-2p-latin-ext.woff2 differ diff --git a/assets/fonts/press-start-2p-latin.woff2 b/assets/fonts/press-start-2p-latin.woff2 new file mode 100644 index 0000000..947a979 Binary files /dev/null and b/assets/fonts/press-start-2p-latin.woff2 differ diff --git a/src/main.js b/src/main.js index 9331bc4..a474dd7 100644 --- a/src/main.js +++ b/src/main.js @@ -75,7 +75,7 @@ $('skip-intro').addEventListener('click', () => { introLine = story.intro.length $('credits-list').replaceChildren(...(story.credits ?? []).flatMap(({ role, names }) => { const dt = document.createElement('dt'), dd = document.createElement('dd'); dt.textContent = role; - dd.textContent = names.join(' · '); + dd.replaceChildren(...names.map(n => Object.assign(document.createElement('span'), { textContent: n }))); return [dt, dd]; })); for (const b of document.querySelectorAll('.open-credits')) b.addEventListener('click', () => { $('credits').hidden = false; }); diff --git a/src/story/story.js b/src/story/story.js index a9b0e03..95e77ff 100644 --- a/src/story/story.js +++ b/src/story/story.js @@ -20,13 +20,14 @@ export const story = { // I crediti, schermata «Crediti» dal titolo e dalla fine: un ruolo e chi l'ha fatto. Arriveranno man mano. credits: [ { role: 'Un gioco di', names: ['Andrea Manzi «Manzolo»'] }, - { role: 'Idee e consigli', names: ['Yuri Baldi', 'BaronDeDuke (Gabriele Rossi)'] }, + { role: 'Idee e consigli', names: ['Yuri Baldi', 'BaronDeDuke (Gabriele Rossi)', 'Tozzino (Francesco Tozzi)'] }, { role: 'Storia e aneddoti di San Piero', names: ['Francesco Bacci'] }, { role: 'Musica', names: ['Andrea Manzi, con Suno'] }, { role: 'Sfondi', names: ['dalle fotografie di San Piero di Andrea'] }, // Chi ci ha mandato foto, ricordi o idee: una riga per contributo, si allunga man mano. { role: 'Fotografie', names: ['Mariano Mirannalti (l\'interno della Pieve)'] }, { role: 'Voci', names: ['XTTS-v2 di Coqui'] }, + { role: 'Carattere', names: ['Press Start 2P di CodeMan38 (licenza OFL)'] }, { role: 'Programmazione', names: ['Andrea Manzi, con Claude e Codex'] }, ], characters: { diff --git a/style.css b/style.css index 96bf3f4..9405b89 100644 --- a/style.css +++ b/style.css @@ -1,3 +1,7 @@ +@font-face { font-family: "Press Start 2P"; src: url(assets/fonts/press-start-2p-latin.woff2) format("woff2"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; font-display: swap; } +@font-face { font-family: "Press Start 2P"; src: url(assets/fonts/press-start-2p-latin-ext.woff2) format("woff2"); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; font-display: swap; } :root { --bg: #1b1420; --panel: #2a2030; @@ -5,11 +9,16 @@ --dim: #b9a9c2; --accent: #ffd27a; --blue: #6fa8ff; - --font: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; + /* Carattere a pixel stile anni '80 (Press Start 2P, licenza OFL: assets/fonts/OFL-press-start-2p.txt). */ + --font: "Press Start 2P", "Courier New", monospace; } * { box-sizing: border-box; } [hidden] { display: none !important; } html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); } +/* Il carattere a pixel ha un solo spessore: niente grassetti o corsivi finti, che lo sfocano. */ +* { font-synthesis: none; font-variant-ligatures: none; } +button, input { font-family: var(--font); } +body { line-height: 1.5; } body { display: flex; justify-content: center; overflow-x: hidden; -webkit-tap-highlight-color: transparent; } #app { width: min(100vw, 1280px, calc((100dvh - 250px) * 16 / 9)); min-width: min(100vw, 320px); margin-block: auto; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); } @@ -17,37 +26,37 @@ body { display: flex; justify-content: center; overflow-x: hidden; -webkit-tap-h #scene { width: 100%; height: 100%; display: block; image-rendering: pixelated; cursor: crosshair; } #speech { position: absolute; left: 0; top: 0; max-width: 46%; transform: translate(-50%, -100%); pointer-events: none; - font-size: clamp(14px, 2.3vw, 26px); font-weight: bold; line-height: 1.2; text-align: center; + font-size: clamp(10.08px, 1.66vw, 18.72px); font-weight: bold; line-height: 1.2; text-align: center; text-shadow: 2px 0 #000, -2px 0 #000, 0 2px #000, 0 -2px #000, 2px 2px #000, -2px -2px #000; } #speech:empty { display: none; } /* Musica: nota per il muto e cursore del volume, in alto a destra sopra la scena (anche sul titolo). */ #sound { position: absolute; top: 6px; right: 6px; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 4px; background: rgba(27, 20, 32, .62); border-radius: 18px; } -#mute { width: 30px; height: 30px; padding: 0; font: bold 18px var(--font); color: var(--accent); background: none; border: 0; cursor: pointer; } +#mute { width: 30px; height: 30px; padding: 0; font: bold 12.96px var(--font); color: var(--accent); background: none; border: 0; cursor: pointer; } #mute[aria-pressed="true"] { color: var(--dim); text-decoration: line-through; } #volume { width: clamp(60px, 10vw, 110px); accent-color: var(--accent); cursor: pointer; } -#sentence { min-height: 1.8em; padding: .25em .6em; text-align: center; color: var(--blue); font-size: clamp(15px, 2vw, 22px); font-weight: bold; background: var(--panel); } +#sentence { min-height: 1.8em; padding: .25em .6em; text-align: center; color: var(--blue); font-size: clamp(10.8px, 1.44vw, 15.84px); font-weight: bold; background: var(--panel); } #panel { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 8px; padding: 8px; background: var(--panel); } /* Otto verbi su due righe piene, quattro per riga. */ #verbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; align-content: start; } #verbs button, #inventory button { font: inherit; color: var(--dim); background: #3a2d42; border: 2px solid #4b3a55; border-radius: 4px; - padding: .35em .2em; font-size: clamp(13px, 1.7vw, 19px); font-weight: bold; cursor: pointer; } + padding: .35em .2em; font-size: clamp(9.36px, 1.22vw, 13.68px); font-weight: bold; cursor: pointer; } #verbs button:hover, #inventory button:hover { color: var(--ink); } #verbs button[aria-pressed="true"] { color: var(--bg); background: var(--accent); border-color: var(--accent); } #inventory { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(2.4em, auto); gap: 4px; align-content: start; min-height: 5.4em; padding: 4px; background: #231a29; border: 2px solid #4b3a55; border-radius: 4px; } #inventory:empty::before { content: 'Inventario'; grid-column: 1 / -1; align-self: center; text-align: center; color: var(--dim); opacity: .45; - font-size: clamp(13px, 1.7vw, 19px); font-weight: bold; letter-spacing: .08em; } + font-size: clamp(9.36px, 1.22vw, 13.68px); font-weight: bold; letter-spacing: .08em; } #inventory button { display: flex; align-items: center; gap: .35em; justify-content: center; color: var(--ink); } #inventory button[aria-pressed="true"] { border-color: var(--accent); } #inventory i { width: .8em; height: .8em; border-radius: 50% 50% 50% 0; flex: none; } #inventory img { width: 1.9em; height: 1.9em; flex: none; image-rendering: pixelated; } #choices { margin: 0; padding: 10px 14px 12px 2.4em; background: var(--panel); min-height: 9.5em; } -#choices li { padding: .25em 0; font-size: clamp(15px, 2vw, 22px); font-weight: bold; color: var(--dim); cursor: pointer; } +#choices li { padding: .25em 0; font-size: clamp(10.8px, 1.44vw, 15.84px); font-weight: bold; color: var(--dim); cursor: pointer; } #choices li:hover, #choices li:focus { color: var(--accent); outline: none; } .overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6em; @@ -61,10 +70,10 @@ body { display: flex; justify-content: center; overflow-x: hidden; -webkit-tap-h #title .subtitle { color: var(--ink); text-shadow: 2px 2px 0 #000; } #intro { justify-content: flex-start; padding-top: 7%; cursor: pointer; image-rendering: pixelated; background: linear-gradient(rgba(20, 12, 30, .6), rgba(20, 12, 30, .1) 55%), url(assets/scenes/panorama-intro.png) center / cover, #2a2030; } -#intro-text { min-height: 4.2em; max-width: 30em; font-size: clamp(16px, 2.6vw, 30px); font-weight: bold; line-height: 1.3; color: var(--ink); +#intro-text { min-height: 4.2em; max-width: 30em; font-size: clamp(11.52px, 1.87vw, 21.6px); font-weight: bold; line-height: 1.3; color: var(--ink); text-shadow: 2px 0 #000, -2px 0 #000, 0 2px #000, 0 -2px #000; animation: appear .8s ease-out; } -#intro .hint { margin-top: auto; color: var(--dim); font-size: clamp(12px, 1.5vw, 16px); text-shadow: 1px 1px 0 #000; } -#skip-intro { position: absolute; right: 10px; bottom: 10px; font: bold 14px var(--font); padding: .3em .9em; border-radius: 6px; border: 0; +#intro .hint { margin-top: auto; color: var(--dim); font-size: clamp(8.64px, 1.08vw, 11.52px); text-shadow: 1px 1px 0 #000; } +#skip-intro { position: absolute; right: 10px; bottom: 10px; font: bold 10.08px var(--font); padding: .3em .9em; border-radius: 6px; border: 0; color: var(--bg); background: var(--dim); cursor: pointer; } @keyframes appear { from { opacity: 0; transform: translateY(6px); } } /* Cartello d'apertura «Manzolo (Poca) Art Presents»: le parole entrano una alla volta, il «(Poca)» cade dall'alto @@ -72,24 +81,24 @@ body { display: flex; justify-content: center; overflow-x: hidden; -webkit-tap-h #splash { z-index: 3; gap: .15em; cursor: pointer; background: radial-gradient(circle at 50% 45%, #2a2030, #0d0910 70%); animation: splash-out .7s ease-in 4.3s forwards; } #splash p { margin: 0; max-width: none; font-weight: bold; text-shadow: 3px 3px 0 #000; opacity: 0; } -#splash .splash-name { font-size: clamp(34px, 8vw, 88px); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); +#splash .splash-name { font-size: clamp(24.48px, 5.76vw, 63.36px); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); animation: splash-in .9s ease-out .2s forwards; } -#splash .splash-art { font-size: clamp(22px, 4.5vw, 50px); color: var(--accent); animation: splash-in .9s ease-out 1s forwards; } +#splash .splash-art { font-size: clamp(15.84px, 3.24vw, 36px); color: var(--accent); animation: splash-in .9s ease-out 1s forwards; } #splash .splash-art span { display: inline-block; font-size: .7em; font-style: italic; color: #7fe08a; opacity: 0; animation: splash-poca .45s cubic-bezier(.3, 1.6, .6, 1) 1.9s forwards; } -#splash .splash-present { font-size: clamp(14px, 2.4vw, 26px); letter-spacing: .5em; text-transform: uppercase; color: var(--dim); +#splash .splash-present { font-size: clamp(10.08px, 1.73vw, 18.72px); letter-spacing: .5em; text-transform: uppercase; color: var(--dim); animation: splash-in .9s ease-out 2.6s forwards; } @keyframes splash-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } } @keyframes splash-poca { from { opacity: 0; transform: translateY(-1.5em) rotate(-8deg) scale(1.8); } to { opacity: 1; transform: rotate(-8deg); } } @keyframes splash-out { to { opacity: 0; } } -.overlay h1 { margin: 0; font-size: clamp(30px, 7vw, 76px); line-height: 1; letter-spacing: .02em; color: var(--ink); text-shadow: 3px 3px 0 #000; } +.overlay h1 { margin: 0; font-size: clamp(21.6px, 5.04vw, 54.72px); line-height: 1; letter-spacing: .02em; color: var(--ink); text-shadow: 3px 3px 0 #000; } .overlay h1 span { color: #7fe08a; } -.overlay h2 { margin: 0; font-size: clamp(24px, 5vw, 52px); color: var(--accent); } -.overlay p { margin: 0; max-width: 34em; font-size: clamp(13px, 2vw, 20px); } +.overlay h2 { margin: 0; font-size: clamp(17.28px, 3.6vw, 37.44px); color: var(--accent); } +.overlay p { margin: 0; max-width: 34em; font-size: clamp(9.36px, 1.44vw, 14.4px); } .subtitle { color: var(--dim); } .dedication { margin-top: .8em !important; font-style: italic; color: var(--accent); } .buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: .4em; } -.buttons button { font: inherit; font-weight: bold; font-size: clamp(15px, 2.2vw, 22px); padding: .45em 1.2em; border-radius: 6px; cursor: pointer; +.buttons button { font: inherit; font-weight: bold; font-size: clamp(10.8px, 1.58vw, 15.84px); padding: .45em 1.2em; border-radius: 6px; cursor: pointer; color: var(--bg); background: var(--accent); border: 0; } #continue { background: #7fe08a; } .buttons button.secondary { color: var(--ink); background: rgba(42, 32, 48, .85); box-shadow: inset 0 0 0 2px var(--dim); } @@ -97,43 +106,49 @@ body { display: flex; justify-content: center; overflow-x: hidden; -webkit-tap-h /* Mappa: la pianta del paese a gradini, i posti visti come cartellini, le strade come linee. */ /* In alto a sinistra: Pausa e Mappa. */ #corner { position: absolute; top: 6px; left: 6px; z-index: 2; display: flex; gap: 6px; } -#map-button, #pause-button { font: bold clamp(12px, 1.6vw, 16px) var(--font); padding: .35em .8em; +#map-button, #pause-button { font: bold clamp(8.64px, 1.15vw, 11.52px) var(--font); padding: .35em .8em; color: var(--accent); background: rgba(27, 20, 32, .62); border: 0; border-radius: 18px; cursor: pointer; } #pause { z-index: 3; background: rgba(15, 10, 20, .9); } .pause-buttons { flex-direction: column; align-items: stretch; min-width: min(70%, 16em); } #pause .hint { color: var(--dim); } #map { z-index: 3; justify-content: flex-start; padding-top: 2.5%; background: rgba(15, 10, 20, .94); } -#map h2 { font-size: clamp(18px, 3vw, 32px); } +#map h2 { font-size: clamp(12.96px, 2.16vw, 23.04px); } #map-board { position: relative; width: 92%; flex: 1; min-height: 0; margin: .3em 0; background: repeating-linear-gradient(transparent 0 calc(25% - 1px), rgba(185, 169, 194, .12) calc(25% - 1px) 25%), radial-gradient(circle at 50% 60%, #3a2d42, #231a29); border-radius: 8px; } #map-roads { position: absolute; inset: 0; width: 100%; height: 100%; } #map-roads line { stroke: #b9a9c2; stroke-width: 2.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; opacity: .7; } -#map-board button { position: absolute; transform: translate(-50%, -50%); font: bold clamp(10px, 1.5vw, 15px) var(--font); padding: .3em .6em; +#map-board button { position: absolute; transform: translate(-50%, -50%); font: clamp(6px, .82vw, 9px) var(--font); padding: .35em .45em; color: var(--bg); background: var(--ink); border: 2px solid #000; border-radius: 6px; cursor: pointer; white-space: nowrap; } #map-board button:hover { background: var(--accent); } #map-board button.here { color: var(--ink); background: #2f5fb3; cursor: default; } #map-board button.here::after { content: ' · sei qui'; font-weight: normal; } /* I crediti crescono con chi contribuisce: scorre solo l'elenco, dedica e Chiudi restano sempre in vista. */ #credits { z-index: 3; justify-content: flex-start; overflow: hidden; padding-top: 4%; background: rgba(15, 10, 20, .96); } -#credits .credits-dedication { margin: .2em 0 .5em !important; font-size: clamp(16px, 2.6vw, 28px); } +#credits .credits-dedication { margin: .2em 0 .5em !important; font-size: clamp(10px, 1.6vw, 17px); } /* Due colonne: il ruolo a destra della sua colonna, il nome a sinistra della sua, allineati sulla riga. */ #credits dl { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; padding-right: .4em; margin: .2em 0 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 1em; row-gap: .45em; align-items: baseline; width: min(100%, 44em); } -#credits dt { text-align: right; color: var(--dim); font-size: clamp(10px, 1.4vw, 14px); letter-spacing: .12em; text-transform: uppercase; } -#credits dd { margin: 0; text-align: left; color: var(--ink); font-size: clamp(13px, 2vw, 20px); font-weight: bold; } -#credits .legal { color: var(--dim); font-size: clamp(10px, 1.2vw, 13px); opacity: .8; } +#credits dt { text-align: right; color: var(--dim); font-size: clamp(7.2px, 1.01vw, 10.08px); letter-spacing: .12em; text-transform: uppercase; } +#credits dd span { display: block; } +#credits dd { margin: 0; text-align: left; color: var(--ink); font-size: clamp(8px, 1.15vw, 12px); line-height: 1.6; font-weight: bold; } +#credits .legal { color: var(--dim); font-size: clamp(7.2px, 0.86vw, 9.36px); opacity: .8; } #rotate { display: none; padding: 1em; text-align: center; color: var(--dim); } @media (orientation: portrait) and (max-width: 700px) { #rotate { display: block; } } +/* Schermi stretti: il carattere a pixel è largo, i verbi vanno sopra l'inventario e su due righe da quattro. */ +@media (max-width: 600px) { + #panel { grid-template-columns: 1fr; gap: 6px; padding: 6px; } + #verbs button { font-size: 9px; padding: .7em .1em; } +} /* Telefono in orizzontale: la scena prende tutta l'altezza, verbi e inventario vanno di lato. */ @media (orientation: landscape) and (max-height: 520px) { #app { width: 100vw; flex-direction: row; } #stage { flex: none; width: min(calc(100dvh * 16 / 9), 68vw); align-self: flex-start; } #side { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--panel); } - #sentence { font-size: 14px; } + #sentence { font-size: 10.08px; } #panel { grid-template-columns: 1fr; gap: 6px; padding: 6px; } #inventory { grid-template-columns: repeat(2, 1fr); min-height: 0; } - #verbs button, #inventory button, #choices li { font-size: 14px; } + #verbs button, #inventory button, #choices li { font-size: 10.08px; } #choices { min-height: 0; padding: 6px 8px 6px 2em; } } diff --git a/tests/browser.mjs b/tests/browser.mjs index 659eb87..9f6f7f9 100644 --- a/tests/browser.mjs +++ b/tests/browser.mjs @@ -172,6 +172,8 @@ try { await phone.click('#skip-intro'); await settle(phone); const overflow = await phone.evaluate(() => document.documentElement.scrollWidth > innerWidth); + // Ogni verbo si vede tutto: niente pulsanti tagliati dall'inventario. + assert.ok(await phone.evaluate(() => [...document.querySelectorAll('#verbs button')].every(b => b.scrollWidth <= b.clientWidth + 1 && b.getBoundingClientRect().right <= innerWidth)), 'verbi tagliati sul telefono'); assert.equal(overflow, false, 'scorrimento orizzontale su telefono'); await phone.screenshot({ path: `${OUT}/08-telefono.png` }); const landscape = await open({ width: 844, height: 390 });