Skip to content

Commit

Permalink
avoid FOUC much more
Browse files Browse the repository at this point in the history
  • Loading branch information
traceypooh committed Jan 20, 2025
1 parent 0e54e31 commit e6dfaea
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
deno.lock
names.txt
node_modules
3 changes: 3 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"nodeModulesDir": "auto"
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<link href="css/blogtini.css" rel="stylesheet" type="text/css"/>
<script type="module" src="theme.js"></script>
</head>
<body class="homepage">
<body class="homepage" style="display:none">

# Welcome to Blogtini!

Expand Down
6 changes: 2 additions & 4 deletions js/blogtini.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,12 @@ log('xxxx testitos', await find_posts_from_github_api_tree()); return
// eslint-disable-next-line no-use-before-define
add_interactivity()


// if (state.filedev || state.localdev) // xxx ideally use normal customElements for production
await import('https://esm.ext.archive.org/[email protected]')

import(cfg.theme)

await import(cfg.theme)

document.querySelector('body').style.display = 'block' // for SSR
document.querySelector('body').style.display = 'block' // SSR step hides body until now
}


Expand Down
2 changes: 1 addition & 1 deletion js/dom.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSDOM } from 'https://esm.ext.archive.org/[email protected]'
import { JSDOM } from 'https://esm.ext.archive.org/[email protected]?target=esnext'

const doc = new JSDOM('')
globalThis.document = doc.window.document
Expand Down

0 comments on commit e6dfaea

Please sign in to comment.