Skip to content

Commit

Permalink
made all videos responsive and lazy load
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshvdw committed Dec 12, 2024
1 parent 4e836a7 commit 3d059d9
Show file tree
Hide file tree
Showing 6 changed files with 257 additions and 56 deletions.
14 changes: 11 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import loadAnim from "./js/home/loadAnim";
import audioImplementation from "./js/global/audio";
import { showreelHome, showreelNav } from "./js/global/showreel";
import { stopCmdClick } from "./js/global/bugFixes";
// import setLogoHref from "./js/pitches/setLogoHref";
import {
responsiveHomeVideos,
responsiveNavShowreel,
lazyLoadHomeVideos,
} from "./js/global/dynamicVideos";

const parceled = true; // for checking localhost vs github pages / CDN
const currentPage = window.location.pathname;
Expand All @@ -15,13 +19,17 @@ const homePage = currentPage == "/";
const onReady = () => {
readyPreloader(); // hides preloader and add event listener for frog lottie
const audio = audioImplementation(homePage); // adds music, ui-sounds and mute-lottie functionality
if (homePage) showreelHome(audio); // code for homepage showreel video
responsiveNavShowreel();
if (homePage) {
responsiveHomeVideos();
lazyLoadHomeVideos();
showreelHome(audio); // code for homepage showreel video
}
showreelNav(audio); // code for nav showreel video
initProjectLotties(); // initiates project lotties for home and work pages
copyEmail(); // copies email to clipboard in footer
initCms(); // sets color hovers and cms filtering style for work page & content hub
document.querySelector(".landing-video-container") && loadAnim(); // for home page intro anim
// document.querySelector(".client-link") && setLogoHref();
document.querySelectorAll(".article-rich-text a").forEach((e) => {
e.target = "_blank";
});
Expand Down
167 changes: 119 additions & 48 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.

4 changes: 2 additions & 2 deletions js/global/audio.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default function audioImplementation(homePage) {
const showreelHome = document.querySelector("#showreel_home");
const showreelNav = document.querySelector("#showreel_nav");
const showreelHome = document.querySelector("#showreel_video");
const showreelNav = document.querySelector("#showreelNavXL");

// MOBILE CHECK
window.mobileCheck = function () {
Expand Down
Loading

0 comments on commit 3d059d9

Please sign in to comment.