Skip to content

Commit

Permalink
[UI] Added Sponsors Section
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruán committed Aug 29, 2024
1 parent 0f5f9fb commit ae1d56b
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/_data/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,10 @@ home:
position: 🚀 SysAdmin
username: rjm
image: /assets/img/committee/ruan.webp
sponsors:
- name: RTC
tier: secondary
image: /assets/img/sponsors/rtc.svg

footer:
credit: Created from Redbrick's Atlas System
60 changes: 60 additions & 0 deletions src/_includes/home/sections/sponsors.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<section class="bg-base-100">
<h1 class="text-white text-shadow text-xl lh:text-3xl font-bold mb-2 lg:mb-4">
{{site.society.name}} is proudly sponsored by:
</h1>
<div class="flex p-5 md:p-10 space-x-5 md:space-x-10 overflow-x-scroll">
{% for sponsor in site.home.sponsors -%}
<div data-cmt-trigger class="flex flex-col items-center">
<h2 data-cmt-title="{{ sponsor.tier }}" class="font-mono font-bold text-sm md:text-md h-10 whitespace-nowrap">
{{ sponsor.tier}}
</h2>
<div data-cmt-card class="indicator overflow-visible">
<div class="relative rounded-xl border border-base-content/20 shadow-xl shadow-slate-950/20 overflow-hidden cmt-card">
<a href="/bio/{{ sponsor.name }}.html">
<img class="-z-10 aspect-[0.75] w-40 max-w-[35vw] object-cover object-center" src="{{ sponsor.image }}" alt="{{ sponsor.name }}" />
<div class="absolute bottom-0 w-full p-2 bg-base-200 bg-opacity-75 backdrop-blur-sm cmt-name">
<p class="text-center md:text-lg">
{{ sponsor.name }}
</p>
</div>
</a>
</div>
</div>
</div>
{%- endfor %}
</div>
</section>
<script>
if (!userAgent.getDevice().type) { // is a desktop device
gsap.registerPlugin(ScrollTrigger)
gsap.registerPlugin(TextPlugin)
gsap.set("[data-cmt-card]", {
scale: 0.9,
opacity: 0,
})
gsap.set("[data-cmt-title]", {
text: "",
})
ScrollTrigger.batch("[data-cmt-trigger]", {
once: true,
end: "bottom bottom",
onEnter: (batch) => batch.forEach((element, i) => {
const stagger = 0.2
const cardElement = element.querySelector("[data-cmt-card]")
const titleElement = element.querySelector("[data-cmt-title]")
gsap.to(cardElement, {
scale: 1,
opacity: 1,
duration: 0.3,
ease: "power2.inOut",
delay: i * stagger,
})
gsap.to(titleElement, {
text: titleElement.dataset.cmtTitle,
duration: 0.75,
delay: 0.25 + (i * stagger),
})
}),
})
}
</script>
36 changes: 36 additions & 0 deletions src/site/assets/img/sponsors/rtc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ae1d56b

Please sign in to comment.