Skip to content

Commit

Permalink
Merge branch 'main' into feature/8-Create-hero-component
Browse files Browse the repository at this point in the history
  • Loading branch information
aortega1441 authored Jun 19, 2024
2 parents 1af6541 + 4a2d64b commit 77dba17
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 3 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@astrojs/check": "^0.7.0",
"@astrojs/tailwind": "^5.1.0",
"astro": "^4.10.1",
"tailwind-scrollbar-hide": "^1.1.7",
"tailwindcss": "^3.4.4",
"typescript": "^5.4.5"
},
Expand Down
12 changes: 12 additions & 0 deletions src/assets/icons/IconChevronRight.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
---

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path
fill="none"
stroke="#54F400"
stroke-linecap="round"
stroke-width="3"
d="m7.6 2.52 8.34 8.34a1.6 1.6 0 0 1 0 2.24L7.6 21.44"></path>
</svg>
8 changes: 8 additions & 0 deletions src/components/NavigationBar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import HashtagWhyULoveFootball from "@components/HashtagWhyULoveFootball.astro";
var navBar_container = document.getElementById("navbar-container");
var hero_text = document.getElementById("hero-text");
var footer = document.getElementById("footer");
var menuItems = document.querySelectorAll("#navbar li");

if (navBar && openButton && closeButton) {
openButton.addEventListener("click", () => {
Expand All @@ -92,5 +93,12 @@ import HashtagWhyULoveFootball from "@components/HashtagWhyULoveFootball.astro";
hero_text?.classList.add("absolute");
footer?.classList.remove("hidden");
});
menuItems.forEach((item) =>
item.addEventListener("click", () => {
if (!navBar?.classList.contains("hidden")) {
navBar?.classList.add("hidden");
}
}),
);
}
</script>
8 changes: 6 additions & 2 deletions src/components/Section.astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ const { backgroundColor, backgroundImage, eyebrow, heading, links } =
class={`bg-${backgroundImage ? `[url('${backgroundImage}')]` : backgroundColor} bg-cover p-6 sm:p-12`}
>
<div
class={`container flex flex-col gap-6 sm:gap-12 items-center justify-center mx-auto ${backgroundImage ? "text-light-lilac" : backgroundColor === "green" ? "text-blue" : "text-green"}`}
class={`container flex flex-col gap-6 sm:gap-12 items-center justify-center mx-auto ${backgroundImage ? "text-light-lilac" : backgroundColor === "green" ? "text-blue" : "text-white"}`}
>
<div class="uppercase font-bold text-sm tracking-[3px]">{eyebrow}</div>
<div
class=`uppercase font-bold text-sm ${backgroundColor === "green" ? "text-blue" : "text-green"} tracking-[3px]`
>
{eyebrow}
</div>
<div class="text-3xl sm:text-5xl text-center">{heading}</div>
<slot />
{
Expand Down
37 changes: 37 additions & 0 deletions src/components/VideoPlayer.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
import IconChevronRight from "@icons/IconChevronRight.astro";
---

<iframe class="w-full" src="https://www.youtube.com/embed/LyVeknDDQCw"></iframe>
<div>
<div class="flex gap-3 items-center mb-3">
<span>More videos</span>
<div class="w-3 h-3">
<IconChevronRight />
</div>
</div>
<div class="relative">
<div class="flex gap-3 overflow-x-scroll relative scrollbar-hide">
<iframe
class="w-4/5 sm:w-2/5"
src="https://www.youtube.com/embed/Fxb9bgPpnys"></iframe>
<iframe
class="w-4/5 sm:w-2/5"
src="https://www.youtube.com/embed/x2fNlaTvd60"></iframe>
<iframe
class="w-4/5 sm:w-2/5"
src="https://www.youtube.com/embed/wFAazFeFgOY"></iframe>
<iframe
class="w-4/5 sm:w-2/5"
src="https://www.youtube.com/embed/QNXl7RAOevI"></iframe>
<iframe
class="w-4/5 sm:w-2/5"
src="https://www.youtube.com/embed/i4Ap6hCtyug"></iframe>
<div class="min-w-[40%] min-h-full"></div>
</div>
<div
class="absolute bg-gradient-to-r from-transparent to-blue h-full ml-auto top-0 right-0 w-2/12 sm:w-1/5"
>
</div>
</div>
</div>
9 changes: 9 additions & 0 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
import Layout from "@layouts/Layout.astro";
import "@styles/global.css";
import Section from "../components/Section.astro";
import VideoPlayer from "../components/VideoPlayer.astro";
---

<Layout title="Welcome to Whyuluvfootball">
<Section
backgroundColor="green"
eyebrow="Our goal"
heading="Our goal is to donate 10 million balls to children around the world."
id="our-goal"
links={[
{ href: "https://gofund.me/96424540", text: "GoFundMe" },
{
Expand All @@ -17,4 +19,11 @@ import Section from "../components/Section.astro";
},
]}
/>
<Section
backgroundColor="blue"
eyebrow="Videos"
heading="I love football because..."
>
<VideoPlayer />
</Section>
</Layout>
4 changes: 4 additions & 0 deletions src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,8 @@
@apply text-[36px] leading-[48px];
}
}

iframe {
@apply aspect-video;
}
}
4 changes: 3 additions & 1 deletion tailwind.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export default {
}
},
},
plugins: [],
plugins: [
require('tailwind-scrollbar-hide')
],
safelist: [
'bg-blue',
'bg-green',
Expand Down

0 comments on commit 77dba17

Please sign in to comment.