Fade in when the page has loaded

This commit is contained in:
Robert Marshall 2020-06-20 07:53:37 +01:00
parent 964ac4bd2c
commit ae6e9a00d4
3 changed files with 13 additions and 1 deletions

View file

@ -6,6 +6,13 @@
<title>@ViewData["Title"] | Robware</title> <title>@ViewData["Title"] | Robware</title>
<link href="/css/style.css" rel="stylesheet" defer/> <link href="/css/style.css" rel="stylesheet" defer/>
<script type="text/javascript" src="/js/javascript.min.js"></script> <script type="text/javascript" src="/js/javascript.min.js"></script>
<noscript>
<style>
html {
opacity: 1;
}
</style>
</noscript>
<link rel="icon" type="image/png" href="/images/logo.png"/> <link rel="icon" type="image/png" href="/images/logo.png"/>
</head> </head>
<body> <body>

View file

@ -14,6 +14,7 @@ html {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: url(/images/background.png); background: url(/images/background.png);
opacity: 0;
} }
html, html,

View file

@ -64,4 +64,8 @@ function documentReady(callback) {
setTimeout(callback, 1); setTimeout(callback, 1);
else else
document.addEventListener("DOMContentLoaded", callback); document.addEventListener("DOMContentLoaded", callback);
} }
window.onload = () => {
document.querySelector("html").style.opacity = 1;
};