TTS redeems: envelope letter with words inked in as spoken

- TTS alerts use the new `tts` style: envelope opens, the letter rises out
  and settles in front near the top, words ink in as the voice says them
  (timed from a loudness curve the server sends: tts.loudness, tts_env,
  tts_prefix); if the voice fails, the full text shows
- Highlight my message keeps its taped note

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bashy 2026-11-21 14:42:36 +02:00
parent 4fda6060bf
commit 060b2351f7
6 changed files with 122 additions and 9 deletions

View file

@ -31,3 +31,33 @@
#fx-alert .note .who .u { color:var(--red); }
#fx-alert .note .text { font:700 46px/52px 'Caveat', cursive; color:var(--ink); word-wrap:break-word;
overflow:hidden; display:-webkit-box; -webkit-line-clamp:9; -webkit-box-orient:vertical; }
/* TTS redeems: envelope letter (fx.js envelope()). The flap opens, the letter rises all the way out (its peak may
leave the screen), then comes down in front of the envelope and ends ~80px from the top; words ink in as spoken.
Coordinates are bottom-up inside .envl (360x560); the letter's slot is clipped at the envelope's bottom edge. */
#fx-alert .envl { position:absolute; left:90px; top:-146px; width:360px; height:560px; }
#fx-alert .envl .env { position:absolute; left:0; bottom:0; width:360px; height:216px; z-index:3; background:#e9d3b0; border-radius:6px;
box-shadow:0 10px 20px rgba(0,0,0,.45); }
#fx-alert .envl .env:before { content:''; position:absolute; inset:0; border-radius:6px; z-index:3;
background:linear-gradient(32deg, #dcc39b 50%, transparent 50%) left/50% 100% no-repeat,
linear-gradient(-32deg, #dcc39b 50%, transparent 50%) right/50% 100% no-repeat; }
#fx-alert .envl .flap { position:absolute; left:0; bottom:216px; width:360px; height:122px; transform-origin:bottom; z-index:1;
background:#d8bd93; clip-path:polygon(0 100%, 50% 0, 100% 100%); animation:fx-flap .6s .35s ease-out both; }
@keyframes fx-flap { from { transform:rotateX(180deg); z-index:4; } }
#fx-alert .envl .slot { position:absolute; left:-40px; right:-40px; bottom:0; top:-400px; overflow:hidden; z-index:2; animation:fx-zswap 1.6s .8s both; }
@keyframes fx-zswap { 0%, 54% { z-index:2; } 55%, 100% { z-index:6; } }
#fx-alert .envl .letter { position:absolute; left:62px; bottom:30px; width:316px; min-height:290px; background:#fffdf7; padding:18px 22px 22px;
box-shadow:0 4px 12px rgba(0,0,0,.3); animation:fx-rise 1.6s .8s both;
background-image:repeating-linear-gradient(transparent 0 29px, rgba(110,150,200,.3) 29px 30px); background-position:0 46px; }
@keyframes fx-rise {
0% { transform:translateY(110px); animation-timing-function:cubic-bezier(.3,.7,.4,1); }
45% { transform:translateY(-200px) rotate(-1deg); }
55% { transform:translateY(-200px) rotate(-1deg); animation-timing-function:cubic-bezier(.4,0,.3,1.2); }
100% { transform:translateY(-14px) rotate(-2deg); }
}
#fx-alert .envl .to { font:700 22px/1 Caveat, cursive; color:var(--red); margin-bottom:6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#fx-alert .envl .tx { font:700 24px/30px Caveat, cursive; color:var(--ink); word-wrap:break-word; }
#fx-alert .envl .w { opacity:.12; transition:opacity .25s; }
#fx-alert .envl .w.on { opacity:1; }
#fx-alert .envl .seal { position:absolute; left:157px; bottom:86px; width:46px; height:46px; z-index:5; border-radius:50%; background:#b74347;
box-shadow:inset 0 -3px 0 rgba(0,0,0,.2), 0 3px 6px rgba(0,0,0,.35); color:#ffd9d4; font:22px/46px sans-serif; text-align:center; }