speak the last-box sentence by default
Browse files- demo/index.html +10 -6
demo/index.html
CHANGED
|
@@ -28,7 +28,7 @@
|
|
| 28 |
nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 26px; color: var(--haze); font-weight: 500; }
|
| 29 |
nav a { text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
|
| 30 |
@media (hover: hover) { nav a:hover { color: var(--paper); border-color: var(--peach); } }
|
| 31 |
-
h1 { margin: 0 0 0.13em; font-size: min(17.5vw,
|
| 32 |
h1 span { display: inline-block; animation: breathe 6s ease-in-out infinite; }
|
| 33 |
h1 span:nth-child(1) { --rest: 220; --full: 320; }
|
| 34 |
h1 span:nth-child(2) { --rest: 460; --full: 560; animation-delay: -0.5s; }
|
|
@@ -39,15 +39,18 @@
|
|
| 39 |
/* The name means breath: each letter slowly fills and empties. */
|
| 40 |
@keyframes breathe { 0%, 100% { font-weight: var(--rest); } 45% { font-weight: var(--full); } }
|
| 41 |
@media (prefers-reduced-motion: reduce) { h1 span { animation: none; } }
|
|
|
|
|
|
|
| 42 |
textarea {
|
| 43 |
-
display: block; width: 100%; max-width:
|
| 44 |
-
border: 0; background: transparent; color: var(--paper); caret-color: var(--peach);
|
| 45 |
-
font: 500 clamp(
|
| 46 |
}
|
|
|
|
| 47 |
textarea:focus { outline: none; }
|
| 48 |
textarea::selection { background: var(--peach); color: var(--ink); }
|
| 49 |
.facts { margin: clamp(8px, 1.4svh, 14px) 0 0; color: var(--haze); font-size: clamp(16px, 1.7vw, 27px); }
|
| 50 |
-
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: clamp(
|
| 51 |
button { font: inherit; color: inherit; cursor: pointer; }
|
| 52 |
.speak { display: inline-flex; align-items: center; gap: 11px; min-height: 50px; padding: 0 26px 0 22px; border: 0; border-radius: 999px; background: var(--paper); color: var(--blue); font-size: 19px; font-weight: 600; }
|
| 53 |
.speak::before { content: ""; border-left: 13px solid currentColor; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
|
|
@@ -135,8 +138,9 @@
|
|
| 135 |
</nav>
|
| 136 |
|
| 137 |
<h1 class="serif" aria-label="fiato"><span>f</span><span>i</span><span>a</span><span>t</span><span>o</span></h1>
|
| 138 |
-
<
|
| 139 |
<p class="facts" id="facts"> </p>
|
|
|
|
| 140 |
|
| 141 |
<div class="controls">
|
| 142 |
<button class="speak" id="speak" disabled>Speak</button>
|
|
|
|
| 28 |
nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 26px; color: var(--haze); font-weight: 500; }
|
| 29 |
nav a { text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
|
| 30 |
@media (hover: hover) { nav a:hover { color: var(--paper); border-color: var(--peach); } }
|
| 31 |
+
h1 { margin: 0 0 0.13em; font-size: min(17.5vw, 30svh); font-weight: 300; line-height: 1; letter-spacing: -0.03em; }
|
| 32 |
h1 span { display: inline-block; animation: breathe 6s ease-in-out infinite; }
|
| 33 |
h1 span:nth-child(1) { --rest: 220; --full: 320; }
|
| 34 |
h1 span:nth-child(2) { --rest: 460; --full: 560; animation-delay: -0.5s; }
|
|
|
|
| 39 |
/* The name means breath: each letter slowly fills and empties. */
|
| 40 |
@keyframes breathe { 0%, 100% { font-weight: var(--rest); } 45% { font-weight: var(--full); } }
|
| 41 |
@media (prefers-reduced-motion: reduce) { h1 span { animation: none; } }
|
| 42 |
+
.say { margin: 0; font-size: clamp(24px, 2.75vw, 44px); font-weight: 500; line-height: 1.2; letter-spacing: -0.015em; }
|
| 43 |
+
/* The line to be spoken: plain text on the blue, with a rule under it to show it can be changed. */
|
| 44 |
textarea {
|
| 45 |
+
display: block; width: 100%; max-width: 34em; margin: clamp(18px, 3.4svh, 36px) 0 0; padding: 0 0 8px; resize: none; overflow: hidden;
|
| 46 |
+
border: 0; border-bottom: 1.5px solid var(--haze); border-radius: 0; background: transparent; color: var(--paper); caret-color: var(--peach);
|
| 47 |
+
font: 500 clamp(19px, 1.9vw, 28px)/1.3 "Instrument Sans", system-ui, sans-serif;
|
| 48 |
}
|
| 49 |
+
textarea:focus-visible { border-color: var(--peach); }
|
| 50 |
textarea:focus { outline: none; }
|
| 51 |
textarea::selection { background: var(--peach); color: var(--ink); }
|
| 52 |
.facts { margin: clamp(8px, 1.4svh, 14px) 0 0; color: var(--haze); font-size: clamp(16px, 1.7vw, 27px); }
|
| 53 |
+
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: clamp(14px, 2.4svh, 24px); }
|
| 54 |
button { font: inherit; color: inherit; cursor: pointer; }
|
| 55 |
.speak { display: inline-flex; align-items: center; gap: 11px; min-height: 50px; padding: 0 26px 0 22px; border: 0; border-radius: 999px; background: var(--paper); color: var(--blue); font-size: 19px; font-weight: 600; }
|
| 56 |
.speak::before { content: ""; border-left: 13px solid currentColor; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
|
|
|
|
| 138 |
</nav>
|
| 139 |
|
| 140 |
<h1 class="serif" aria-label="fiato"><span>f</span><span>i</span><span>a</span><span>t</span><span>o</span></h1>
|
| 141 |
+
<p class="say">A tiny voice that knows how to sigh.</p>
|
| 142 |
<p class="facts" id="facts"> </p>
|
| 143 |
+
<textarea id="text" rows="1" aria-label="Text to read. Edit it, then press Speak." spellcheck="false">That was the last box, <exhale> and now we can finally sit down.</textarea>
|
| 144 |
|
| 145 |
<div class="controls">
|
| 146 |
<button class="speak" id="speak" disabled>Speak</button>
|