summaryrefslogtreecommitdiff
path: root/views
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/layouts/general-page.html3
-rw-r--r--views/pages/global-map.html29
-rw-r--r--views/pages/unsubscribe-page.html1
3 files changed, 15 insertions, 18 deletions
diff --git a/views/layouts/general-page.html b/views/layouts/general-page.html
index 3f5bcfd..01043c6 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">
diff --git a/views/pages/global-map.html b/views/pages/global-map.html
index 4b07bd2..7d788d6 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 }}
@@ -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 {