fix #3
|
|
@ -4,7 +4,7 @@ import "./ScrollCandle.css";
|
||||||
// Space taken by flame + wick + base + label + bottom offset + header (ticker 36 + AppBar 76) + safety gap
|
// Space taken by flame + wick + base + label + bottom offset + header (ticker 36 + AppBar 76) + safety gap
|
||||||
const NON_BODY_HEIGHT = 70 + 8 + 10 + 24 + 40 + 112 + 16;
|
const NON_BODY_HEIGHT = 70 + 8 + 10 + 24 + 40 + 112 + 16;
|
||||||
const CANDLE_MIN_HEIGHT = 14; // px — almost fully melted
|
const CANDLE_MIN_HEIGHT = 14; // px — almost fully melted
|
||||||
|
//
|
||||||
export function ScrollCandle() {
|
export function ScrollCandle() {
|
||||||
const [maxHeight, setMaxHeight] = useState(
|
const [maxHeight, setMaxHeight] = useState(
|
||||||
() => Math.max(200, window.innerHeight - NON_BODY_HEIGHT)
|
() => Math.max(200, window.innerHeight - NON_BODY_HEIGHT)
|
||||||
|
|
@ -45,10 +45,10 @@ export function ScrollCandle() {
|
||||||
// Label changes as candle melts
|
// Label changes as candle melts
|
||||||
const label =
|
const label =
|
||||||
scrollPct < 0.15 ? "just lit" :
|
scrollPct < 0.15 ? "just lit" :
|
||||||
scrollPct < 0.45 ? "burning..." :
|
scrollPct < 0.45 ? "burning..." :
|
||||||
scrollPct < 0.75 ? "melting..." :
|
scrollPct < 0.75 ? "melting..." :
|
||||||
scrollPct < 0.92 ? "almost gone" :
|
scrollPct < 0.92 ? "almost gone" :
|
||||||
"★ keep scrolling";
|
"★ keep scrolling";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="scroll-candle-wrap" aria-hidden="true">
|
<div className="scroll-candle-wrap" aria-hidden="true">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue