Skip to content

Commit

Permalink
fix(ui): 🐛 Updat fade out animation (was practically slower, but not …
Browse files Browse the repository at this point in the history
…teorically)
  • Loading branch information
AlexDeveloperUwU committed Dec 17, 2024
1 parent 41c4140 commit 5bce26b
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 40 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"conventionalCommits.scopes": [
"ui"
]
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"problemMatcher": [],
"isBackground": true,
"label": "Server",
"detail": "nodemon index.js",
"detail": "npm run init",
"runOptions": {
"runOn": "folderOpen"
}
Expand Down
18 changes: 1 addition & 17 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import morgan from "morgan";
import compression from "compression";
import fs from "fs";
import rateLimiter from "./serverUtils/js/ratelimiter.js";
import { ensureDirExists, cleanOldLogs, verifyEnvVars } from "./serverUtils/js/startup.js";
import { ensureDirExists, cleanOldLogs} from "./serverUtils/js/startup.js";
import setupAuth from "./serverUtils/js/auth.js";

// Inicialización del servidor Express
Expand Down Expand Up @@ -126,22 +126,6 @@ import apiRoutes from "./routes/api.js";
app.use(apiRoutes);
app.use(publicRoutes);

// Verificación de variables de entorno necesarias
const requiredEnvVars = [
"formWebhookUrl",
"logsWebhookUrl",
"discordClientId",
"discordClientSecret",
"discordCallbackUrl",
"sessionSecret",
"hetrixApiToken",
"homecoreId",
"codenexisId",
"loadrunnerId",
];

verifyEnvVars(requiredEnvVars);

// Inicio del servidor
app.listen(port, () => {
console.log(`Servidor escuchando en http://localhost:${port}`);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"description": "Mi página web oficial, hecha de forma que sea más interactiva y dinámica",
"main": "index.js",
"scripts": {
"init": "nodemon --ignore data/* index.js",
"init": "nodemon --ignore data/* --ignore public/* index.js",
"css": "npx tailwindcss -i ./public/css/tailwind.css -o ./public/css/main.css --watch --minify",
"minify": "node ./utils/minify.js",
"autominify": "npm run minify"
Expand Down
2 changes: 1 addition & 1 deletion public/css/main.css

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions public/css/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ body {
}

.fade-out {
animation: fadeOut 0.5s forwards;
animation: fadeOut 0.4s forwards; // Tiene que ser un segundo menos bc god knows why :D
}

.hidden {
Expand All @@ -246,10 +246,9 @@ body {

.latestVideoEmbed {
width: 100%;
height: 500px; /* Ajusta la altura según sea necesario */
height: 500px;
}

/* Asegúrate de que las clases responsive-iframe tienen un tamaño adecuado */
.responsive-iframe2 {
width: 100%;
height: 100%;
Expand Down
11 changes: 8 additions & 3 deletions public/js/common/mainIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ function showMainContent() {
const mainContent = document.querySelector("main");
mainContent.classList.remove("hidden");
mainContent.classList.add("fade-in");

setTimeout(function () {
mainContent.classList.remove("fade-in");
}, 500);
}

window.addEventListener("load", function () {
setTimeout(function () {
showMainContent();
}, 600);
}, 500);
});

function fadeOutMainContent(callback) {
Expand All @@ -19,16 +23,17 @@ function fadeOutMainContent(callback) {
mainContent.classList.add("hidden");
mainContent.classList.remove("fade-out");
callback();
}, 605);
}, 400);
}

document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("click", function (event) {
const link = event.target.closest('a[href*="?view="]');
const link = event.target.closest('a[href*="?view="], a[href^="/"]');

if (link) {
event.preventDefault();
const url = link.href;

fadeOutMainContent(function () {
window.location.href = url;
});
Expand Down
6 changes: 3 additions & 3 deletions public/js/common/mainOthers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function showMainContent() {
window.addEventListener("load", function () {
setTimeout(function () {
showMainContent();
}, 600);
}, 500);
});

function fadeOutMainContent(callback) {
Expand Down Expand Up @@ -44,12 +44,12 @@ function fadeOutMainContent(callback) {
}

callback();
}, 605);
}, 400);
}

document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("click", function (event) {
const link = event.target.closest('a[href*="?view="]');
const link = event.target.closest('a[href*="?view="], a[href^="/"]');

if (link) {
event.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion public/js/minified/common/mainIndex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/js/minified/common/mainOthers.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions serverUtils/js/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,4 @@ export function clearCacheDirectory(cacheDir) {
fs.unlinkSync(path.join(cacheDir, file));
});
});
}

export function verifyEnvVars(requiredVars) {
requiredVars.forEach((varName) => {
if (!process.env[varName]) {
throw new Error(`La variable de entorno ${varName} no está definida o no tiene un valor.`);
}
});
}
}

0 comments on commit 5bce26b

Please sign in to comment.