remove bloat css change of them toggle
This commit is contained in:
+35
-87
@@ -18,13 +18,7 @@
|
||||
<nav>
|
||||
<a class="nav-logo" href="#">samantha_vero_friis</a>
|
||||
<div class="nav-links">
|
||||
<a href="/engine">engine</a>
|
||||
<a href="/portfolio">portfolio</a>
|
||||
<a href="/cinema">cinema</a>
|
||||
<a href="/finance">finance</a>
|
||||
<a href="/infra">infrastructure</a>
|
||||
<a href="/git">git</a>
|
||||
<a class="cta" href="mailto:me@samantha42.xyz">contact</a>
|
||||
<a onclick="openOverlay()" >login</a>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
@@ -32,24 +26,8 @@
|
||||
<div class="shell">
|
||||
<aside>
|
||||
<div class="row">
|
||||
<div class="toggle-wrap" role="switch" aria-checked="true" tabindex="0" id="toggle"
|
||||
aria-label="Toggle day/night mode">
|
||||
<div class="track day" id="track">
|
||||
<div class="stars">
|
||||
<div class="star"></div>
|
||||
<div class="star"></div>
|
||||
<div class="star"></div>
|
||||
<div class="star"></div>
|
||||
<div class="star"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="knob day" id="knob">
|
||||
<div class="sun-rays" id="rays"></div>
|
||||
<div class="moon-crater" style="width:4px;height:4px;top:3px;left:5px;"></div>
|
||||
<div class="moon-crater" style="width:3px;height:3px;top:9px;left:9px;"></div>
|
||||
<div class="moon-crater" style="width:2px;height:2px;top:4px;left:11px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<img id="day" src="/static/icons/lovesun.png" width="30px" class="hidden" onclick="makeday()" >
|
||||
<img id="night" src="/static/icons/sleepmoon.png" width="30px" onclick="makenight()" >
|
||||
</div>
|
||||
<div>
|
||||
<p class="sidebar-label">navigate</p>
|
||||
@@ -61,6 +39,8 @@
|
||||
<a href="#automation">automation</a>
|
||||
<a href="#interests">interests</a>
|
||||
<a class="hidden" href="/42">42</a>
|
||||
<a href="#newsletter">newsletter</a>
|
||||
<a href="#contact">contact</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -99,8 +79,8 @@
|
||||
<div class="hero-meta">
|
||||
<span>
|
||||
<div hx-get="/status" hx-trigger="load" hx-swap="outerHTML"></div>
|
||||
<span>samantha42.xyz</span>
|
||||
<span>me@samantha42.xyz</span>
|
||||
<span class="exp-tag">samantha42.xyz</span>
|
||||
<span class="exp-tag">me@samantha42.xyz</span>
|
||||
</div>
|
||||
</section>
|
||||
<section id="experience">
|
||||
@@ -458,67 +438,34 @@
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
const toggle = document.getElementById('toggle');
|
||||
const track = document.getElementById('track');
|
||||
const knob = document.getElementById('knob');
|
||||
const rays = document.getElementById('rays');
|
||||
const stateLabel = document.getElementById('state-label');
|
||||
const themeRoot = document.getElementById('themeRoot');
|
||||
|
||||
let isDay = true;
|
||||
|
||||
const RAY_COUNT = 8;
|
||||
for (let i = 0; i < RAY_COUNT; i++) {
|
||||
const r = document.createElement('div');
|
||||
r.className = 'ray';
|
||||
r.style.transform = `rotate(${i * (360/RAY_COUNT)}deg)`;
|
||||
rays.appendChild(r);
|
||||
}
|
||||
|
||||
function applyState() {
|
||||
if (isDay) {
|
||||
track.className = 'track day';
|
||||
knob.className = 'knob day';
|
||||
toggle.setAttribute('aria-checked', 'true');
|
||||
themeRoot.classList.remove('night');
|
||||
} else {
|
||||
track.className = 'track night';
|
||||
knob.className = 'knob night';
|
||||
toggle.setAttribute('aria-checked', 'false');
|
||||
themeRoot.classList.add('night');
|
||||
}
|
||||
}
|
||||
|
||||
toggle.addEventListener('click', () => { isDay = !isDay; applyState(); });
|
||||
toggle.addEventListener('keydown', e => {
|
||||
if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); isDay = !isDay; applyState(); }
|
||||
});
|
||||
|
||||
function copyClass() {
|
||||
navigator.clipboard.writeText(classOut.textContent).catch(() => {});
|
||||
}
|
||||
// just some fun.
|
||||
// just some fun.
|
||||
console.log("%c👀 hi there!", "font-size:20px")
|
||||
|
||||
|
||||
function makeday() {
|
||||
themeRoot.classList.remove('night');
|
||||
const day = document.getElementById('day');
|
||||
const night = document.getElementById('night');
|
||||
day.classList.add("hidden");
|
||||
night.classList.remove("hidden");
|
||||
}
|
||||
function makenight() {
|
||||
themeRoot.classList.add('night');
|
||||
const day = document.getElementById('day');
|
||||
const night = document.getElementById('night');
|
||||
day.classList.remove("hidden");
|
||||
night.classList.add("hidden");
|
||||
}
|
||||
|
||||
// about.js
|
||||
function closeOverlay() {
|
||||
document.getElementById('overlay').style.display = 'none';
|
||||
// about.js
|
||||
function closeOverlay() {
|
||||
document.getElementById('overlay').style.display = 'none';
|
||||
}
|
||||
|
||||
// or toggle it from anywhere:
|
||||
function openOverlay() {
|
||||
document.getElementById('overlay').style.display = 'flex';
|
||||
}
|
||||
|
||||
// or toggle it from anywhere:
|
||||
function openOverlay() {
|
||||
document.getElementById('overlay').style.display = 'flex';
|
||||
}
|
||||
|
||||
function InterestShow() {
|
||||
const body = document.getElementById('interests-body');
|
||||
const button = document.getElementById('interest-button');
|
||||
button.textContent = "close ↑"
|
||||
body.classList.remove("hidden")
|
||||
}
|
||||
|
||||
function toggleInterests() {
|
||||
const body = document.getElementById('interests-body');
|
||||
const button = document.getElementById('interest-button');
|
||||
@@ -529,7 +476,8 @@ function openOverlay() {
|
||||
button.textContent = "close ↑"
|
||||
}
|
||||
}
|
||||
function nlSubmit() {
|
||||
|
||||
function nlSubmit() {
|
||||
const input = document.getElementById('nl-email');
|
||||
const val = input.value.trim();
|
||||
if (!val || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val)) {
|
||||
@@ -545,9 +493,9 @@ function openOverlay() {
|
||||
document.getElementById('nl-note').style.display = 'none';
|
||||
document.getElementById('nl-success').style.display = 'block';
|
||||
}
|
||||
document.getElementById('nl-email').addEventListener('keydown', e => {
|
||||
if (e.key === 'Enter') nlSubmit();
|
||||
});
|
||||
document.getElementById('nl-email').addEventListener('keydown', e => {
|
||||
if (e.key === 'Enter') nlSubmit();
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user