Skip to content

Commit

Permalink
tool tips added & svg upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
YueSteveYin committed Sep 14, 2024
1 parent ba824e6 commit 2233483
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 271 deletions.
218 changes: 31 additions & 187 deletions assets/img/logos/open-book-grey.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions assets/img/logos/researchArea.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion assets/img/logos/year-icon.svg

This file was deleted.

1 change: 1 addition & 0 deletions assets/img/logos/year.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 0 additions & 60 deletions layouts/_default/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,6 @@ <h3 class="text-lg font-medium leading-6 text-black">Contact Us</h3>
class="parallax relative overflow-hidden p-8 text-white"
style="background-image: url(/img/background/bodyBackground.webp);"
>
<!-- Meteors -->
<div class="meteor meteor-1"></div>
<div class="meteor meteor-2"></div>
<div class="meteor meteor-3"></div>
<div class="meteor meteor-4"></div>

<section class="no-js-hide p-8">
{{ partial "search.html" . }}
Expand Down Expand Up @@ -362,61 +357,6 @@ <h2 class="{{ $secHedClass }} scroll-mt-2" x-ref="hed">
</section>
</section>

<style>
.meteor {
position: absolute; /* Positioned relative to the section */
width: 20px;
height: 20px;
background: linear-gradient(135deg, white, transparent);
border-radius: 50%;
transform: rotate(45deg);
opacity: 0.8;
}

/* Individual meteor start positions relative to the section */
.meteor-1 {
top: 0;
right: 0;
}
.meteor-2 {
top: 0;
right: 20px;
}
.meteor-3 {
top: 0;
right: 40px;
}
.meteor-4 {
top: 0;
right: 60px;
}
</style>

<script>
document.addEventListener("scroll", () => {
const section = document.querySelector(".parallax"); // Get the section
const sectionTop = section.offsetTop; // Get section's top offset relative to the page
const scrollPosition = window.scrollY;

// Check if the section is in view
if (scrollPosition >= sectionTop) {
const relativeScroll = scrollPosition - sectionTop; // Scroll relative to the section

// Select all meteors
const meteors = document.querySelectorAll(".meteor");

// Adjust position of each meteor based on scroll amount
meteors.forEach((meteor, index) => {
const speed = (index + 1) * 0.5; // Each meteor moves at a different speed
const xMovement = relativeScroll * speed; // Horizontal movement (to the left)
const yMovement = relativeScroll * speed; // Vertical movement (downward)

meteor.style.transform = `translate(-${xMovement}px, -${yMovement}px) rotate(45deg)`;
});
}
});
</script>

<!-- Section by Area of Expertise -->
<section class="bg-g-3 p-8 shadow-inner">
<div class="{{ $wellClass }}" x-data="{ isOpen: false }">
Expand Down
Loading

0 comments on commit 2233483

Please sign in to comment.