diff --git a/index.html b/index.html index 674730a..a0de938 100644 --- a/index.html +++ b/index.html @@ -129,6 +129,11 @@ > + + +
- + Keybase PGP - Moe ICP 20218600 - @@ -219,6 +222,7 @@

Running on 186526 Network. + Build in "unknown".

Copyright © 2020 - Now 186526.xyz All rights Reserved.

diff --git a/package.json b/package.json index 54c1764..fb39316 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ }, "dependencies": { "@vitejs/plugin-legacy": "^1.8.1", + "tippy.js": "^6.3.7", "typed.js": "^2.0.12", "workbox-cdn": "4.2.0" }, diff --git a/src/main.ts b/src/main.ts index 366885c..b57d792 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,10 +1,15 @@ -const __APP_VERSION__ = "__APP_VERSION"; -const __APP_BUILD_TIME__ = __APP_BUILD_TIME; +const APP_VERSION = __APP_VERSION__; +const APP_BUILD_TIME = __APP_BUILD_TIME__; import "./styles.css"; import Typed from "typed.js"; +import Tippy from 'tippy.js'; + +import 'tippy.js/dist/tippy.css'; +import 'tippy.js/animations/scale.css'; + window.addEventListener("load", (_ev) => { new Typed(document.querySelector("description") ?? "description", { stringsElement: "#description-list", @@ -18,15 +23,18 @@ window.addEventListener("load", (_ev) => { }); document.querySelectorAll("[alt]").forEach((Elem) => { - const tooltip = document.createElement("tooltiptext"); - tooltip.innerText = Elem.getAttribute("alt") ?? ""; - Elem.appendChild(tooltip); + Tippy(Elem, { + content: Elem.getAttribute("alt") ?? "", + }) }); // @ts-expect-error document.querySelector( "#footer > div" - ).innerHTML += `Update Commit Latest Update`; + ).innerHTML += `Update Commit Latest Update`; + + // @ts-expect-error + document.querySelector("#footer").innerHTML = document.querySelector("#footer")?.innerHTML.replaceAll("unknown",__APP_BUILD_MACHINE__); if ("serviceWorker" in navigator) { navigator.serviceWorker diff --git a/src/styles/base.css b/src/styles/base.css index 54e3f82..7a50807 100644 --- a/src/styles/base.css +++ b/src/styles/base.css @@ -141,29 +141,6 @@ background { } } -tooltiptext { - display: none; - visibility: hidden; - font-family: "Google Sans", Roboto, Noto Sans SC, sans-serif; - width: 120px; - background-color: #555; - color: #fff; - text-align: center; - padding: 5px 0; - border-radius: 6px; - opacity: 0; - transition: opacity 0.6s; - - position: absolute; - z-index: 1; -} - -:hover > tooltiptext { - display: block; - visibility: visible; - opacity: 1; -} - .toast { background: var(--mask-color); border-radius: 8px; diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 17afc9a..222c79c 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -1,3 +1,4 @@ /// -declare const __APP_VERSION: string; -declare const __APP_BUILD_TIME: string; +declare const __APP_VERSION__: string; +declare const __APP_BUILD_TIME__: string; +declare const __APP_BUILD_MACHINE__: string; diff --git a/vite.config.js b/vite.config.js index 14bb156..578b165 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,5 +1,6 @@ import child_process from "child_process"; import legacy from "@vitejs/plugin-legacy"; +import os from "os"; /** * @type {import('vite').UserConfig} @@ -7,11 +8,12 @@ import legacy from "@vitejs/plugin-legacy"; const config = { base: "./", define: { - __APP_VERSION: child_process + __APP_VERSION__: `"${child_process .execSync("git rev-parse --short HEAD") .toString() - .replace("\n", ""), - __APP_BUILD_TIME: Math.floor(Date.now() / 1000), + .replace("\n", "")}"`, + __APP_BUILD_TIME__: Math.floor(Date.now() / 1000), + __APP_BUILD_MACHINE__:`"${os.hostname}"` }, plugins: [ legacy({ diff --git a/yarn.lock b/yarn.lock index 097a97f..63a2629 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,11 @@ resolved "https://registry.npmmirror.com/@babel/standalone/-/standalone-7.17.11.tgz#9cc17674da762332b2e40d469ce37725a6136487" integrity sha512-47wVYBeTktYHwtzlFuK7qqV/H5X6mU4MUNqpQ9iiJOqnP8rWL0eX0GWLKRsv8D8suYzhuS1K/dtwgGr+26U7Gg== +"@popperjs/core@^2.9.0": + version "2.11.5" + resolved "https://registry.npmmirror.com/@popperjs/core/-/core-2.11.5.tgz#db5a11bf66bdab39569719555b0f76e138d7bd64" + integrity sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw== + "@trysound/sax@0.2.0": version "0.2.0" resolved "https://registry.npmmirror.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" @@ -749,6 +754,13 @@ systemjs@^6.12.1: resolved "https://registry.npmmirror.com/systemjs/-/systemjs-6.12.1.tgz#47cdd23a6ec9f1b01cf5b5f70562c8550da229d3" integrity sha512-hqTN6kW+pN6/qro6G9OZ7ceDQOcYno020zBQKpZQLsJhYTDMCMNfXi/Y8duF5iW+4WWZr42ry0MMkcRGpbwG2A== +tippy.js@^6.3.7: + version "6.3.7" + resolved "https://registry.npmmirror.com/tippy.js/-/tippy.js-6.3.7.tgz#8ccfb651d642010ed9a32ff29b0e9e19c5b8c61c" + integrity sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ== + dependencies: + "@popperjs/core" "^2.9.0" + typed.js@^2.0.12: version "2.0.12" resolved "https://registry.npmmirror.com/typed.js/-/typed.js-2.0.12.tgz#246aff074c8e18d32ec27acb7be15094ac0bc0e1"