Skip to content

Commit d913968

Browse files
committed
pride month
1 parent 20881c4 commit d913968

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

src/components/Pride.astro

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,26 @@ export const COLORS = {
1515
pan: ['hsl(331deg 100% 55%)', 'hsl(50deg 100% 50%)', 'hsl(200deg 100% 55%)'],
1616
};
1717
18+
interface Props {
19+
fontSize?: string;
20+
}
21+
22+
const {
23+
fontSize = "1.2rem",
24+
} = Astro.props;
25+
1826
const variant = 'rainbow-original'; // rainbow | rainbow-original | trans | pan
1927
const width = 200;
2028
const numOfColumns = 20;
2129
const staggeredDelay = 50;
22-
const billow = 10;
30+
const billow = 5;
2331
2432
const colors = COLORS[variant];
2533
const friendlyWidth = Math.round(width / numOfColumns) * numOfColumns;
2634
2735
const firstColumnDelay = numOfColumns * staggeredDelay * -1;
2836
29-
function generateGradientString(colors) {
37+
function generateGradientString(colors: string[]) {
3038
const numOfColors = colors.length;
3139
const segmentHeight = 100 / numOfColors;
3240
@@ -40,7 +48,7 @@ function generateGradientString(colors) {
4048
return `linear-gradient(to bottom, ${gradientStops.join(', ')})`;
4149
}
4250
43-
function range(n) {
51+
function range(n: number) {
4452
return Array.from({ length: n }, (_, i) => i);
4553
}
4654
---
@@ -60,7 +68,7 @@ function range(n) {
6068
))
6169
}
6270
</div>
63-
<span class="flag-text"> Pride Month </span>
71+
<span class="flag-text" style={`--font-size: ${fontSize}`}> Happy Pride Month! </span>
6472
</div>
6573

6674
<style>
@@ -75,7 +83,7 @@ function range(n) {
7583

7684
.flag {
7785
display: flex;
78-
aspect-ratio: 12 / 2;
86+
aspect-ratio: 6 / 2;
7987
animation-duration: 600ms;
8088
cursor: pointer;
8189
}
@@ -84,8 +92,8 @@ function range(n) {
8492
position: absolute;
8593
top: 50%;
8694
left: 50%;
87-
transform: translate(-50%, -50%);
88-
font-size: 2rem;
95+
transform: translate(-50%, -55%);
96+
font-size: var(--font-size);
8997
font-weight: bold;
9098
text-shadow:
9199
0 0 10px black,
@@ -94,6 +102,7 @@ function range(n) {
94102
user-select: none;
95103
cursor: pointer;
96104
text-wrap: nowrap;
105+
text-align: center;
97106
}
98107

99108
.column {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
import Default from '@astrojs/starlight/components/TableOfContents.astro';
33
import Sponsors from './Sponsors.astro';
4+
import Pride from './Pride.astro';
45
---
56

67
<Default {...Astro.props}><slot /></Default>
78
<Sponsors />
9+
<Pride></Pride>

0 commit comments

Comments
 (0)