sinzmise-cetastories 2.0.0-1731114112124 → 2.0.0-1731114615672
Sign up to get free protection for your applications and to get access to all the features.
- package/404/index.html +1 -4033
- package/about/index.html +1 -4041
- package/album/index.html +1 -4050
- package/archives/2021/12/index.html +1 -3917
- package/archives/2021/index.html +1 -3917
- package/archives/2022/12/index.html +1 -3917
- package/archives/2022/index.html +1 -3917
- package/archives/2023/01/index.html +1 -4072
- package/archives/2023/02/index.html +1 -3917
- package/archives/2023/03/index.html +1 -4063
- package/archives/2023/04/index.html +1 -3992
- package/archives/2023/07/index.html +1 -4217
- package/archives/2023/08/index.html +1 -4067
- package/archives/2023/09/index.html +1 -3917
- package/archives/2023/10/index.html +1 -3917
- package/archives/2023/11/index.html +1 -3917
- package/archives/2023/12/index.html +1 -3918
- package/archives/2023/index.html +1 -4591
- package/archives/2023/page/2/index.html +1 -4572
- package/archives/2023/page/3/index.html +1 -3930
- package/archives/2024/01/index.html +1 -4142
- package/archives/2024/02/index.html +1 -3922
- package/archives/2024/03/index.html +1 -3916
- package/archives/2024/04/index.html +1 -3997
- package/archives/2024/05/index.html +1 -4065
- package/archives/2024/06/index.html +1 -3917
- package/archives/2024/07/index.html +1 -3917
- package/archives/2024/08/index.html +1 -3992
- package/archives/2024/09/index.html +1 -3917
- package/archives/2024/10/index.html +1 -3984
- package/archives/2024/index.html +1 -4576
- package/archives/2024/page/2/index.html +1 -4433
- package/archives/index.html +1 -4560
- package/archives/page/2/index.html +1 -4560
- package/archives/page/3/index.html +1 -4560
- package/archives/page/4/index.html +1 -4560
- package/archives/page/5/index.html +1 -4560
- package/assets/algolia/algoliasearch.js +3 -7182
- package/assets/algolia/algoliasearchLite.js +3 -4445
- package/atom.xml +31 -31
- package/bbs/bbs.html +1 -4012
- package/bbs/bbs.js +2 -12
- package/bbs/index.html +1 -4031
- package/categories/index.html +1 -4050
- package/categories//344/270/252/344/272/272/345/260/217/350/256/260/index.html +1 -4570
- package/categories//344/270/252/344/272/272/345/260/217/350/256/260/page/2/index.html +1 -4485
- package/categories//346/255/214/346/233/262/346/224/266/351/233/206/index.html +1 -3920
- package/categories//346/270/270/346/210/217/347/233/270/345/205/263/index.html +1 -4148
- package/categories//347/253/231/347/202/271/346/212/230/350/205/276/index.html +1 -4610
- package/categories//347/253/231/347/202/271/346/212/230/350/205/276/page/2/index.html +1 -4148
- package/categories//351/241/271/347/233/256/346/212/230/350/205/276/index.html +1 -4072
- package/charts/index.html +1 -4039
- package/comments/index.html +1 -4052
- package/css/custom2.css +2 -3
- package/css/first.css +2 -1868
- package/css/pace/big-counter.css +2 -39
- package/css/pace/corner-indicator.css +2 -72
- package/css/pace/flash.css +2 -76
- package/css/pace/mac-osx.css +2 -86
- package/css/pace/pace.css +2 -50
- package/css/plane.css +2 -59
- package/css/style.css +2 -8585
- package/css/tags.css +2 -3516
- package/essay/index.html +1 -4050
- package/fcircle/index.html +1 -4075
- package/games +2 -2
- package/index.html +1 -4717
- package/js/app.js +2 -1341
- package/js/autoload.js +2 -62
- package/js/ceta/fancybox.css +2 -2
- package/js/ceta/fancybox.umd.js +2 -2
- package/js/ceta/iconfontInkss.js +2 -1
- package/js/ceta/message.css +2 -6
- package/js/ceta/message.js +2 -6
- package/js/clock.js +2 -1
- package/js/kslink.js +2 -38
- package/js/newyear.js +2 -76
- package/js/plane.js +2 -2200
- package/js/plugins/aplayer.js +2 -186
- package/js/plugins/parallax.js +2 -191
- package/js/plugins/rightMenus.js +2 -623
- package/js/plugins/tags/contributors.js +2 -92
- package/js/plugins/tags/friends.js +2 -93
- package/js/plugins/tags/sites.js +2 -96
- package/js/search/algolia.js +2 -239
- package/js/search/hexo.js +2 -195
- package/js/search/meilisearch.js +2 -220
- package/js/txmap.js +2 -248
- package/link/index.html +1 -6180
- package/load.html +1 -294
- package/maps/assets/algolia/algoliasearch.js.map +1 -0
- package/maps/assets/algolia/algoliasearchLite.js.map +1 -0
- package/maps/bbs/bbs.js.map +1 -0
- package/maps/css/custom2.css.map +1 -0
- package/maps/css/first.css.map +1 -0
- package/maps/css/pace/big-counter.css.map +1 -0
- package/maps/css/pace/corner-indicator.css.map +1 -0
- package/maps/css/pace/flash.css.map +1 -0
- package/maps/css/pace/mac-osx.css.map +1 -0
- package/maps/css/pace/pace.css.map +1 -0
- package/maps/css/plane.css.map +1 -0
- package/maps/css/style.css.map +1 -0
- package/maps/css/tags.css.map +1 -0
- package/maps/js/app.js.map +1 -0
- package/maps/js/autoload.js.map +1 -0
- package/maps/js/ceta/fancybox.css.map +1 -0
- package/maps/js/ceta/fancybox.umd.js.map +1 -0
- package/maps/js/ceta/iconfontInkss.js.map +1 -0
- package/maps/js/ceta/message.css.map +1 -0
- package/maps/js/ceta/message.js.map +1 -0
- package/maps/js/clock.js.map +1 -0
- package/maps/js/kslink.js.map +1 -0
- package/maps/js/newyear.js.map +1 -0
- package/maps/js/plane.js.map +1 -0
- package/maps/js/plugins/aplayer.js.map +1 -0
- package/maps/js/plugins/parallax.js.map +1 -0
- package/maps/js/plugins/rightMenus.js.map +1 -0
- package/maps/js/plugins/tags/contributors.js.map +1 -0
- package/maps/js/plugins/tags/friends.js.map +1 -0
- package/maps/js/plugins/tags/sites.js.map +1 -0
- package/maps/js/search/algolia.js.map +1 -0
- package/maps/js/search/hexo.js.map +1 -0
- package/maps/js/search/meilisearch.js.map +1 -0
- package/maps/js/txmap.js.map +1 -0
- package/maps/sw.js.map +1 -0
- package/maps/weichuncai/css/style.css.map +1 -0
- package/maps/weichuncai/js/common.js.map +1 -0
- package/maps/weichuncai/js/jquery.js.map +1 -0
- package/maps/weichuncai/wcc-config.js.map +1 -0
- package/music/index.html +1 -4033
- package/package.json +1 -1
- package/page/2/index.html +1 -4578
- package/page/3/index.html +1 -4575
- package/page/4/index.html +1 -4572
- package/page/5/index.html +1 -3924
- package/posts/10021/index.html +5 -4130
- package/posts/10045/index.html +1 -4224
- package/posts/10733/index.html +1 -4125
- package/posts/10996/index.html +5 -4127
- package/posts/12779/index.html +1 -4134
- package/posts/13624/index.html +1 -4179
- package/posts/15688/index.html +1 -4133
- package/posts/15748/index.html +5 -4121
- package/posts/15799/index.html +1 -4130
- package/posts/15842/index.html +5 -4121
- package/posts/16107/index.html +1 -4111
- package/posts/18063/index.html +1 -4124
- package/posts/20412/index.html +1 -4134
- package/posts/21375/index.html +1 -4124
- package/posts/22945/index.html +4 -4169
- package/posts/23021/index.html +1 -4104
- package/posts/27531/index.html +5 -4121
- package/posts/28536/index.html +1 -4116
- package/posts/28733/index.html +1 -4168
- package/posts/29196/index.html +1 -4106
- package/posts/38917/index.html +1 -4144
- package/posts/38964/index.html +1 -4208
- package/posts/42487/index.html +1 -4135
- package/posts/42580/index.html +1 -4128
- package/posts/45875/index.html +1 -4118
- package/posts/46640/index.html +1 -4147
- package/posts/48762/index.html +1 -4109
- package/posts/50710/index.html +1 -4114
- package/posts/52677/index.html +1 -4125
- package/posts/53662/index.html +1 -4123
- package/posts/54386/index.html +1 -4116
- package/posts/54481/index.html +1 -4133
- package/posts/54787/index.html +5 -4124
- package/posts/56467/index.html +1 -4121
- package/posts/57692/index.html +1 -4143
- package/posts/58203/index.html +1 -4116
- package/posts/61417/index.html +1 -4117
- package/posts/61712/index.html +1 -4113
- package/posts/646/index.html +1 -4106
- package/posts/64856/index.html +1 -4120
- package/posts/64935/index.html +1 -4120
- package/search.xml +95 -95
- package/seas/index.html +1 -4050
- package/sw.js +2 -798
- package/tags/Flash/347/233/270/345/205/263/index.html +1 -3924
- package/tags/Steam/346/270/270/346/210/217/index.html +1 -3924
- package/tags/Windows/350/275/257/344/273/266/index.html +1 -3997
- package/tags/index.html +1 -4033
- package/tags//344/270/252/344/272/272/345/260/217/350/256/260/index.html +1 -4570
- package/tags//344/270/252/344/272/272/345/260/217/350/256/260/page/2/index.html +1 -4485
- package/tags//345/205/266/345/256/203/346/270/270/346/210/217/index.html +1 -4073
- package/tags//345/212/240/350/275/275/345/212/250/347/224/273/index.html +1 -3924
- package/tags//346/202/254/346/265/256/345/256/240/347/211/251-/347/234/213/346/235/277/345/250/230/index.html +1 -3925
- package/tags//346/255/214/346/233/262/346/224/266/351/233/206/index.html +1 -3920
- package/tags//346/270/270/346/210/217/347/233/270/345/205/263/index.html +1 -4148
- package/tags//347/253/231/347/202/271/345/272/225/351/203/250/351/255/224/346/224/271/index.html +1 -3924
- package/tags//347/253/231/347/202/271/346/212/230/350/205/276/index.html +1 -4610
- package/tags//347/253/231/347/202/271/346/212/230/350/205/276/page/2/index.html +1 -4148
- package/tags//350/207/252/345/273/272/351/203/250/347/275/262/index.html +1 -4224
- package/tags//351/241/265/351/235/242/351/255/224/346/224/271/index.html +1 -4075
- package/tags//351/241/271/347/233/256/346/212/230/350/205/276/index.html +1 -4072
- package/update/index.html +1 -4112
- package/weichuncai/css/style.css +2 -25
- package/weichuncai/js/common.js +2 -449
- package/weichuncai/js/jquery.js +2 -139
- package/weichuncai/wcc-config.js +2 -17
package/js/plugins/aplayer.js
CHANGED
@@ -1,186 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
* */
|
4
|
-
const RightMenuAplayer = (() => {
|
5
|
-
let playStatus; // 播放器状态
|
6
|
-
const APlayer = {}; // 右键音乐所控制的播放器
|
7
|
-
const fn = {};
|
8
|
-
|
9
|
-
fn.checkAPlayer = () => {
|
10
|
-
if (playStatus === undefined || APlayer.player === undefined) {
|
11
|
-
fn.setAPlayerObject();
|
12
|
-
} else if (APlayer.observer === undefined) {
|
13
|
-
fn.setAPlayerObserver();
|
14
|
-
}
|
15
|
-
}
|
16
|
-
|
17
|
-
// 设置全局播放器所对应的 aplyer 对象
|
18
|
-
fn.setAPlayerObject = () => {
|
19
|
-
let meting = document.querySelectorAll('.footer meting-js');
|
20
|
-
if (meting.length == 0) {
|
21
|
-
meting = document.querySelectorAll('meting-js');
|
22
|
-
}
|
23
|
-
APlayer.player = undefined;
|
24
|
-
meting.forEach((item, index) => {
|
25
|
-
if (item.meta.id == volantis.GLOBAL_CONFIG.plugins.aplayer.id && item.aplayer && APlayer.player === undefined) {
|
26
|
-
APlayer.player = item.aplayer;
|
27
|
-
fn.setAPlayerObserver();
|
28
|
-
fn.updateTitle();
|
29
|
-
}
|
30
|
-
});
|
31
|
-
}
|
32
|
-
|
33
|
-
// 事件监听
|
34
|
-
fn.setAPlayerObserver = () => {
|
35
|
-
try {
|
36
|
-
APlayer.player.on('play', function (e) {
|
37
|
-
fn.updateAPlayerControllerStatus(e);
|
38
|
-
APlayer.status = 'play';
|
39
|
-
});
|
40
|
-
APlayer.player.on('pause', function (e) {
|
41
|
-
fn.updateAPlayerControllerStatus(e);
|
42
|
-
APlayer.status = 'pause';
|
43
|
-
});
|
44
|
-
APlayer.player.on('volumechange', function (e) {
|
45
|
-
fn.onUpdateAPlayerVolume(e);
|
46
|
-
});
|
47
|
-
APlayer.player.on('loadstart', function (e) {
|
48
|
-
fn.updateTitle(e);
|
49
|
-
});
|
50
|
-
|
51
|
-
// 监听音量手势
|
52
|
-
APlayer.volumeBarWrap = document.getElementsByClassName('nav volume')[0].children[0];
|
53
|
-
APlayer.volumeBar = APlayer.volumeBarWrap.children[0];
|
54
|
-
|
55
|
-
const thumbMove = (e) => {
|
56
|
-
fn.updateAPlayerVolume(e);
|
57
|
-
};
|
58
|
-
|
59
|
-
const thumbUp = (e) => {
|
60
|
-
APlayer.volumeBarWrap.classList.remove('aplayer-volume-bar-wrap-active');
|
61
|
-
document.removeEventListener('mouseup', thumbUp);
|
62
|
-
document.removeEventListener('mousemove', thumbMove);
|
63
|
-
fn.updateAPlayerVolume(e);
|
64
|
-
};
|
65
|
-
|
66
|
-
APlayer.volumeBarWrap.addEventListener('mousedown', (event) => {
|
67
|
-
event.stopPropagation();
|
68
|
-
APlayer.volumeBarWrap.classList.add('aplayer-volume-bar-wrap-active');
|
69
|
-
document.addEventListener('mousemove', thumbMove);
|
70
|
-
document.addEventListener('mouseup', thumbUp);
|
71
|
-
});
|
72
|
-
|
73
|
-
APlayer.volumeBarWrap.addEventListener('click', (event) => {
|
74
|
-
event.stopPropagation();
|
75
|
-
});
|
76
|
-
|
77
|
-
fn.updateAPlayerControllerStatus();
|
78
|
-
fn.onUpdateAPlayerVolume();
|
79
|
-
APlayer.observer = true;
|
80
|
-
} catch (error) {
|
81
|
-
console.log(error);
|
82
|
-
APlayer.observer = undefined;
|
83
|
-
}
|
84
|
-
}
|
85
|
-
|
86
|
-
fn.updateAPlayerVolume = (e) => {
|
87
|
-
let percentage = ((e.clientX || e.changedTouches[0].clientX) -
|
88
|
-
APlayer.volumeBar.getBoundingClientRect().left) / APlayer.volumeBar.clientWidth;
|
89
|
-
percentage = Math.max(percentage, 0);
|
90
|
-
percentage = Math.min(percentage, 1);
|
91
|
-
APlayer.player.volume(percentage);
|
92
|
-
}
|
93
|
-
|
94
|
-
fn.onUpdateAPlayerVolume = () => {
|
95
|
-
try {
|
96
|
-
APlayer.volumeBar.children[0].style.width = APlayer.player.audio.volume * 100 + '%';
|
97
|
-
} catch (error) {
|
98
|
-
console.log(error);
|
99
|
-
}
|
100
|
-
}
|
101
|
-
|
102
|
-
// 更新控制器状态
|
103
|
-
fn.updateAPlayerControllerStatus = () => {
|
104
|
-
try {
|
105
|
-
if (APlayer.player.audio.paused) {
|
106
|
-
playStatus = 'pause';
|
107
|
-
document.getElementsByClassName('nav toggle')[0].children[0].classList.add('fa-play');
|
108
|
-
document.getElementsByClassName('nav toggle')[0].children[0].classList.remove('fa-pause');
|
109
|
-
} else {
|
110
|
-
playStatus = 'play';
|
111
|
-
document.getElementsByClassName('nav toggle')[0].children[0].classList.remove('fa-play');
|
112
|
-
document.getElementsByClassName('nav toggle')[0].children[0].classList.add('fa-pause');
|
113
|
-
}
|
114
|
-
} catch (error) {
|
115
|
-
console.log(error);
|
116
|
-
}
|
117
|
-
}
|
118
|
-
|
119
|
-
// 播放/暂停
|
120
|
-
fn.aplayerToggle = () => {
|
121
|
-
fn.checkAPlayer();
|
122
|
-
try {
|
123
|
-
APlayer.player.toggle();
|
124
|
-
} catch (error) {
|
125
|
-
console.log(error);
|
126
|
-
}
|
127
|
-
}
|
128
|
-
|
129
|
-
// 上一曲
|
130
|
-
fn.aplayerBackward = () => {
|
131
|
-
fn.checkAPlayer();
|
132
|
-
try {
|
133
|
-
APlayer.player.skipBack();
|
134
|
-
APlayer.player.play();
|
135
|
-
} catch (error) {
|
136
|
-
console.log(error);
|
137
|
-
}
|
138
|
-
}
|
139
|
-
|
140
|
-
// 下一曲
|
141
|
-
fn.aplayerForward = () => {
|
142
|
-
fn.checkAPlayer();
|
143
|
-
try {
|
144
|
-
APlayer.player.skipForward();
|
145
|
-
APlayer.player.play();
|
146
|
-
} catch (error) {
|
147
|
-
console.log(error);
|
148
|
-
}
|
149
|
-
}
|
150
|
-
|
151
|
-
// 调节音量
|
152
|
-
fn.aplayerVolume = (percent) => {
|
153
|
-
fn.checkAPlayer();
|
154
|
-
try {
|
155
|
-
APlayer.player.volume(percent);
|
156
|
-
} catch (error) {
|
157
|
-
console.log(error);
|
158
|
-
}
|
159
|
-
}
|
160
|
-
|
161
|
-
// 更新音乐标题
|
162
|
-
fn.updateTitle = () => {
|
163
|
-
fn.checkAPlayer();
|
164
|
-
try {
|
165
|
-
const index = APlayer.player.list.index;
|
166
|
-
const obj = APlayer.player.list.audios[index];
|
167
|
-
document.getElementsByClassName('nav music-title')[0].innerHTML = obj.title;
|
168
|
-
} catch (error) {
|
169
|
-
//console.log(error);
|
170
|
-
}
|
171
|
-
}
|
172
|
-
|
173
|
-
return {
|
174
|
-
checkAPlayer: fn.checkAPlayer,
|
175
|
-
aplayerBackward: fn.aplayerBackward,
|
176
|
-
aplayerToggle: fn.aplayerToggle,
|
177
|
-
aplayerForward: fn.aplayerForward,
|
178
|
-
APlayer: APlayer
|
179
|
-
}
|
180
|
-
})()
|
181
|
-
|
182
|
-
Object.freeze(RightMenuAplayer);
|
183
|
-
|
184
|
-
volantis.requestAnimationFrame(() => {
|
185
|
-
RightMenuAplayer.checkAPlayer();
|
186
|
-
});
|
1
|
+
const RightMenuAplayer=(()=>{let e;const a={},l={checkAPlayer:()=>{void 0===e||void 0===a.player?l.setAPlayerObject():void 0===a.observer&&l.setAPlayerObserver()},setAPlayerObject:()=>{let e=document.querySelectorAll(".footer meting-js");0==e.length&&(e=document.querySelectorAll("meting-js")),a.player=void 0,e.forEach(((e,t)=>{e.meta.id==volantis.GLOBAL_CONFIG.plugins.aplayer.id&&e.aplayer&&void 0===a.player&&(a.player=e.aplayer,l.setAPlayerObserver(),l.updateTitle())}))},setAPlayerObserver:()=>{try{a.player.on("play",(function(e){l.updateAPlayerControllerStatus(e),a.status="play"})),a.player.on("pause",(function(e){l.updateAPlayerControllerStatus(e),a.status="pause"})),a.player.on("volumechange",(function(e){l.onUpdateAPlayerVolume(e)})),a.player.on("loadstart",(function(e){l.updateTitle(e)})),a.volumeBarWrap=document.getElementsByClassName("nav volume")[0].children[0],a.volumeBar=a.volumeBarWrap.children[0];const e=e=>{l.updateAPlayerVolume(e)},t=r=>{a.volumeBarWrap.classList.remove("aplayer-volume-bar-wrap-active"),document.removeEventListener("mouseup",t),document.removeEventListener("mousemove",e),l.updateAPlayerVolume(r)};a.volumeBarWrap.addEventListener("mousedown",(l=>{l.stopPropagation(),a.volumeBarWrap.classList.add("aplayer-volume-bar-wrap-active"),document.addEventListener("mousemove",e),document.addEventListener("mouseup",t)})),a.volumeBarWrap.addEventListener("click",(e=>{e.stopPropagation()})),l.updateAPlayerControllerStatus(),l.onUpdateAPlayerVolume(),a.observer=!0}catch(e){console.log(e),a.observer=void 0}},updateAPlayerVolume:e=>{let l=((e.clientX||e.changedTouches[0].clientX)-a.volumeBar.getBoundingClientRect().left)/a.volumeBar.clientWidth;l=Math.max(l,0),l=Math.min(l,1),a.player.volume(l)},onUpdateAPlayerVolume:()=>{try{a.volumeBar.children[0].style.width=100*a.player.audio.volume+"%"}catch(e){console.log(e)}},updateAPlayerControllerStatus:()=>{try{a.player.audio.paused?(e="pause",document.getElementsByClassName("nav toggle")[0].children[0].classList.add("fa-play"),document.getElementsByClassName("nav toggle")[0].children[0].classList.remove("fa-pause")):(e="play",document.getElementsByClassName("nav toggle")[0].children[0].classList.remove("fa-play"),document.getElementsByClassName("nav toggle")[0].children[0].classList.add("fa-pause"))}catch(e){console.log(e)}},aplayerToggle:()=>{l.checkAPlayer();try{a.player.toggle()}catch(e){console.log(e)}},aplayerBackward:()=>{l.checkAPlayer();try{a.player.skipBack(),a.player.play()}catch(e){console.log(e)}},aplayerForward:()=>{l.checkAPlayer();try{a.player.skipForward(),a.player.play()}catch(e){console.log(e)}},aplayerVolume:e=>{l.checkAPlayer();try{a.player.volume(e)}catch(e){console.log(e)}},updateTitle:()=>{l.checkAPlayer();try{const e=a.player.list.index,l=a.player.list.audios[e];document.getElementsByClassName("nav music-title")[0].innerHTML=l.title}catch(e){}}};return{checkAPlayer:l.checkAPlayer,aplayerBackward:l.aplayerBackward,aplayerToggle:l.aplayerToggle,aplayerForward:l.aplayerForward,APlayer:a}})();Object.freeze(RightMenuAplayer),volantis.requestAnimationFrame((()=>{RightMenuAplayer.checkAPlayer()}));
|
2
|
+
//# sourceMappingURL=../../maps/js/plugins/aplayer.js.map
|
package/js/plugins/parallax.js
CHANGED
@@ -1,191 +1,2 @@
|
|
1
|
-
let Parallax = {};
|
2
|
-
|
3
|
-
Parallax.options.speed = 0.25;
|
4
|
-
Parallax.options.zIndex = -100;
|
5
|
-
Parallax.options.fade = 1500;
|
6
|
-
Parallax.slidein = () => {
|
7
|
-
let slider = Parallax.mirrors[0].slider;
|
8
|
-
if (Parallax.mirrors.length >= 2) {
|
9
|
-
slider = Parallax.mirrors[1].slider;
|
10
|
-
}
|
11
|
-
var opac = parseFloat(slider.style.opacity);
|
12
|
-
if (opac !== 1) {
|
13
|
-
if (Parallax.mirrors.length >= 2) {
|
14
|
-
opac = opac + 0.1;
|
15
|
-
slider.style.opacity = opac;
|
16
|
-
setTimeout(Parallax.slidein, Parallax.options.fade / 10);
|
17
|
-
}else{
|
18
|
-
slider.style.opacity = 1;
|
19
|
-
}
|
20
|
-
} else {
|
21
|
-
if (Parallax.mirrors.length >= 2) {
|
22
|
-
Parallax.mirrors[0].mirror.remove();
|
23
|
-
Parallax.mirrors.shift();
|
24
|
-
}
|
25
|
-
}
|
26
|
-
};
|
27
|
-
Parallax.start = () => {
|
28
|
-
let mirror = document.createElement("div");
|
29
|
-
mirror.classList.add("parallax-mirror");
|
30
|
-
mirror.style.visibility = "hidden";
|
31
|
-
mirror.style.zIndex = Parallax.options.zIndex;
|
32
|
-
mirror.style.position = "fixed";
|
33
|
-
mirror.style.top = 0;
|
34
|
-
mirror.style.left = 0;
|
35
|
-
mirror.style.overflow = "hidden";
|
36
|
-
Parallax.window.appendChild(mirror);
|
37
|
-
let slider = document.createElement("img");
|
38
|
-
slider.src = Parallax.options.src;
|
39
|
-
slider.alt = "parallax";
|
40
|
-
slider.classList.add("parallax-slider");
|
41
|
-
slider.style.opacity = 0;
|
42
|
-
mirror.appendChild(slider);
|
43
|
-
if (!Parallax.mirrors) {
|
44
|
-
Parallax.mirrors = [];
|
45
|
-
}
|
46
|
-
let mirrorItem = {};
|
47
|
-
mirrorItem.mirror = mirror;
|
48
|
-
mirrorItem.slider = slider;
|
49
|
-
Parallax.mirrors.push(mirrorItem);
|
50
|
-
Parallax.slidein();
|
51
|
-
slider.addEventListener(
|
52
|
-
"load",
|
53
|
-
function () {
|
54
|
-
Parallax.update();
|
55
|
-
},
|
56
|
-
false
|
57
|
-
);
|
58
|
-
};
|
59
|
-
Parallax.init = () => {
|
60
|
-
function loadDimensions() {
|
61
|
-
Parallax.wH = document.documentElement.clientHeight;
|
62
|
-
Parallax.wW = document.documentElement.clientWidth;
|
63
|
-
}
|
64
|
-
function getScrollTop() {
|
65
|
-
var scrollPos;
|
66
|
-
if (window.pageYOffset) {
|
67
|
-
scrollPos = window.pageYOffset;
|
68
|
-
} else if (document.compatMode && document.compatMode != "BackCompat") {
|
69
|
-
scrollPos = document.documentElement.scrollTop;
|
70
|
-
} else if (document.body) {
|
71
|
-
scrollPos = document.body.scrollTop;
|
72
|
-
}
|
73
|
-
return scrollPos;
|
74
|
-
}
|
75
|
-
function loadScrollPosition() {
|
76
|
-
const winScrollTop = getScrollTop();
|
77
|
-
Parallax.sT = Math.max(0, winScrollTop);
|
78
|
-
Parallax.sL = Math.max(0, document.body.scrollLeft);
|
79
|
-
Parallax.overScroll = Math.min(winScrollTop, 0);
|
80
|
-
}
|
81
|
-
window.addEventListener(
|
82
|
-
"resize",
|
83
|
-
function () {
|
84
|
-
loadDimensions();
|
85
|
-
Parallax.update();
|
86
|
-
},
|
87
|
-
false
|
88
|
-
);
|
89
|
-
loadDimensions();
|
90
|
-
let lastPosition = -1;
|
91
|
-
(function loop() {
|
92
|
-
const yoffset = getScrollTop();
|
93
|
-
if (lastPosition !== yoffset) {
|
94
|
-
lastPosition = yoffset;
|
95
|
-
loadScrollPosition();
|
96
|
-
Parallax.update();
|
97
|
-
}
|
98
|
-
window.requestAnimationFrame =
|
99
|
-
window.requestAnimationFrame ||
|
100
|
-
window.mozRequestAnimationFrame ||
|
101
|
-
window.webkitRequestAnimationFrame;
|
102
|
-
window.requestAnimationFrame(loop);
|
103
|
-
})();
|
104
|
-
};
|
105
|
-
|
106
|
-
Parallax.refreshItem = (slider) => {
|
107
|
-
Parallax.options.aspectRatio =
|
108
|
-
slider.naturalWidth / (slider.naturalHeight || 1);
|
109
|
-
const aspect = Parallax.options.aspectRatio || 1;
|
110
|
-
Parallax.options.boxWidth = Parallax.window.clientWidth;
|
111
|
-
Parallax.options.boxHeight = Parallax.window.clientHeight;
|
112
|
-
Parallax.options.boxOffsetTop = Parallax.window.scrollTop;
|
113
|
-
Parallax.options.boxOffsetLeft = Parallax.window.scrollLeft;
|
114
|
-
Parallax.options.boxOffsetBottom =
|
115
|
-
Parallax.options.boxOffsetTop + Parallax.options.boxHeight;
|
116
|
-
const winHeight = Parallax.wH;
|
117
|
-
const maxOffset = Parallax.options.boxOffsetTop;
|
118
|
-
const minOffset = Math.max(
|
119
|
-
Parallax.options.boxOffsetTop + Parallax.options.boxHeight - winHeight,
|
120
|
-
0
|
121
|
-
);
|
122
|
-
const imageHeightMin =
|
123
|
-
(Parallax.options.boxHeight +
|
124
|
-
(maxOffset - minOffset) * (1 - Parallax.options.speed)) |
|
125
|
-
0;
|
126
|
-
const imageOffsetMin =
|
127
|
-
((Parallax.options.boxOffsetTop - maxOffset) *
|
128
|
-
(1 - Parallax.options.speed)) |
|
129
|
-
0;
|
130
|
-
let margin;
|
131
|
-
if (Parallax.options.boxWidth < imageHeightMin * aspect) {
|
132
|
-
Parallax.options.imageWidth = (imageHeightMin * aspect) | 0;
|
133
|
-
Parallax.options.imageHeight = imageHeightMin;
|
134
|
-
Parallax.options.offsetBaseTop = imageOffsetMin;
|
135
|
-
margin = Parallax.options.imageWidth - Parallax.options.boxWidth;
|
136
|
-
Parallax.options.offsetLeft = (-margin / 2) | 0;
|
137
|
-
} else {
|
138
|
-
Parallax.options.imageWidth = Parallax.options.boxWidth;
|
139
|
-
Parallax.options.imageHeight = (Parallax.options.boxWidth / aspect) | 0;
|
140
|
-
Parallax.options.offsetLeft = 0;
|
141
|
-
margin = Parallax.options.imageHeight - imageHeightMin;
|
142
|
-
Parallax.options.offsetBaseTop = (imageOffsetMin - margin / 2) | 0;
|
143
|
-
}
|
144
|
-
};
|
145
|
-
Parallax.renderItem = (mirror, slider) => {
|
146
|
-
const scrollTop = Parallax.sT;
|
147
|
-
const scrollLeft = Parallax.sL;
|
148
|
-
const scrollBottom = scrollTop + Parallax.wH;
|
149
|
-
if (
|
150
|
-
Parallax.options.boxOffsetBottom > scrollTop &&
|
151
|
-
Parallax.options.boxOffsetTop <= scrollBottom
|
152
|
-
) {
|
153
|
-
Parallax.options.visibility = "visible";
|
154
|
-
Parallax.options.mirrorTop = Parallax.options.boxOffsetTop - scrollTop;
|
155
|
-
Parallax.options.mirrorLeft = Parallax.options.boxOffsetLeft - scrollLeft;
|
156
|
-
Parallax.options.offsetTop =
|
157
|
-
Parallax.options.offsetBaseTop -
|
158
|
-
Parallax.options.mirrorTop * (1 - Parallax.options.speed);
|
159
|
-
} else {
|
160
|
-
Parallax.options.visibility = "hidden";
|
161
|
-
}
|
162
|
-
mirror.style.transform =
|
163
|
-
"translate3d(" +
|
164
|
-
Parallax.options.mirrorLeft +
|
165
|
-
"px, " +
|
166
|
-
Parallax.options.mirrorTop +
|
167
|
-
"px, 0px)";
|
168
|
-
mirror.style.visibility = Parallax.options.visibility;
|
169
|
-
mirror.style.height = Parallax.options.boxHeight + "px";
|
170
|
-
mirror.style.width = Parallax.options.boxWidth + "px";
|
171
|
-
|
172
|
-
slider.style.transform =
|
173
|
-
"translate3d(" +
|
174
|
-
Parallax.options.offsetLeft +
|
175
|
-
"px, " +
|
176
|
-
Parallax.options.offsetTop +
|
177
|
-
"px, 0px)";
|
178
|
-
slider.style.position = "absolute";
|
179
|
-
slider.style.height = Parallax.options.imageHeight + "px";
|
180
|
-
slider.style.width = Parallax.options.imageWidth + "px";
|
181
|
-
slider.style.maxWidth = "none";
|
182
|
-
};
|
183
|
-
Parallax.update = () => {
|
184
|
-
if (!Parallax.mirrors) {
|
185
|
-
return
|
186
|
-
}
|
187
|
-
Parallax.mirrors.forEach((e) => {
|
188
|
-
Parallax.refreshItem(e.slider);
|
189
|
-
Parallax.renderItem(e.mirror, e.slider);
|
190
|
-
});
|
191
|
-
};
|
1
|
+
let Parallax={options:{}};Parallax.options.speed=.25,Parallax.options.zIndex=-100,Parallax.options.fade=1500,Parallax.slidein=()=>{let a=Parallax.mirrors[0].slider;Parallax.mirrors.length>=2&&(a=Parallax.mirrors[1].slider);var l=parseFloat(a.style.opacity);1!==l?Parallax.mirrors.length>=2?(l+=.1,a.style.opacity=l,setTimeout(Parallax.slidein,Parallax.options.fade/10)):a.style.opacity=1:Parallax.mirrors.length>=2&&(Parallax.mirrors[0].mirror.remove(),Parallax.mirrors.shift())},Parallax.start=()=>{let a=document.createElement("div");a.classList.add("parallax-mirror"),a.style.visibility="hidden",a.style.zIndex=Parallax.options.zIndex,a.style.position="fixed",a.style.top=0,a.style.left=0,a.style.overflow="hidden",Parallax.window.appendChild(a);let l=document.createElement("img");l.src=Parallax.options.src,l.alt="parallax",l.classList.add("parallax-slider"),l.style.opacity=0,a.appendChild(l),Parallax.mirrors||(Parallax.mirrors=[]);let o={};o.mirror=a,o.slider=l,Parallax.mirrors.push(o),Parallax.slidein(),l.addEventListener("load",(function(){Parallax.update()}),!1)},Parallax.init=()=>{function a(){Parallax.wH=document.documentElement.clientHeight,Parallax.wW=document.documentElement.clientWidth}function l(){var a;return window.pageYOffset?a=window.pageYOffset:document.compatMode&&"BackCompat"!=document.compatMode?a=document.documentElement.scrollTop:document.body&&(a=document.body.scrollTop),a}window.addEventListener("resize",(function(){a(),Parallax.update()}),!1),a();let o=-1;!function a(){const t=l();o!==t&&(o=t,function(){const a=l();Parallax.sT=Math.max(0,a),Parallax.sL=Math.max(0,document.body.scrollLeft),Parallax.overScroll=Math.min(a,0)}(),Parallax.update()),window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame,window.requestAnimationFrame(a)}()},Parallax.refreshItem=a=>{Parallax.options.aspectRatio=a.naturalWidth/(a.naturalHeight||1);const l=Parallax.options.aspectRatio||1;Parallax.options.boxWidth=Parallax.window.clientWidth,Parallax.options.boxHeight=Parallax.window.clientHeight,Parallax.options.boxOffsetTop=Parallax.window.scrollTop,Parallax.options.boxOffsetLeft=Parallax.window.scrollLeft,Parallax.options.boxOffsetBottom=Parallax.options.boxOffsetTop+Parallax.options.boxHeight;const o=Parallax.wH,t=Parallax.options.boxOffsetTop,r=Math.max(Parallax.options.boxOffsetTop+Parallax.options.boxHeight-o,0),i=Parallax.options.boxHeight+(t-r)*(1-Parallax.options.speed)|0,e=(Parallax.options.boxOffsetTop-t)*(1-Parallax.options.speed)|0;let s;Parallax.options.boxWidth<i*l?(Parallax.options.imageWidth=i*l|0,Parallax.options.imageHeight=i,Parallax.options.offsetBaseTop=e,s=Parallax.options.imageWidth-Parallax.options.boxWidth,Parallax.options.offsetLeft=-s/2|0):(Parallax.options.imageWidth=Parallax.options.boxWidth,Parallax.options.imageHeight=Parallax.options.boxWidth/l|0,Parallax.options.offsetLeft=0,s=Parallax.options.imageHeight-i,Parallax.options.offsetBaseTop=e-s/2|0)},Parallax.renderItem=(a,l)=>{const o=Parallax.sT,t=Parallax.sL,r=o+Parallax.wH;Parallax.options.boxOffsetBottom>o&&Parallax.options.boxOffsetTop<=r?(Parallax.options.visibility="visible",Parallax.options.mirrorTop=Parallax.options.boxOffsetTop-o,Parallax.options.mirrorLeft=Parallax.options.boxOffsetLeft-t,Parallax.options.offsetTop=Parallax.options.offsetBaseTop-Parallax.options.mirrorTop*(1-Parallax.options.speed)):Parallax.options.visibility="hidden",a.style.transform="translate3d("+Parallax.options.mirrorLeft+"px, "+Parallax.options.mirrorTop+"px, 0px)",a.style.visibility=Parallax.options.visibility,a.style.height=Parallax.options.boxHeight+"px",a.style.width=Parallax.options.boxWidth+"px",l.style.transform="translate3d("+Parallax.options.offsetLeft+"px, "+Parallax.options.offsetTop+"px, 0px)",l.style.position="absolute",l.style.height=Parallax.options.imageHeight+"px",l.style.width=Parallax.options.imageWidth+"px",l.style.maxWidth="none"},Parallax.update=()=>{Parallax.mirrors&&Parallax.mirrors.forEach((a=>{Parallax.refreshItem(a.slider),Parallax.renderItem(a.mirror,a.slider)}))};
|
2
|
+
//# sourceMappingURL=../../maps/js/plugins/parallax.js.map
|