revert to the state before the editorial rework (8669263): restore the terminal layout, phone home screen and pre-rework assets
This undoes 8669263..1880a5b as a single revert commit; the reverted work
remains reachable in history at 1880a5b.
This commit is contained in:
parent
1880a5b0db
commit
b2244da743
24 changed files with 1693 additions and 3108 deletions
|
|
@ -3,10 +3,11 @@
|
|||
import { useRef } from "react";
|
||||
import { useServerInsertedHTML } from "next/navigation";
|
||||
|
||||
// Runs before paint to set the phone/desktop split. The theme itself is not
|
||||
// read from storage — the web theme is always the landing view — so this only
|
||||
// tags the device, which CSS uses to hide the Desktop-mode button on phones.
|
||||
const INIT_SCRIPT = `(function(){try{var ua=navigator.userAgent||'';var phone=/(iPhone|iPod|Android.+Mobile|Windows Phone|IEMobile|BlackBerry|Opera Mini|Mobile)/i.test(ua);document.documentElement.setAttribute('data-device',phone?'phone':'desktop');}catch(e){}})();`;
|
||||
// Runs before paint so the saved theme and the phone/desktop split are applied
|
||||
// without a flash. It is injected with useServerInsertedHTML so the <script>
|
||||
// lives in the SSR HTML stream instead of inside the React tree — React 19
|
||||
// logs an error for script tags rendered by components on the client.
|
||||
const INIT_SCRIPT = `(function(){try{var t=localStorage.getItem('theme');if(t==='terminal'||t==='skeuo'){document.documentElement.setAttribute('data-theme',t);}var ua=navigator.userAgent||'';var phone=/(iPhone|iPod|Android.+Mobile|Windows Phone|IEMobile|BlackBerry|Opera Mini|Mobile)/i.test(ua);document.documentElement.setAttribute('data-device',phone?'phone':'desktop');}catch(e){}})();`;
|
||||
|
||||
export default function ThemeScript() {
|
||||
// useServerInsertedHTML can fire several times during a single render pass;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue