2022-09-02 13:59:11 +00:00
|
|
|
var bodyRect = document.body.getBoundingClientRect();
|
|
|
|
|
|
2022-10-07 13:37:57 +00:00
|
|
|
// TODO: pull these from data js
|
2022-09-14 16:05:58 +00:00
|
|
|
const sections = [
|
|
|
|
|
"pitch",
|
|
|
|
|
"products",
|
|
|
|
|
"infographics",
|
|
|
|
|
"bitcoin",
|
|
|
|
|
"be-your-own",
|
|
|
|
|
"powered-by",
|
|
|
|
|
"support",
|
|
|
|
|
"dev",
|
|
|
|
|
"community",
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const bitcoinServices = [
|
|
|
|
|
"balanceofsatoshis",
|
|
|
|
|
"bitcoind",
|
|
|
|
|
"btc-rpc-proxy",
|
|
|
|
|
"btcpayserver",
|
|
|
|
|
"c-lightning",
|
|
|
|
|
"electrs",
|
|
|
|
|
"lightning-jet",
|
|
|
|
|
"lnd",
|
|
|
|
|
"lightning-terminal",
|
|
|
|
|
"lndg",
|
|
|
|
|
"mempool",
|
|
|
|
|
"ride-the-lightning",
|
|
|
|
|
"spark-wallet",
|
|
|
|
|
"specter",
|
|
|
|
|
"sphinx-relay",
|
|
|
|
|
"thunderhub",
|
|
|
|
|
];
|
2022-09-02 13:59:11 +00:00
|
|
|
|
2022-09-18 15:37:00 +00:00
|
|
|
//const defaultActions = "restart none none reverse";
|
|
|
|
|
const defaultActions = "play none none none"; //onEnter, onLeave, onEnterBack, and onLeaveBack
|
|
|
|
|
// "play", "pause", "resume", "reset", "restart", "complete", "reverse", and "none".
|
|
|
|
|
|
2022-09-02 13:59:11 +00:00
|
|
|
//////////////////////////////////////////
|
|
|
|
|
// AUTO APPLY URL ANCHORS
|
|
|
|
|
|
2022-09-14 16:05:58 +00:00
|
|
|
// setTimeout(function () {
|
|
|
|
|
// // timeout to allow initial load to redirect to anchor
|
|
|
|
|
// // TODO: maybe apply the scroll-behavior: smooth to HTML after a timeout
|
2022-09-02 13:59:11 +00:00
|
|
|
|
2022-09-14 16:05:58 +00:00
|
|
|
// sections.forEach((slug) => {
|
|
|
|
|
// ScrollTrigger.create({
|
|
|
|
|
// trigger: "#" + slug,
|
2022-10-07 13:37:57 +00:00
|
|
|
// start: "top 25%",
|
|
|
|
|
// end: "bottom 25%",
|
2022-09-14 16:05:58 +00:00
|
|
|
// //markers: { startColor: "white", endColor: "white" },
|
|
|
|
|
// onEnter: () => {
|
|
|
|
|
// window.location.href = "#" + slug;
|
|
|
|
|
// },
|
|
|
|
|
// onEnterBack: () => {
|
|
|
|
|
// window.location.href = "#" + slug;
|
|
|
|
|
// },
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// }, 2000);
|
2022-09-02 13:59:11 +00:00
|
|
|
|
2022-07-19 14:25:29 +00:00
|
|
|
//gsap.config({trialWarn: false});
|
|
|
|
|
|
|
|
|
|
// create the smooth scroller FIRST!
|
|
|
|
|
// ScrollSmoother.create({
|
|
|
|
|
// smooth: 2, // seconds it takes to "catch up" to native scroll position
|
|
|
|
|
// effects: true, // look for data-speed and data-lag attributes on elements and animate accordingly
|
|
|
|
|
// wrapper: '.scroll_track',
|
|
|
|
|
// content: '.scroll_track_content'
|
|
|
|
|
// });
|
|
|
|
|
|
2022-09-02 13:59:11 +00:00
|
|
|
// backdrop-filter: blur(10px);
|
|
|
|
|
//background-color: rgba(0,0,0,0.1);
|
|
|
|
|
|
2022-07-28 11:55:52 +00:00
|
|
|
gsap.from("#hero-to-pitch path:first-child", {
|
2022-09-02 13:59:11 +00:00
|
|
|
drawSVG: 0,
|
|
|
|
|
ease: "none",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#hero-to-pitch",
|
|
|
|
|
scrub: true,
|
2022-10-18 14:13:05 +00:00
|
|
|
start: "top 50%", // "triggerElement page"
|
|
|
|
|
end: "bottom 50%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////
|
|
|
|
|
// PITCH
|
|
|
|
|
|
2022-09-25 14:52:59 +00:00
|
|
|
gsap.from("#pitch h1, #pitch p", {
|
2022-09-18 15:37:00 +00:00
|
|
|
duration: 0.5,
|
|
|
|
|
y: "5rem",
|
|
|
|
|
scale: 0.9,
|
|
|
|
|
opacity: 0,
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#pitch",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-10-18 15:55:41 +00:00
|
|
|
// gsap.from("#pitch iframe", {
|
|
|
|
|
// duration: 0.5,
|
|
|
|
|
// opacity: 0,
|
|
|
|
|
// filter: "blur(10px)",
|
|
|
|
|
// scrollTrigger: {
|
|
|
|
|
// trigger: "#pitch",
|
|
|
|
|
// start: "top 75%", // "triggerElement page"
|
|
|
|
|
// toggleActions: defaultActions,
|
|
|
|
|
// },
|
|
|
|
|
// });
|
2022-09-25 14:52:59 +00:00
|
|
|
|
2022-09-18 15:37:00 +00:00
|
|
|
//////////////////////////////////////////
|
|
|
|
|
// PRODUCTS
|
|
|
|
|
|
|
|
|
|
gsap.from("#products .subsection:nth-child(1)", {
|
|
|
|
|
duration: 0.5,
|
|
|
|
|
opacity: 0,
|
|
|
|
|
outline: "1px solid rgba(255,255,255,1)",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#products",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gsap.from("#products .subsection:nth-child(2)", {
|
|
|
|
|
duration: 0.5,
|
|
|
|
|
delay: 0.25,
|
|
|
|
|
opacity: 0,
|
|
|
|
|
outline: "1px solid rgba(255,255,255,1)",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#products",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-02 13:59:11 +00:00
|
|
|
},
|
|
|
|
|
});
|
2022-07-28 11:55:52 +00:00
|
|
|
|
2022-10-07 13:37:57 +00:00
|
|
|
const buyAnchor = document.querySelector(".product--buy");
|
2022-09-19 10:11:15 +00:00
|
|
|
|
|
|
|
|
const buyTL = gsap
|
2022-10-07 13:37:57 +00:00
|
|
|
.timeline({ paused: true })
|
|
|
|
|
.from(
|
2022-10-07 16:36:05 +00:00
|
|
|
"#buy-real-lines path:first-child",
|
2022-10-07 13:37:57 +00:00
|
|
|
{ drawSVG: 0, ease: "none", duration: 0.75 },
|
|
|
|
|
0
|
|
|
|
|
)
|
|
|
|
|
.to(
|
2022-10-18 15:55:41 +00:00
|
|
|
".product__buy-image",
|
2022-10-07 13:37:57 +00:00
|
|
|
{ opacity: 0.4, ease: "none", duration: 0.25 },
|
|
|
|
|
0
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
buyAnchor.onmouseenter = () => buyTL.play();
|
|
|
|
|
buyAnchor.onmouseleave = () => buyTL.reverse();
|
|
|
|
|
|
2022-10-18 15:55:41 +00:00
|
|
|
// const diyAnchor = document.querySelector(".product--diy");
|
2022-09-19 10:11:15 +00:00
|
|
|
|
2022-10-18 15:55:41 +00:00
|
|
|
// const diyTL = gsap
|
|
|
|
|
// .timeline({ paused: true })
|
|
|
|
|
// .from(
|
|
|
|
|
// "#diy-lines path:first-child",
|
|
|
|
|
// { drawSVG: 0, ease: "none", duration: 0.75 },
|
|
|
|
|
// 0
|
|
|
|
|
// )
|
|
|
|
|
// .to(
|
|
|
|
|
// ".product--diy img:first-child",
|
|
|
|
|
// { opacity: 0.4, ease: "none", duration: 0.25 },
|
|
|
|
|
// 0
|
|
|
|
|
// );
|
2022-10-07 13:37:57 +00:00
|
|
|
|
2022-10-18 15:55:41 +00:00
|
|
|
// diyAnchor.onmouseenter = () => diyTL.play();
|
|
|
|
|
// diyAnchor.onmouseleave = () => diyTL.reverse();
|
2022-09-19 10:11:15 +00:00
|
|
|
|
2022-09-02 13:59:11 +00:00
|
|
|
gsap.from("#products-to-info path:first-child", {
|
|
|
|
|
drawSVG: 0,
|
|
|
|
|
ease: "none",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#products-to-info path:first-child",
|
|
|
|
|
scrub: true,
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
|
|
|
|
end: "bottom 75%", // "triggerElement page"
|
2022-09-02 13:59:11 +00:00
|
|
|
},
|
|
|
|
|
});
|
2022-07-28 11:55:52 +00:00
|
|
|
|
2022-10-18 15:55:41 +00:00
|
|
|
// gsap.from("#products-to-info path:nth-child(2)", {
|
|
|
|
|
// drawSVG: 0,
|
|
|
|
|
// ease: "none",
|
|
|
|
|
// scrollTrigger: {
|
|
|
|
|
// trigger: "#products-to-info path:nth-child(2)",
|
|
|
|
|
// scrub: true,
|
|
|
|
|
// start: "top 75%", // "triggerElement page"
|
|
|
|
|
// end: "bottom 75%", // "triggerElement page"
|
|
|
|
|
// },
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// gsap.from("#products-to-info path:nth-child(3)", {
|
|
|
|
|
// drawSVG: 0,
|
|
|
|
|
// ease: "none",
|
|
|
|
|
// scrollTrigger: {
|
|
|
|
|
// trigger: "#products-to-info path:nth-child(3)",
|
|
|
|
|
// scrub: true,
|
|
|
|
|
// start: "top 75%", // "triggerElement page"
|
|
|
|
|
// end: "bottom 75%", // "triggerElement page"
|
|
|
|
|
// },
|
|
|
|
|
// });
|
2022-07-28 11:55:52 +00:00
|
|
|
|
2022-09-18 15:37:00 +00:00
|
|
|
//////////////////////////////////////////
|
|
|
|
|
// INFOGRAPHICS
|
|
|
|
|
|
|
|
|
|
gsap.from("#infographics .subsection:nth-child(1)", {
|
|
|
|
|
duration: 0.5,
|
|
|
|
|
opacity: 0,
|
|
|
|
|
outline: "1px solid rgba(255,255,255,1)",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#infographics .subsection:nth-child(1)",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gsap.from("#infographics .subsection:nth-child(2)", {
|
|
|
|
|
duration: 0.5,
|
|
|
|
|
opacity: 0,
|
|
|
|
|
outline: "1px solid rgba(255,255,255,1)",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#infographics .subsection:nth-child(2)",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////
|
2022-09-14 16:05:58 +00:00
|
|
|
// BITCOIN
|
|
|
|
|
|
2022-09-18 15:37:00 +00:00
|
|
|
gsap.from("#bitcoin .subsection:nth-of-type(1)", {
|
|
|
|
|
duration: 1,
|
|
|
|
|
opacity: 0,
|
|
|
|
|
filter: "blur(10px)",
|
|
|
|
|
y: "5rem",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#bitcoin .subsection:nth-of-type(1)",
|
|
|
|
|
start: "top bottom", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gsap.from("#bitcoin .subsection:nth-of-type(2)", {
|
|
|
|
|
duration: 1,
|
|
|
|
|
opacity: 0,
|
|
|
|
|
filter: "blur(10px)",
|
|
|
|
|
y: "-5rem",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#bitcoin .subsection:nth-of-type(2)",
|
|
|
|
|
start: "top bottom", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-09-14 16:05:58 +00:00
|
|
|
function getRandomInt(min, max) {
|
|
|
|
|
min = Math.ceil(min);
|
|
|
|
|
max = Math.floor(max);
|
|
|
|
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getRandomNumber(min, max) {
|
|
|
|
|
return Math.random() * (max - min) + min;
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-07 13:37:57 +00:00
|
|
|
//positionServiceIcons();
|
|
|
|
|
|
|
|
|
|
const timelineServiceIcons = gsap.timeline({
|
|
|
|
|
onComplete() {
|
|
|
|
|
//deleteSplit();
|
|
|
|
|
//scroll.update();
|
|
|
|
|
//resolve();
|
|
|
|
|
console.log("complete");
|
|
|
|
|
},
|
|
|
|
|
});
|
2022-09-25 14:52:59 +00:00
|
|
|
|
|
|
|
|
function positionServiceIcons() {
|
2022-10-07 13:37:57 +00:00
|
|
|
console.log("positionServiceIcons");
|
|
|
|
|
|
|
|
|
|
bitcoinServices.forEach((service, i) => {
|
|
|
|
|
var serviceClass = ".service-icon--" + service;
|
|
|
|
|
|
|
|
|
|
gsap.set(serviceClass, {});
|
|
|
|
|
gsap.to(serviceClass, {});
|
|
|
|
|
|
|
|
|
|
const serviceElement = document.querySelector(serviceClass);
|
2022-09-25 14:52:59 +00:00
|
|
|
const bitcoinSectionElement = document.querySelector("#bitcoin");
|
2022-10-07 13:37:57 +00:00
|
|
|
const upOrDown = i % 2;
|
2022-09-25 14:52:59 +00:00
|
|
|
const bitcoinHeight = bitcoinSectionElement.clientHeight;
|
|
|
|
|
|
|
|
|
|
serviceElement
|
|
|
|
|
? (serviceElement.style.left = getRandomInt(5, 90) + "vw")
|
|
|
|
|
: "";
|
|
|
|
|
|
|
|
|
|
if (upOrDown) {
|
2022-10-07 13:37:57 +00:00
|
|
|
gsap.set(serviceClass, {
|
2022-09-25 14:52:59 +00:00
|
|
|
y: getRandomInt(0, bitcoinHeight / 2) + "px",
|
|
|
|
|
});
|
2022-10-07 13:37:57 +00:00
|
|
|
gsap.to(serviceClass, {
|
2022-09-25 14:52:59 +00:00
|
|
|
y: getRandomInt(bitcoinHeight / 2, bitcoinHeight) + "px",
|
|
|
|
|
//x: getRandomInt(0, 100) + "vw",
|
|
|
|
|
ease: "in",
|
|
|
|
|
delay: getRandomNumber(0, 1),
|
2022-10-07 13:37:57 +00:00
|
|
|
overwrite: true,
|
2022-09-25 14:52:59 +00:00
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#bitcoin",
|
|
|
|
|
scrub: true,
|
|
|
|
|
start: "top 25%",
|
|
|
|
|
end: "90% center", // "triggerElement page"
|
|
|
|
|
//markers: { startColor: "lime", endColor: "lime" },
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
} else {
|
2022-10-07 13:37:57 +00:00
|
|
|
gsap.set(serviceClass, {
|
2022-09-25 14:52:59 +00:00
|
|
|
y: getRandomInt(bitcoinHeight / 2, bitcoinHeight) + "px",
|
|
|
|
|
});
|
2022-10-07 13:37:57 +00:00
|
|
|
gsap.to(serviceClass, {
|
2022-09-25 14:52:59 +00:00
|
|
|
y: getRandomInt(0, bitcoinHeight / 2) + "px",
|
|
|
|
|
//x: getRandomInt(0, 100) + "vw",
|
|
|
|
|
ease: "in",
|
|
|
|
|
delay: getRandomNumber(0, 1),
|
2022-10-07 13:37:57 +00:00
|
|
|
overwrite: true,
|
2022-09-25 14:52:59 +00:00
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#bitcoin",
|
|
|
|
|
scrub: true,
|
|
|
|
|
start: "top bottom",
|
|
|
|
|
end: "90% center",
|
2022-10-07 13:37:57 +00:00
|
|
|
//markers: { startColor: "lime", endColor: "blue" },
|
2022-09-25 14:52:59 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-07 13:37:57 +00:00
|
|
|
const tickerTL = gsap.timeline();
|
|
|
|
|
|
2022-09-25 14:52:59 +00:00
|
|
|
function onResizeComplete() {
|
|
|
|
|
positionServiceIcons();
|
2022-10-07 13:37:57 +00:00
|
|
|
initializeSizes();
|
|
|
|
|
//gsap.delayedCall(next, crossfade);
|
|
|
|
|
//tickerTL.resizePlay ? tickerTL.resizePlay.restart(true) : "";
|
2022-09-29 10:44:18 +00:00
|
|
|
}
|
2022-10-07 13:37:57 +00:00
|
|
|
|
2022-09-25 14:52:59 +00:00
|
|
|
var resizeTimeout = setTimeout(onResizeComplete, 400);
|
2022-10-07 13:37:57 +00:00
|
|
|
window.onresize = function () {
|
|
|
|
|
// if (tickerTL.isActive()) tickerTL.pause();
|
|
|
|
|
// if (!tickerTL.resizePlay)
|
|
|
|
|
// tickerTL.resizePlay = gsap.delayedCall(0.2, function () {
|
|
|
|
|
// tickerTL.play();
|
|
|
|
|
// });
|
|
|
|
|
|
2022-09-25 14:52:59 +00:00
|
|
|
clearTimeout(resizeTimeout);
|
|
|
|
|
resizeTimeout = setTimeout(onResizeComplete, 400);
|
2022-10-07 13:37:57 +00:00
|
|
|
console.log("onresize");
|
2022-09-25 14:52:59 +00:00
|
|
|
};
|
2022-09-14 16:05:58 +00:00
|
|
|
|
2022-09-18 15:37:00 +00:00
|
|
|
gsap.from("#bitcoin-to-be path:first-child", {
|
2022-09-02 13:59:11 +00:00
|
|
|
drawSVG: 0,
|
|
|
|
|
ease: "none",
|
|
|
|
|
scrollTrigger: {
|
2022-09-18 15:37:00 +00:00
|
|
|
trigger: "#bitcoin-to-be",
|
2022-09-02 13:59:11 +00:00
|
|
|
scrub: true,
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%",
|
|
|
|
|
end: "bottom 75%",
|
2022-09-02 13:59:11 +00:00
|
|
|
},
|
|
|
|
|
});
|
2022-07-19 14:25:29 +00:00
|
|
|
|
2022-09-18 15:37:00 +00:00
|
|
|
//////////////////////////////////////////
|
2022-09-14 16:05:58 +00:00
|
|
|
// BE YOUR OWN
|
|
|
|
|
|
2022-09-18 15:37:00 +00:00
|
|
|
gsap.from("#be-your-own h1", {
|
|
|
|
|
duration: 0.5,
|
|
|
|
|
y: "5rem",
|
|
|
|
|
opacity: 0,
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#be-your-own",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gsap.from("#be-your-own p", {
|
2022-09-19 10:11:15 +00:00
|
|
|
duration: 0.5,
|
2022-09-18 15:37:00 +00:00
|
|
|
y: "5rem",
|
|
|
|
|
filter: "blur(10px)",
|
|
|
|
|
opacity: 0,
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#be-your-own h1",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gsap.from("#be-your-own #ticker", {
|
|
|
|
|
duration: 1.5,
|
|
|
|
|
filter: "blur(20px)",
|
|
|
|
|
opacity: 0,
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#be-your-own #ticker",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-10-07 13:37:57 +00:00
|
|
|
// TICKER
|
2022-09-29 10:44:18 +00:00
|
|
|
|
2022-10-07 13:37:57 +00:00
|
|
|
let pseudoserviceArray = gsap.utils.toArray(".pseudoservice"),
|
|
|
|
|
next = 4,
|
|
|
|
|
itemHeight,
|
|
|
|
|
listHeight,
|
|
|
|
|
windowHeight,
|
|
|
|
|
kerplunk,
|
|
|
|
|
kerplunk2;
|
2022-09-29 10:44:18 +00:00
|
|
|
|
|
|
|
|
function initializeSizes() {
|
2022-09-02 13:59:11 +00:00
|
|
|
itemHeight = document
|
|
|
|
|
.querySelector(".pseudoservice")
|
2022-09-29 10:44:18 +00:00
|
|
|
.getBoundingClientRect().height;
|
2022-10-07 13:37:57 +00:00
|
|
|
|
2022-09-02 13:59:11 +00:00
|
|
|
listHeight = document
|
|
|
|
|
.querySelector(".pseudoservices")
|
2022-09-29 10:44:18 +00:00
|
|
|
.getBoundingClientRect().height;
|
|
|
|
|
|
2022-10-07 13:37:57 +00:00
|
|
|
windowHeight = document.getElementById("ticker__window").clientHeight;
|
2022-09-29 10:44:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
kerplunk = CustomEase.create(
|
|
|
|
|
"custom",
|
|
|
|
|
"M0,0 C0.126,0.382 0.066,0.863 0.198,1.036 0.25,1.104 0.264,0.982 0.326,0.982 0.344,0.982 0.489,0.998 0.516,1 0.65,1.007 0.863,1 1,1 "
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
kerplunk2 = CustomEase.create(
|
|
|
|
|
"custom",
|
|
|
|
|
"M0,0 C0.126,0.382 0.178,0.802 0.288,1.052 0.303,1.088 0.372,0.99 0.434,0.99 0.502,0.99 0.497,1 0.524,1 0.664,1 0.863,1 1,1 "
|
|
|
|
|
);
|
2022-07-19 14:25:29 +00:00
|
|
|
|
|
|
|
|
function crossfade() {
|
2022-10-07 13:37:57 +00:00
|
|
|
var action = tickerTL
|
2022-09-14 16:05:58 +00:00
|
|
|
.to(pseudoserviceArray, {
|
2022-09-18 15:37:00 +00:00
|
|
|
id: "thunk",
|
2022-09-14 16:05:58 +00:00
|
|
|
y: "-=" + itemHeight,
|
|
|
|
|
duration: 1,
|
|
|
|
|
ease: kerplunk2,
|
2022-10-11 15:44:21 +00:00
|
|
|
overwrite: true,
|
2022-09-14 16:05:58 +00:00
|
|
|
})
|
|
|
|
|
.to(pseudoserviceArray[0], { y: "+=" + listHeight, duration: 0 }); // the first to the end
|
2022-07-19 14:25:29 +00:00
|
|
|
|
2022-09-14 16:05:58 +00:00
|
|
|
pseudoserviceArray.push(pseudoserviceArray.shift()); // the first (shift) to the end (push) from the array
|
2022-07-19 14:25:29 +00:00
|
|
|
|
|
|
|
|
// start endless run
|
|
|
|
|
gsap.delayedCall(next, crossfade);
|
2022-09-14 16:05:58 +00:00
|
|
|
|
|
|
|
|
var thisPseudoservice = pseudoserviceArray[2].innerHTML,
|
|
|
|
|
thisElement = document.querySelector(
|
2022-10-07 13:37:57 +00:00
|
|
|
".service-container--" + thisPseudoservice.toLowerCase().replace(" ", "-")
|
2022-09-14 16:05:58 +00:00
|
|
|
);
|
|
|
|
|
|
2022-09-29 10:44:18 +00:00
|
|
|
var slidesContainerArray = document.querySelectorAll(".service-container");
|
2022-09-14 16:05:58 +00:00
|
|
|
slidesContainerArray.forEach((thisContainer) => {
|
|
|
|
|
thisContainer.style.display = "none";
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (thisElement) {
|
|
|
|
|
thisElement.style.display = "flex";
|
|
|
|
|
}
|
2022-07-19 14:25:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gsap.delayedCall(next, crossfade);
|
|
|
|
|
|
2022-09-18 15:37:00 +00:00
|
|
|
gsap.from("#be-to-powered path", {
|
2022-09-14 16:05:58 +00:00
|
|
|
drawSVG: 0,
|
|
|
|
|
ease: "none",
|
|
|
|
|
scrollTrigger: {
|
2022-09-18 15:37:00 +00:00
|
|
|
trigger: "#be-to-powered path",
|
2022-09-14 16:05:58 +00:00
|
|
|
scrub: true,
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%",
|
|
|
|
|
end: "bottom 75%",
|
2022-09-14 16:05:58 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-09-18 15:37:00 +00:00
|
|
|
//////////////////////////////////////////
|
|
|
|
|
// POWERED
|
|
|
|
|
|
|
|
|
|
gsap.from("#powered-by h1", {
|
|
|
|
|
duration: 0.5,
|
|
|
|
|
y: "-5rem",
|
|
|
|
|
opacity: 0,
|
2022-09-14 16:05:58 +00:00
|
|
|
scrollTrigger: {
|
2022-09-18 15:37:00 +00:00
|
|
|
trigger: "#powered-by h1",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gsap.from("#powered-by p", {
|
2022-09-19 10:11:15 +00:00
|
|
|
duration: 0.5,
|
2022-09-18 15:37:00 +00:00
|
|
|
filter: "blur(10px)",
|
|
|
|
|
opacity: 0,
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#powered-by h1",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gsap.from("#powered-by svg", {
|
|
|
|
|
duration: 1,
|
|
|
|
|
filter: "blur(20px)",
|
|
|
|
|
opacity: 0,
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#powered-by svg",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-14 16:05:58 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gsap.from("#powered-to-support path", {
|
|
|
|
|
drawSVG: 0,
|
|
|
|
|
ease: "none",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#powered-to-support path",
|
|
|
|
|
scrub: true,
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%",
|
|
|
|
|
end: "bottom 75%",
|
2022-09-14 16:05:58 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-09-18 15:37:00 +00:00
|
|
|
//////////////////////////////////////////
|
|
|
|
|
// SUPPORT
|
|
|
|
|
|
|
|
|
|
gsap.from("#support", {
|
|
|
|
|
duration: 0.5,
|
|
|
|
|
opacity: 0,
|
|
|
|
|
outline: "1px solid rgba(255,255,255,1)",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#support",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-09-14 16:05:58 +00:00
|
|
|
gsap.from("#support-to-dev path", {
|
|
|
|
|
drawSVG: 0,
|
|
|
|
|
ease: "none",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#support-to-dev path",
|
|
|
|
|
scrub: true,
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%",
|
|
|
|
|
end: "bottom 75%",
|
2022-09-14 16:05:58 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-09-18 15:37:00 +00:00
|
|
|
//////////////////////////////////////////
|
|
|
|
|
// DEV
|
|
|
|
|
|
2022-09-25 14:52:59 +00:00
|
|
|
gsap.from("#dev h1", {
|
2022-09-18 15:37:00 +00:00
|
|
|
duration: 0.5,
|
|
|
|
|
scale: 0.8,
|
|
|
|
|
opacity: 0,
|
|
|
|
|
filter: "blur(10px)",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#dev",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gsap.from("#dev .col:nth-child(1)", {
|
|
|
|
|
duration: 0.5,
|
|
|
|
|
x: "5rem",
|
|
|
|
|
opacity: 0,
|
|
|
|
|
delay: 0.5,
|
2022-10-07 13:37:57 +00:00
|
|
|
outline: "1px solid rgba(255,255,255,1)",
|
2022-09-18 15:37:00 +00:00
|
|
|
filter: "blur(10px)",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#dev",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gsap.from("#dev .col:nth-child(2)", {
|
|
|
|
|
duration: 0.5,
|
|
|
|
|
x: "-5rem",
|
|
|
|
|
scale: 0.5,
|
|
|
|
|
opacity: 0,
|
2022-09-19 10:11:15 +00:00
|
|
|
delay: 0.75,
|
2022-09-18 15:37:00 +00:00
|
|
|
filter: "blur(10px)",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#dev",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-09-14 16:05:58 +00:00
|
|
|
gsap.from("#dev-to-contact path", {
|
|
|
|
|
drawSVG: 0,
|
|
|
|
|
ease: "none",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#dev-to-contact path",
|
|
|
|
|
scrub: true,
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%",
|
|
|
|
|
end: "bottom 75%",
|
2022-09-14 16:05:58 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2022-09-18 15:37:00 +00:00
|
|
|
//////////////////////////////////////////
|
|
|
|
|
// CONTACT
|
2022-09-14 16:05:58 +00:00
|
|
|
|
2022-09-18 15:37:00 +00:00
|
|
|
gsap.from("#community", {
|
|
|
|
|
duration: 0.5,
|
|
|
|
|
scale: 0.8,
|
|
|
|
|
opacity: 0,
|
|
|
|
|
//outline: "1px solid rgba(255,255,255,1)",
|
|
|
|
|
filter: "blur(10px)",
|
|
|
|
|
scrollTrigger: {
|
|
|
|
|
trigger: "#community",
|
2022-09-19 10:43:19 +00:00
|
|
|
start: "top 75%", // "triggerElement page"
|
2022-09-19 10:11:15 +00:00
|
|
|
toggleActions: defaultActions,
|
2022-09-18 15:37:00 +00:00
|
|
|
},
|
2022-10-11 15:44:21 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////
|
|
|
|
|
// EMAIL POST
|
|
|
|
|
|
|
|
|
|
function showSuccess() {
|
|
|
|
|
hideError();
|
|
|
|
|
emailSuccess.classList.add("form-alert--visible");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function hideSuccess() {
|
|
|
|
|
emailError.classList.remove("form-alert--visible");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showError(message) {
|
|
|
|
|
hideSuccess();
|
|
|
|
|
emailError.classList.add("form-alert--visible");
|
|
|
|
|
emailError.innerHTML(message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function hideError() {
|
|
|
|
|
emailError.classList.remove("form-alert--visible");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
document.getElementById("contactSubmit").addEventListener("click", function () {
|
|
|
|
|
const fromEmail = document.getElementById("fromEmail");
|
|
|
|
|
const emailError = document.getElementById("emailError");
|
|
|
|
|
const emailSuccess = document.getElementById("emailSuccess");
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/.test(
|
|
|
|
|
fromEmail.value
|
|
|
|
|
)
|
|
|
|
|
) {
|
|
|
|
|
hideError();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
fetch(siteUrl + "app/php/email/v1/SendSupportMail.php", {
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "application/x-www-form-urlencoded",
|
|
|
|
|
},
|
|
|
|
|
body: formBody,
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
|
showSuccess();
|
|
|
|
|
} else {
|
|
|
|
|
showError(
|
|
|
|
|
"Something's not working. If you keep getting this error, try us at <a href='https://twitter.com/start9labs' target='_blank'>Twitter</a> instead."
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} catch (error) {
|
|
|
|
|
showError(
|
|
|
|
|
"Something's not working. If you keep getting this error, try us at <a href='https://twitter.com/start9labs' target='_blank'>Twitter</a> instead."
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
showError("Sorry, you must use a valid email address.");
|
|
|
|
|
}
|
|
|
|
|
});
|