Skip to content

Commit b266868

Browse files
committed
Moved animation css code to tailwind config and added yellow as warning color
1 parent 5b1076d commit b266868

File tree

7 files changed

+25
-27
lines changed

7 files changed

+25
-27
lines changed

src/app/hero-banner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function HeroBanner() {
1717
href={"/race"}
1818
title="View Profile Picture"
1919
prefetch
20-
className="px-4 py-2 text-sm italic font-medium transition-colors bg-yellow-500 rounded-md md:text-2xl ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus:bg-accent hover:bg-accent hover:text-accent-foreground"
20+
className="px-4 py-2 text-sm italic font-medium transition-colors bg-warning rounded-md md:text-2xl ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus:bg-accent hover:bg-accent hover:text-accent-foreground"
2121
>
2222
{"Start Racing"}
2323
</Link>

src/app/race/displayed-code.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { cn } from "@/lib/utils";
2-
import "@/styles/animation.css";
32

43
interface displayCodeProps {
54
code: string;
@@ -21,7 +20,7 @@ export default function DisplayedCode({
2120
key={index}
2221
className={cn({
2322
"bg-red-500 opacity-100": errors.includes(index),
24-
"blink-animation": userInput.length === index,
23+
"animate-blink": userInput.length === index,
2524
"opacity-100":
2625
userInput.length !== index && userInput[index] === char,
2726
"opacity-50":

src/components/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function Header() {
99
const user = await getCurrentUser();
1010

1111
return (
12-
<header className="sticky top-0 z-40 flex w-full border-b-2 border-yellow-500 bg-background/10 backdrop-blur-sm">
12+
<header className="sticky top-0 z-40 flex w-full border-b-2 border-warning bg-background/10 backdrop-blur-sm">
1313
<div className="container flex items-center w-full h-20 space-x-4 sm:space-x-0">
1414
<div className="flex-1">
1515
<MainNav items={siteConfig.getHeaderLinks(!!user)} />

src/components/mode-toggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function ModeToggle() {
1818
return (
1919
<DropdownMenu>
2020
<DropdownMenuTrigger asChild>
21-
<Button className="border-yellow-500" variant="outline" size="icon">
21+
<Button className="border-warning" variant="outline" size="icon">
2222
<Icons.sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:rotate-90 dark:scale-0" />
2323
<Icons.moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
2424
<span className="sr-only">Toggle theme</span>

src/styles/animation.css

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

src/styles/globals.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
--success: 129, 74%, 45%;
3535
--success-foreground: 114, 65%, 36%;
3636

37+
--warning-light: 53, 98.3%, 76.9%;
38+
--warning-dark: 45, 93.4%, 47.5%;
39+
3740
--ring: 215 20.2% 65.1%;
3841

3942
--radius: 0.5rem;
@@ -72,6 +75,9 @@
7275
--success: 121, 68%, 44%;
7376
--success-foreground: 114, 68%, 35%;
7477

78+
--warning-light: 53, 98.3%, 76.9%;
79+
--warning-dark: 45, 93.4%, 47.5%;
80+
7581
--ring: 217.2 32.6% 17.5%;
7682

7783
--monochrome-color: 0 0% 100%;

tailwind.config.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
module.exports = {
33
darkMode: ["class"],
44
content: [
5-
'./pages/**/*.{ts,tsx}',
6-
'./components/**/*.{ts,tsx}',
7-
'./app/**/*.{ts,tsx}',
8-
'./src/**/*.{ts,tsx}',
5+
"./pages/**/*.{ts,tsx}",
6+
"./components/**/*.{ts,tsx}",
7+
"./app/**/*.{ts,tsx}",
8+
"./src/**/*.{ts,tsx}",
99
],
1010
theme: {
1111
container: {
@@ -44,6 +44,10 @@ module.exports = {
4444
DEFAULT: "hsl(var(--success))",
4545
foreground: "hsl(var(--success-foreground))",
4646
},
47+
warning: {
48+
DEFAULT: "hsl(var(--warning-dark))",
49+
200: "hsl(var(--warning-light))",
50+
},
4751
muted: {
4852
DEFAULT: "hsl(var(--muted))",
4953
foreground: "hsl(var(--muted-foreground))",
@@ -86,14 +90,20 @@ module.exports = {
8690
"dash": {
8791
"0%": { transform: "translate(2539.6383913420013px, 0)" },
8892
"100%": { transform: "translate(-2539.6383913420013px, 0)" }
93+
},
94+
"blink": {
95+
"0%": { background: "bg-warning-200", color: "##878c8e" },
96+
"50%": { background: "transparent" },
97+
"100%": { background: "bg-warning-200", color: "##878c8e" },
8998
}
9099
},
91100
animation: {
92101
"accordion-down": "accordion-down 0.2s ease-out",
93102
"accordion-up": "accordion-up 0.2s ease-out",
94103
"gear-rotate-left": "gear-rotate-left 5s linear infinite",
95104
"gear-rotate-right": "gear-rotate-right 5s linear infinite",
96-
"dash":"dash linear infinite",
105+
"dash": "dash linear infinite",
106+
"blink": "blink 1.5s ease infinite"
97107
},
98108
},
99109
},

0 commit comments

Comments
 (0)