diff options
| author | 2026-03-29 02:05:06 +0700 | |
|---|---|---|
| committer | 2026-03-29 02:05:06 +0700 | |
| commit | 0a9de353b2456505b0b8214fab4a7c844d31735c (patch) | |
| tree | ae130f4617bab4b05f13521b1e701cd88f48d69f /views/pages | |
| parent | 610341bc9d59f9724e8e71f663b28df1904cb038 (diff) | |
| download | web-0a9de353b2456505b0b8214fab4a7c844d31735c.tar.gz web-0a9de353b2456505b0b8214fab4a7c844d31735c.zip | |
fix: add page metadata correctly
feat: link marker fill saturation and brightness in the global map to the publication date
Diffstat (limited to 'views/pages')
| -rw-r--r-- | views/pages/blog-catalogue.html | 5 | ||||
| -rw-r--r-- | views/pages/blog-page.html | 7 | ||||
| -rw-r--r-- | views/pages/global-map.html | 27 | ||||
| -rw-r--r-- | views/pages/home-page.html | 6 | ||||
| -rw-r--r-- | views/pages/language-pick.html | 5 | ||||
| -rw-r--r-- | views/pages/user-page.html | 5 |
6 files changed, 12 insertions, 43 deletions
diff --git a/views/pages/blog-catalogue.html b/views/pages/blog-catalogue.html index 349e58f..d2c74ae 100644 --- a/views/pages/blog-catalogue.html +++ b/views/pages/blog-catalogue.html @@ -1,8 +1,3 @@ -{{ define "meta" }} -<meta name="og:title" content="{{ .L.BlogSearch.Header }}"> -<meta name="og:description" content="{{ .L.BlogSearch.Description }}"> -{{ end }} - {{ define "body" }} <div class="flex flex-row ar-lt-0.8:flex-col text-base h-full"> <div class="relative flex shrink-0 ar-gt-0.8:min-w-[10dvh] ar-gt-0.8:max-w-[20dvh] ar-gt-0.8:w-fit ar-lt-0.8:w-full ar-lt-0.8:max-h-[30%] ar-gt-0.8:mr-6"> diff --git a/views/pages/blog-page.html b/views/pages/blog-page.html index 241ef43..c81406f 100644 --- a/views/pages/blog-page.html +++ b/views/pages/blog-page.html @@ -1,10 +1,3 @@ -{{ define "meta" }} -<meta name="og:title" content="{{ .Title }}"> -<meta name="og:description" content="{{ .ShortDescription }} [{{ .ActionDate }}]"> -<meta name="og:image" content="{{ .Thumbnail }}"> -<meta name="twitter:card" content="summary_large_image"> -{{ end }} - {{ define "body" }} <div class="absolute w-full h-full inset-0 inset-shadow-[0_0_0.4rem_black] pointer-events-none z-20"></div> <div class="relative bg-background-light flex flex-col px-8 py-4 overflow-y-auto"> diff --git a/views/pages/global-map.html b/views/pages/global-map.html index a19f3fa..4b07bd2 100644 --- a/views/pages/global-map.html +++ b/views/pages/global-map.html @@ -245,35 +245,32 @@ map.addLayer(markers); } - function stringToColor(str) { + function markerToHsl(str, newCoef) { let hash = 0; - for (let i = 0; i < str.length; i++) { + for (let i = 0; i < str.length / 2; i++) { hash = str.charCodeAt(i) + ((hash << 5) - hash); + hash = str.charCodeAt(str.length - i - 1) + ((hash << 5) - hash); + hash %= 360; } - let color = '#'; - for (let i = 0; i < 3; i++) { - const value = (hash >> (i * 8)) & 0xFF; - color += ('00' + value.toString(16)).substr(-2); - } - - return color; + return [hash, (20 + newCoef * 80).toFixed(0), (20 + newCoef * 75).toFixed(0)]; } - function mapAddMarker(x, y, relativeErrorMeters = 0, title = "", link = "", thumbnail = "") { - const titleColor = stringToColor(title); + function mapAddMarker(x, y, relativeErrorMeters = 0, title = "", link = "", thumbnail = "", newCoef = 1) { + const [h, s, l] = markerToHsl(title, newCoef); + const color = `hsl(${h} ${s}% ${l}%)`; if (relativeErrorMeters != 0) { var circle = L.circle([x, y], { - color: titleColor, - fillColor: titleColor, + color: color, + fillColor: color, fillOpacity: 0.15, radius: relativeErrorMeters }).addTo(map); } var marker = L.marker([x, y], { - icon: createCustomIcon(titleColor), + icon: createCustomIcon(color), title: title, }).bindPopup(` <div class="flex flex-row justify-center justify-items-center"> @@ -287,7 +284,7 @@ document.addEventListener('DOMContentLoaded', () => { initLocationMap(); {{- range .MapMarkers }} - mapAddMarker({{ .Lat }}, {{ .Long }}, {{ .AccuracyMeters }}, {{ .Title }}, {{ .PageLink }}, {{ .Thumbnail }}); + mapAddMarker({{ .Lat }}, {{ .Long }}, {{ .AccuracyMeters }}, {{ .Title }}, {{ .PageLink }}, {{ .Thumbnail }}, {{ fdiv .Index (len $.MapMarkers) }}); {{- end }} }); diff --git a/views/pages/home-page.html b/views/pages/home-page.html index 4ba6b8e..6d397fa 100644 --- a/views/pages/home-page.html +++ b/views/pages/home-page.html @@ -1,9 +1,3 @@ -{{ define "meta" }} -<meta name="og:title" content="{{ .Title }}"> -<meta name="og:description" content="{{ .L.HomePage.Description }}"> -<meta name="og:image" content="https://f003.backblazeb2.com/file/sayana-static/home-page-gifs/{{ .GifName }}"> -{{ end }} - {{ define "body" }} <div class="absolute w-full h-full inset-0 inset-shadow-[0_0_0.4rem_black] pointer-events-none z-20"></div> <div class="relative bg-background-light flex flex-row ar-lt-0.6:flex-col w-full h-full overflow-y-auto text-base/loose tracking-wide z-10"> diff --git a/views/pages/language-pick.html b/views/pages/language-pick.html index 3f6f672..775c18e 100644 --- a/views/pages/language-pick.html +++ b/views/pages/language-pick.html @@ -1,8 +1,3 @@ -{{ define "meta" }} -<meta name="og:title" content="{{ .Root.Header }}"> -<meta name="og:description" content="{{ .Root.Description }}"> -{{ end }} - {{ define "body" }} <div class="flex flex-col justify-center text-3xl h-full"> {{- range .AvailableLanguages }} diff --git a/views/pages/user-page.html b/views/pages/user-page.html index c9f7373..fda7e66 100644 --- a/views/pages/user-page.html +++ b/views/pages/user-page.html @@ -1,8 +1,3 @@ -{{ define "meta" }} -<meta name="og:title" content="{{ .L.BlogSearch.Header }}"> -<meta name="og:description" content="{{ .L.BlogSearch.Description }}"> -{{ end }} - {{ define "body" }} <div class="absolute w-full h-full inset-0 inset-shadow-[0_0_0.4rem_black] pointer-events-none z-20"></div> <div class="relative bg-background-light flex flex-col px-8 py-4"> |