diff options
| author | Fuwn <[email protected]> | 2023-09-12 05:35:40 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-12 05:35:40 -0700 |
| commit | 3a2515a2832393d427b0c1b8a7f05df0f6a71bf3 (patch) | |
| tree | 59add73d1bdb4ce3be5e7afcd179186cc4dbb15f | |
| parent | fix(css): border size (diff) | |
| download | startpage-3a2515a2832393d427b0c1b8a7f05df0f6a71bf3.tar.xz startpage-3a2515a2832393d427b0c1b8a7f05df0f6a71bf3.zip | |
feat: art source
| -rw-r--r-- | index.html | 4 | ||||
| -rw-r--r-- | index.js | 4 |
2 files changed, 7 insertions, 1 deletions
@@ -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> @@ -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"]; }); }); } |