From 7a65150afeb67ab83ac2eb34194601033e3d647d Mon Sep 17 00:00:00 2001 From: SayaAndy Date: Sat, 18 Oct 2025 22:44:19 +0700 Subject: feat: uninterruptable lightbox fix: image description taking up all the height in glightbox --- views/pages/blog-page.html | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'views/pages') diff --git a/views/pages/blog-page.html b/views/pages/blog-page.html index c9c9e91..77164fa 100644 --- a/views/pages/blog-page.html +++ b/views/pages/blog-page.html @@ -46,6 +46,11 @@ {{ .MapLocationY }}, {{ .MapLocationAreaMeters }} ), 1000); + + var lightbox = GLightbox({ + selector: '.glightbox', + moreLength: 0 + }); {{- end }} -- cgit v1.3.1+13 From f87c9ca31061b232e7e3d71b8cb3c5895c9f77dc Mon Sep 17 00:00:00 2001 From: SayaAndy Date: Sat, 18 Oct 2025 22:48:00 +0700 Subject: fix: display theme wheel correctly in map page --- views/pages/global-map.html | 66 ++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 24 deletions(-) (limited to 'views/pages') diff --git a/views/pages/global-map.html b/views/pages/global-map.html index 83078c9..e9236e4 100644 --- a/views/pages/global-map.html +++ b/views/pages/global-map.html @@ -38,6 +38,10 @@ @@ -74,6 +79,7 @@ const themeWheel = document.getElementById('theme-wheel'); const themeButton = document.getElementById('theme-button'); const themeIcons = document.querySelectorAll('.theme-icon'); + const themeWheelRadius = convertRemToPixels(6); themeIcons.forEach(icon => { if (icon.getAttribute('data-theme') == savedTheme) { @@ -93,49 +99,61 @@ } function positionThemeIcons() { - const icons = themeWheel.querySelectorAll('.theme-icon'); - const iconCount = icons.length; - const vmax = calculateVmax(1); - const wheelRadius = 7.5*vmax; // Radius of the wheel - const iconRadius = 4*vmax; // Distance from center to place icons - const iconSize = 3*vmax; // Half of icon size for centering - - icons.forEach((icon, index) => { - const angle = (index * 360 / iconCount) - 90; - const angleRad = (angle * Math.PI) / 180; - - const x = Math.cos(angleRad) * iconRadius + wheelRadius - iconSize; - const y = Math.sin(angleRad) * iconRadius + wheelRadius - iconSize; - - icon.style.left = x + 'px'; - icon.style.top = y + 'px'; + const sliceAngle = 360 / themeIcons.length; + + themeIcons.forEach((icon, index) => { + const startAngle = index * sliceAngle; + const endAngle = (index + 1) * sliceAngle; + + const clipPath = createSliceClipPath(startAngle, endAngle, themeWheelRadius); + icon.style.clipPath = clipPath; }); } + function createSliceClipPath(startAngle, endAngle, radius) { + const centerX = radius; + const centerY = radius; + + let points = `${centerX}px ${centerY}px`; + + const segments = Math.max(2, Math.ceil(Math.abs(endAngle - startAngle) / 5)); + const angleStep = (endAngle - startAngle) / segments; + + for (let i = 0; i <= segments; i++) { + const angle = ((startAngle + angleStep * i - 90) * Math.PI) / 180; + const x = centerX + Math.cos(angle) * radius; + const y = centerY + Math.sin(angle) * radius; + points += `, ${x}px ${y}px`; + } + + points += `, ${centerX}px ${centerY}px`; + + return `polygon(${points})`; + } + function positionThemeWheel() { const buttonRect = themeButton.getBoundingClientRect(); const buttonCenterX = buttonRect.left + buttonRect.width / 2; const buttonCenterY = buttonRect.top + buttonRect.height / 2; - const wheelRadius = calculateVmax(7.5); - const margin = calculateVmax(1); + const margin = 0; - let wheelX = buttonCenterX - wheelRadius; - let wheelY = buttonCenterY - wheelRadius; + let wheelX = buttonCenterX - themeWheelRadius; + let wheelY = buttonCenterY - themeWheelRadius; const viewportWidth = window.innerWidth; const viewportHeight = window.innerHeight; if (wheelX < margin) { wheelX = margin; - } else if (wheelX + (wheelRadius * 2) > viewportWidth - margin) { - wheelX = viewportWidth - (wheelRadius * 2) - margin; + } else if (wheelX + (themeWheelRadius * 2) > viewportWidth - margin) { + wheelX = viewportWidth - (themeWheelRadius * 2) - margin; } if (wheelY < margin) { wheelY = margin; - } else if (wheelY + (wheelRadius * 2) > viewportHeight - margin) { - wheelY = viewportHeight - (wheelRadius * 2) - margin; + } else if (wheelY + (themeWheelRadius * 2) > viewportHeight - margin) { + wheelY = viewportHeight - (themeWheelRadius * 2) - margin; } themeWheel.style.left = wheelX + 'px'; -- cgit v1.3.1+13 From 0aeed432c4fbce4a87b56e4dcb14b25065438300 Mon Sep 17 00:00:00 2001 From: SayaAndy Date: Sat, 18 Oct 2025 22:49:34 +0700 Subject: fix: stretch map to feel empty space on the right --- views/pages/global-map.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'views/pages') diff --git a/views/pages/global-map.html b/views/pages/global-map.html index e9236e4..686b46b 100644 --- a/views/pages/global-map.html +++ b/views/pages/global-map.html @@ -69,7 +69,7 @@ -
+
-- cgit v1.3.1+13