Fixed some scroll behavior and removed non-ascii characters from source
code. Just use escapes.
This commit is contained in:
parent
25f2d77706
commit
df6e980f3a
3 changed files with 42 additions and 28 deletions
|
|
@ -5,7 +5,7 @@
|
|||
var tagBtns = document.querySelectorAll('.blog-tag');
|
||||
var items = document.querySelectorAll('.post-list-item');
|
||||
|
||||
// ── Tag filtering ──────────────────────────────
|
||||
// Tag filtering
|
||||
tagBtns.forEach(function (btn) {
|
||||
btn.addEventListener('click', function () {
|
||||
tagBtns.forEach(function (b) { b.classList.remove('active'); });
|
||||
|
|
@ -18,28 +18,35 @@
|
|||
});
|
||||
});
|
||||
|
||||
// ── Open a post ────────────────────────────────
|
||||
// Open a post
|
||||
document.querySelectorAll('.blog-open-post').forEach(function (link) {
|
||||
link.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
listing.classList.add('hidden');
|
||||
panels.forEach(function (p) { p.classList.add('hidden'); });
|
||||
var panel = document.getElementById('blog-post-' + link.dataset.postIdx);
|
||||
if (panel) { panel.classList.remove('hidden'); content.scrollTop = 0; }
|
||||
if (panel) {
|
||||
panel.classList.remove('hidden');
|
||||
content.scrollTop = 0;
|
||||
var win = content.closest('.window');
|
||||
if (win && win._syncMore) win._syncMore();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// ── Back to listing ────────────────────────────
|
||||
// Back to listing
|
||||
document.querySelectorAll('.blog-back').forEach(function (btn) {
|
||||
btn.addEventListener('click', function () {
|
||||
panels.forEach(function (p) { p.classList.add('hidden'); });
|
||||
listing.classList.remove('hidden');
|
||||
content.scrollTop = 0;
|
||||
var win = content.closest('.window');
|
||||
if (win && win._syncMore) win._syncMore();
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
||||
// ── Projects panel ─────────────────────────────
|
||||
// Projects panel
|
||||
(function () {
|
||||
var listing = document.getElementById('projects-listing');
|
||||
var content = document.getElementById('projects-window-content');
|
||||
|
|
@ -49,7 +56,7 @@
|
|||
|
||||
if (!listing) return;
|
||||
|
||||
// ── Tag filtering ────────────────────────────
|
||||
// Tag filtering
|
||||
tagBtns.forEach(function (btn) {
|
||||
btn.addEventListener('click', function () {
|
||||
tagBtns.forEach(function (b) { b.classList.remove('active'); });
|
||||
|
|
@ -62,23 +69,30 @@
|
|||
});
|
||||
});
|
||||
|
||||
// ── Open a project ───────────────────────────
|
||||
// Open a project
|
||||
document.querySelectorAll('.project-open-item').forEach(function (link) {
|
||||
link.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
listing.classList.add('hidden');
|
||||
panels.forEach(function (p) { p.classList.add('hidden'); });
|
||||
var panel = document.getElementById('project-item-' + link.dataset.projectIdx);
|
||||
if (panel) { panel.classList.remove('hidden'); content.scrollTop = 0; }
|
||||
});
|
||||
if (panel) {
|
||||
panel.classList.remove('hidden');
|
||||
content.scrollTop = 0;
|
||||
var win = content.closest('.window');
|
||||
if (win && win._syncMore) win._syncMore();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// ── Back to listing ──────────────────────────
|
||||
// Back to listing
|
||||
document.querySelectorAll('.project-back').forEach(function (btn) {
|
||||
btn.addEventListener('click', function () {
|
||||
panels.forEach(function (p) { p.classList.add('hidden'); });
|
||||
listing.classList.remove('hidden');
|
||||
content.scrollTop = 0;
|
||||
var win = content.closest('.window');
|
||||
if (win && win._syncMore) win._syncMore();
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* ═══════════════════════════════════════════
|
||||
/*
|
||||
Phosphor Terminal — Window Manager (wm.js)
|
||||
═══════════════════════════════════════════ */
|
||||
*/
|
||||
|
||||
const WM = (() => {
|
||||
"use strict";
|
||||
|
|
@ -10,7 +10,7 @@ const WM = (() => {
|
|||
let drag = null;
|
||||
let resize = null;
|
||||
|
||||
/* ── Init ──────────────────────────────── */
|
||||
/* Init */
|
||||
|
||||
function init() {
|
||||
document.querySelectorAll(".window").forEach(register);
|
||||
|
|
@ -22,7 +22,7 @@ const WM = (() => {
|
|||
if (visible.length) focusEl(visible[visible.length - 1].el);
|
||||
}
|
||||
|
||||
/* ── Build and inject window chrome ────── */
|
||||
/* Build and inject window chrome */
|
||||
|
||||
function buildChrome(win) {
|
||||
const title = win.dataset.title || win.dataset.wid || "";
|
||||
|
|
@ -32,7 +32,7 @@ const WM = (() => {
|
|||
const maxBtn = document.createElement("button");
|
||||
maxBtn.className = "win-btn maximize";
|
||||
maxBtn.title = "Full screen";
|
||||
maxBtn.textContent = "⤢";
|
||||
maxBtn.textContent = "\u2922";
|
||||
const titleSpan = document.createElement("span");
|
||||
titleSpan.className = "window-title";
|
||||
titleSpan.textContent = title;
|
||||
|
|
@ -45,19 +45,19 @@ const WM = (() => {
|
|||
const closeBtn = document.createElement("button");
|
||||
closeBtn.className = "win-btn close";
|
||||
closeBtn.title = "Close";
|
||||
closeBtn.textContent = "×";
|
||||
closeBtn.textContent = "\u00D7";
|
||||
const spacer = document.createElement("div");
|
||||
spacer.className = "win-footer-spacer";
|
||||
const resizeHandle = document.createElement("div");
|
||||
resizeHandle.className = "win-resize";
|
||||
resizeHandle.title = "Drag to resize";
|
||||
resizeHandle.textContent = "◢";
|
||||
resizeHandle.textContent = "\u25E2";
|
||||
footer.appendChild(closeBtn);
|
||||
footer.appendChild(spacer);
|
||||
footer.appendChild(resizeHandle);
|
||||
win.appendChild(footer);
|
||||
|
||||
// ── More / scroll indicator ──────────────
|
||||
// More / scroll indicator
|
||||
const moreBar = document.createElement("div");
|
||||
moreBar.className = "scroll-more hidden";
|
||||
moreBar.textContent = "-- more --";
|
||||
|
|
@ -79,7 +79,7 @@ const WM = (() => {
|
|||
}
|
||||
}
|
||||
|
||||
/* ── Register a window element ─────────── */
|
||||
/* Register a window element */
|
||||
|
||||
function register(win) {
|
||||
const id = win.dataset.wid;
|
||||
|
|
@ -117,7 +117,7 @@ const WM = (() => {
|
|||
});
|
||||
}
|
||||
|
||||
/* ── Focus ─────────────────────────────── */
|
||||
/* Focus */
|
||||
|
||||
function focusEl(win) {
|
||||
document.querySelectorAll(".window.focused")
|
||||
|
|
@ -131,9 +131,9 @@ const WM = (() => {
|
|||
if (s && !s.hidden) focusEl(s.el);
|
||||
}
|
||||
|
||||
/* ── Show / Hide ───────────────────────── */
|
||||
/* Show / Hide */
|
||||
|
||||
/* ── Clamp window to desktop-area bounds ── */
|
||||
/* Clamp window to desktop-area bounds */
|
||||
|
||||
function clampToArea(el) {
|
||||
const area = document.querySelector(".desktop-area");
|
||||
|
|
@ -178,7 +178,7 @@ const WM = (() => {
|
|||
}
|
||||
}
|
||||
|
||||
/* ── Maximize / Restore ────────────────── */
|
||||
/* Maximize / Restore */
|
||||
|
||||
function toggleMax(id) {
|
||||
const s = state.get(id);
|
||||
|
|
@ -210,7 +210,7 @@ const WM = (() => {
|
|||
focusEl(el);
|
||||
}
|
||||
|
||||
/* ── Drag ──────────────────────────────── */
|
||||
/* Drag */
|
||||
|
||||
function startDrag(e, win) {
|
||||
e.preventDefault();
|
||||
|
|
@ -229,7 +229,7 @@ const WM = (() => {
|
|||
document.body.style.cursor = "move";
|
||||
}
|
||||
|
||||
/* ── Mouse events ──────────────────────── */
|
||||
/* Mouse events */
|
||||
|
||||
function onMove(e) {
|
||||
if (drag) {
|
||||
|
|
@ -252,7 +252,7 @@ const WM = (() => {
|
|||
document.body.style.cursor = "";
|
||||
}
|
||||
|
||||
/* ── Desktop icons ─────────────────────── */
|
||||
/* Desktop icons */
|
||||
|
||||
function setupIcons() {
|
||||
document.querySelectorAll(".desktop-icon[data-opens]").forEach(icon => {
|
||||
|
|
@ -265,7 +265,7 @@ const WM = (() => {
|
|||
});
|
||||
}
|
||||
|
||||
/* ── Boot: hide icons for hidden windows ─ */
|
||||
/* Boot: hide icons for hidden windows */
|
||||
|
||||
document.addEventListener("DOMContentLoaded", init);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,5 +22,5 @@ Matrix: lordtet@lordnet.sh
|
|||
### PGP
|
||||
|
||||
<p style="color:var(--p-dim); font-size:13px; margin-bottom:6px;">Fingerprint:</p>
|
||||
<pre>//to do!</pre>
|
||||
<pre>7F07 6085 BE8F B9A0 666D CC33 2E05 6DFB 2523 EEF2</pre>
|
||||
<p style="color:var(--p-dim); font-size:13px;">Key available on <a href="https://keys.openpgp.org" target="_blank" rel="noopener">keys.openpgp.org</a> or on request.</p>
|
||||
|
|
|
|||
Loading…
Reference in a new issue