aboutsummaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2021-12-12 11:19:38 +0100
committerMinteck <contact@minteck.org>2021-12-12 11:19:38 +0100
commitdc8f78256944885108f1d52b822c8677bf9d964c (patch)
tree38ea776d4fe8d9d11c28448246afa8af4886351a /assets
downloadwolfeye-php-dc8f78256944885108f1d52b822c8677bf9d964c.tar.gz
wolfeye-php-dc8f78256944885108f1d52b822c8677bf9d964c.tar.bz2
wolfeye-php-dc8f78256944885108f1d52b822c8677bf9d964c.zip
Initial commit
Diffstat (limited to 'assets')
-rw-r--r--assets/default.pngbin0 -> 1478 bytes
-rw-r--r--assets/instant.js50
-rw-r--r--assets/main.css200
-rw-r--r--assets/relevant.svg1
-rw-r--r--assets/search.svg1
-rw-r--r--assets/verified.svg1
6 files changed, 253 insertions, 0 deletions
diff --git a/assets/default.png b/assets/default.png
new file mode 100644
index 0000000..b018b02
--- /dev/null
+++ b/assets/default.png
Binary files differ
diff --git a/assets/instant.js b/assets/instant.js
new file mode 100644
index 0000000..439daab
--- /dev/null
+++ b/assets/instant.js
@@ -0,0 +1,50 @@
+(async () => {
+ instant = JSON.parse(
+ (await (
+ await (
+ await window.fetch("/ratelimited/instant.php?q=" + query)
+ ).blob()
+ ).text()
+ ));
+
+ document.getElementById("details").innerHTML = "<small id='details-source'>from <a id='details-source-link' href='https://duckduckgo.com' target='_blank'>DuckDuckGo</a>:</small><p>" + instant.Abstract + "</p><p><i>— <a href='" + instant.AbstractURL + "' id='details-data-link' target='_blank'>" + instant.AbstractSource + "</a></i></p>";
+ if (instant.Abstract.trim() !== "") document.getElementById("details").style.display = "block";
+ if (instant.Abstract.trim() !== "") document.getElementById("results").classList.add("with-details");
+ if (instant.Abstract.trim() !== "") try {document.getElementsByClassName("dym-section")[0].outerHTML = ""; } catch (e) {}
+
+ if (!instant._WolfEye_External) {
+ try { document.getElementById("details-source").innerHTML = "&nbsp;" } catch (e) {}
+ try { document.getElementById("details-data-link").target = "" } catch (e) {}
+ }
+
+ if (instant.Results[0]) {
+ if (!document.getElementsByClassName("result-official")[0]) {
+ document.getElementById("results").innerHTML = '<div class="result result-official"><a href="https://example.com"><div class="result-name" style="font-size: 18px;"><img alt="" class="result-icon" src="about:blank"> <b>Example</b> <img class="result-relevant" src="/assets/relevant.svg" alt=""></div><div class="result-url"><small>https://example.com/</small></div></a></div>' + document.getElementById("results").innerHTML;
+ }
+
+ document.getElementsByClassName("result-official")[0].classList.add("result-verified");
+ document.getElementsByClassName("result-official")[0].children[0].href = instant.Results[0].FirstURL;
+ document.getElementsByClassName("result-official")[0].children[0].children[0].children[2].src = "/assets/verified.svg";
+ document.getElementsByClassName("result-official")[0].children[0].children[0].children[2].title = "Verified Website";
+ document.getElementsByClassName("result-official")[0].children[0].children[0].children[0].src = "https://duckduckgo.com" + instant.Results[0].Icon.URL;
+ document.getElementsByClassName("result-official")[0].children[0].children[0].children[1].innerText = instant.Heading;
+ document.getElementsByClassName("result-official")[0].children[0].children[1].children[0].innerText = instant.Results[0].FirstURL;
+ }
+
+ if (query === "wolfeye" || query === "wolf eye") {
+ document.getElementById("details").innerHTML = "<h3>Hold tight! Let's go home...</h3><p>You are already using WolfEye; but you seem lost. Use the search bar at the top of this page to search for something on the Web.</p>"
+ document.getElementById("details").style.display = "block";
+
+ if (!document.getElementsByClassName("result-official")[0]) {
+ document.getElementById("results").innerHTML = '<div class="result result-official"><a href="https://example.com"><div class="result-name" style="font-size: 18px;"><img alt="" class="result-icon" src="about:blank"> <b>Example</b> <img class="result-relevant" src="/assets/relevant.svg" alt=""></div><div class="result-url"><small>https://example.com/</small></div></a></div>' + document.getElementById("results").innerHTML;
+ }
+
+ document.getElementsByClassName("result-official")[0].classList.add("result-verified");
+ document.getElementsByClassName("result-official")[0].children[0].href = "https://wolfeye.minteck.org";
+ document.getElementsByClassName("result-official")[0].children[0].children[0].children[2].src = "/assets/verified.svg";
+ document.getElementsByClassName("result-official")[0].children[0].children[0].children[2].title = "Verified Website";
+ document.getElementsByClassName("result-official")[0].children[0].children[0].children[0].src = "/logo.svg";
+ document.getElementsByClassName("result-official")[0].children[0].children[0].children[1].innerText = "WolfEye";
+ document.getElementsByClassName("result-official")[0].children[0].children[1].children[0].innerText = "https://wolfeye.minteck.org";
+ }
+})() \ No newline at end of file
diff --git a/assets/main.css b/assets/main.css
new file mode 100644
index 0000000..107521f
--- /dev/null
+++ b/assets/main.css
@@ -0,0 +1,200 @@
+body, html {
+ background: #222;
+ color: white;
+ margin: 0;
+ font-family: arial,sans-serif;
+}
+
+.result-url, .result-name {
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.result {
+ color: white;
+ text-decoration: none;
+ padding: 8px;
+ margin-bottom: 5px;
+ border-radius: 5px;
+ border: 2px solid transparent;
+}
+
+.result:hover {
+ background: #333;
+}
+
+.result:active, .result:focus {
+ background: #444;
+}
+
+.result a {
+ text-decoration: inherit;
+ color: inherit;
+}
+
+.result.result-official {
+ border-color: rgba(255, 255, 0, 0.3);
+}
+
+.result.result-verified {
+ border-color: rgba(0, 255, 21, 0.3);
+}
+
+.result-relevant {
+ vertical-align: middle;
+}
+
+#results-intro-logo, #results-intro-bar {
+ display: inline-block;
+ margin: 0;
+}
+
+#results-intro {
+ background: #111;
+ padding: 0 50px;
+ margin-bottom: 20px;
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ border-bottom: 1px solid #252525;
+}
+
+#results-intro-bar-input {
+ background: #171717;
+ color: white;
+ border: 1px solid #222;
+ padding: 10px;
+ outline: none;
+ height: 8px;
+ border-radius: 5px;
+ width: calc(100vw - 230px);
+ margin: 8px 10px;
+}
+
+#results-intro-bar-input:hover {
+ border-color: #333;
+}
+
+#results-intro-bar-input:active, #results-intro-bar-input:focus {
+ border-color: #444;
+}
+
+#intro-results-separator {
+ margin-top: 43px;
+}
+
+@media (max-width: 1200px) {
+ #results, #details, #results-debug {
+ padding: 50px 200px !important;
+ }
+}
+
+@media (max-width: 1000px) {
+ #results, #details, #results-debug {
+ padding: 50px 150px !important;
+ }
+}
+
+@media (max-width: 700px) {
+ #results, #details, #results-debug {
+ padding: 50px 100px !important;
+ }
+}
+
+@media (max-width: 500px) {
+ #results, #details, #results-debug {
+ padding: 50px 50px !important;
+ }
+}
+
+@media (max-width: 450px) {
+ #results, #details, #results-debug {
+ padding: 50px 10px !important;
+ }
+}
+
+#results, #details, #results-debug {
+ padding: 50px 250px;
+}
+
+.dym-link {
+ color: lightgray;
+}
+
+.dym-section {
+ padding: 10px;
+ background: #333;
+ border-bottom: 1px solid #353535;
+}
+
+.result-icon {
+ width: 24px;
+ height: 24px;
+ vertical-align: middle;
+}
+
+#results-intro-logo-img {
+ width: 32px;
+ height: 32px;
+ vertical-align: middle;
+}
+
+#details {
+ padding-top: 10px !important;
+ padding-bottom: 10px !important;
+ display: none;
+}
+
+#results-intro-bar-submit {
+ background-color: transparent;
+ color: transparent;
+ border: transparent;
+ cursor: pointer;
+ background-image: url("/assets/search.svg");
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: contain;
+ width: 24px;
+ height: 24px;
+ padding: 4px;
+}
+
+@media (max-width: 50px) {
+ #results-intro {
+ padding: 0 50px;
+ }
+ #results-intro-bar-input {
+ width: calc(100vw - 152px);
+ margin: 8px 5px;
+ }
+}
+
+#results-debug {
+ margin: 0;
+ padding-top: 10px !important;
+ padding-bottom: 0 !important;
+}
+
+#results.with-details {
+ padding-top: 10px !important;
+}
+
+#results-debug-inner-details {
+ opacity: 0;
+ font-family: monospace;
+}
+
+#results-debug-inner-details:hover {
+ opacity: 1;
+}
+
+#details-source {
+ display: inline-block;
+ opacity: .5;
+}
+
+#details-source-link, #details-data-link {
+ color: white;
+} \ No newline at end of file
diff --git a/assets/relevant.svg b/assets/relevant.svg
new file mode 100644
index 0000000..dc6a14c
--- /dev/null
+++ b/assets/relevant.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="rgba(255, 255, 0, 0.3)"><g><rect fill="none" height="24" width="24"/><path d="M14.43,10l-1.47-4.84c-0.29-0.95-1.63-0.95-1.91,0L9.57,10H5.12c-0.97,0-1.37,1.25-0.58,1.81l3.64,2.6l-1.43,4.61 c-0.29,0.93,0.79,1.68,1.56,1.09L12,17.31l3.69,2.81c0.77,0.59,1.85-0.16,1.56-1.09l-1.43-4.61l3.64-2.6 c0.79-0.57,0.39-1.81-0.58-1.81H14.43z"/></g></svg> \ No newline at end of file
diff --git a/assets/search.svg b/assets/search.svg
new file mode 100644
index 0000000..06a261d
--- /dev/null
+++ b/assets/search.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#ffffff"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M15.5 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.79 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg> \ No newline at end of file
diff --git a/assets/verified.svg b/assets/verified.svg
new file mode 100644
index 0000000..ada4600
--- /dev/null
+++ b/assets/verified.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="rgba(0, 255, 21, 0.3)"><g><rect fill="none" height="24" width="24"/><rect fill="none" height="24" width="24"/></g><g><path d="M23,12l-2.44-2.79l0.34-3.69l-3.61-0.82L15.4,1.5L12,2.96L8.6,1.5L6.71,4.69L3.1,5.5L3.44,9.2L1,12l2.44,2.79l-0.34,3.7 l3.61,0.82L8.6,22.5l3.4-1.47l3.4,1.46l1.89-3.19l3.61-0.82l-0.34-3.69L23,12z M9.38,16.01L7,13.61c-0.39-0.39-0.39-1.02,0-1.41 l0.07-0.07c0.39-0.39,1.03-0.39,1.42,0l1.61,1.62l5.15-5.16c0.39-0.39,1.03-0.39,1.42,0l0.07,0.07c0.39,0.39,0.39,1.02,0,1.41 l-5.92,5.94C10.41,16.4,9.78,16.4,9.38,16.01z"/></g></svg> \ No newline at end of file