Diffstat (limited to 'views')
| -rw-r--r-- | views/layouts/general-page.html | 16 | ||||
| -rw-r--r-- | views/pages/blog-page.html | 6 | ||||
| -rw-r--r-- | views/pages/global-map.html | 35 | ||||
| -rw-r--r-- | views/pages/unsubscribe-page.html | 1 |
4 files changed, 26 insertions, 32 deletions
diff --git a/views/layouts/general-page.html b/views/layouts/general-page.html index 3f5bcfd..97b412c 100644 --- a/views/layouts/general-page.html +++ b/views/layouts/general-page.html @@ -3,9 +3,6 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - {{- range $k, $v := .Meta }} - <meta name="{{ $k }}" content="{{ $v }}"> - {{- end }} <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"> <link rel="stylesheet" href="https://f003.backblazeb2.com/file/sayana-static/libs/leaflet/1.9.4/leaflet.css"> <link rel="stylesheet" href="https://f003.backblazeb2.com/file/sayana-static/libs/glightbox/3.3.0/css/glightbox.min.css"> @@ -175,12 +172,9 @@ <div class="grow bg-split-left"></div> - <div class="flex flex-col sm:flex-row"> - <div id="sidebar" class="bg-sidebar flex - flex-row sticky w-dvw h-fit xs:w-[90dvw] - sm:left-0 sm:flex-col sm:fixed sm:w-fit - z-20 shadow-[0_0_1rem_black]"> - <div class="text-[3rem] flex flex-row sm:flex-col gap-0 relative z-20"> + <div class="flex flex-col [@media(max-height:32rem)]:flex-row"> + <div id="sidebar" class="bg-sidebar flex sticky flex-col z-20 w-dvw xs:w-[90dvw] sm:w-[80dvw] md:w-[75dvw] lg:w-[70dvw] xl:w-[65dvw] 2xl:w-[60dvw] [@media(max-height:32rem)]:w-fit h-fit [@media(max-height:32rem)]:h-dvh shadow-[0_0_1rem_black]"> + <div class="text-[3rem] flex flex-row [@media(max-height:32rem)]:flex-col gap-0 relative z-20"> <a onclick="return changeUrl('/../', true);" href="./" id="sidebar-back-button" class="themed-button themed-button-sidebar w-fit h-fit hidden" draggable="false"> <i class="fas fa-circle-left flex w-18 h-18 content-center text-center text-sidebar"></i> </a> @@ -243,10 +237,10 @@ </script> </div> - <div class="bg-background-dark @container/main flex z-10 w-dvw xs:w-[90dvw] sm:w-[85dvw] md:w-[80dvw] lg:w-[75dvw] xl:w-[70dvw] 2xl:w-[60dvw] 3xl:w-[50dvw] grow-0 h-[calc(100dvh-5rem)] sm:h-dvh shadow-[0_0_1rem_black]"> + <div class="bg-background-dark @container/main flex z-10 w-dvw xs:w-[90dvw] sm:w-[80dvw] md:w-[75dvw] lg:w-[70dvw] xl:w-[65dvw] 2xl:w-[60dvw] grow-0 h-[calc(100dvh-5.1rem)] [@media(max-height:32rem)]:h-dvh shadow-[0_0_1rem_black]"> <div class="bg-background-dark border-r-2 border-dashed border-main-hard"></div> - <div class="max-h-full max-w-full flex flex-col grow bg-background-dark relative pt-4 ml-8 pr-4"> + <div class="max-h-100% flex flex-col grow bg-background-dark relative pt-4 ml-8 pr-4"> <div id="general-page-header" class="max-xs:hidden [@media(max-height:32rem)]:hidden flex flex-col basis-8" hx-get="/api/v1/general-page/header{{ if .QueryString }}?{{ .QueryString }}{{ end }}" hx-trigger="load" hx-target="this" hx-swap="innerHTML"> </div> diff --git a/views/pages/blog-page.html b/views/pages/blog-page.html index c81406f..f488d64 100644 --- a/views/pages/blog-page.html +++ b/views/pages/blog-page.html @@ -21,9 +21,9 @@ function initLocationMap(id, x, y, relativeErrorMeters = 0) { map = L.map(id).setView([x, y], 8); - L.tileLayer('https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png', { - maxZoom: 20, - attribution: '<a href="https://github.com/cyclosm/cyclosm-cartocss-style/releases" title="CyclOSM - Open Bicycle render">CyclOSM</a> | Map data: © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' + L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { + maxZoom: 18, + attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' }).addTo(map); if (relativeErrorMeters != 0) { diff --git a/views/pages/global-map.html b/views/pages/global-map.html index 4b07bd2..52ea841 100644 --- a/views/pages/global-map.html +++ b/views/pages/global-map.html @@ -3,8 +3,6 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta name="og:title" content="{{ .L.GlobalMap.Header }}"> - <meta name="og:description" content="{{ .L.GlobalMap.Description }}"> <title>{{ .L.GlobalMap.Header }} // SAYA TODAY</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"> {{ block "header" . }}{{ end }} @@ -232,9 +230,9 @@ function initLocationMap() { map = L.map('map-container').setView([{{ .MapLocationLat }}, {{ .MapLocationLong }}], 4); - L.tileLayer('https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png', { - maxZoom: 20, - attribution: '<a href="https://github.com/cyclosm/cyclosm-cartocss-style/releases" title="CyclOSM - Open Bicycle render">CyclOSM</a> | Map data: © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', + L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { + maxZoom: 18, + attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>', zoomControl: false }).addTo(map); @@ -245,32 +243,35 @@ map.addLayer(markers); } - function markerToHsl(str, newCoef) { + function stringToColor(str) { let hash = 0; - for (let i = 0; i < str.length / 2; i++) { + for (let i = 0; i < str.length; i++) { hash = str.charCodeAt(i) + ((hash << 5) - hash); - hash = str.charCodeAt(str.length - i - 1) + ((hash << 5) - hash); - hash %= 360; } - return [hash, (20 + newCoef * 80).toFixed(0), (20 + newCoef * 75).toFixed(0)]; + let color = '#'; + for (let i = 0; i < 3; i++) { + const value = (hash >> (i * 8)) & 0xFF; + color += ('00' + value.toString(16)).substr(-2); + } + + return color; } - function mapAddMarker(x, y, relativeErrorMeters = 0, title = "", link = "", thumbnail = "", newCoef = 1) { - const [h, s, l] = markerToHsl(title, newCoef); - const color = `hsl(${h} ${s}% ${l}%)`; + function mapAddMarker(x, y, relativeErrorMeters = 0, title = "", link = "", thumbnail = "") { + const titleColor = stringToColor(title); if (relativeErrorMeters != 0) { var circle = L.circle([x, y], { - color: color, - fillColor: color, + color: titleColor, + fillColor: titleColor, fillOpacity: 0.15, radius: relativeErrorMeters }).addTo(map); } var marker = L.marker([x, y], { - icon: createCustomIcon(color), + icon: createCustomIcon(titleColor), title: title, }).bindPopup(` <div class="flex flex-row justify-center justify-items-center"> @@ -284,7 +285,7 @@ document.addEventListener('DOMContentLoaded', () => { initLocationMap(); {{- range .MapMarkers }} - mapAddMarker({{ .Lat }}, {{ .Long }}, {{ .AccuracyMeters }}, {{ .Title }}, {{ .PageLink }}, {{ .Thumbnail }}, {{ fdiv .Index (len $.MapMarkers) }}); + mapAddMarker({{ .Lat }}, {{ .Long }}, {{ .AccuracyMeters }}, {{ .Title }}, {{ .PageLink }}, {{ .Thumbnail }}); {{- end }} }); diff --git a/views/pages/unsubscribe-page.html b/views/pages/unsubscribe-page.html index c1db9d6..3876818 100644 --- a/views/pages/unsubscribe-page.html +++ b/views/pages/unsubscribe-page.html @@ -3,7 +3,6 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta name="robots" content="noindex,nofollow"> <title>{{ .L.UnsubscribePage.Header }} // SAYA TODAY</title> <style> html { |