summaryrefslogtreecommitdiff
path: root/views/pages
diff options
from:
to:
context:
space:
mode:
authorGravatar Saya Andy <145215889+SayaAndy@users.noreply.github.com> 2026-03-30 02:13:49 +0700
committerGravatar GitHub <noreply@github.com> 2026-03-30 02:13:49 +0700
commit8d0385546b0a5f4f3b0832fce1b4c0a10fa0a927 (patch)
tree3be8adf291fecb7611adce3d5ed610f8ac832ca2 /views/pages
parent56d333f3501cfc8e5725784e29ea917d347f37d8 (diff)
parent52fbb4a4eb781dd4ba66fae0e1ceaec6721758f5 (diff)
downloadweb-0.12.3.tar.gz
web-0.12.3.zip
v0.12.3 (#24)v0.12.3
* [feat: add meta for embeds & search engines](https://github.com/SayaAndy/saya-today-web/commit/610341bc9d59f9724e8e71f663b28df1904cb038) * feat: link marker fill saturation and brightness in the global map to the publication date * [feat: add namespace parameter for gallery](https://github.com/SayaAndy/saya-today-web/commit/52fbb4a4eb781dd4ba66fae0e1ceaec6721758f5) * refactor: replace sprintf for galleryid with simple replaceall in gallery rendering
Diffstat (limited to 'views/pages')
-rw-r--r--views/pages/global-map.html29
-rw-r--r--views/pages/unsubscribe-page.html1
2 files changed, 15 insertions, 15 deletions
diff --git a/views/pages/global-map.html b/views/pages/global-map.html
index 7d788d6..4b07bd2 100644
--- a/views/pages/global-map.html
+++ b/views/pages/global-map.html
@@ -3,6 +3,8 @@
<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 }}
@@ -243,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">
@@ -285,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/unsubscribe-page.html b/views/pages/unsubscribe-page.html
index 3876818..c1db9d6 100644
--- a/views/pages/unsubscribe-page.html
+++ b/views/pages/unsubscribe-page.html
@@ -3,6 +3,7 @@
<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 {