From 39dd311cee2255c6cc41d656007f395784e44d31 Mon Sep 17 00:00:00 2001 From: Squibid Date: Tue, 26 Dec 2023 22:58:20 -0500 Subject: feat:explain the users query --- misc/tools.php | 23 +++++++++++++++++++++++ query.php | 4 ++++ scrapers/wallhaven.php | 18 ++++++++++++++++++ style/style.css | 30 ++++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+) diff --git a/misc/tools.php b/misc/tools.php index 9917be7..0dbb7b8 100644 --- a/misc/tools.php +++ b/misc/tools.php @@ -1,4 +1,7 @@ "; + } + + return $q; + } ?> diff --git a/query.php b/query.php index 41cc918..2cfa97f 100644 --- a/query.php +++ b/query.php @@ -1,6 +1,7 @@

%s Wallpapers found for \"%s\"

", $res[1]["total"], $_GET["q"], humanquery($_GET["q"], $_GET["NSFW"] ? true : false)); + /* display wallpapers */ printf("
\n"); if (!$res[0]) diff --git a/scrapers/wallhaven.php b/scrapers/wallhaven.php index 5dbdd68..29df5d3 100644 --- a/scrapers/wallhaven.php +++ b/scrapers/wallhaven.php @@ -53,6 +53,21 @@ return array($walls, $meta); } + function gettaginfo($link) { + $decoded = json_decode(callapi("GET", $link), true); + $tag = []; + + foreach($decoded["data"] as $key => $value) { + $tag["id"] = $decoded["data"]["id"]; + $tag["name"] = $decoded["data"]["name"]; + $tag["alias"] = $decoded["data"]["alias"]; + $tag["category_id"] = $decoded["data"]["category_id"]; + $tag["purity"] = $decoded["data"]["purity"]; + $tag["created_at"] = $decoded["data"]["created_at"]; + } + return $tag; + } + function getwallpaper($link) { $decoded = json_decode(callapi("GET", $link), true); $wall = $decoded["data"]; @@ -92,6 +107,9 @@ $wall["tags"][$key]["purity"] = $decoded["data"]["tags"][$key]["purity"]; $wall["tags"][$key]["created_at"] = $decoded["data"]["tags"][$key]["created_at"]; } + $wall["thumbs"]["large"] = $decoded["data"]["thumbs"]["large"]; + $wall["thumbs"]["orig"] = $decoded["data"]["thumbs"]["original"]; + $wall["thumbs"]["small"] = $decoded["data"]["thumbs"]["small"]; } return $wall; } diff --git a/style/style.css b/style/style.css index a90ad2a..b039b56 100644 --- a/style/style.css +++ b/style/style.css @@ -85,6 +85,36 @@ h1, #header { } } +#queryinfo { + font-size: 25px; + width: 85%; + margin: 0 auto; + color: #fff; +} +#queryinfo p { margin: 0 auto; } +#queryinfo a { color: var(--user-color-1); } +#queryinfo img, #queryinfo span { display: none; } +#queryinfo a:hover img { + display: unset !important; + position: absolute; + border: 0.2em solid #fff; + margin-top: 1.2em; + margin-left: -12em; +} +#queryinfo a:hover span { + display: unset !important; + position: absolute; + margin-top: 1em; + margin-left: -5em; + + width: 0; + height: 0; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #fff; + transform: scale(2); +} + #wallpapers { text-align: center; color: #fff; -- cgit v1.2.1