summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-09-12 05:35:40 -0700
committerFuwn <[email protected]>2023-09-12 05:35:40 -0700
commit3a2515a2832393d427b0c1b8a7f05df0f6a71bf3 (patch)
tree59add73d1bdb4ce3be5e7afcd179186cc4dbb15f
parentfix(css): border size (diff)
downloadstartpage-3a2515a2832393d427b0c1b8a7f05df0f6a71bf3.tar.xz
startpage-3a2515a2832393d427b0c1b8a7f05df0f6a71bf3.zip
feat: art source
-rw-r--r--index.html4
-rw-r--r--index.js4
2 files changed, 7 insertions, 1 deletions
diff --git a/index.html b/index.html
index b5be298..c81fdd6 100644
--- a/index.html
+++ b/index.html
@@ -13,7 +13,9 @@
<body>
<div class="wrapper">
- <div class="waifu"><img id="waifu" /></div>
+ <div class="waifu">
+ <a href="#" id="waifu-link"><img id="waifu" /></a>
+ </div>
<div class="content">
<div class="time" id="time"></div>
diff --git a/index.js b/index.js
index caf5125..1da60a5 100644
--- a/index.js
+++ b/index.js
@@ -155,6 +155,10 @@ function chooseWaifu() {
fetch("https://api.waifu.im/search").then((response) => {
response.json().then((json) => {
doc.getElementById("waifu").src = json["images"][0]["url"];
+ doc.getElementById("waifu-link").href =
+ json["images"][0]["source"] ||
+ json["images"][0]["artist"]["twitter"] ||
+ json["images"][0]["artist"]["pixiv"];
});
});
}