Skip to content

Commit 66b8575

Browse files
Merge pull request #54 from audacity/Component-optimisation
Component optimisation
2 parents de2f7f3 + 554c8a0 commit 66b8575

File tree

10 files changed

+222
-360
lines changed

10 files changed

+222
-360
lines changed

package-lock.json

Lines changed: 123 additions & 311 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@
1212
"dependencies": {
1313
"@astrojs/react": "^4.2.1",
1414
"@astrojs/sitemap": "^3.2.1",
15-
"@astrojs/tailwind": "^6.0.0",
15+
"@astrojs/tailwind": "^6.0.1",
1616
"@fontsource-variable/signika": "^5.0.8",
1717
"@fontsource/twinkle-star": "^5.0.8",
1818
"@types/react": "^18.0.28",
1919
"@types/react-dom": "^18.0.10",
20-
"astro": "^5.5.2",
20+
"astro": "^5.5.4",
2121
"astro-compressor": "^0.4.1",
2222
"astro-icon": "^0.8.1",
2323
"astro-lazy-youtube-embed": "^0.5.4",
24-
"framer-motion": "^9.0.2",
2524
"platform": "^1.3.6",
2625
"react": "^18.2.0",
2726
"react-dom": "^18.2.0",

src/components/homepage/BlogPosts.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ const maxposts = 3;
2121
.sort((a, b) => b.data.publishDate.getTime() - a.data.publishDate.getTime())
2222
.slice(0,maxposts)
2323
.map((post) => {
24+
// Only pass props that match the expected Props interface
2425
return (
2526
<NEWBlogPostCard
2627
href={post.slug}
2728
title={post.data.title}
2829
description={post.data.description}
29-
author={post.data.author}
3030
publishDate={post.data.publishDate}
3131
cover={post.data.cover}
3232
coverAlt={post.data.coverAlt}

src/components/navigation/HamburgerMenu.jsx

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

src/components/navigation/NavigationReact.jsx

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import React, { useState } from "react";
2-
import { AnimatePresence } from "framer-motion";
3-
import HamburgerMenu from "./HamburgerMenu";
42
import AudacityLogo from "../../assets/img/Audacity_Logo.svg";
53
import "@fontsource-variable/signika";
64
import "../../styles/fonts.css";
@@ -63,16 +61,14 @@ function NavigationReact(props) {
6361
}
6462

6563
return (
66-
<nav className="border-b-2 z-3 filter bg-white bg-opacity-90 backdrop-blur-xl ">
64+
<nav className="border-b-2 z-3 filter bg-white bg-opacity-90 backdrop-blur-xl">
6765
<div className="flex h-14 items-center max-w-screen-2xl mx-auto px-4 md:px-6">
6866
<div className="flex-1">
6967
<a className="flex w-fit items-center gap-1 lg:gap-2" href="/">
7068
<img
7169
className="w-5 lg:w-6 h-full"
7270
src={AudacityLogo.src}
7371
alt="A yellow and orange waveform between the ears of a set of blue headphones"
74-
width="24"
75-
height="24"
7672
/>
7773
<p className="signika text-blue-700 lg:text-lg font-medium lg:leading-none">
7874
Audacity
@@ -115,9 +111,6 @@ function NavigationReact(props) {
115111
className="fill-gray-700 w-4"
116112
xmlns="http://www.w3.org/2000/svg"
117113
viewBox="0 0 320 512"
118-
width="16"
119-
height="16"
120-
aria-hidden="true"
121114
>
122115
<path d="M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" />
123116
</svg>
@@ -126,25 +119,52 @@ function NavigationReact(props) {
126119
className="fill-gray-700 w-4"
127120
xmlns="http://www.w3.org/2000/svg"
128121
viewBox="0 0 448 512"
129-
width="16"
130-
height="16"
131-
aria-hidden="true"
132122
>
133123
<path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z" />
134124
</svg>
135125
)}
136126
</button>
137127
</div>
138-
<AnimatePresence>
139-
{isHamburgerMenuOpen && (
140-
<HamburgerMenu
141-
navLinks={navLinks}
142-
onLinkClick={handleHamburgerMenuClick}
143-
/>
144-
)}
145-
</AnimatePresence>
128+
129+
{isHamburgerMenuOpen && (
130+
<div className="flex flex-col py-2 bg-gray-50 border-y-2 absolute left-0 right-0 z-40 transition-opacity duration-200 ease-in-out opacity-100">
131+
{navLinks.map((navLink, index) => (
132+
<a
133+
key={index}
134+
onClick={() => handleHamburgerMenuClick()}
135+
className="py-3 px-4 text-gray-800 hover:text-blue-700 hover:bg-gray-100 transition-all duration-200 ease-in-out"
136+
style={{
137+
animationName: "fadeIn",
138+
animationDuration: "200ms",
139+
animationTimingFunction: "ease-in-out",
140+
animationFillMode: "forwards",
141+
animationDelay: `${index * 50}ms`,
142+
opacity: 0,
143+
transform: "translateX(-10px)",
144+
}}
145+
href={navLink.href}
146+
target={navLink.target}
147+
>
148+
{navLink.linkText}
149+
</a>
150+
))}
151+
152+
<style jsx>{`
153+
@keyframes fadeIn {
154+
from {
155+
opacity: 0;
156+
transform: translateX(-10px);
157+
}
158+
to {
159+
opacity: 1;
160+
transform: translateX(0);
161+
}
162+
}
163+
`}</style>
164+
</div>
165+
)}
146166
</nav>
147167
);
148168
}
149169

150-
export default NavigationReact;
170+
export default NavigationReact;

src/content/blog/audacity-3-4.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ publishDate: 2023-11-02
88
draft: false
99
---
1010

11-
<iframe width="560" height="315" src="https://www.youtube.com/embed/xgdYuSHdkso?si=xNPqJqRtzJnreHZh" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
11+
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; margin-bottom: 20px;">
12+
<iframe
13+
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;"
14+
src="https://www.youtube.com/embed/xgdYuSHdkso?si=xNPqJqRtzJnreHZh"
15+
title="YouTube video player"
16+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
17+
referrerpolicy="strict-origin-when-cross-origin"
18+
allowfullscreen
19+
></iframe>
20+
</div>
1221
1322
*Watch the release video!*
1423

src/content/blog/audacity-3-5.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
---
22
title: Audacity 3.5
33
author: Leo Wattenberg
4-
description: Audacity 3.5 adds Cloud saving, automatic tempo detection and more!
4+
description: Audacity 3.5 adds Cloud saving, automatic tempo detection and more!
55
cover: "./audacity-3.5.webp"
66
coverAlt: "Audacity 3.5: Cloud saving and more"
77
publishDate: 2024-04-22
88
draft: false
99
---
1010

11-
<iframe width="560" height="315" src="https://www.youtube.com/embed/qEAZv_o0HuQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> <i>Watch the release video!</i>
11+
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; margin-bottom: 20px;">
12+
<iframe
13+
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;"
14+
src="https://www.youtube.com/embed/qEAZv_o0HuQ"
15+
title="YouTube video player"
16+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
17+
referrerpolicy="strict-origin-when-cross-origin"
18+
allowfullscreen
19+
></iframe>
20+
</div>
21+
<i>Watch the release video!</i>
1222
1323
We are excited to announce Audacity 3.5, which adds the following features:
1424

@@ -28,15 +38,15 @@ You now can non-destructively change the pitch of a clip by holding Alt and pres
2838

2939
## and more!
3040

31-
There have been many other changes for this release.
41+
There have been many other changes for this release.
3242

33-
* Added the ability to export labels as subtitle files.
34-
* Added an option to skip plugin scanning.
35-
* Added an overflow menu, and speed and pitch indicators for clips.
36-
* Various changes to a variety of features.
37-
* Removed some niche features to simplify the app. This should make Audacity a bit less overwhelming to use, and also will speed up future development as fewer things need to be considered.
43+
- Added the ability to export labels as subtitle files.
44+
- Added an option to skip plugin scanning.
45+
- Added an overflow menu, and speed and pitch indicators for clips.
46+
- Various changes to a variety of features.
47+
- Removed some niche features to simplify the app. This should make Audacity a bit less overwhelming to use, and also will speed up future development as fewer things need to be considered.
3848

39-
A more detailed overview of these changes can be found in our [changelog](https://support.audacityteam.org/additional-resources/changelog/audacity-3.5).
49+
A more detailed overview of these changes can be found in our [changelog](https://support.audacityteam.org/additional-resources/changelog/audacity-3.5).
4050
You can download Audacity on [audacityteam.org/download](/download).
4151

42-
The [Intel OpenVINO plugin](https://github.com/intel/openvino-plugins-ai-audacity/releases/tag/v3.5.0-R2) also has been updated for version 3.5.
52+
The [Intel OpenVINO plugin](https://github.com/intel/openvino-plugins-ai-audacity/releases/tag/v3.5.0-R2) also has been updated for version 3.5.

src/content/blog/audacity-3-6.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ publishDate: 2024-07-16
88
draft: false
99
---
1010

11-
<iframe width="560" height="315" src="https://www.youtube.com/embed/f5TXPUOFH6A?si=3B9NiGTBOrLR2Ypp" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
11+
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; margin-bottom: 20px;">
12+
<iframe
13+
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;"
14+
src="https://www.youtube.com/embed/f5TXPUOFH6A?si=3B9NiGTBOrLR2Ypp"
15+
title="YouTube video player"
16+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
17+
referrerpolicy="strict-origin-when-cross-origin"
18+
allowfullscreen
19+
></iframe>
20+
</div>
1221
1322
*Watch the release video*
1423

src/pages/blog.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const publishedBlogPosts = await getCollection("blog", ({ data }) => {
2525
href={post.slug}
2626
title={post.data.title}
2727
description={post.data.description}
28-
author={post.data.author}
2928
publishDate={post.data.publishDate}
3029
cover={post.data.cover}
3130
coverAlt={post.data.coverAlt}

tailwind.config.cjs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,22 @@
22
module.exports = {
33
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
44
theme: {
5-
extend: {},
5+
extend: {
6+
animation: {
7+
fadeIn: "fadeIn 0.2s ease-in-out",
8+
fadeInSlow: "fadeInSlow 0.3s ease-in-out forwards",
9+
},
10+
keyframes: {
11+
fadeIn: {
12+
"0%": { opacity: "0" },
13+
"100%": { opacity: "1" },
14+
},
15+
fadeInSlow: {
16+
"0%": { opacity: "0", transform: "translateX(-10px)" },
17+
"100%": { opacity: "1", transform: "translateX(0)" },
18+
},
19+
},
20+
},
621
screens: {
722
xxs: "320px",
823
xs: "480px",

0 commit comments

Comments
 (0)