From 01f9f7787ae3f7c68366bb221e541cef344912fc Mon Sep 17 00:00:00 2001 From: Redume Date: Mon, 22 Jul 2024 22:07:11 +0300 Subject: [PATCH] I copied the files to the folder with the localization. --- localized-files/ru/index.html | 4 +- localized-files/ru/static/css/wallpaper.css | 125 ++++++++++++++++++ .../ru/static/script/wallpaperLoad.js | 37 ++++++ localized-files/ru/wallapaper.html | 54 ++++++++ wallapaper.html | 2 +- 5 files changed, 219 insertions(+), 3 deletions(-) create mode 100644 localized-files/ru/static/css/wallpaper.css create mode 100644 localized-files/ru/static/script/wallpaperLoad.js create mode 100644 localized-files/ru/wallapaper.html diff --git a/localized-files/ru/index.html b/localized-files/ru/index.html index cca053b..05b0a0c 100644 --- a/localized-files/ru/index.html +++ b/localized-files/ru/index.html @@ -42,10 +42,10 @@
- Get it on Google Play + Скачать приложение на Google Play - Get it on Github + Скачать приложение на Github
diff --git a/localized-files/ru/static/css/wallpaper.css b/localized-files/ru/static/css/wallpaper.css new file mode 100644 index 0000000..a0f9e35 --- /dev/null +++ b/localized-files/ru/static/css/wallpaper.css @@ -0,0 +1,125 @@ +body { + background: #153E3F; + color: white; + font-family: 'Roboto', serif; +} + +@media (min-width: 0) { + .wallpaper img { + width: 90%; + border-radius: 8px; + margin: 0 auto 0 auto; + display: flex; + } + + .wallpaper h1 { + text-align: center; + } + + .copyright { + font-size: 110%; + width: 90%; + } + + p { + margin-left: auto; + margin-right: auto; + } + + .desc { + font-size: 125%; + line-height: 32px; + width: 90%; + } + + .wallpaper-text { + display: flex; + flex-direction: column-reverse; + } + + .get-it-on { + display: flex; + margin: 5% auto 3% auto; + } + +} + +@media (min-width: 768px) { + .get-it-on { + display: flex; + margin: 5% auto 3% auto; + } + + .desc { + font-size: 150%; + line-height: 39px; + width: 90%; + } + + .copyright { + font-size: 125%; + width: 90%; + } +} + +@media (min-width: 992px) { + .wallpaper img { + width: 65%; + border-radius: 8px; + margin: 0 auto 0 auto; + display: flex; + } + + .desc { + font-size: 200%; + line-height: 45px; + width: 90%; + } + + .copyright { + font-size: 150%; + width: 90%; + } + + .wallpaper h1 { + text-align: center; + font-size: 250%; + } + +} + +@media (min-width: 1200px) { + .wallpaper img { + width: 40%; + border-radius: 8px; + float: left; + } + + .wallpaper-text { + display: flex; + flex-direction: column; + } + + .desc { + font-size: 150%; + line-height: 36px; + width: 90%; + } + + .copyright { + font-size: 120%; + } + + .get-it-on { + display: block ; + width: 70%; + margin-left: 15%; + margin-right: auto; + } +} + +@media (min-width: 1400px) { + .wallpaper img { + max-width: 27%; + } +} \ No newline at end of file diff --git a/localized-files/ru/static/script/wallpaperLoad.js b/localized-files/ru/static/script/wallpaperLoad.js new file mode 100644 index 0000000..31c3dfc --- /dev/null +++ b/localized-files/ru/static/script/wallpaperLoad.js @@ -0,0 +1,37 @@ +function load(date) { + fetch(`https://api.starlio.space/wallpaper/${date}`).then(res => { + res.json().then(data => { + if (data.length === 0) return; + + document.querySelector("div.wallpaper img").src = data.url; + document.querySelector("div.wallpaper div.wallpaper-text div.wallpaper-desc h1").innerHTML = data.title; + document.querySelector(".copyright").innerHTML = `Image Credit & Copyright: ${data.copyright}`; + document.querySelector(".desc").innerHTML = data.explanation; + }); + }); +} + +function parseURL() { + let pathname = document.location.pathname + pathname = pathname.slice(pathname.lastIndexOf('/')+1) + + if (isNaN(new Date(pathname).getTime())) return null; + if (!isValidDate(pathname)) return null; + + return pathname; +} + + +/* THX, bro <3 + https://stackoverflow.com/a/35413963/20781634 + */ +function isValidDate(dateString) { + var regEx = /^\d{4}-\d{2}-\d{2}$/; + if(!dateString.match(regEx)) return false; + var d = new Date(dateString); + var dNum = d.getTime(); + if(!dNum && dNum !== 0) return false; + return d.toISOString().slice(0,10) === dateString; +} + +load(parseURL()); \ No newline at end of file diff --git a/localized-files/ru/wallapaper.html b/localized-files/ru/wallapaper.html new file mode 100644 index 0000000..886d047 --- /dev/null +++ b/localized-files/ru/wallapaper.html @@ -0,0 +1,54 @@ + + + + + Starlio + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Jones-Emberson 1 +
+
+

Spiral Aurora over Iceland

+ +

The scene may look like a fantasy, but it's really Iceland. The rock arch is named Gatklettur and located on the island's northwest coast. Some of the larger rocks in the foreground span a meter across. The fog over the rocks is really moving waves averaged over long exposures. The featured image is a composite of several foreground and background shots taken with the same camera and from the same location on the same night last November. The location was picked for its picturesque foreground, but the timing was planned for its colorful background: aurora. The spiral aurora, far behind the arch, was one of the brightest seen in the astrophotographer's life. The coiled pattern was fleeting, though, as auroral patterns waved and danced for hours during the cold night. Far in the background were the unchanging stars, with Earth's rotation causing them to appear to slowly circle the sky's northernmost point near Polaris.

+
+ +
+
+ + + \ No newline at end of file diff --git a/wallapaper.html b/wallapaper.html index 729abf1..886d047 100644 --- a/wallapaper.html +++ b/wallapaper.html @@ -49,6 +49,6 @@ - + \ No newline at end of file