-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
189 lines (174 loc) · 7.46 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<title>about:ash</title>
</head>
<body>
<div class="container">
<button id="bganim_toggle">Stop animation</button>
<canvas id="bganim" aria-label="Background animation" alt="Background animation"></canvas>
<div id="content">
<h2 id="hi">Hi, I'm Ash.</h2>
<div id="tooltip"><span id="errname">They/them</span> <span id="err">on/ona</span>
<hr id="rainbowrule"><a id="viewproblem" href="https://placekitten.com/g/1920/1080">View problem</a>
<span id="quickfix">No
quick fixes available.</span>
</div>
<div id="aboutme">
<p>
I'm an amateur programmer, mostly interested in Python. This site is a website I wrote to
try to remember
my webdev courses from school.
<p>This site
uses the Rose Pine theme with my favorite variant. My projects are pretty varied as I like trying
new
things. This is one of them, hence all of the problems, I hadn't touched js for years.</p>
</p>
Please don't look at my <a href="https://github.com/maybork/about_me" target="_blank">source code</a>
(it's insecure)
</div>
<h2 id="proj_accordion" tabindex="0" role="button" aria-label="Projects"><i role="none" id="accordion_arrow" class="bi bi-caret-right-fill"></i>Projects
</h2>
<div id="projects">
<div class="project">
<h3>mcpi Control Panel <a class="source" href="https://github.com/maybork/mcpi-webapp">[source]</a>
</h3>
<p>
A control panel for Minecraft using the <a href="https://github.com/martinohanlon/mcpi"
target="_blank">
MCPI</a> library. It mplements a cursor which can move around and draw itself. Made with
Flask
and Bootstrap.
<img src="static/mc.webp" alt="Minecraft control panel">
</p>
</div>
<div class="project">
<h3>This site <a class="source" href="https://github.com/maybork/about_me">[source]</a></h3>
<p>
In order to understand recursion, one must first understand recursion.
<iframe src="index.html" title="An iframe containing this website." tabindex="-1"></iframe>
Hilarious, I know. I used Pts.js for the background animation, otherwise I wanted to avoid using
any 3rd party libraries in order to
try and figure things out myself. I can't make the animation sticky for whatever reason but I'm
still pretty satisfied with the result.
</p>
</div>
<div class="project">
<h3>Rose Pine for KDE Plasma <a class="source" href="https://github.com/maybork/kde">[source]</a>
</h3>
<p>
<img src="static/rosepinekde.webp" alt="Rose Pine KDE Plasma theme">
I'm the sole maintainer (and possibly the only user too) of this theme. It's unfinished for a
good reason - theming with Qt is
one of the most painful experiences I've had. I'm kind of hoping it gets forgotten, though it
does look pretty nice.
</p>
<div class="project"></div>
</div>
</div>
</body>
<script>
(() => {
let iframeEl = document.querySelector('iframe');
let nextQueryValue = !location.search ? 1 :
Number(location.search.split("?").pop()) + 1;
if (nextQueryValue < 4) {
iframeEl.src = `index.html?${nextQueryValue}`;
}
else {
iframeEl.src = "";
}
//make all elements in the iframe non-focusable
iframeEl.contentWindow.document.querySelectorAll('*').forEach(el => {
el.tabIndex = -1;
});
})();
function a11yClick(event) {
//from https://karlgroves.com/ridiculously-easy-trick-for-keyboard-accessibility/
if (event.type === 'click') {
return true;
}
else if (event.type === 'keypress') {
var code = event.charCode || event.keyCode;
if ((code === 32) || (code === 13)) {
return true;
}
}
else {
return false;
}
}
// implement the bganim toggle button. There should be three states: play, pause, hide
let bganim_toggle = document.getElementById('bganim_toggle');
let bganim = document.getElementById('bganim');
let states = {
"play": () => {
space.resume()
bganim.classList.remove('fadeout')
bganim.classList.add('fadein')
bganim_toggle.innerHTML = "Pause animation";
bganim_toggle.onclick = states["pause"];
},
"pause": () => {
bganim_toggle.innerHTML = "Hide animation";
bganim_toggle.onclick = states["hide"];
space.pause()
},
"hide": () => {
bganim.classList.remove('fadein')
bganim.classList.add("fadeout");
bganim_toggle.innerHTML = "Play animation";
bganim_toggle.onclick = states["play"];
}
}
bganim_toggle.onclick = states["pause"];
setTimeout(() => {
var tooltip = document.getElementById('tooltip');
var name = document.getElementById('name');
name.addEventListener('mouseover', () => {
tooltip.classList.add('show');
});
name.addEventListener('mouseout', () => {
tooltip.classList.remove('show');
});
}, 2000);
const projects = document.getElementById('projects');
(() => {
projects.querySelectorAll('a').forEach(el => {
el.tabIndex = -1;
}
)
})();
function accordion(){
const proj_accordion = document.getElementById('proj_accordion');
const accordion_arrow = document.getElementById('accordion_arrow');
projects.style.maxHeight = projects.style.maxHeight ? null : projects.scrollHeight + "px";
projects.querySelectorAll('a').forEach(el => {
if (el.tabIndex == 0) {
el.tabIndex = -1;
el.ariaHidden = true;
}
else {
el.tabIndex = 0;
el.ariaHidden = false;
}
});
accordion_arrow.classList.toggle('open')
}
proj_accordion.addEventListener('click', (event) => {
accordion()
});
proj_accordion.addEventListener('keypress', (event) => {
if (a11yClick(event)) {
accordion()
}
});
</script>
<script src="lib/pts.js"></script>
<script src="anim.js"></script>
</html>