Skip to content

Commit

Permalink
feat: improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Jan 12, 2025
1 parent 7174d49 commit 84d9b3e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,11 @@ <h5 class="fw-bold mt-1 mb-0 ms-0 p-0" style="color: var(--bs-gray-900); font-si
<div class="fixed-top" id="offline-mode" style="opacity: 0; z-index: 1057; pointer-events: none;"></div>

<!-- Modal login -->
<div class="modal fade" id="mainModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-label="Modal Login" aria-hidden="true">
<div class="modal fade" id="mainModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="login-form" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content rounded-4">
<div class="modal-body">
<h5 style="display: none;" id="login-form">Login</h5>
<form>
<div class="mb-3">
<label for="loginEmail" class="form-label my-1"><i class="fa-solid fa-envelope me-2"></i>Email</label>
Expand Down
5 changes: 4 additions & 1 deletion js/app/admin/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ export const auth = (() => {
}

return res;
}, clearSession);
}, (res) => {
clearSession();
return res;
});
};

/**
Expand Down
11 changes: 7 additions & 4 deletions js/libs/confetti.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ const heartShape = () => {
};

/**
* @param {number} [until=15]
* @returns {void}
*/
export const openAnimation = () => {
const duration = 15 * 1000;
export const openAnimation = (until = 15) => {
const duration = until * 1000;
const animationEnd = Date.now() + duration;
const colors = ['#FFC0CB', '#FF1493', '#C71585'];

const heart = heartShape();
const colors = ['#FFC0CB', '#FF1493', '#C71585'];

const randomInRange = (min, max) => {
return Math.random() * (max - min) + min;
Expand Down Expand Up @@ -57,9 +59,10 @@ export const openAnimation = () => {
export const tapTapAnimation = (div) => {

const end = Date.now() + 25;
const colors = ['#ff69b4', '#ff1493'];
const yPosition = Math.max(0.3, Math.min(1, (div.getBoundingClientRect().top / window.innerHeight) + 0.2));

const heart = heartShape();
const colors = ['#FF69B4', '#FF1493'];

(function frame() {
colors.forEach((color) => {
Expand Down

0 comments on commit 84d9b3e

Please sign in to comment.