fix: remove initial background flash

This commit is contained in:
Rui Saraiva 2022-07-07 11:29:08 +01:00
parent 37a1af5f35
commit a2d70d783f
No known key found for this signature in database
GPG Key ID: 63937B371A665CD0
2 changed files with 5 additions and 5 deletions

View File

@ -4,13 +4,13 @@ import Document, { Html, Head, Main, NextScript } from 'next/document'
class MyDocument extends Document {
render() {
return (
<Html lang="en">
<Html lang="en" className="preload">
<Head />
<body className="preload">
<script src="/js/noflash.js" />
<body>
<script src="/js/noflash.js?v1" />
<Main />
<NextScript />
<script src="/js/onload.js" />
<script src="/js/onload.js?v1" />
</body>
</Html>
)

View File

@ -1,5 +1,5 @@
;(function () {
window.addEventListener('load', function () {
document.body.classList.remove('preload')
document.documentElement.classList.remove('preload')
})
})()