Skip to content

Commit acacdd2

Browse files
committed
feat: let us use tailwindcss
1 parent dfccc49 commit acacdd2

File tree

7 files changed

+66
-421
lines changed

7 files changed

+66
-421
lines changed

src/games/carrot-card-demo/components/Card.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ interface CardProps {
1010

1111
export const Card: React.FC<CardProps> = ({ card, onChoice }) => {
1212
return (
13-
<div className="card-container">
14-
<div className="card-illustration">
13+
<div className="absolute inset-0 flex flex-col bg-gradient-to-br from-slate-700 to-slate-800 text-white overflow-hidden animate-fade-in">
14+
<div className="flex-1 relative overflow-hidden bg-gradient-to-br from-slate-600 to-slate-700">
1515
<ImageLoader
1616
src={card.illustration || card.id}
1717
fallbackSrc="default"
1818
basePath="/illustrations/"
1919
alt={card.name}
20-
imageClass="h-full w-full object-cover"
20+
imageClass="w-full h-full object-cover transition-transform duration-300 hover:scale-105"
2121
/>
2222
</div>
23-
<div className="card-content">
24-
<h2 className="card-name">{card.name}</h2>
25-
<div className="card-description">
23+
<div className="p-8 bg-black/80 backdrop-blur-sm border-t border-white/10">
24+
<h2 className="text-3xl font-bold mb-4 text-gray-100 text-center">{card.name}</h2>
25+
<div className="text-lg leading-relaxed mb-8 text-gray-300 text-center max-w-2xl mx-auto">
2626
<TypewriterText text={card.description} enabled={true} />
2727
</div>
28-
<div className="card-choices">
28+
<div className="flex gap-4 justify-center flex-wrap">
2929
{card.choices.map((choice: any, index: number) => (
3030
<button
3131
key={index}
32-
className="choice-button"
32+
className="bg-gradient-to-r from-blue-500 to-blue-600 hover:from-blue-400 hover:to-blue-500 text-white px-6 py-3 rounded-full cursor-pointer text-base font-medium transition-all duration-300 shadow-lg shadow-blue-500/30 hover:shadow-xl hover:shadow-blue-500/40 hover:-translate-y-1 active:translate-y-0 min-w-[150px]"
3333
onClick={() => onChoice()}
3434
title={choice.description}
3535
>

src/games/carrot-card-demo/components/GameContainer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Card as CardType } from '@/games/carrot-card-demo/types';
33
import { cardService } from '@/games/carrot-card-demo/services/cardService';
44
import { Card } from '@/games/carrot-card-demo/components/Card';
55
import { MainMenu } from '@/games/carrot-card-demo/components/MainMenu';
6-
import '../styles/game.css';
76

87
export function GameContainer() {
98
const [currentCard, setCurrentCard] = useState<CardType | null>(null);

src/games/carrot-card-demo/components/MainMenu.tsx

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,33 @@ interface MainMenuProps {
66

77
export function MainMenu({ onStart }: MainMenuProps) {
88
return (
9-
<div className="main-menu-container">
10-
<div className="main-menu-content">
11-
<div className="main-menu-header">
12-
<h1 className="main-menu-title">Carrot Card Adventure</h1>
13-
<p className="main-menu-subtitle">An interactive storytelling experience</p>
9+
<div className="absolute inset-0 flex items-center justify-center bg-gradient-to-br from-indigo-500 via-purple-500 to-purple-700 overflow-hidden">
10+
{/* Background texture overlay */}
11+
<div
12+
className="absolute inset-0 opacity-30"
13+
style={{
14+
backgroundImage: `url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><defs><pattern id='grain' width='100' height='100' patternUnits='userSpaceOnUse'><circle cx='25' cy='25' r='1' fill='rgba(255,255,255,0.1)'/><circle cx='75' cy='75' r='1' fill='rgba(255,255,255,0.1)'/><circle cx='50' cy='10' r='0.5' fill='rgba(255,255,255,0.05)'/></pattern></defs><rect width='100' height='100' fill='url(%23grain)'/></svg>")`
15+
}}
16+
></div>
17+
18+
<div className="relative z-10 text-center text-white max-w-2xl px-12 animate-fade-in">
19+
<div className="mb-12">
20+
<h1 className="text-6xl font-extrabold mb-4 bg-gradient-to-r from-white to-blue-100 bg-clip-text text-transparent drop-shadow-lg tracking-tight">
21+
Carrot Card Adventure
22+
</h1>
23+
<p className="text-xl opacity-90 font-light tracking-wide">
24+
An interactive storytelling experience
25+
</p>
1426
</div>
1527

16-
<div className="main-menu-actions">
17-
<button onClick={onStart} className="main-menu-start-btn">
28+
<div className="flex flex-col items-center gap-6">
29+
<button
30+
onClick={onStart}
31+
className="bg-gradient-to-r from-red-500 to-orange-500 hover:from-red-400 hover:to-pink-400 text-white font-semibold text-lg px-10 py-4 rounded-full cursor-pointer transition-all duration-300 shadow-lg shadow-orange-500/30 hover:shadow-xl hover:shadow-orange-500/40 hover:-translate-y-1 active:translate-y-0 uppercase tracking-wider"
32+
>
1833
Begin Your Journey
1934
</button>
20-
<p className="main-menu-hint">
35+
<p className="text-sm opacity-70 italic">
2136
Make choices that shape your destiny
2237
</p>
2338
</div>

src/games/carrot-card-demo/styles/game.css

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

0 commit comments

Comments
 (0)