', // HTML markup of popup, `mfp-close` will be replaced by the close button
patterns: {
youtube: {
index: 'youtube.com/', // String that detects type of video (in this case YouTube). Simply via url.indexOf(index).
id: function(url) {
// parse the id after the v=, but before other URL parameters
var matches = /v=([^&]+)/ig.exec(url) || [];
return matches[1];
},
src: '//www.youtube.com/embed/%id%?autoplay=1&rel=0' // URL that will be set as a source for iframe.
},
youtubeshort: {
index: 'youtu.be/', // String that detects type of video (in this case YouTube). Simply via url.indexOf(index).
id: function(url) {
var slashPos = url.lastIndexOf('/'),
vidId = url.substr(slashPos);
return vidId;
},
src: '//www.youtube.com/embed/%id%?autoplay=1' // URL that will be set as a source for iframe.
}
},
srcAction: 'iframe_src' // Templating object key. First part defines CSS selector, second attribute. "iframe_src" means: find "iframe" and set attribute "src".
}
})
.magnificPopup('open'); // open immediately
return false;
});
});
});
(function($) {
var markerVal = false;
var body = document.body;
//check motion preferences
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
// //if motion is reduced, disable animations
// if () {
// gsap.registerPlugin(ScrollTrigger);
// ScrollTrigger.defaults({animation: false});
// }
if (! (body.classList.contains('elementor-editor-active') || prefersReducedMotion.matches)) {
// Select all elements with the class "delayed-section" using document.querySelectorAll.
let delSections = document.querySelectorAll(".delayed-section");
delSections.forEach((elem, i) => {
var trigger = elem.querySelector(".innerContainer");
var img = elem.querySelector("img");
// gsap.set(img, { opacity: 0 });
gsap.set(img, { opacity: 1 });
const tl = gsap.timeline( {
scrollTrigger: {
trigger: trigger,
start: "+=133 80%",
end: "+=200 20%",
// scrub: true,
scrub: 0.5,
markers: markerVal,
toggleActions: "play reverse play reverse",
}
});
tl
.to(img, { opacity: 1, duration: 1, stagger: 0.1 })
// .to(img, { opacity: 0, duration: 1, stagger: 0.1 }, 0.8 )
;
});
document.addEventListener("DOMContentLoaded", function(){
var textItems = document.querySelectorAll('.sprigText, .social-content p');
textItems.forEach((elem, i) => {
gsap.set(elem, { opacity: 0, y:"100"});
const tl = gsap.timeline( {
scrollTrigger: {
trigger: elem,
start: "top 90%",
end: "top 70%",
// scrub: true,
scrub: 0.5,
markers: markerVal,
toggleActions: "play reverse play reverse",
}
});
tl.to(elem, { opacity: 1, y: "0"});
});
var collegesContainer = document.querySelector('.f-colleges');
var collegeRow = collegesContainer.querySelectorAll('.f-college-row');
collegeRow.forEach((elem, rowIndex) => {
var colleges = elem.querySelectorAll('.elementor-widget-call-to-action');
gsap.set(colleges, { opacity: 0, y: "100" });
colleges.forEach((college, collegeIndex) => {
function setOffset(collegeIndex){
if (window.innerWidth > 700) { // For larger screens
collegeoffset = collegeIndex;
} else { // For smaller screens
collegeoffset = 0;
}
return `top ${90 - collegeoffset * 5}%`;
}
// console.log("index: " + `top ${90 + collegeIndex * 5}vh`);
gsap.to(college, {
opacity: 1,
y: "0",
stagger: 0.3,
scrollTrigger: {
trigger: college,
start: () => setOffset(collegeIndex), // Staggered start based on college index
end: "top 70%",
scrub: 0.5,
toggleActions: "play reverse play reverse",
markers: markerVal, // Uncomment if you need
}
});
});
});
var ctaItems = document.querySelectorAll('.f-move-card > .e-con-inner');
ctaItems.forEach((elem, i) => {
gsap.set(elem, { opacity: 0, y:"100"});
const tl = gsap.timeline( {
scrollTrigger: {
trigger: elem,
start: "top 90%",
end: "top 70%",
// scrub: true,
scrub: 0.5,
markers: markerVal,
toggleActions: "play reverse play reverse",
}
});
tl.to(elem, { opacity: 1, y: "0"});
});
var newsRow = document.querySelectorAll('.homenews');
enterDom('.articlewrapper:first-child', function(el) {
setNewsAnimation();
});
function setNewsAnimation(){
newsRow.forEach((elem, rowIndex) => {
var newsItems = elem.querySelectorAll('.articlewrapper');
newsItems.forEach((newsItem, newsIndex) => {
gsap.set(newsItem, { opacity: 0, y:"100"});
function setOffset(newsIndex){
if (window.innerWidth > 700) { // For larger screens
offset = newsIndex;
} else { // For smaller screens
offset = 0;
}
return `top ${90 - offset * 5}%`;
}
// console.log("index: " + `top ${90 + newsIndex * 5}vh`);
gsap.to(newsItem, {
opacity: 1,
y: "0",
stagger: 0.3,
scrollTrigger: {
trigger: newsItem,
start: () => setOffset(newsIndex), // Staggered start based on college index
end: "top 70%",
scrub: 0.5,
toggleActions: "play reverse play reverse",
markers: markerVal, // Uncomment if you need
}
});
});
});
}
});
} //end if
// !function(e){"use strict";var t,n=[],r=e.document,o=e.MutationObserver||e.WebKitMutationObserver;function c(){for(var e,t,o=0,c=n.length;o