Skip to content

Commit

Permalink
better links
Browse files Browse the repository at this point in the history
  • Loading branch information
vickkie committed Jun 23, 2024
1 parent 4afdce0 commit f3fc58a
Show file tree
Hide file tree
Showing 13 changed files with 648 additions and 462 deletions.
451 changes: 402 additions & 49 deletions css/portfolio-hero.css

Large diffs are not rendered by default.

Binary file added img/22.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions img/svg/lakeme.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
469 changes: 217 additions & 252 deletions index.html

Large diffs are not rendered by default.

172 changes: 20 additions & 152 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ if ("serviceWorker" in navigator) {
});
}

let emailButtons = selectAll(".emailme");

emailButtons.forEach((emailButton) => {
emailButton.addEventListener("click", function () {
window.open("mailto:[email protected]");
});
});
// // Call the splittingjs to transform the data-splitting texts to spans of chars
// Splitting();

Expand Down Expand Up @@ -399,29 +406,6 @@ document.addEventListener("DOMContentLoaded", function () {
}
window.addEventListener("resize", hideMf);

// Group 10: Magnetic effect for elements with class .viewall

const els = selectAll(".magnetic");

els.forEach((el) => {
el.addEventListener("mouseenter", () => {
console.log("magnettt");
});

// Apply Magnetic effect to each element individually
new Magnetic(el, {
y: 0.4, // horizontal delta
x: 0.4, // vertical delta
s: 0.2, // speed
rs: 0.7, // release speed
});
});

// Automatic handle magnetic elements through attribute
$("[data-magnetic]").each(function () {
new Magnetic(this);
});

//Group 11: scroll to a location

gsap.registerPlugin(ScrollToPlugin);
Expand Down Expand Up @@ -512,133 +496,8 @@ document.addEventListener("DOMContentLoaded", function () {
}, 0);
});

//Group 13: change Array of words in hello contact footer

const words = ["Hello", "Hola", "Bonjour", "Salut", "Chao"];
let currentIndex = 0;

function changeWord() {
const span = document.getElementById("changehello");
currentIndex = (currentIndex + 1) % words.length;
span.innerHTML = words[currentIndex];
}

// Call the function after 10 seconds
setInterval(changeWord, 10000);

// Group 13: copy email address

function copyToClipboard(text) {
if (innerWidth > 767 && document.hasFocus()) {
navigator.clipboard.writeText(text);

let copies = selectAll(".copy");

copies.forEach((copy) => {
copy.innerHTML = "Copied";

setTimeout(() => {
copy.innerHTML = "Copy!";
}, 4000);
});
}
}

// Group 14 : animate text
const text3d = () => {
if (innerWidth > 767) {
gsap.registerPlugin(ScrollTrigger);
const fx19Titles = [...selectAll("[data-effect19]")];

fx19Titles.forEach((title) => {
const chars = title.querySelectorAll(".char");

chars.forEach((char) => gsap.set(char.parentNode, { perspective: 1000 }));

gsap.fromTo(
chars,
{
"will-change": "opacity, transform",
transformOrigin: "50% 0%",
opacity: 0,
rotationX: -90,
z: -200,
},
{
ease: "power1",
opacity: 1,
stagger: 0.05,
rotationX: 0,
z: 0,
scrollTrigger: {
trigger: title,
start: "center bottom",
end: "bottom top+=40%",
scrub: true,
},
}
);
});
}
};

text3d();

let resizeTimer;
window.addEventListener("resize", () => {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(() => {
text3d();
copyToClipboard();
}, 250);
});

// Group 14: rotate the socials star

if (innerWidth > 767) {
let socialtl = gsap.timeline({
scrollTrigger: {
trigger: ".wiggle",
start: "top 90%",
end: "top 30%",
scrub: 1,
},
});

socialtl.fromTo(
"#logo-36",
{
scale: 0.3,
y: "-200px",
rotate: 0,
},
{
scale: 1,
y: 0,
rotate: 360,
}
);
}

//Group 15: lets rotate some i's in the footer

let chars = [...selectAll(".rotate-i .char")];

// Here we're creating a timeline that we can use
const lettertl = gsap.timeline({
repeat: -1,
duration: 2,
delay: 3,
yoyo: true,
});

lettertl.to(chars[6], { rotation: 360 });
lettertl.to(chars[11], { rotation: 360 });

//use the defaults

let emailbox = select(".email-box");

// Group 13: darkmode if user browser prefers

// if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
Expand All @@ -649,6 +508,7 @@ let emailbox = select(".email-box");
// }

//Animate the fucking explorer
let emailbox = select(".email-box");

let explorer = select(".in-world-btn-wrap");
let explorerLine = select(".meeting-content-bottom");
Expand All @@ -660,10 +520,18 @@ exploTl.to(explorer, {
scaleX: 0,
});

exploTl.to(explorerLine, {
scale: 0,
duration: 0.6,
});
exploTl.fromTo(
explorerLine,
{
scaleX: 1,
opacity: 1,
transformOrigin: "center center",
},
{
scaleX: 0,
opacity: 0,
}
);

ScrollTrigger.create({
trigger: explorer,
Expand Down
2 changes: 1 addition & 1 deletion public/bundle.js

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

2 changes: 1 addition & 1 deletion public/css/portfolio-hero.css

Large diffs are not rendered by default.

Binary file added public/img/22.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/img/svg/lakeme.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f3fc58a

Please sign in to comment.