Skip to content

Commit

Permalink
Final: Enhance app functionalities (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangsonww committed Jan 18, 2025
1 parent b6cbfc9 commit c38c5e3
Show file tree
Hide file tree
Showing 35 changed files with 1,252 additions and 30 deletions.
13 changes: 12 additions & 1 deletion MovieVerse-Frontend/js/create-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,17 @@ const firebaseConfig = {
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

function showSpinner() {
document.getElementById('myModal').classList.add('modal-visible');
}

function hideSpinner() {
document.getElementById('myModal').classList.remove('modal-visible');
}

document.getElementById('createAccountForm').addEventListener('submit', async e => {
showSpinner();

try {
e.preventDefault();
const email = document.getElementById('newEmail').value;
Expand Down Expand Up @@ -128,8 +138,9 @@ document.getElementById('createAccountForm').addEventListener('submit', async e
"Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!";
noUserSelected.style.height = '350px';
}
hideSpinner();
}
} finally {
hideSpinner();
}
});

Expand Down
5 changes: 4 additions & 1 deletion MovieVerse-Frontend/js/reset-password.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

document.getElementById('resetPasswordForm').addEventListener('submit', async function (event) {
showSpinner();

try {
event.preventDefault();
const resetEmail = document.getElementById('resetEmail').value;
Expand All @@ -65,8 +67,9 @@ document.getElementById('resetPasswordForm').addEventListener('submit', async fu
"Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!";
noUserSelected.style.height = '350px';
}
hideSpinner();
}
} finally {
hideSpinner();
}
});

Expand Down
13 changes: 12 additions & 1 deletion MovieVerse-Frontend/js/sign-in.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,19 @@ const firebaseConfig = {
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

function showSpinner() {
document.getElementById('myModal').classList.add('modal-visible');
}

function hideSpinner() {
document.getElementById('myModal').classList.remove('modal-visible');
}

document.getElementById('signInForm').addEventListener('submit', async function (event) {
event.preventDefault();

showSpinner();

try {
const email = document.getElementById('signInEmail').value;
const password = document.getElementById('signInPassword').value;
Expand All @@ -70,8 +80,9 @@ document.getElementById('signInForm').addEventListener('submit', async function
"Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!";
noUserSelected.style.height = '350px';
}
hideSpinner();
}
} finally {
hideSpinner();
}
});

Expand Down
13 changes: 12 additions & 1 deletion MovieVerse-Mobile/app/js/create-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,17 @@ const firebaseConfig = {
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

function showSpinner() {
document.getElementById('myModal').classList.add('modal-visible');
}

function hideSpinner() {
document.getElementById('myModal').classList.remove('modal-visible');
}

document.getElementById('createAccountForm').addEventListener('submit', async e => {
showSpinner();

try {
e.preventDefault();
const email = document.getElementById('newEmail').value;
Expand Down Expand Up @@ -128,8 +138,9 @@ document.getElementById('createAccountForm').addEventListener('submit', async e
"Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!";
noUserSelected.style.height = '350px';
}
hideSpinner();
}
} finally {
hideSpinner();
}
});

Expand Down
4 changes: 2 additions & 2 deletions MovieVerse-Mobile/app/js/dinosaur-jump.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const ctx = canvas.getContext('2d');
// Dino properties
let dino = {
x: 50,
y: canvas.height - 50, // Start at the bottom
y: canvas.height - 50,
width: 20,
height: 20,
vy: 0,
Expand All @@ -17,7 +17,7 @@ let gameSpeed = 3;
let score = 0;
let isGameOver = false;
let spawnTimer = 0; // Timer to control obstacle spawns
const spawnInterval = 120; // Minimum frames between spawns (e.g., 2 seconds at 60 FPS)
const spawnInterval = 100; // Minimum frames between spawns (e.g., 2 seconds at 60 FPS)

// Key press or tap to jump
function handleJump() {
Expand Down
5 changes: 4 additions & 1 deletion MovieVerse-Mobile/app/js/reset-password.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

document.getElementById('resetPasswordForm').addEventListener('submit', async function (event) {
showSpinner();

try {
event.preventDefault();
const resetEmail = document.getElementById('resetEmail').value;
Expand All @@ -65,8 +67,9 @@ document.getElementById('resetPasswordForm').addEventListener('submit', async fu
"Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!";
noUserSelected.style.height = '350px';
}
hideSpinner();
}
} finally {
hideSpinner();
}
});

Expand Down
13 changes: 12 additions & 1 deletion MovieVerse-Mobile/app/js/sign-in.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,19 @@ const firebaseConfig = {
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

function showSpinner() {
document.getElementById('myModal').classList.add('modal-visible');
}

function hideSpinner() {
document.getElementById('myModal').classList.remove('modal-visible');
}

document.getElementById('signInForm').addEventListener('submit', async function (event) {
event.preventDefault();

showSpinner();

try {
const email = document.getElementById('signInEmail').value;
const password = document.getElementById('signInPassword').value;
Expand All @@ -70,8 +80,9 @@ document.getElementById('signInForm').addEventListener('submit', async function
"Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!";
noUserSelected.style.height = '350px';
}
hideSpinner();
}
} finally {
hideSpinner();
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,17 @@ const firebaseConfig = {
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

function showSpinner() {
document.getElementById('myModal').classList.add('modal-visible');
}

function hideSpinner() {
document.getElementById('myModal').classList.remove('modal-visible');
}

document.getElementById('createAccountForm').addEventListener('submit', async e => {
showSpinner();

try {
e.preventDefault();
const email = document.getElementById('newEmail').value;
Expand Down Expand Up @@ -128,8 +138,9 @@ document.getElementById('createAccountForm').addEventListener('submit', async e
"Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!";
noUserSelected.style.height = '350px';
}
hideSpinner();
}
} finally {
hideSpinner();
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

document.getElementById('resetPasswordForm').addEventListener('submit', async function (event) {
showSpinner();

try {
event.preventDefault();
const resetEmail = document.getElementById('resetEmail').value;
Expand All @@ -65,8 +67,9 @@ document.getElementById('resetPasswordForm').addEventListener('submit', async fu
"Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!";
noUserSelected.style.height = '350px';
}
hideSpinner();
}
} finally {
hideSpinner();
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,19 @@ const firebaseConfig = {
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

function showSpinner() {
document.getElementById('myModal').classList.add('modal-visible');
}

function hideSpinner() {
document.getElementById('myModal').classList.remove('modal-visible');
}

document.getElementById('signInForm').addEventListener('submit', async function (event) {
event.preventDefault();

showSpinner();

try {
const email = document.getElementById('signInEmail').value;
const password = document.getElementById('signInPassword').value;
Expand All @@ -70,8 +80,9 @@ document.getElementById('signInForm').addEventListener('submit', async function
"Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!";
noUserSelected.style.height = '350px';
}
hideSpinner();
}
} finally {
hideSpinner();
}
});

Expand Down
Loading

0 comments on commit c38c5e3

Please sign in to comment.