Skip to content

Commit

Permalink
fixed mute, unmute functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshvdw committed Jan 24, 2024
1 parent 668efda commit 27b924f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import { stopCmdClick } from "./js/global/bugFixes";
const parceled = true; // for checking localhost vs github pages / CDN
const currentPage = window.location.pathname;
const homePage = currentPage == "/";
// alert("local");

const onReady = () => {
// alert("local");
readyPreloader(); // hides preloader and add event listener for frog lottie
const page = window.location.pathname.split("/").pop();
const audio = audioImplementation(homePage); // adds music, ui-sounds and mute-lottie functionality
Expand Down
7 changes: 5 additions & 2 deletions dist/app.js

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

2 changes: 1 addition & 1 deletion dist/app.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion js/global/showreel.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function showreelHome(audio) {

// FIRST CLICK LOGIC
function firstClickLogic() {
console.log("first click logic");
showreelVideo.muted = false; //unmute video
showreelVideo.currentTime = 0; //restart video
clickToUnmuteUI.style.display = "none"; //hide unmute ui
Expand All @@ -42,6 +43,7 @@ export function showreelHome(audio) {

// SECOND CLICK LOGIC
function secondClickLogic() {
console.log("second click logic");
showreelVideo.muted = true; //mute video again
if (!showreelMuteState()) fadeMusicToggle(); //if unmuted, toggle music fade
clickToUnmuteUI.style.opacity = "100"; // set unmute opacity to 100
Expand All @@ -52,10 +54,11 @@ export function showreelHome(audio) {

// THIRD CLICK LOGIC
function thirdClickLogic() {
console.log("third click logic");
showreelVideo.muted = false; //unmute video
if (!showreelMuteState()) fadeMusicToggle(); //if unmuted, toggle music fade
clickToUnmuteUI.style.display = "none"; //hide unmute ui
clickLogic = "twice"; //update click logic
clickLogic = "once"; //update click logic
outOfView = false; //ensure out of view logic is false
}

Expand Down

0 comments on commit 27b924f

Please sign in to comment.