Skip to content

Commit 1e529a1

Browse files
Merge pull request #50 from audacity/optimised-images
Optimised images & remove bloat
2 parents 330eaea + ee6c341 commit 1e529a1

File tree

8 files changed

+46
-54
lines changed

8 files changed

+46
-54
lines changed
-89.8 KB
Binary file not shown.

src/assets/img/LaptopMockUp.webp

-255 KB
Binary file not shown.

src/components/card/NEWBlogPostCard.astro

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
import { Image } from "astro:assets";
3+
24
export interface Props {
35
title: string;
46
description: string;
@@ -7,19 +9,27 @@ export interface Props {
79
cover: ImageMetadata;
810
coverAlt: string;
911
}
10-
const { title, href, publishDate, description, cover, coverAlt } =
11-
Astro.props;
12+
const { title, href, publishDate, description, cover, coverAlt } = Astro.props;
1213
13-
const options = {
14+
const options: Intl.DateTimeFormatOptions = {
1415
weekday: "long",
1516
year: "numeric",
1617
month: "long",
1718
day: "numeric",
1819
};
1920
---
2021

21-
<a href=`/blog/${href}` class="col-span-12 sm:col-span-6 md:col-span-4 flex flex-col gap-4">
22-
<img class="rounded-md aspect-image" alt={coverAlt} src={cover.src} />
22+
<a
23+
href=`/blog/${href}`
24+
class="col-span-12 sm:col-span-6 md:col-span-4 flex flex-col gap-4 hover:opacity-90 transition-opacity duration-200"
25+
>
26+
<Image
27+
width="800"
28+
quality="80"
29+
class="rounded-md aspect-image"
30+
alt={coverAlt}
31+
src={cover}
32+
/>
2333
<div class="flex flex-col gap-1">
2434
<small>{publishDate.toLocaleDateString("en-US", options)}</small>
2535
<h3>{title}</h3>

src/components/homepage/HeroBanner.astro

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
import DownloadButton from "../button/DownloadButton";
3-
import AudacityMockUp from "../../assets/img/HeroBannerImage.webp";
43
import DownloadMuseHubButton from "../button/DownloadMuseHubButton";
4+
import { Image } from "astro:assets";
5+
import AudacityMockUp from "../../assets/img/HeroBannerImage.webp";
56
---
67

78
<section id="main" class="bg-gradient-to-r from-indigo-900 to-blue-700">
@@ -29,9 +30,11 @@ import DownloadMuseHubButton from "../button/DownloadMuseHubButton";
2930
<div
3031
class="col-span-12 md:col-start-7 md:col-span-7 flex items-center justify-center mx-4"
3132
>
32-
<img
33+
<Image
34+
src={AudacityMockUp}
3335
alt="A laptop showing the Audacity application"
34-
src={AudacityMockUp.src}
36+
width={960}
37+
quality={80}
3538
/>
3639
</div>
3740
</div>

src/components/homepage/RecordAnything.astro

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/components/homepage/ReleaseVideo.astro

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,44 @@
11
---
2+
import { getImage } from "astro:assets";
23
import ReleaseVideoPlaceholder from "../../assets/img/audacity-placeholder.webp";
3-
import promoPlaceholder from "../../assets/img/promo/ace-placeholder.webp";
4+
import PromoVideoPlaceholder from "../../assets/img/promo/ace-placeholder.webp";
45
import FeaturedVideo from "../video/FeaturedVideo";
56
7+
const releaseVideoPlaceholderImage = await getImage({
8+
src: ReleaseVideoPlaceholder,
9+
format: 'webp', // or whatever format you prefer
10+
width: 1408, // specify dimensions as needed
11+
quality: 80,
12+
});
13+
14+
const featuredVideoPlaceholderImage = await getImage({
15+
src: PromoVideoPlaceholder,
16+
format: 'webp', // or whatever format you prefer
17+
width: 1408, // specify dimensions as needed
18+
quality: 80,
19+
});
20+
621
const releaseVideo = {
722
title:"Our latest release",
823
label:"Master channel, new realtime effects & more!",
9-
placeholderImage: ReleaseVideoPlaceholder,
24+
placeholderImage: releaseVideoPlaceholderImage.src,
1025
videoURL:"https://www.youtube-nocookie.com/embed/f5TXPUOFH6A?autoplay=1"
1126
}
1227
1328
const promoVideo = {
1429
title:"ACE Studio showcase",
1530
label:"Ad: Turn your lyrics into song with ACE Studio, the AI singing voice generator.",
16-
placeholderImage: promoPlaceholder,
31+
placeholderImage: featuredVideoPlaceholderImage.src,
1732
videoURL:"https://www.youtube-nocookie.com/embed/QTlB5UR-IEE?autoplay=1",
1833
CTA: true,
1934
ctaText: "Try for free",
2035
ctaURL:"https://www.musehub.com/app/ace-studio?utm_source=au-web&utm_medium=mh-app-cta&utm_campaign=au-web-mh-app-ace-studio"
2136
}
37+
38+
2239
---
2340

24-
<section class="bg-gray-900">
41+
<section class="bg-slate-100">
2542
<div
2643
class="grid md:grid-cols-2 max-w-screen-2xl px-6 sm:px-12 mx-auto py-8 gap-8"
2744
>

src/components/video/FeaturedVideo.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ function FeaturedVideo(props) {
2525
return (
2626
<div className="flex flex-col gap-2 lg:gap-4 ">
2727
<div className="flex flex-col xs:flex-row xs:justify-between md:h-10">
28-
<h3 className="text-white content-center">{title}</h3>
28+
<h3 className="text-slate-900 content-center">{title}</h3>
2929
{CTA && (
3030
<a
3131
className="py-3 px-4 rounded-md justify-center bg-yellow-300 hover:bg-yellow-400 active:bg-yellow-500 w-fit"
3232
href={ctaURL}
3333
onClick={() => handleCTAClick()}
3434
>
35-
<p className="leading-none font-semibold">{ctaText}</p>
35+
<p className="text-slate-900 leading-none font-semibold">{ctaText}</p>
3636
</a>
3737
)}
3838
</div>
@@ -49,14 +49,14 @@ function FeaturedVideo(props) {
4949
) : (
5050
<img
5151
tabIndex="0"
52-
src={placeholderImage.src}
52+
src={placeholderImage}
5353
alt="YouTube thumbnail"
5454
className="w-full aspect-video rounded-md shadow-xl cursor-pointer"
5555
onClick={() => handleVideoClick()}
5656
onKeyDown={(e) => e.key === "Enter" && handleVideoClick()}
5757
/>
5858
)}
59-
<p className="text-white">{label}</p>
59+
<p className="text-slate-900">{label}</p>
6060
</div>
6161
);
6262
}

src/pages/index.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import RecordAnything from "../components/homepage/RecordAnything.astro";
1313
<BaseLayout title="Audacity ® | Free Audio editor, recorder, music making and more!">
1414
<HeroBanner />
1515
<ReleaseVideo />
16-
<RecordAnything />
1716
<ShareYourSounds client:load/>
1817
<FeatureCards />
1918
<BlogPosts />

0 commit comments

Comments
 (0)