From ace19a693dfa376d6722b77a143c0b87656e3ec2 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Thu, 18 Apr 2024 21:39:08 -0500 Subject: [PATCH] MORE ORGANIZE!!! --- .gitignore | 3 ++- {static/imgs => assets/Images}/asahiPFP.png | Bin {static/imgs => assets/Images}/notFound.png | Bin index.js | 4 +++- overcomplicatedStatuses.js | 2 +- pageUpdater.js | 15 +++------------ static/root.css | 8 ++++---- 7 files changed, 13 insertions(+), 19 deletions(-) rename {static/imgs => assets/Images}/asahiPFP.png (100%) rename {static/imgs => assets/Images}/notFound.png (100%) diff --git a/.gitignore b/.gitignore index 5f48730..4b19e9e 100644 --- a/.gitignore +++ b/.gitignore @@ -131,4 +131,5 @@ dist .pnp.* # Violet's Purgatory -static/cached \ No newline at end of file +static/cached +cached \ No newline at end of file diff --git a/static/imgs/asahiPFP.png b/assets/Images/asahiPFP.png similarity index 100% rename from static/imgs/asahiPFP.png rename to assets/Images/asahiPFP.png diff --git a/static/imgs/notFound.png b/assets/Images/notFound.png similarity index 100% rename from static/imgs/notFound.png rename to assets/Images/notFound.png diff --git a/index.js b/index.js index 11ead16..e998b23 100644 --- a/index.js +++ b/index.js @@ -15,11 +15,13 @@ app.listen(PORT, () => { console.log("Violet's Purgatory is now listening on port: " + PORT) }) -var cachePath = path.join(staticpath, 'cached') +var cachePath = path.join(__dirname, 'cached') var fontPath = path.join(staticpath, "fonts") +var assetPath = path.join(__dirname, "assets") app.use("/fonts", express.static(fontPath)) app.use("/cached", express.static(cachePath)) +app.use("/imgs", express.static(path.join(assetPath, "Images"))) if (!fs.existsSync(cachePath)) { fs.mkdirSync(cachePath) diff --git a/overcomplicatedStatuses.js b/overcomplicatedStatuses.js index 5bd7d91..cc47964 100644 --- a/overcomplicatedStatuses.js +++ b/overcomplicatedStatuses.js @@ -85,7 +85,7 @@ module.exports = { function get_img(activity, size = "large_image") { if (cachedImages[get_img_url(activity, size)]) { var fn = cachedImages[get_img_url(activity, size)] - var fp = path.join(__dirname, 'static/cached', fn) + var fp = path.join(__dirname, 'cached', fn) } else { return '/imgs/notFound.png' } diff --git a/pageUpdater.js b/pageUpdater.js index 43e250e..c21c283 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -122,16 +122,7 @@ module.exports = { var filePath = (req.baseUrl + req.path).trim() - if (filePath.includes("cached") || filePath.includes("imgs")) { - filePath = path.join(__dirname, 'static', filePath) - res.send(fs.readFileSync(filePath)) - - return - } - - if (filePath.includes(".")) { - - } else { + if (!filePath.includes(".")) { if (filePath.charAt(filePath.length - 1) != '/') { res.redirect(filePath + '/') return @@ -256,7 +247,7 @@ function socketeer() { if (get_img_url(activity)) { var url = get_img_url(activity) var fn = Math.ceil(Math.random() * 100_000_000_000).toString() - var fp = path.join(__dirname, 'static/cached', fn) + var fp = path.join(__dirname, 'cached', fn) if (!cachedImages[url]) { const response = await (await fetch(url)).arrayBuffer() @@ -270,7 +261,7 @@ function socketeer() { if (get_img_url(activity, "small_image")) { var url = get_img_url(activity, "small_image") var fn = Math.ceil(Math.random() * 100_000_000_000).toString() - var fp = path.join(__dirname, 'static/cached', fn) + var fp = path.join(__dirname, 'cached', fn) if (!cachedImages[url]) { const response = await (await fetch(url)).arrayBuffer() diff --git a/static/root.css b/static/root.css index b5dd08a..f3510fb 100644 --- a/static/root.css +++ b/static/root.css @@ -54,12 +54,12 @@ transform: scale(0.9); border-radius: 50%; rotate: 0deg; - transition: rotate 2s cubic-bezier(0.39, 0.575, 0.565, 1); } .pfp:active { - rotate: 1440deg; - transition: rotate 5s cubic-bezier(0.445, 0.05, 0.55, 0.95); + rotate: 7200deg; + transform: scale(1.1); + transition: all 5s cubic-bezier(0.445, 0.05, 0.55, 0.95) !important; } .CLAlign { @@ -69,7 +69,7 @@ img:not(.project-inner > div > img):not(.activity>img) { width: 100%; max-width: 168px; - /* transition: all 2s cubic-bezier(0.075, 0.82, 0.165, 1); */ + transition: all 2s cubic-bezier(0.075, 0.82, 0.165, 1); } @media screen and (min-width: 850px) {