Skip to content

Commit

Permalink
Merge pull request #65 from Bitshala/image-optimizations
Browse files Browse the repository at this point in the history
refac: image optimization for home page
  • Loading branch information
emjshrx authored Dec 6, 2023
2 parents e7e6168 + cabbbaf commit d44e7aa
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 18 deletions.
Binary file removed public/home/headerbg.png
Binary file not shown.
Binary file added public/home/headerbg.webp
Binary file not shown.
Binary file removed public/testimonial/background.png
Binary file not shown.
Binary file added public/testimonial/background.webp
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
3 changes: 3 additions & 0 deletions src/components/cohort/Checkerboard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<img
src="/website-v2/cohort/checkerboard1.png"
class="w-auto"
alt="Cohort Community"
/>
</div>
</div>
Expand All @@ -31,6 +32,7 @@
<img
src="/website-v2/cohort/checkerboard2.png"
class="w-auto"
alt="Structured Cohort"
/>
</div>
<div
Expand Down Expand Up @@ -71,6 +73,7 @@
<img
src="/website-v2/cohort/checkerboard3.png"
class="w-auto"
alt="Cohort Job Board"
/>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/components/cohortPages/MeetYourTAs.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const { team, color } = Astro.props;
<img
src={`/website-v2/people/${member.image}.png`}
class="h-28 items-center p-3 "
alt={member.name}
/>
<div class="flex flex-col">
<div class="flex">
Expand All @@ -33,12 +34,14 @@ const { team, color } = Astro.props;
<img
src="/website-v2/people/github.png"
class="mr-3 mt-3 h-8 rounded-xl bg-white "
alt="Github"
/>
</a>
<a>
<img
src="/website-v2/people/twitter.png"
class="mr-3 mt-3 h-8 rounded-xl bg-white "
alt="Twitter"
/>
</a>
</div>
Expand Down
7 changes: 6 additions & 1 deletion src/components/common/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ const Carousel = ({
{config[page].title}
</h1>
<div className="lg:flex">
<img src={config[page].img} />
<img
src={config[page].img}
loading="lazy"
alt={config[page].title}
/>
<div className="m-2 flex flex-col justify-between lg:p-10 lg:text-2xl">
<div>{config[page].content}</div>
<button className="mt-5 w-1/2 p-2 outline">
Expand All @@ -65,6 +69,7 @@ const Carousel = ({
key={page.title}
className="h-3 w-3 rounded-full outline hover:bg-white"
onClick={() => setPage(index)}
aria-label={page.title}
/>
);
})}
Expand Down
1 change: 1 addition & 0 deletions src/components/common/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const list3 = [
<img
src="/website-v2/footer/logo.png"
class="mb-60 h-16"
alt="Bitshala Logo"
/>
<div>Copyright © 2023 Bitshala</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/components/common/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ const {
>
<div class="mb-10 flex w-full justify-between">
<a href="/website-v2">
<img src="/website-v2/footer/logo.png" class="h-16" />
<img
src="/website-v2/footer/logo.png"
class="h-16"
alt="Bitshala Logo"
/>
</a>
<Hamburger client:only />
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/components/common/videoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ export const VideoList = ({
href={vid.link}
target="_blank"
>
<img className=" mr-5 h-24" src={vid.img} />
<img
className=" mr-5 h-24"
src={vid.img}
alt={vid.title}
/>
{vid.title}
</a>
),
Expand Down
5 changes: 5 additions & 0 deletions src/components/home/People.astro
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const advisors = [
<img
src={`/website-v2/people/${member.image}.png`}
class="h-28 items-center p-3 lg:h-40"
alt={member.name}
/>
<div class="flex w-full flex-col">
<div class="flex w-full justify-between px-5 py-3">
Expand All @@ -112,12 +113,14 @@ const advisors = [
<img
src="/website-v2/people/github.png"
class="m-1 h-6 rounded-xl bg-white lg:h-10"
alt="Github"
/>
</a>
<a href={member.twitter} target="_blank">
<img
src="/website-v2/people/twitter.png"
class="m-1 h-6 rounded-xl bg-white lg:h-10"
alt="Twitter"
/>
</a>
</div>
Expand Down Expand Up @@ -145,6 +148,7 @@ const advisors = [
<img
src={`/website-v2/people/${member.image}.png`}
class="h-28 items-center p-3 lg:h-40"
alt={member.name}
/>
<div class="flex w-full flex-col">
<div class="flex w-full justify-between px-5 py-3">
Expand All @@ -158,6 +162,7 @@ const advisors = [
<img
src="/website-v2/people/twitter.png"
class="m-1 h-8 rounded-xl bg-white lg:h-10"
alt="Twitter"
/>
</a>
</div>
Expand Down
39 changes: 26 additions & 13 deletions src/components/home/Testimonial.astro
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
---
import { Image } from "astro:assets";
import bitcoin from "../../assets/testimonial/bitcoin.png";
import person1 from "../../assets/testimonial/person1.png";
import person2 from "../../assets/testimonial/goku.png";
---

<div class="mb-10 mt-10">
<div class="inline lg:hidden">
<div class="flex">
<div class="mr-2">
<img
src="/website-v2/testimonial/bitcoin.png"
<Image
src={bitcoin}
class="max-h-96"
alt="Image of Bitcoin"
/>
</div>
<div class="flex flex-col">
<div class="mb-4">
<img
src="/website-v2/testimonial/person1.png"
<Image
src={person1}
class="max-h-44"
alt="Person 1"
/>
</div>
<div>
<img
src="/website-v2/testimonial/goku.png"
<Image
src={person2}
class="max-h-44"
alt="Person 2"
/>
</div>
</div>
Expand All @@ -27,22 +37,25 @@
<div class="flex">
<div class="hidden lg:flex">
<div class="mr-8">
<img
src="/website-v2/testimonial/bitcoin.png"
<Image
src={bitcoin}
class="min-h-96"
alt="Image of Bitcoin"
/>
</div>
<div class="flex flex-col">
<div>
<img
src="/website-v2/testimonial/person1.png"
<Image
src={person1}
class="min-h-96 mb-8"
alt="Person 1"
/>
</div>
<div>
<img
src="/website-v2/testimonial/goku.png"
<Image
src={person2}
class="min-h-96"
alt="Person 2"
/>
</div>
</div>
Expand Down Expand Up @@ -96,7 +109,7 @@
</p>
<div
style={{
backgroundImage: `url(/website-v2/testimonial/background.png)`,
backgroundImage: `url(/website-v2/testimonial/background.webp)`,
backgroundSize: "cover",
backgroundRepeat: "no-repeat",
backgroundPosition: "center",
Expand Down
2 changes: 1 addition & 1 deletion src/components/talks/VideoCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const { video } = Astro.props as {
href={video.link}
target="_blank"
>
<img class="w-full" src={video.img} />
<img class="w-full" src={video.img} alt={video.title} />
<div
class="mt-2 w-full text-ellipsis font-bold lg:text-xl"
>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Header from "../components/common/Header.astro";
<Header
heading=""
subheading=""
image="/website-v2/home/headerbg.png"
image="/website-v2/home/headerbg.webp"
headingColor=""
subheadingColor=""
>
Expand Down

0 comments on commit d44e7aa

Please sign in to comment.