@@ -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+
1826const variant = ' rainbow-original' ; // rainbow | rainbow-original | trans | pan
1927const width = 200 ;
2028const numOfColumns = 20 ;
2129const staggeredDelay = 50 ;
22- const billow = 10 ;
30+ const billow = 5 ;
2331
2432const colors = COLORS [variant ];
2533const friendlyWidth = Math .round (width / numOfColumns ) * numOfColumns ;
2634
2735const 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 {
0 commit comments