-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
261 lines (237 loc) · 9.77 KB
/
index.html
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<!DOCTYPE HTML>
<!-- SPOILER: i am NOT a web developer lmao -->
<html lang="en">
<head>
<link rel="stylesheet" href="styles.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preload" as="image" href="http://7ukecreat0r.github.io/assets/logo.png" />
<link rel="preload" as="image" href="https://7ukecreat0r.github.io/assets/social-discord.png" />
<link rel="preload" as="image" href="https://7ukecreat0r.github.io/assets/social-yt.png" />
<link rel="preload" as="image" href="https://7ukecreat0r.github.io/assets/social-twitter.png" />
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Roboto&family=Roboto+Mono&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=0.5">
<title>7UKECREAT0R</title>
<meta name="title" content="7UKECREAT0R">
<meta name="description" content="advanced books for computers">
</head>
<body>
<!-- main logo -->
<div id="collection" class="main">
<div id="insidecollection" class="maincl" onclick="toggleMenu()">
<img src="http://7ukecreat0r.github.io/assets/logo.png" alt="LOGO" class="logo" />
<div id="textcontainer">
<h1>LUKECREATOR</h1>
<h2>SOFTWARE DEVELOPER</h2>
</div>
</div>
</div>
<!-- sub menu items-->
<div class="items" style="margin-top: 48px;">
<div class="item" id="i_home" selected="false" onclick="clicked(this)">
<p class="itemicon">⌂</p>
<p class="itemtext">home</p>
</div>
<div class="item" id="i_about" selected="false" onclick="clicked(this)">
<p class="itemicon">⌞</p>
<p class="itemtext">about</p>
</div>
<div class="item" id="i_projects" selected="false" onclick="clicked(this)">
<p class="itemicon">⌞</p>
<p class="itemtext">projects</p>
</div>
<div class="item" id="i_contact" selected="false" onclick="clicked(this)">
<p class="itemicon">⌞</p>
<p class="itemtext">contact</p>
</div>
</div>
<!-- loading screen -->
<div id="fill" class="fill" style="opacity: 1;">
<p class="fill">hey there</p>
</div>
<script>
const homeInnerHTML = `
<img src="http://7ukecreat0r.github.io/assets/logo.png" alt="LOGO" class="logo">
<div id="textcontainer">
<h1>LUKECREATOR</h1>
<h2>SOFTWARE DEVELOPER</h2>
</div>
`;
const aboutInnerHTML = `
<p class="text">
<b>Hey I'm Luke; I'm a software developer based in South Carolina.</b><br />
I'm very familiar with Java and C# backends along with a massive tech stack in low-level computing. Web and front-end terrify me.
For the most part I'm extremely casual and never serious unless it's work related. If you'd like to get in contact, just hit me up on Discord and we'll work something out!
</p>
`;
const projectsInnerHTML = `
<button onclick="transitionPage('projects.html')">projects</button>
`;
const contactInnerHTML = `
<img src="https://7ukecreat0r.github.io/assets/social-yt.png" class="social" onclick="transitionPage('https://www.youtube.com/7ukecreat0r')"/>
<img src="https://7ukecreat0r.github.io/assets/social-discord.png" class="social" onclick="transitionPage('https://discord.com/invite/tJsEcseENM')" />
<img src="https://7ukecreat0r.github.io/assets/social-twitter.png" class="social" onclick="transitionPage('https://twitter.com/lukecreator')" />
`
// Element instances
var fadeElement; // element
var mainElement; // element
var itemElements; // element[]
var activeTimeout = null;
// Item Actions Based on Index
function item_home() {
if (!menuOpen)
return;
resetAnimation(mainElement, "logo-exit 0.3s ease forwards");
titlePresent = true;
activeTimeout = setTimeout(function () {
mainElement.innerHTML = homeInnerHTML;
resetAnimation(mainElement, "logo-enter 0.3s ease forwards");
}, 300);
}
function item_about() {
if (!menuOpen)
return;
resetAnimation(mainElement, "logo-exit 0.3s ease forwards");
titlePresent = false;
activeTimeout = setTimeout(function () {
mainElement.innerHTML = aboutInnerHTML;
resetAnimation(mainElement, "logo-enter 0.3s ease forwards");
}, 300);
}
function item_projects() {
if (!menuOpen)
return;
resetAnimation(mainElement, "logo-exit 0.3s ease forwards");
titlePresent = false;
activeTimeout = setTimeout(function () {
mainElement.innerHTML = projectsInnerHTML;
resetAnimation(mainElement, "logo-enter 0.3s ease forwards");
}, 300);
}
function item_contact() {
if (!menuOpen)
return;
resetAnimation(mainElement, "logo-exit 0.3s ease forwards");
titlePresent = false;
activeTimeout = setTimeout(function () {
mainElement.innerHTML = contactInnerHTML;
const socials = document.getElementsByClassName("social");
var delay = 0.0;
for (const element of socials) {
element.style.animationDelay = delay + 's';
delay -= 0.4;
}
resetAnimation(mainElement, "logo-enter 0.3s ease forwards");
}, 300);
}
const itemFunctions = [
item_home,
item_about,
item_projects,
item_contact
];
// Loading screen
const oStep = 0.1;
const itemDelay = 75;
var fadeTicks = 10;
var opacity = 1.0;
var fading = false;
// Menu
var menuOpen = false;
var titlePresent = true;
// Fade out loading element when DOM is loaded
window.addEventListener("load", function () {
fadeElement = this.document.getElementById("fill");
mainElement = this.document.getElementById("insidecollection");
itemElements = this.document.querySelectorAll(".item");
fading = true;
// Control loading screen fade
window.setInterval(function () {
if (fading) {
if (fadeTicks-- < 1) {
fadeElement.remove();
fading = false;
return;
}
opacity -= oStep;
fadeElement.style.opacity = opacity;
}
for (var i = 0; i < itemElements.length; i++) {
const menu = itemElements[i];
menu.style.animationDelay = ((i + 1) * itemDelay) + "ms";
}
}, 16);
});
function resetAnimation(e, animation) {
e.style.animation = "";
void e.offsetWidth;
e.style.animation = animation;
}
function transitionPage(url) {
menuOpen = false;
resetAnimation(mainElement, "logo-exit 0.3s ease forwards");
for (var i = 0; i < itemElements.length; i++) {
const menu = itemElements[i];
resetAnimation(menu, "itemdisable 0.2s ease-out both");
}
activeTimeout = setTimeout(function () {
window.location.href = url;
}, 500);
}
function toggleMenu() {
if (!titlePresent)
return;
menuOpen = !menuOpen;
if (menuOpen) {
defaultItems();
resetAnimation(mainElement, "open-menu 0.4s ease forwards");
} else {
resetAnimation(mainElement, "open-menu 0.4s ease reverse");
}
for (var i = 0; i < itemElements.length; i++) {
const menu = itemElements[i];
if (menuOpen) {
resetAnimation(menu, "itemenable 0.2s ease-out forwards");
} else {
resetAnimation(menu, "itemdisable 0.2s ease-out both");
}
}
}
// When category is clicked, replace the title logo with looked up text.
function defaultItems() {
resetItems();
itemElements[0].setAttribute("selected", "true");
}
function resetItems() {
for (var i = 0; i < itemElements.length; i++) {
const disable = itemElements[i];
disable.setAttribute("selected", "false");
}
}
function resetTimeouts() {
if (activeTimeout)
clearTimeout(activeTimeout);
activeTimeout = null;
}
function clicked(element) {
if (element.getAttribute("selected") === "true")
return;
resetItems();
element.setAttribute("selected", "true");
var index = -1;
for (var i = 0; i < itemElements.length; i++) {
if (itemElements[i].id == element.id) {
index = i;
break;
}
}
if (index == -1) {
alert("unknown button");
return;
}
resetTimeouts();
itemFunctions[index]();
}
</script>
</body>
</html>