diff --git a/src/pages/status.css b/src/pages/status.css new file mode 100644 index 00000000..74ae38e0 --- /dev/null +++ b/src/pages/status.css @@ -0,0 +1,29 @@ +.status-deck header h1 { + grid-column: 1 / 3; +} +.status-deck header { + display: flex; + align-items: center; + white-space: nowrap; +} +.status-deck header h1 { + min-width: 0; + flex-grow: 1; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; +} + +.status-deck header.inview h1 { + font-weight: bold; +} + +.hero-heading { + font-size: 16px; + pointer-events: none; + display: inline-block; + margin-bottom: 0.25em; +} +.hero-heading .insignificant { + font-weight: normal; +} diff --git a/src/pages/status.jsx b/src/pages/status.jsx index 9b958a14..35120f9a 100644 --- a/src/pages/status.jsx +++ b/src/pages/status.jsx @@ -1,3 +1,5 @@ +import './status.css'; + import debounce from 'just-debounce-it'; import { Link } from 'preact-router/match'; import { @@ -7,15 +9,18 @@ import { useRef, useState, } from 'preact/hooks'; +import { InView } from 'react-intersection-observer'; import { useSnapshot } from 'valtio'; import Icon from '../components/icon'; import Loader from '../components/loader'; +import NameText from '../components/name-text'; import Status from '../components/status'; import htmlContentLength from '../utils/html-content-length'; import shortenNumber from '../utils/shorten-number'; import states from '../utils/states'; import store from '../utils/store'; +import useDebouncedCallback from '../utils/useDebouncedCallback'; import useTitle from '../utils/useTitle'; const LIMIT = 40; @@ -243,6 +248,9 @@ function StatusPage({ id }) { const hasManyStatuses = statuses.length > LIMIT; const hasDescendants = statuses.some((s) => s.descendant); + const [heroInView, setHeroInView] = useState(true); + const onView = useDebouncedCallback(setHeroInView, 100); + return (