Skip to content

Commit 13d6052

Browse files
committed
[design] add page load fade in
1 parent 3e6084b commit 13d6052

File tree

6 files changed

+45
-1
lines changed

6 files changed

+45
-1
lines changed

‎gulpfile.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const cssFiles = [
7575
constjsFiles=[
7676
path.src+'/js/helper.js',
7777
path.src+'/js/data.js',
78+
path.src+'/js/ready.js',
7879
path.src+'/js/fontawesome.js',
7980
path.src+'/js/update.js',
8081
path.src+'/js/state.js',

‎src/css/background.css‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
height:100vh;
77
pointer-events: none;
88
z-index:var(--z-index-background);
9-
animation: appear var(--layout-timing-medium) 1;
109
display: none;
1110
}
1211

‎src/css/base.css‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ body{
2020
justify-content: center;
2121
align-items: center;
2222
min-height:100vh;
23+
opacity:0;
24+
transition: opacity var(--layout-timing-fast);
25+
}
26+
27+
.is-readybody{
28+
opacity:1;
2329
}
2430

2531
html.is-background-color-by-theme,

‎src/html/script-js.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<!-- nightTab -->
88
<scriptsrc="js/helper.js"></script>
99
<scriptsrc="js/data.js"></script>
10+
<scriptsrc="js/ready.js"></script>
1011
<scriptsrc="js/fontawesome.js"></script>
1112
<scriptsrc="js/update.js"></script>
1213
<scriptsrc="js/state.js"></script>

‎src/js/init.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// log version
22
console.log("nightTab version",version.get().number,version.get().name);
3+
ready.init();
34
data.init();
45
state.init();
56
header.init();

‎src/js/ready.js‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
varready=(function(){
2+
3+
varbind={};
4+
5+
bind.loaded={
6+
func: function(){
7+
render.loaded();
8+
bind.loaded.remove();
9+
},
10+
add: function(){
11+
window.addEventListener("load",bind.loaded.func,false);
12+
},
13+
remove: function(){
14+
window.removeEventListener("load",bind.loaded.func);
15+
}
16+
};
17+
18+
varrender={};
19+
20+
render.loaded=function(){
21+
varhtml=helper.e("html");
22+
helper.addClass(html,"is-ready");
23+
};
24+
25+
varinit=function(){
26+
bind.loaded.add();
27+
};
28+
29+
// exposed methods
30+
return{
31+
init: init,
32+
bind: bind,
33+
render: render
34+
};
35+
36+
})();

0 commit comments

Comments
(0)