From c9f6c54764185a2a9858916c1abb1cbd472614ba Mon Sep 17 00:00:00 2001 From: MeownsterMatt Date: Wed, 1 May 2024 06:55:02 +0530 Subject: [PATCH] hope that works --- .gitignore | 2 +- assets/MeownsterMatt.ico-B2lEfo04.svg | 107 ++++++++++++++++++++- assets/manifest-CPkg6ODG.json | 2 +- index.html | 129 +++++++++++++++++++++++++- meownsterCLI.js | 94 ++++++++++++++++++- sw.js | 36 ++++++- 6 files changed, 364 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4236e16..b512c09 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -npm_modules \ No newline at end of file +node_modules \ No newline at end of file diff --git a/assets/MeownsterMatt.ico-B2lEfo04.svg b/assets/MeownsterMatt.ico-B2lEfo04.svg index 61a7046..e3a712c 100644 --- a/assets/MeownsterMatt.ico-B2lEfo04.svg +++ b/assets/MeownsterMatt.ico-B2lEfo04.svg @@ -1 +1,106 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/manifest-CPkg6ODG.json b/assets/manifest-CPkg6ODG.json index 9ca3dbd..f84de3e 100644 --- a/assets/manifest-CPkg6ODG.json +++ b/assets/manifest-CPkg6ODG.json @@ -10,7 +10,7 @@ "display": "standalone", "icons": [ { - "src": "/MeownsterMatt.ico-B2lEfo04.svg", + "src": "/assets/MeownsterMatt.ico-B2lEfo04.svg", "type": "image/svg+xml", "sizes": "512x512" } diff --git a/index.html b/index.html index 1d5f85a..4ac6837 100644 --- a/index.html +++ b/index.html @@ -1 +1,128 @@ -MeownsterMatt

MeownsterMatt


  • usage: meow <operation> [...]
  • operations:

  • note:
    • clickable if you're scared or too lazy to type

>

\ No newline at end of file + + + + + + + MeownsterMatt + + + + + + + + + + +
+ + +
+ +
+
+

MeownsterMatt

+
+
+ + +
+
+
    +
  • usage: meow <operation> [...]
  • +
  • operations:

    +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • note:
  • +
  • +
      +
    • clickable if you're scared or too lazy to type
    • +
    +
  • +
+
+ + + + + + + + + + + + + + +
+
+

+ >

+

+
+
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/meownsterCLI.js b/meownsterCLI.js index d254847..5ab6ec2 100644 --- a/meownsterCLI.js +++ b/meownsterCLI.js @@ -1 +1,93 @@ -function emailCopyToClipboard(){const e=document.getElementById("emailCopyToClipboard"),d="meownstermatt@gmail.com";navigator.clipboard.writeText(d),e.classList.add("text-green-500"),e.classList.remove("text-yellow-500"),setTimeout(()=>{e.classList.remove("text-green-500"),e.classList.add("text-yellow-500")},1e3)}function showLinks(){cmdLinks.classList.remove("hidden"),cmdGames.classList.add("hidden"),cmdAbout.classList.add("hidden"),cmdNotFound.classList.add("hidden")}function showGames(){cmdLinks.classList.add("hidden"),cmdGames.classList.remove("hidden"),cmdAbout.classList.add("hidden"),cmdNotFound.classList.add("hidden")}function showAbout(){cmdLinks.classList.add("hidden"),cmdGames.classList.add("hidden"),cmdAbout.classList.remove("hidden"),cmdNotFound.classList.add("hidden")}function clearScreen(){cmdLinks.classList.add("hidden"),cmdGames.classList.add("hidden"),cmdAbout.classList.add("hidden"),cmdNotFound.classList.add("hidden")}function commandNotFound(){cmdLinks.classList.add("hidden"),cmdGames.classList.add("hidden"),cmdAbout.classList.add("hidden"),cmdNotFound.classList.remove("hidden")}const cmdLinks=document.getElementById("cmdLinks"),cmdGames=document.getElementById("cmdGames"),cmdAbout=document.getElementById("cmdAbout"),cmdNotFound=document.getElementById("cmdNotFound"),input=document.getElementById("cmdText");input.addEventListener("keypress",function(e){if("Enter"===e.key){e.preventDefault();var d=document.getElementById("cmdText").value.replace(/\s/g,"").toLowerCase();switch(input.value="",d){case"meow-l":case"meow--links":case"sudomeow-l":case"sudomeow--links":showLinks();break;case"meow-g":case"meow--games":case"sudomeow-g":case"sudomeow--games":showGames();break;case"meow-a":case"meow--about":case"sudomeow-a":case"sudomeow--about":showAbout();break;case"clear":case"sudoclear":clearScreen();break;default:commandNotFound()}}}); \ No newline at end of file +// Email Copy +function emailCopyToClipboard() { + const emailCopyToClipboard = document.getElementById("emailCopyToClipboard") + const copyText = "meownstermatt@gmail.com"; + navigator.clipboard.writeText(copyText); + emailCopyToClipboard.classList.add("text-green-500") + emailCopyToClipboard.classList.remove("text-yellow-500") + setTimeout(() => { + emailCopyToClipboard.classList.remove("text-green-500") + emailCopyToClipboard.classList.add("text-yellow-500") + }, 1000); +} + +function showLinks() { + cmdLinks.classList.remove("hidden") + cmdGames.classList.add("hidden") + cmdAbout.classList.add("hidden") + cmdNotFound.classList.add("hidden") +} + +function showGames() { + cmdLinks.classList.add("hidden") + cmdGames.classList.remove("hidden") + cmdAbout.classList.add("hidden") + cmdNotFound.classList.add("hidden") +} + +function showAbout() { + cmdLinks.classList.add("hidden") + cmdGames.classList.add("hidden") + cmdAbout.classList.remove("hidden") + cmdNotFound.classList.add("hidden") +} + +function clearScreen() { + cmdLinks.classList.add("hidden") + cmdGames.classList.add("hidden") + cmdAbout.classList.add("hidden") + cmdNotFound.classList.add("hidden") +} + +function commandNotFound() { + cmdLinks.classList.add("hidden") + cmdGames.classList.add("hidden") + cmdAbout.classList.add("hidden") + cmdNotFound.classList.remove("hidden") +} + +// CLI Js +const cmdLinks = document.getElementById("cmdLinks") +const cmdGames = document.getElementById("cmdGames") +const cmdAbout = document.getElementById("cmdAbout") +const cmdNotFound = document.getElementById("cmdNotFound") +const input = document.getElementById("cmdText") +input.addEventListener("keypress", function(event) { + if (event.key === "Enter") { + event.preventDefault(); + var inputProcessed = document.getElementById("cmdText").value.replace(/\s/g, "").toLowerCase() + input.value = "" + + switch (inputProcessed) { + case "meow-l": + case "meow--links": + case "sudomeow-l": + case "sudomeow--links": + showLinks() + break; + + case "meow-g": + case "meow--games": + case "sudomeow-g": + case "sudomeow--games": + showGames() + break; + + case "meow-a": + case "meow--about": + case "sudomeow-a": + case "sudomeow--about": + showAbout() + break; + + case "clear": + case "sudoclear": + clearScreen() + break; + + default: + commandNotFound() + break; + } + } +}); \ No newline at end of file diff --git a/sw.js b/sw.js index 5808592..a5e09ca 100644 --- a/sw.js +++ b/sw.js @@ -1 +1,35 @@ -const CACHE_NAME="temperature-converter-v1";self.addEventListener("install",e=>{e.waitUntil((async()=>{const e=await caches.open(CACHE_NAME);e.addAll(["/","/meownsterCLI.js"])})())}),self.addEventListener("fetch",e=>{e.respondWith((async()=>{const t=await caches.open(CACHE_NAME),a=await t.match(e.request);if(a)return a;try{const a=await fetch(e.request);return t.put(e.request,a.clone()),a}catch(e){}})())}); \ No newline at end of file +const CACHE_NAME = `temperature-converter-v1`; + +// Use the install event to pre-cache all initial resources. +self.addEventListener('install', event => { + event.waitUntil((async () => { + const cache = await caches.open(CACHE_NAME); + cache.addAll([ + '/', + '/meownsterCLI.js', + ]); + })()); +}); + +self.addEventListener('fetch', event => { + event.respondWith((async () => { + const cache = await caches.open(CACHE_NAME); + + // Get the resource from the cache. + const cachedResponse = await cache.match(event.request); + if (cachedResponse) { + return cachedResponse; + } else { + try { + // If the resource was not in the cache, try the network. + const fetchResponse = await fetch(event.request); + + // Save the resource in the cache and return it. + cache.put(event.request, fetchResponse.clone()); + return fetchResponse; + } catch (e) { + // The network failed. + } + } + })()); +}); \ No newline at end of file