[Fix]: Bring back performance

Oooopsie
This commit is contained in:
ClaraCrazy 2025-12-28 01:24:39 +01:00
parent 214e7d31eb
commit 093a358f05
No known key found for this signature in database
GPG key ID: EBBC896ACB497011
2 changed files with 7 additions and 16 deletions

View file

@ -14,8 +14,11 @@ document.addEventListener('DOMContentLoaded', () => {
} }
function initExpiryTimers(expiryTime, expiryUnit) { function initExpiryTimers(expiryTime, expiryUnit) {
// Cache timer elements on init instead of querying every second
let timers = document.querySelectorAll('.expiry-timer');
if (timers.length === 0) return; // Don't set interval if no timers exist
function updateExpiryTimers() { function updateExpiryTimers() {
const timers = document.querySelectorAll('.expiry-timer');
const now = new Date(); const now = new Date();
timers.forEach(el => { timers.forEach(el => {
const dateStr = el.dataset.date; const dateStr = el.dataset.date;
@ -37,8 +40,8 @@ document.addEventListener('DOMContentLoaded', () => {
el.textContent = `Expires in ${hours}h ${minutes}m ${seconds}s`; el.textContent = `Expires in ${hours}h ${minutes}m ${seconds}s`;
}); });
} }
setInterval(updateExpiryTimers, 1000); updateExpiryTimers(); // Call once immediately
updateExpiryTimers(); setInterval(updateExpiryTimers, 1000); // Then every second
} }
function formatEmailDates() { function formatEmailDates() {

View file

@ -6,8 +6,6 @@ body {
flex-direction: column; flex-direction: column;
background: linear-gradient( 135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)), #131516; background: linear-gradient( 135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)), #131516;
color: #cccccc; color: #cccccc;
backdrop-filter: blur(18px) saturate(120%);
-webkit-backdrop-filter: blur(18px) saturate(120%);
border: 1px solid rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.12);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
} }
@ -91,6 +89,7 @@ text-muted {
} }
.action-links { .action-links {
margin-bottom: 15px;
float: right; float: right;
justify-content: flex-end; justify-content: flex-end;
/* aligns all links to the right */ /* aligns all links to the right */
@ -109,7 +108,6 @@ text-muted {
letter-spacing: 0.5px; letter-spacing: 0.5px;
transition: all 0.3s ease; transition: all 0.3s ease;
border: 1px solid rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.15);
backdrop-filter: blur(10px);
position: relative; position: relative;
overflow: hidden; overflow: hidden;
text-decoration: none; text-decoration: none;
@ -162,8 +160,6 @@ select:hover {
max-width: 600px; max-width: 600px;
margin: auto; margin: auto;
background: linear-gradient( 135deg, rgba(155, 77, 202, 0.12), rgba(155, 77, 202, 0.04)), rgba(255, 255, 255, 0.04); background: linear-gradient( 135deg, rgba(155, 77, 202, 0.12), rgba(155, 77, 202, 0.04)), rgba(255, 255, 255, 0.04);
backdrop-filter: blur(20px) saturate(125%);
-webkit-backdrop-filter: blur(20px) saturate(125%);
border-radius: 22px; border-radius: 22px;
border: 1px solid rgba(155, 77, 202, 0.25); border: 1px solid rgba(155, 77, 202, 0.25);
padding: 40px 36px; padding: 40px 36px;
@ -239,8 +235,6 @@ select:hover {
color: #fff; color: #fff;
background: rgba(155, 77, 202, 0.2); background: rgba(155, 77, 202, 0.2);
border: 1px solid rgba(155, 77, 202, 0.35); border: 1px solid rgba(155, 77, 202, 0.35);
backdrop-filter: blur(12px) saturate(120%);
-webkit-backdrop-filter: blur(12px) saturate(120%);
box-shadow: 0 8px 20px rgba(155, 77, 202, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08); box-shadow: 0 8px 20px rgba(155, 77, 202, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
cursor: pointer; cursor: pointer;
transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
@ -319,7 +313,6 @@ label {
} }
.email-card { .email-card {
backdrop-filter: blur(20px);
border-radius: 18px; border-radius: 18px;
border: 1px solid rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.08);
padding: 24px; padding: 24px;
@ -416,7 +409,6 @@ label {
.empty-card { .empty-card {
background: rgba(255, 255, 255, 0.03); background: rgba(255, 255, 255, 0.03);
backdrop-filter: blur(20px);
border-radius: 20px; border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.08);
padding: 50px; padding: 50px;
@ -450,7 +442,6 @@ label {
.mail-header { .mail-header {
background: rgba(255, 255, 255, 0.03); background: rgba(255, 255, 255, 0.03);
backdrop-filter: blur(20px);
border-radius: 20px; border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.08);
padding: 30px; padding: 30px;
@ -480,7 +471,6 @@ label {
.mail-content { .mail-content {
background: rgba(255, 255, 255, 0.02); background: rgba(255, 255, 255, 0.02);
backdrop-filter: blur(15px);
border-radius: 18px; border-radius: 18px;
border: 1px solid rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.06);
padding: 30px; padding: 30px;
@ -493,7 +483,6 @@ label {
border: 1px solid rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.1);
width: 100%; width: 100%;
min-height: 40vh; min-height: 40vh;
backdrop-filter: blur(10px);
} }
.mail-text-content { .mail-text-content {
@ -513,7 +502,6 @@ label {
.mail-attachments { .mail-attachments {
background: rgba(255, 255, 255, 0.03); background: rgba(255, 255, 255, 0.03);
backdrop-filter: blur(20px);
border-radius: 18px; border-radius: 18px;
border: 1px solid rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.08);
padding: 25px; padding: 25px;