diff options
| author | Fuwn <[email protected]> | 2023-09-12 05:14:31 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-12 05:14:31 -0700 |
| commit | 1876f7206a31860111be35dbb38f6d7f46d18838 (patch) | |
| tree | 74297ac0b9a367a01123e63de89061ae01b501a1 | |
| download | startpage-1876f7206a31860111be35dbb38f6d7f46d18838.tar.xz startpage-1876f7206a31860111be35dbb38f6d7f46d18838.zip | |
feat: initial commit
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | colors.css | 28 | ||||
| -rw-r--r-- | index.css | 75 | ||||
| -rw-r--r-- | index.html | 63 | ||||
| -rw-r--r-- | index.js | 159 | ||||
| -rw-r--r-- | unifont-12.0.01.woff2 | bin | 0 -> 1605860 bytes |
6 files changed, 326 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..600d2d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode
\ No newline at end of file diff --git a/colors.css b/colors.css new file mode 100644 index 0000000..f6ebb4d --- /dev/null +++ b/colors.css @@ -0,0 +1,28 @@ +/* CSS variables + Generated by 'wal' */ +:root { + --wallpaper: url("/home/fuwn/Downloads/ol0svyx4zgqa1.jpg"); + + /* Special */ + --background: #1b1219; + --foreground: #cfc6db; + --cursor: #cfc6db; + + /* Colors */ + --color0: #1b1219; + --color1: #6D5697; + --color2: #986B97; + --color3: #BF7C91; + --color4: #8D6EAD; + --color5: #BE9484; + --color6: #A386B6; + --color7: #cfc6db; + --color8: #908a99; + --color9: #6D5697; + --color10: #986B97; + --color11: #BF7C91; + --color12: #8D6EAD; + --color13: #BE9484; + --color14: #A386B6; + --color15: #cfc6db; +} diff --git a/index.css b/index.css new file mode 100644 index 0000000..9034878 --- /dev/null +++ b/index.css @@ -0,0 +1,75 @@ +@font-face { + font-family: "unifont"; + src: url("unifont-12.0.01.woff2"); +} + +body { + font-family: "unifont"; + background-color: var(--background); + color: var(--foreground); + padding: 0; + margin: 0; +} + +.wrapper { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.content { + flex: 0 1 auto; + border: 1px solid var(--color1); + padding: 100px; +} + +@media screen and (max-width: 957px) { + .content { + padding: 50px; + } + + .waifu { + height: 316px !important; + } +} + +@media screen and (max-width: 749px) { + .content { + padding: 50px; + } + + .waifu { + display: none; + } +} + +.waifu { + flex: 0 2 0; + height: 416px; + border: 1px solid var(--color1); +} + +.media-links, +.schedule-links, +.school-links, +.code-links, +.weeb-links { + border-bottom: 1px solid var(--color1); + padding-bottom: 10px; + margin-bottom: 5px; +} + +img { + height: 100%; +} + +.weather { + border-bottom: 1px solid var(--color1); + padding-bottom: 5px; + margin-bottom: 10px; +} + +a { + color: var(--color2); +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..c94773e --- /dev/null +++ b/index.html @@ -0,0 +1,63 @@ +<!DOCTYPE html> +<html data-lt-installed="true"> + <head> + <title>~/</title> + <link rel="stylesheet" href="/home/fuwn/.cache/wal/colors.css" /> + <link rel="stylesheet" href="./colors.css" /> + <link rel="stylesheet" href="./index.css" /> + </head> + + <body> + <div class="wrapper"> + <div class="waifu"><img id="waifu" /></div> + + <div class="content"> + <div class="time" id="time"></div> + + <div class="weather" id="weather"> + <div id="weather"> + <div id="current"></div> + <div id="tmrrw"></div> + </div> + </div> + + <div class="links" id="links"> + <div class="media-links" id="media-links"> + <a href="https://open.spotify.com/">spotify</a> + <a href="https://stats.fm/Fuwn">stats.fm</a> + <a href="https://www.crunchyroll.com/videos/new">crunchyroll</a> + <a href="https://www.hidive.com/dashboard">hidive</a> + </div> + + <div class="schedule-links" id="schedule-links"> + <a href="https://livechart.me/timetable">livechart.me</a> + <a href="https://animeschedule.net/">animescheadule</a> + <a href="https://anichart.net/">anichart</a> + <a href="https://due.moe/">due.moe</a> + </div> + + <div class="weeb-links" id="weeb-links"> + <a href="https://anilist.co/">anilist</a> + <a href="https://mangadex.org/">mangadex</a> + <a href="https://myanimelist.net/">myanimelist</a> + <a href="https://listen.moe/">listen.moe</a> + </div> + + <div class="school-links" id="school-links"> + <a href="https://mhcc.blackboard.com/">blackboard</a> + <a href="https://oit.instructure.com/">canvas</a> + <a href="https://techweb.oit.edu/">techweb</a> + </div> + + <div class="fun-links" id="fun-links"> + <a href="https://osu.ppy.sh/users/25566237">osu</a> + <a href="https://boards.4channel.org/a/">/a/</a> + <a href="https://boards.4channel.org/g/">/g/</a> + </div> + </div> + </div> + </div> + + <script src="./index.js"></script> + </body> +</html> diff --git a/index.js b/index.js new file mode 100644 index 0000000..923f028 --- /dev/null +++ b/index.js @@ -0,0 +1,159 @@ +const doc = document; + +function updateClock() { + var days = [ + "sunday", + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + ]; + var months = [ + "january", + "february", + "march", + "april", + "may", + "june", + "july", + "august", + "september", + "october", + "november", + "december", + ]; + var m = new Date(); + var dateStr = + days[m.getDay()] + + " " + + months[m.getMonth()] + + " " + + m.getDate() + + ", " + + m.getFullYear() + + " | " + + ("0" + m.getHours()).slice(-2) + + ":" + + ("0" + m.getMinutes()).slice(-2) + + ":" + + ("0" + m.getSeconds()).slice(-2); + doc.getElementById("time").innerHTML = dateStr; + setTimeout(updateClock, 500); +} + +function weather() { + var key = "40d2bf562ba19169b08d75a16f3756c1"; + var lat = "45.53929"; + var lon = "-122.38731"; + + fetch( + `https://api.openweathermap.org/data/2.5/onecall?units=metric&lat=${lat}&lon=${lon}&exclude=minutely,hourly&appid=${key}` + ) + .then((resp) => resp.json()) + .then((data) => { + displayWeather(data); + }) + .catch((e) => { + console.log(`ERROR! ${e}`); + }); +} + +function displayWeather(data) { + var conditions = { + 200: "thunderstorms, light rain", + 201: "thunderstorms, rain", + 202: "thunderstorms, heavy rain", + 210: "light thunderstorms", + 211: "thunderstorms", + 212: "heavy thunderstorms", + 221: "ragged thunderstorms", + 230: "thunderstorms, light drizzle", + 231: "thunderstorms, drizzle", + 232: "thunderstorms, heavy drizzle", + + 300: "light drizzle", + 301: "drizzle", + 302: "heavy drizzle", + 310: "light drizzle rain", + 311: "drizzle rain", + 312: "heavy drizzle rain", + 313: "rain showers and drizzle", + 314: "heavy rain showers and drizzle", + 321: "drizzle showers", + + 500: "light rain", + 501: "rain", + 502: "heavy rain", + 503: "very heavy rain", + 504: "extreme rain", + 511: "freezing rain", + 520: "light showers", + 521: "showers", + 522: "heavy showers", + 531: "ragged showers", + + 600: "light snow", + 601: "snow", + 602: "heavy snow", + 611: "sleet", + 612: "light sleet", + 613: "sleet showers", + 615: "light rain and snow", + 616: "rain and snow, glhf", + 620: "light snow showers", + 621: "snow showers", + 622: "heavy snow showers", + + 701: "mist", + 711: "smoke", + 721: "haze", + 731: "dust", + 741: "fog", + 751: "darude sandstorm", + 761: "dust", + 762: "stark mountain ash", + 771: "squalls", + 781: "tornado", + + 800: "clear", + 801: "light clouds", + 802: "scattered clouds", + 803: "broken clouds", + 804: "overcast", + }; + + var currentWeather = `${data.current.temp.toFixed(0)}°c + ${conditions[data.current.weather[0].id]} (feels like + ${data.current.feels_like.toFixed(0)}°c)`; + + var tmrrwWeather = `${data.daily[1].temp.day.toFixed(0)}°c + ${conditions[data.daily[1].weather[0].id]} (feels like + ${data.daily[1].feels_like.day.toFixed(0)}°c)`; + + doc.getElementById("current").innerHTML += currentWeather; + doc.getElementById("tmrrw").innerHTML += tmrrwWeather; +} + +function chooseWaifu() { + // imgs = [ + // "https://safebooru.org//images/4328/bd9ffeae0248d21841160ee8e605856371d11c4f.jpg", + // "https://safebooru.org//samples/4328/sample_03c998b6ad2f7f36116699b383890ae113e64fca.jpg", + // "https://safebooru.org//samples/4328/sample_fe9ee936fdf55235fcb31a2276f23b1b581773bb.jpg", + // ]; + // doc.getElementById("waifu").src = `${ + // imgs[Math.floor(Math.random() * imgs.length)] + // }`; + fetch("https://api.waifu.im/search").then((response) => { + response.json().then((json) => { + doc.getElementById("waifu").src = json["images"][0]["url"]; + }); + }); +} + +window.onload = function () { + chooseWaifu(); + weather(); +}; +updateClock(); diff --git a/unifont-12.0.01.woff2 b/unifont-12.0.01.woff2 Binary files differnew file mode 100644 index 0000000..d6e201a --- /dev/null +++ b/unifont-12.0.01.woff2 |