-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
118 lines (112 loc) · 4 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.2/p5.min.js" integrity="sha512-rCZdHNB0AePry6kAnKAVFMRfWPmUXSo+/vlGtrOUvhsxD0Punm/xWbEh+8vppPIOzKB9xnk42yCRZ5MD/jvvjQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.2/p5.js" integrity="sha512-+tu0+vUXyZX+S51npa//IN6znNTLZsBoy8mXn9WzHxfBqYMy6gOzzfTK0VqZf9O171RY9AJviHDokCnvEq8+1A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.2/addons/p5.sound.js" integrity="sha512-TU9AWtV5uUZPX8dbBAH8NQF1tSdigPRRT82vllAQ1Ke28puiqLA6ZVKxtUGlgrH6yWFnkKy+sE6luNEGH9ar0A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<link rel="stylesheet" href="style.css">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Generative Art Projects"
/>
<title>Gen Art</title>
</head>
<body>
<style>
html {
position:relative;
min-height: 100%;
}
body {
width: 80%;
margin: auto;
font-size: 110%;
}
footer {
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
h1 {
font-size: 500%;
text-align: center;
}
h2 {
font-weight: 200;
}
a {
text-decoration: none;
font-size: 120%;
outline: 1px solid white;
padding: 20px 0px 20px 20px;
color: white;
transition: background-color 0.5s
}
a:hover {
background-color: white;
color: black;
transition: background-color 0.5s;
}
#contact {
border: none;
padding: 0;
margin: 0;
font-size: 100%;
text-decoration: underline;
}
</style>
<noscript>You need to enable JavaScript to run this app.</noscript>
<main>
<article>
<section id="sketch">
<h>
<h1 id="headline">....</h1>
<h2>Generative Art Projects</h2>
</h>
<a id="Dust" class="link" href="Art/A1/dust.html">Dust</a>
<a id="Cables" class="link" href="Art/A2/cables.html">Cables</a>
<a id="Flower" class="link" href="Art/A3/flower.html">Flower</a>
<a id="Tornados" class="link" href="Art/A4/tornados.html">Tornados</a>
<a id="Perlin" class="link" href="Art/A5/perlin.html">Explosion</a>
</section>
</article>
</main>
<footer>
<p>
2022 / <a id="contact" href="https://yooksel.com/">Contact</a>
</p>
</footer>
<script>
let count = 1000;
window.addEventListener('load', () => {
loop('.-..:-_:', '#headline', count);
if (count === 0) {
count = 10;
loop('...:-_:', '#headline', count);
}
});
let links = document.getElementsByClassName('link');
for (let i = 0; i < links.length; i++) {
links[i].addEventListener('mouseover', (event) => {
loop(links[i].innerHTML + ".-.:", "#" + links[i].id, 5);
});
};
const sleep = (milliseconds) => {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}
const loop = async (text, element, count) => {
let hd = document.querySelector(element);
for (let i = 0 ; i < count; i++) {
await sleep(200);
let shuffled = text.split('').sort(function(){return 0.5-Math.random()}).join('');
hd.innerHTML = shuffled;
}
hd.innerHTML = hd.id;
}
</script>
</body>
</html>