-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
126 lines (119 loc) · 4.64 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
if (navigator.userAgent.match(/MSIE (?: [^;]*)?8/)) { // IE8
window.location.href = "https://jiegeblog.eu.org/browser_not_support.html";
} else if (navigator.userAgent.match(/MSIE (?: [^;]*)?9/)) { // IE9
window.location.href = "https://jiegeblog.eu.org/browser_not_support.html";
} else if (navigator.userAgent.match(/MSIE (?: [^;]*)?10/)) { // IE10
window.location.href = "https://jiegeblog.eu.org/browser_not_support.html";
} else if (navigator.userAgent.match(/Trident\/\d.+ rv:11\./)) { // IE11 (using Trident version)
window.location.href = "https://jiegeblog.eu.org/browser_not_support.html";
}
function showSidebar() {
const sidebar = document.querySelector('.sidebar');
window.scrollTo(0, 0);
sidebar.style.display = 'flex';
setTimeout(
function showSidebar2() {
sidebar.style.opacity = '1';
}, 100)
}
function hideSidebar() {
const sidebar = document.querySelector('.sidebar');
sidebar.style.opacity = '0';
setTimeout(
function hideSidebar2() {
sidebar.style.display = 'none';
}, 500)
}
function downloadFile() {
const url = 'About_Me.md';
const Link = document.createElement('a');
link.href = url;
link.download = 'README.md';
document.body.appendChild(Link);
link.click();
document.body.removeChild(Link);
}
var prevScrollpos = window.pageYOffset;
window.onscroll = function() {
var currentScrollPos = window.pageYOffset;
let navbar = document.querySelector('nav');
if (prevScrollpos > currentScrollPos) {
navbar.style.top = '0';
navbar.style.boxShadow = '5px 5px 5px #00000018';
} else {
navbar.style.top = '-50px';
navbar.style.boxShadow = '0px 0px 0px #00000018';
}
prevScrollpos = currentScrollPos;
};
const image = document.getElementById('secret-onclick');
const imageMobile = document.getElementById('secret-onclick-mobile');
let clickCount = 0;
image.addEventListener('click', () => {
const loader = document.getElementById('loader');
const secretText = document.getElementById('secret-text-change');
const secretText2 = document.getElementById('secret-text-change-2');
const disappear = document.getElementById('secret-disappear');
const embedWindow = document.getElementById('sc-embed-cd');
clickCount++;
if (clickCount === 2) {
secretText.innerHTML = "Bro I told you don't click me twice.";
secretText2.innerHTML = 'Hidden Easter Egg!';
secretText2.style.animation = 'changecolor';
secretText2.style.animationDuration = '15s';
image.style.border = '5px solid #505050';
secretText2.style.animationIterationCount = 'infinite';
disappear.style.transform = 'scale(0)';
embedWindow.style.display = 'block';
setTimeout(
function makebtnconDisappear() {
disappear.style.display = 'none';
loader.style.display = 'block';
embedWindow.style.display = 'block';
setTimeout(
function f2sc() {
embedWindow.style.transform = 'scale(1)';
loader.style.display = 'none';
}
, 2000)
}
, 1500)
image.style.width = '180px';
} else {
secretText.innerHTML = "You can click me, BUT DON'T CLICK ME TWICE!";
}
});
imageMobile.addEventListener('click', () => {
const loader = document.getElementById('loader-mobile');
const secretText = document.getElementById('secret-text-change-mobile');
const secretText2 = document.getElementById('secret-text-change-2-mobile');
const disappear = document.getElementById('secret-disappear-mobile');
const embedWindow = document.getElementById('sc-embed-cd-mobile');
clickCount++;
if (clickCount === 2) {
secretText.innerHTML = "Bro I told you don't click me twice.";
secretText2.innerHTML = 'Hidden Easter Egg!';
secretText2.style.animation = 'changecolor';
secretText2.style.animationDuration = '15s';
image.style.border = '5px solid #505050';
secretText2.style.animationIterationCount = 'infinite';
disappear.style.transform = 'scale(0)';
embedWindow.style.display = 'block';
setTimeout(
function makebtnconDisappear() {
disappear.style.display = 'none';
loader.style.display = 'block';
embedWindow.style.display = 'block';
setTimeout(
function f2sc() {
embedWindow.style.transform = 'scale(1)';
loader.style.display = 'none';
}
, 2000)
}
, 1500)
imageMobile.style.width = '150px';
} else {
secretText.innerHTML = "You can click me, BUT DON'T CLICK ME TWICE!";
}
});