Skip to content

Commit c3d90ec

Browse files
committed
feat: Implement core application pages and reusable UI components.
1 parent 5902100 commit c3d90ec

File tree

8 files changed

+1591
-1467
lines changed

8 files changed

+1591
-1467
lines changed

web/components/ui/Button.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import React from 'react';
2-
import { useTheme } from '../../contexts/ThemeContext';
32
import { THEMES } from '../../constants';
3+
import { useTheme } from '../../contexts/ThemeContext';
44

55
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
66
variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
77
size?: 'sm' | 'md' | 'lg';
88
}
99

10-
export const Button: React.FC<ButtonProps> = ({
11-
children,
12-
variant = 'primary',
13-
size = 'md',
14-
className = '',
15-
...props
10+
export const Button: React.FC<ButtonProps> = ({
11+
children,
12+
variant = 'primary',
13+
size = 'md',
14+
className = '',
15+
...props
1616
}) => {
1717
const { style } = useTheme();
1818

1919
const baseStyles = "transition-all duration-200 font-bold flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed";
20-
20+
2121
const sizeStyles = {
2222
sm: "px-3 py-1.5 text-sm",
2323
md: "px-5 py-2.5 text-base",
@@ -27,8 +27,8 @@ export const Button: React.FC<ButtonProps> = ({
2727
let themeStyles = "";
2828

2929
if (style === THEMES.NEOBRUTALISM) {
30-
themeStyles = "border-2 border-black shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] active:translate-x-[4px] active:translate-y-[4px] active:shadow-none rounded-none uppercase tracking-wider";
31-
30+
themeStyles = "border-2 border-black shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] active:translate-x-[4px] active:translate-y-[4px] active:shadow-none rounded-none uppercase tracking-wider font-mono";
31+
3232
if (variant === 'primary') themeStyles += " bg-neo-main text-white";
3333
if (variant === 'secondary') themeStyles += " bg-neo-second text-black";
3434
if (variant === 'danger') themeStyles += " bg-red-500 text-white";
@@ -37,15 +37,15 @@ export const Button: React.FC<ButtonProps> = ({
3737
} else {
3838
// Glassmorphism
3939
themeStyles = "rounded-xl backdrop-blur-md border border-white/20 shadow-lg hover:shadow-xl active:scale-95";
40-
40+
4141
if (variant === 'primary') themeStyles += " bg-gradient-to-r from-blue-500 to-purple-600 text-white shadow-blue-500/30";
4242
if (variant === 'secondary') themeStyles += " bg-white/10 text-white hover:bg-white/20";
4343
if (variant === 'danger') themeStyles += " bg-gradient-to-r from-red-500 to-pink-600 text-white shadow-red-500/30";
4444
if (variant === 'ghost') themeStyles += " bg-transparent border-none shadow-none hover:bg-white/10 text-current";
4545
}
4646

4747
return (
48-
<button
48+
<button
4949
className={`${baseStyles} ${sizeStyles[size]} ${themeStyles} ${className}`}
5050
{...props}
5151
>

web/components/ui/Modal.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { AnimatePresence, motion, Variants } from 'framer-motion';
2+
import { X } from 'lucide-react';
13
import React from 'react';
2-
import { motion, AnimatePresence, Variants } from 'framer-motion';
3-
import { useTheme } from '../../contexts/ThemeContext';
44
import { THEMES } from '../../constants';
5-
import { X } from 'lucide-react';
5+
import { useTheme } from '../../contexts/ThemeContext';
66

77
interface ModalProps {
88
isOpen: boolean;
@@ -22,20 +22,20 @@ export const Modal: React.FC<ModalProps> = ({ isOpen, onClose, title, children,
2222

2323
const modalVariants: Variants = style === THEMES.NEOBRUTALISM ? {
2424
hidden: { y: '100%', rotate: -5, opacity: 0 },
25-
visible: {
26-
y: 0,
27-
rotate: 0,
25+
visible: {
26+
y: 0,
27+
rotate: 0,
2828
opacity: 1,
29-
transition: { type: 'spring', damping: 15, stiffness: 200 }
29+
transition: { type: 'spring', damping: 15, stiffness: 200 }
3030
},
3131
exit: { y: '100%', rotate: 5, opacity: 0 }
3232
} : {
3333
hidden: { scale: 0.8, opacity: 0, backdropFilter: 'blur(0px)' },
34-
visible: {
35-
scale: 1,
36-
opacity: 1,
34+
visible: {
35+
scale: 1,
36+
opacity: 1,
3737
backdropFilter: 'blur(10px)',
38-
transition: { type: 'spring', damping: 20, stiffness: 300 }
38+
transition: { type: 'spring', damping: 20, stiffness: 300 }
3939
},
4040
exit: { scale: 0.8, opacity: 0 }
4141
};
@@ -58,8 +58,8 @@ export const Modal: React.FC<ModalProps> = ({ isOpen, onClose, title, children,
5858
animate="visible"
5959
exit="exit"
6060
className={`relative w-full max-w-lg overflow-hidden flex flex-col max-h-[90vh]
61-
${style === THEMES.NEOBRUTALISM
62-
? 'bg-white border-2 border-black shadow-[8px_8px_0px_0px_rgba(0,0,0,1)]'
61+
${style === THEMES.NEOBRUTALISM
62+
? 'bg-white border-2 border-black shadow-[8px_8px_0px_0px_rgba(0,0,0,1)] rounded-none'
6363
: 'bg-gray-900/80 border border-white/20 rounded-3xl shadow-2xl text-white'}`}
6464
>
6565
{/* Header */}

0 commit comments

Comments
 (0)