Diffstat (limited to 'views/pages')
| -rw-r--r-- | views/pages/blog-page.html | 10 | ||||
| -rw-r--r-- | views/pages/global-map.html | 33 | ||||
| -rw-r--r-- | views/pages/robots.txt | 5 | ||||
| -rw-r--r-- | views/pages/sitemap.xml | 10 | ||||
| -rw-r--r-- | views/pages/unsubscribe-page.html | 1 |
5 files changed, 20 insertions, 39 deletions
diff --git a/views/pages/blog-page.html b/views/pages/blog-page.html index 3fc4526..c81406f 100644 --- a/views/pages/blog-page.html +++ b/views/pages/blog-page.html @@ -1,12 +1,12 @@ {{ define "body" }} <div class="absolute w-full h-full inset-0 inset-shadow-[0_0_0.4rem_black] pointer-events-none z-20"></div> -<article class="relative bg-background-light flex flex-col px-8 py-4 overflow-y-auto"> - <h1 class="max-xs:block [@media(max-height:32rem)]:block hidden font-andika text-2xl font-bold italic text-main-hard tracking-[.0125rem] mb-1">{{ .Title }}</h1> +<div class="relative bg-background-light flex flex-col px-8 py-4 overflow-y-auto"> + <p class="max-xs:block [@media(max-height:32rem)]:block hidden font-andika text-2xl font-bold italic text-main-hard tracking-[.0125rem] mb-1">{{ .Title }}</p> <p class="block grow text-lg font-andika text-secondary"> <b>{{ .L.Metadata.Published }}</b>: - <time datetime="{{ .PublishedDate }}" hx-get="/api/v1/tz" hx-vals='js:{timestamp: "{{ .PublishedDate }}", tz: clientTimeZone}' hx-target="this" hx-swap="innerHTML" hx-trigger="load"> + <span hx-get="/api/v1/tz" hx-vals='js:{timestamp: "{{ .PublishedDate }}", tz: clientTimeZone}' hx-target="this" hx-swap="innerHTML" hx-trigger="load"> {{ .PublishedDate }} - </time> + </span> </p> <p class="block grow text-lg font-andika text-secondary"><b>{{ .L.Metadata.Action }}</b>: {{ .ActionDate }}</p> <p class="block grow text-md font-andika italic text-main-hard">{{ .ShortDescription }}</p> @@ -60,7 +60,7 @@ }); </script> {{- end }} -</article> +</div> {{ end }} {{ define "header" }} diff --git a/views/pages/global-map.html b/views/pages/global-map.html index 604b52e..7d788d6 100644 --- a/views/pages/global-map.html +++ b/views/pages/global-map.html @@ -3,13 +3,7 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta name="description" content="{{ .L.GlobalMap.Description }}"> - <meta property="og:title" content="{{ .L.GlobalMap.Header }}"> - <meta property="og:description" content="{{ .L.GlobalMap.Description }}"> - <meta property="og:url" content="{{ .CanonicalEndpoint }}/{{ .Lang }}/map"> - <meta property="og:type" content="site"> <title>{{ .L.GlobalMap.Header }} // SAYA TODAY</title> - <link rel="canonical" href="{{ .CanonicalEndpoint }}/{{ .Lang }}/map"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"> {{ block "header" . }}{{ end }} <link href="/output.css" rel="stylesheet"> @@ -249,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"> @@ -288,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/robots.txt b/views/pages/robots.txt deleted file mode 100644 index 1e5bebb..0000000 --- a/views/pages/robots.txt +++ /dev/null @@ -1,5 +0,0 @@ -User-agent: * -Allow: / -Disallow: /api/ - -Sitemap: {{ .CanonicalEndpoint }}/sitemap.xml
\ No newline at end of file diff --git a/views/pages/sitemap.xml b/views/pages/sitemap.xml deleted file mode 100644 index 1474a56..0000000 --- a/views/pages/sitemap.xml +++ /dev/null @@ -1,10 +0,0 @@ -<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> - {{- range .URLs }} - <url> - <loc>{{ $.CanonicalEndpoint }}{{ .Loc }}</loc> - <lastmod>{{ .LastModified.UTC.Format "2006-01-02T15:04:05Z" }}</lastmod> - <changefreq>{{ .ChangeFreq }}</changefreq> - <priority>{{ printf "%.1f" .Priority }}</priority> - </url> - {{- end }} -</urlset> 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 { |