Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions .github/workflows/deploy.yml

This file was deleted.

29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
MIT License

Copyright (c) 2025 Hasnae R.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---

## Acknowledgements

The "2048 Time Rush" game included in this project is inspired by the original
2048 game created by Gabriele Cirulli (https://github.com/gabrielecirulli/2048),
which is licensed under the MIT License.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@labset/vibe-coded",
"version": "1.0.0",
"description": "",
"license": "Apache-2.0",
"license": "MIT",
"author": "Hasnae R.",
"workspaces": [
"web/"
Expand Down
6 changes: 6 additions & 0 deletions web/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,10 @@ export default defineConfig([
],
},
},
{
files: ["src/routes/**/*.{ts,tsx}"],
rules: {
"react-refresh/only-export-components": "off",
},
},
]);
11 changes: 11 additions & 0 deletions web/src/components/theme-context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { createContext } from "react";
import type { ColorTheme, Mode } from "./theme-provider";

interface ThemeContextValue {
colorTheme: ColorTheme;
mode: Mode;
setColorTheme: (theme: ColorTheme) => void;
setMode: (mode: Mode) => void;
}

export const ThemeContext = createContext<ThemeContextValue | null>(null);
24 changes: 2 additions & 22 deletions web/src/components/theme-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
import {
createContext,
useCallback,
useContext,
useEffect,
useState,
} from "react";
import { useCallback, useEffect, useState } from "react";
import { ThemeContext } from "./theme-context";

export type ColorTheme = "burgundy" | "sage" | "ocean" | "amethyst";
export type Mode = "light" | "dark" | "system";

interface ThemeContextValue {
colorTheme: ColorTheme;
mode: Mode;
setColorTheme: (theme: ColorTheme) => void;
setMode: (mode: Mode) => void;
}

const ThemeContext = createContext<ThemeContextValue | null>(null);

const THEME_KEY = "game-gallery-theme";
const MODE_KEY = "game-gallery-mode";

Expand Down Expand Up @@ -64,9 +50,3 @@ export function ThemeProvider({ children }: { children: React.ReactNode }) {
</ThemeContext>
);
}

export function useTheme() {
const ctx = useContext(ThemeContext);
if (!ctx) throw new Error("useTheme must be used within ThemeProvider");
return ctx;
}
7 changes: 2 additions & 5 deletions web/src/components/theme-switcher.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { Sun, Moon, Monitor } from "lucide-react";
import { Button } from "@/components/ui/button";
import {
useTheme,
type ColorTheme,
type Mode,
} from "@/components/theme-provider";
import { useTheme } from "@/components/use-theme";
import type { ColorTheme, Mode } from "@/components/theme-provider";

const colorThemes: { value: ColorTheme; label: string; swatch: string }[] = [
{ value: "burgundy", label: "Burgundy", swatch: "oklch(.37 .14 15)" },
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/ui/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ function Badge({
});
}

export { Badge, badgeVariants };
export { Badge };
2 changes: 1 addition & 1 deletion web/src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ function Button({
);
}

export { Button, buttonVariants };
export { Button };
8 changes: 8 additions & 0 deletions web/src/components/use-theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { useContext } from "react";
import { ThemeContext } from "./theme-context";

export function useTheme() {
const ctx = useContext(ThemeContext);
if (!ctx) throw new Error("useTheme must be used within ThemeProvider");
return ctx;
}
2 changes: 1 addition & 1 deletion web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ThemeProvider } from "@/components/theme-provider";
import { routeTree } from "./routeTree.gen";
import "./index.css";

const router = createRouter({ routeTree, basepath: "/vibe-coded" });
const router = createRouter({ routeTree });

declare module "@tanstack/react-router" {
interface Register {
Expand Down
2 changes: 1 addition & 1 deletion web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function spaFallback(): Plugin {

// https://vite.dev/config/
export default defineConfig({
base: "/vibe-coded/",
base: "/",
plugins: [
TanStackRouterVite({ target: "react" }),
react(),
Expand Down
Loading