mirror of
https://github.com/infinition/Bjorn.git
synced 2025-12-23 17:45:06 +00:00
Compare commits
2 Commits
55ddd0680e
...
10d71122bc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10d71122bc | ||
|
|
daed1faf14 |
42
index.html
42
index.html
@@ -161,7 +161,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body p {
|
.markdown-body p {
|
||||||
margin-bottom: 1.25rem;
|
/* margin-bottom: 1.25rem; */
|
||||||
line-height: 1.7;
|
line-height: 1.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,7 +249,6 @@
|
|||||||
.markdown-body img {
|
.markdown-body img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
cursor: zoom-in;
|
cursor: zoom-in;
|
||||||
transition: transform 0.2s;
|
transition: transform 0.2s;
|
||||||
}
|
}
|
||||||
@@ -598,7 +597,7 @@
|
|||||||
<div class="p-4 border-t border-hack-border bg-hack-bg/30 flex-none">
|
<div class="p-4 border-t border-hack-border bg-hack-bg/30 flex-none">
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<strong class="text-gray-500 text-sm block mb-3 font-mono tracking-wide">:: JOIN US ::</strong>
|
<strong class="text-gray-500 text-sm block mb-3 font-mono tracking-wide">:: JOIN US ::</strong>
|
||||||
<div class="flex flex-col gap-2.5">
|
<div class="flex flex-col">
|
||||||
|
|
||||||
<a href="https://discord.gg/B3ZH9taVfT" target="_blank"
|
<a href="https://discord.gg/B3ZH9taVfT" target="_blank"
|
||||||
class="hover:opacity-80 transition-opacity block">
|
class="hover:opacity-80 transition-opacity block">
|
||||||
@@ -714,8 +713,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
marked.use({ renderer });
|
marked.use({ renderer });
|
||||||
marked.setOptions({ breaks: true, gfm: true });
|
marked.setOptions({ breaks: false, gfm: true });
|
||||||
|
|
||||||
const STATE = {
|
const STATE = {
|
||||||
wikiData: {},
|
wikiData: {},
|
||||||
contentCache: {},
|
contentCache: {},
|
||||||
@@ -1393,8 +1391,8 @@
|
|||||||
const overlay = document.getElementById('overlay');
|
const overlay = document.getElementById('overlay');
|
||||||
|
|
||||||
function openMenu() {
|
function openMenu() {
|
||||||
closeTOC(); // Close TOC if open
|
|
||||||
sidebar.classList.remove('-translate-x-full');
|
sidebar.classList.remove('-translate-x-full');
|
||||||
|
closeTOC(); // Close TOC if open
|
||||||
overlay.classList.remove('hidden');
|
overlay.classList.remove('hidden');
|
||||||
setTimeout(() => overlay.classList.remove('opacity-0'), 10);
|
setTimeout(() => overlay.classList.remove('opacity-0'), 10);
|
||||||
}
|
}
|
||||||
@@ -1408,8 +1406,8 @@
|
|||||||
const list = document.getElementById('mobile-toc-list');
|
const list = document.getElementById('mobile-toc-list');
|
||||||
if (!list.hasChildNodes() || list.innerHTML.includes('No sections')) return;
|
if (!list.hasChildNodes() || list.innerHTML.includes('No sections')) return;
|
||||||
|
|
||||||
closeMenu(); // Close Menu if open
|
|
||||||
tocSidebar.classList.remove('translate-x-full');
|
tocSidebar.classList.remove('translate-x-full');
|
||||||
|
closeMenu(); // Close Menu if open
|
||||||
overlay.classList.remove('hidden');
|
overlay.classList.remove('hidden');
|
||||||
setTimeout(() => overlay.classList.remove('opacity-0'), 10);
|
setTimeout(() => overlay.classList.remove('opacity-0'), 10);
|
||||||
}
|
}
|
||||||
@@ -1470,22 +1468,44 @@
|
|||||||
scrollBtn.onclick = () => scrollContainer.scrollTo({ top: 0, behavior: 'smooth' });
|
scrollBtn.onclick = () => scrollContainer.scrollTo({ top: 0, behavior: 'smooth' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- MOBILE SWIPE GESTURES ---
|
// --- MOBILE SWIPE GESTURES ---
|
||||||
let touchStartX = 0;
|
let touchStartX = 0;
|
||||||
let touchStartY = 0;
|
let touchStartY = 0;
|
||||||
let touchEndX = 0;
|
let touchEndX = 0;
|
||||||
let touchEndY = 0;
|
let touchEndY = 0;
|
||||||
|
let scrollableElement = null;
|
||||||
|
|
||||||
const MIN_SWIPE_DISTANCE = 50;
|
const MIN_SWIPE_DISTANCE = 50;
|
||||||
const MAX_VERTICAL_DRIFT = 80;
|
const MAX_VERTICAL_DRIFT = 80;
|
||||||
const EDGE_ZONE_LEFT = 200; // Swipe from left triggers Menu
|
const EDGE_ZONE_LEFT = 200; // Swipe from left triggers Menu
|
||||||
const EDGE_ZONE_RIGHT = 100; // Distance from right edge to likely trigger TOC
|
const EDGE_ZONE_RIGHT = 100; // Distance from right edge to likely trigger TOC
|
||||||
|
|
||||||
|
// Helper function to check if element has horizontal scroll
|
||||||
|
function hasHorizontalScroll(el) {
|
||||||
|
if (!el) return false;
|
||||||
|
return el.scrollWidth > el.clientWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find closest scrollable parent
|
||||||
|
function findScrollableParent(el) {
|
||||||
|
while (el && el !== document.body) {
|
||||||
|
if (hasHorizontalScroll(el)) {
|
||||||
|
return el;
|
||||||
|
}
|
||||||
|
el = el.parentElement;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
document.addEventListener("touchstart", (e) => {
|
document.addEventListener("touchstart", (e) => {
|
||||||
const t = e.changedTouches[0];
|
const t = e.changedTouches[0];
|
||||||
touchStartX = t.clientX;
|
touchStartX = t.clientX;
|
||||||
touchStartY = t.clientY;
|
touchStartY = t.clientY;
|
||||||
|
touchEndX = t.clientX;
|
||||||
|
touchEndY = t.clientY;
|
||||||
|
|
||||||
|
// Check if touch started on a horizontally scrollable element
|
||||||
|
scrollableElement = findScrollableParent(e.target);
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener("touchmove", (e) => {
|
document.addEventListener("touchmove", (e) => {
|
||||||
@@ -1495,6 +1515,12 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener("touchend", () => {
|
document.addEventListener("touchend", () => {
|
||||||
|
// If we're in a scrollable element, don't trigger swipe gestures
|
||||||
|
if (scrollableElement) {
|
||||||
|
scrollableElement = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const dx = touchEndX - touchStartX;
|
const dx = touchEndX - touchStartX;
|
||||||
const dy = Math.abs(touchEndY - touchStartY);
|
const dy = Math.abs(touchEndY - touchStartY);
|
||||||
const screenW = window.innerWidth;
|
const screenW = window.innerWidth;
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
# <img src="https://github.com/user-attachments/assets/c5eb4cc1-0c3d-497d-9422-1614651a84ab" alt="thumbnail_IMG_0546" width="33"> Bjorn
|
# <img src="https://github.com/user-attachments/assets/c5eb4cc1-0c3d-497d-9422-1614651a84ab" alt="thumbnail_IMG_0546" width="33"> Bjorn
|
||||||
|
  [](https://opensource.org/licenses/MIT) [](https://www.reddit.com/r/Bjorn_CyberViking) [](https://discord.com/invite/B3ZH9taVfT)
|
||||||

|
|
||||||

|
|
||||||
[](https://opensource.org/licenses/MIT)
|
|
||||||
|
|
||||||
[](https://www.reddit.com/r/Bjorn_CyberViking)
|
|
||||||
[](https://discord.com/invite/B3ZH9taVfT)
|
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://github.com/user-attachments/assets/c5eb4cc1-0c3d-497d-9422-1614651a84ab" alt="thumbnail_IMG_0546" width="150">
|
<img src="https://github.com/user-attachments/assets/c5eb4cc1-0c3d-497d-9422-1614651a84ab" alt="thumbnail_IMG_0546" width="150">
|
||||||
|
|||||||
Reference in New Issue
Block a user