Skip to content

Commit 60ec07b

Browse files
committed
i
1 parent e087a22 commit 60ec07b

10 files changed

Lines changed: 66 additions & 70 deletions

File tree

dist/404.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/bundle-0e7a0.css

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bundle-0e7a0.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bundle-a12f1.css

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/bundle-a12f1.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/css/style.css

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ canvas {
3636
background-blend-mode:difference;
3737
text-align:center;
3838
opacity:.65;
39-
transition:all 1s;
39+
transition:all .2s;
4040
border-radius:0 0 2rem 2rem;}
4141
.scrolled-down #header-verse {display:none;}
4242
header:hover {background:linear-gradient(to bottom, rgba(255, 0, 0, .4) 0%, rgba(0, 222, 0, .15) 6%, rgba(128, 22, 128, 0.3) 94%, rgba(255, 0, 0, .4) 100%);}
@@ -48,7 +48,7 @@ header {position:fixed;
4848
margin-bottom:.3rem;
4949
z-index:1;
5050
padding:1rem 0 0 0;
51-
transition:all .1s ease-out;
51+
transition:all .2s ease-out;
5252
overflow:hidden;
5353
background:linear-gradient(to top, rgba(255, 0, 0, .25) 0%, rgba(0, 22, 0, .3) 2%, rgba(128, 0, 128, 0.2) 98%, rgba(0, 0, 255, .5) 100%);
5454
backdrop-filter:brightness(115%) contrast(90%) saturate(270%);
@@ -94,9 +94,9 @@ header {position:fixed;
9494
#site-title {margin-left:-.1rem;margin-top:.3rem;display:flex;align-items:center;} .scrolled-down #site-title {margin-top:-.25rem;}
9595
#site-title-text:hover {opacity:.77;}
9696
#site-title-text {opacity:.55;margin:.3em 0 0 -.3rem;}
97-
.img-header {height:4rem;transition:all 1s ease;
97+
.img-header {height:4rem;transition:all .2s ease;
9898
filter:drop-shadow(0 0 1rem rgba(127, 127, 127, 0.75));}
99-
.img-header:hover {filter:invert(100%) !important;transition:all .5s ease-in-out;scale:1.07;}
99+
.img-header:hover {filter:invert(100%) !important;transition:all .4s ease-in-out;scale:1.07;}
100100
.no-bg {background:none !important;border:none !important;}
101101
#site-intro {text-align:center;
102102
padding:.1rem 0 .2rem;
@@ -147,7 +147,7 @@ h1 {margin:0;
147147
text-align:left;
148148
width:50%;
149149
filter:drop-shadow(0 0 1rem rgba(255, 255, 255, 0.7));}
150-
h2, h3, h4, h5, h6 {margin-bottom:0.7rem;padding:0 0 0 .2rem;}
150+
h2, h3, h4, h5, h6 {margin-bottom:.7rem;padding:0 0 0 .2rem;}
151151
.article-title {text-align:center;line-height:1.4;margin:.5rem 0 0 0;filter:drop-shadow(0 0 1rem rgb(255, 0, 128))!important;}
152152
body, p {margin:0;
153153
text-align:left;
@@ -177,7 +177,7 @@ a:hover {text-decoration:dotted underline;
177177
background:linear-gradient(to top, rgba(22,22,222, .2), rgba(22, 222, 222, .5));}
178178
article {min-height:80vh;border:dotted 1px rgba(255,255,0,.1);}
179179
.article-header {background-image:url("../img/bg.png");
180-
transition:all 1.1s ease-in;
180+
transition:scale .8s ease-in;
181181
background-size:35%;
182182
background-attachment:scroll;
183183
border:solid 1px rgba(0,255,0,.15);
@@ -197,7 +197,7 @@ article {min-height:80vh;border:dotted 1px rgba(255,255,0,.1);}
197197
border-right:outset 4px rgba(255, 0, 0, 0.6);
198198
border-left:inset 4px rgba(255, 0, 0, 0.6);}
199199
.article-header-wrapper {background:linear-gradient(to bottom, rgba(0, 222, 0, .15), rgba(128, 22, 128, 0.3));
200-
transition:all 1.2s ease-out;
200+
transition:scale 1s ease-out;
201201
margin:0 -.7rem;
202202
z-index:2;
203203
border:inset .7rem rgba(255,255,100,.1);
@@ -215,7 +215,7 @@ article {min-height:80vh;border:dotted 1px rgba(255,255,0,.1);}
215215
.section-nav {background:linear-gradient(to right, rgb(22 222 28 / 25%) 0%, rgb(110 0 145 / 45%) 50%, rgb(222 114 22 / 25%) 100%);
216216
padding:0 0 .65rem;
217217
border:solid 1px rgba(255,0,0,.3);
218-
transition:scale 2s ease;
218+
transition:scale 1.2s ease;
219219
filter:drop-shadow(0 0 1.7rem rgba(0, 174, 255, 0.8));}
220220
.section-nav .col a {padding:.2rem .9rem;}
221221
.section-nav:hover {background:linear-gradient(to left, rgb(22 222 28 / 30%) 0%, rgb(110 0 145 / 55%) 50%, rgb(222 114 22 / 30%) 100%);
@@ -234,7 +234,7 @@ article {min-height:80vh;border:dotted 1px rgba(255,255,0,.1);}
234234
opacity:.8;
235235
padding:.3rem 2rem;
236236
border:solid 1px rgba(255,0,0,.3);
237-
transition:all 1.5s ease;
237+
transition:all 1.3s ease-in;
238238
filter:drop-shadow(0 0 1.5rem rgba(6, 0, 48, 0.8));}
239239
.article-nav-bottom:hover {background:linear-gradient(to left, rgb(22 222 28 / 22%) 0%, rgb(110 0 145 / 22%) 50%, rgb(222 114 22 / 22%) 100%);
240240
scale:1.02;
@@ -274,14 +274,14 @@ article {min-height:80vh;border:dotted 1px rgba(255,255,0,.1);}
274274
right:2.5%;
275275
padding:5px;
276276
background:rgba(128,128,128,.1);
277-
opacity:0.4;}
277+
opacity:.4;}
278278
#toTop:hover {cursor:pointer;
279279
background:rgba(128,128,128,.3);
280-
opacity:0.9;}
280+
opacity:.9;}
281281
.to-top {width:2.7rem;} .to-top:hover {filter:invert(100%);}
282-
#toTopFooter {opacity:0.5;} #toTopFooter:hover {cursor:pointer;opacity:0.9;}
282+
#toTopFooter {opacity:.5;} #toTopFooter:hover {cursor:pointer;opacity:.9;}
283283
footer {background:linear-gradient(to top, rgba(0, 0, 0, .3), rgba(128, 128, 128, 0.2));
284-
transition:all 1.2s ease-in-out;
284+
transition:all 1.1s ease-in-out;
285285
margin-right:-.7rem;
286286
margin-left:-.7rem;
287287
margin-bottom:.4rem;
@@ -300,9 +300,9 @@ footer:hover {background:linear-gradient(to bottom, rgba(0, 0, 0, .3), rgba(128,
300300
blockquote:hover {background:linear-gradient(to right, rgba(0, 0, 0, .15), rgba(128, 128, 128, 0.1));}
301301
blockquote {background:linear-gradient(to left, rgba(0, 0, 0, .15), rgba(128, 128, 128, 0.1));
302302
width:92%;
303-
margin:0.3rem auto;
304-
margin-bottom:0.3rem;
305-
padding-bottom:0.3rem;
303+
margin:.3rem auto;
304+
margin-bottom:.3rem;
305+
padding-bottom:.3rem;
306306
border:inset .2rem rgba(100,100,100,.2);
307307
border-radius:.7rem;}
308308
button {font-size:80%;
@@ -323,19 +323,19 @@ li {list-style-type:none;display:inline-block;}
323323
input, textarea {font-size:110%;background:radial-gradient( circle farthest-corner at 22.4% 21.7%, rgba(4,189,228,1) 0%, rgba(2,83,185,1) 100% );}
324324
::placeholder {color:rgb(168, 0, 0);}
325325
img {opacity:1;transition:all .7s ease-in-out;border-radius:0;} img:hover {opacity:.91;}
326-
.img-opaq {opacity:0.66;} .img-opaq:hover {opacity:.86;}
327-
.img-opaq2 {opacity:0.72;} .img-opaq2:hover {opacity:.88;}
328-
.img-opaq3 {opacity:0.8;} .img-opaq3:hover {opacity:.9;}
329-
.img-opaq4 {opacity:0.85;} .img-opaq4:hover {opacity:.92;}
330-
.opaq80 {opacity:0.8 !important;}
326+
.img-opaq {opacity:.66;} .img-opaq:hover {opacity:.86;}
327+
.img-opaq2 {opacity:.72;} .img-opaq2:hover {opacity:.88;}
328+
.img-opaq3 {opacity:.8;} .img-opaq3:hover {opacity:.9;}
329+
.img-opaq4 {opacity:.85;} .img-opaq4:hover {opacity:.92;}
330+
.opaq80 {opacity:.8 !important;}
331331
.img-gray:hover {filter:grayscale(85%);transition:all 1s ease-in-out;}
332332
.img-sat:hover {filter:saturate(40);transition:all 3s ease-in-out;}
333333
.img-sat2:hover {filter:saturate(20);transition:all 3s ease-in-out;}
334334
.img-sat3:hover {filter:saturate(10);transition:all 3s ease-in-out;}
335335
figure {text-align:center;font-style:italic;font-size:80%;margin:0;}
336336
figure a {text-decoration:none;background:none!important;border:none;}
337337
figcaption {opacity:.7} figcaption:hover {opacity:1;}
338-
.img-fluid {object-fit:contain;min-width:400px;min-width:70%;margin:auto;max-width:99.5%;max-height:82vh;margin-top:0.5rem;margin-bottom:0.5rem;}
338+
.img-fluid {object-fit:contain;min-width:400px;min-width:70%;margin:auto;max-width:99.5%;max-height:82vh;margin-top:.5rem;margin-bottom:.5rem;}
339339
#fullScreenOverlay {display:none;
340340
position:fixed;
341341
z-index:999;
@@ -402,22 +402,6 @@ details > summary:hover {cursor:pointer;text-decoration:underline;}
402402
padding:1.5rem;
403403
width:75%;
404404
}
405-
.search-overlay .closeBtn {
406-
position:absolute;
407-
top:2rem;
408-
right:4rem;
409-
font-size:300%;
410-
cursor:pointer;
411-
margin-top:-5%;
412-
}
413-
.closeBtn {
414-
top:0;
415-
right:0;
416-
margin:0;
417-
padding:0;
418-
margin-right:-3rem;
419-
z-index:1;
420-
}
421405
.search-results-wrapper {
422406
flex-grow:1;
423407
overflow-y:auto;

src/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
<canvas id="canvas"></canvas>
1313
</div></div>
1414

15-
<div id="searchOverlay" class="search-overlay">
16-
<span class="closeBtn" onclick="closeSearchOverlay()">&times;</span>
15+
<div id="searchOverlay" class="search-overlay"><span class="close-button" onclick="closeSearchOverlay()">&times;</span>
1716
<div class="search-overlay-content"><div class="search-input-container">
1817
<input type="text" id="searchInput" placeholder="Search...">
1918
</div>

src/js/color-change.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,20 @@ setTimeout(() => {
115115
hoverShift.forEach(element => {
116116
let stopAnim = null;
117117
let disengageTimeout = null;
118-
const startAnim = throttle(() => {
118+
const sharedHoverHandler = throttle((event) => {
119119
if (stopAnim) stopAnim();
120120
stopAnim = startShift(element, getRandomInterval(), true);
121121
}, 30);
122-
element.addEventListener('mouseover', startAnim);
123-
element.addEventListener('click', startAnim);
122+
const sharedDisengage = debounce(() => handleDisengage(element, stopAnim), 30);
123+
element.addEventListener('mouseover', sharedHoverHandler);
124+
element.addEventListener('click', sharedHoverHandler);
124125
element.addEventListener('touchstart', () => {
125126
if (stopAnim) stopAnim();
126127
stopAnim = startShift(element, getRandomInterval(), true);
128+
if (disengageTimeout) clearTimeout(disengageTimeout);
127129
disengageTimeout = setTimeout(() => handleDisengage(element, stopAnim), 888);
128130
});
129-
element.addEventListener('mouseout', debounce(() => handleDisengage(element, stopAnim), 30));
131+
element.addEventListener('mouseout', sharedDisengage);
130132
});
131133
}
132-
}, delayOtherResources2);
134+
}, delayOtherResources2);

src/js/utils.js

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,15 @@ class SimpleToggle extends HTMLElement {
157157
customElements.define('s-t', SimpleToggle);
158158

159159
//basic search
160+
const searchInput = document.getElementById('searchInput');
161+
const searchResults = document.getElementById('searchResults');
162+
const searchOverlay = document.getElementById('searchOverlay');
160163
function searchSPA() {
161-
const query = document.getElementById('searchInput').value.toLowerCase().trim();
162-
const results = document.getElementById('searchResults');
163-
results.innerHTML = '';
164-
if (!query) {results.innerHTML='<p>Enter a search term</p>';results.style.display='block';return;}
165-
if (query.length < 3) {results.style.display='none';return;}
166-
results.style.display = 'block';
164+
const query = searchInput.value.toLowerCase().trim();
165+
searchResults.innerHTML = '';
166+
if (!query) {searchResults.innerHTML='<p>Enter a search term</p>';searchResults.style.display='block';return;}
167+
if (query.length < 3) {searchResults.style.display='none';return;}
168+
searchResults.style.display = 'block';
167169
let hasResults = false;
168170
document.querySelectorAll('article').forEach(article => {
169171
const clone = article.cloneNode(true);
@@ -177,31 +179,40 @@ function searchSPA() {
177179
const i = text.indexOf(query);
178180
const excerpt = text.slice(Math.max(0,i-50), i+query.length+50);
179181
const highlighted = excerpt.replace(new RegExp(query,'gi'), m=>`<strong>${m}</strong>`);
180-
results.insertAdjacentHTML('beforeend', `
182+
searchResults.insertAdjacentHTML('beforeend', `
181183
<div class="search-result">
182184
<h3>${id ? `<a href="/${id}" class="search-result-link">` : ''}${title}${id ? '</a>' : ''}</h3>
183185
<p>...${highlighted}...</p>
184186
</div>
185187
`);
186188
});
187-
results.querySelectorAll('.search-result-link').forEach(link =>
189+
searchResults.querySelectorAll('.search-result-link').forEach(link =>
188190
link.addEventListener('click', closeSearchOverlay)
189191
);
190-
if (!hasResults) results.innerHTML = '<p>No results found.</p>';
192+
if (!hasResults) searchResults.innerHTML = '<p>No results found.</p>';
191193
}
192-
function handleKeyPress(e) {if (e.key === "Escape") closeSearchOverlay();}
194+
let sharedSearchHandler;
193195
function openSearchOverlay() {
194-
document.getElementById("searchOverlay").style.display = "block";
195-
document.getElementById("searchInput").focus();
196+
searchOverlay.style.display = "block";
196197
document.body.style.overflow = 'hidden';
197-
document.addEventListener('keydown', handleKeyPress);
198-
searchSPA();
198+
searchInput.focus();
199+
searchResults.innerHTML='<p>Enter a search term</p>';searchResults.style.display='block';
200+
sharedSearchHandler = throttle((event) => {
201+
if (event.type === 'keydown' && event.key === 'Escape') {
202+
closeSearchOverlay();
203+
} else if (event.type === 'input') {
204+
searchSPA();
205+
}
206+
}, 500);
207+
document.addEventListener('keydown', sharedSearchHandler);
208+
searchInput.addEventListener('input', sharedSearchHandler);
199209
}
200210
function closeSearchOverlay() {
201-
document.getElementById("searchOverlay").style.display = "none";
211+
searchOverlay.style.display = "none";
202212
document.body.style.overflow = 'auto';
203-
document.removeEventListener('keydown', handleKeyPress);
204-
document.getElementById('searchInput').value = '';
205-
document.getElementById('searchResults').innerHTML = '';
213+
searchInput.value = '';
214+
searchResults.innerHTML = '';
215+
document.removeEventListener('keydown', sharedSearchHandler);
216+
searchInput.removeEventListener('input', sharedSearchHandler);
217+
sharedSearchHandler = null;
206218
}
207-
document.getElementById('searchInput').addEventListener('input', throttle(() => search(), 500));

0 commit comments

Comments
 (0)