From 3a2515a2832393d427b0c1b8a7f05df0f6a71bf3 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 12 Sep 2023 05:35:40 -0700 Subject: feat: art source --- index.html | 4 +++- index.js | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index b5be298..c81fdd6 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,9 @@
-
+
+ +
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"]; }); }); } -- cgit v1.2.3