-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ee8e0d
commit 69c24ab
Showing
112 changed files
with
23,036 additions
and
3,397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended', 'plugin:storybook/recommended'], | ||
ignorePatterns: ['dist', '.eslintrc.cjs'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['react-refresh'], | ||
rules: { | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
*storybook.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { StorybookConfig } from "@storybook/react-vite"; | ||
|
||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
addons: [ | ||
"@storybook/addon-onboarding", | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@chromatic-com/storybook", | ||
"@storybook/addon-interactions", | ||
], | ||
core: { | ||
builder: "@storybook/builder-vite", // 👈 The builder enabled here. | ||
}, | ||
framework: { | ||
name: "@storybook/react-vite", | ||
options: {}, | ||
}, | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { Preview } from "@storybook/react"; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# React + TypeScript + Vite | ||
|
||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
|
||
Currently, two official plugins are available: | ||
|
||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh | ||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh | ||
|
||
## Expanding the ESLint configuration | ||
|
||
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: | ||
|
||
- Configure the top-level `parserOptions` property like this: | ||
|
||
```js | ||
export default { | ||
// other rules... | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: ['./tsconfig.json', './tsconfig.node.json', './tsconfig.app.json'], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
} | ||
``` | ||
|
||
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` | ||
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` | ||
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"$schema": "https://ui.shadcn.com/schema.json", | ||
"style": "default", | ||
"rsc": false, | ||
"tsx": true, | ||
"tailwind": { | ||
"config": "tailwind.config.js", | ||
"css": "src/index.css", | ||
"baseColor": "slate", | ||
"cssVariables": true, | ||
"prefix": "" | ||
}, | ||
"aliases": { | ||
"components": "@/components", | ||
"utils": "@/lib/utils" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link href="https://fonts.googleapis.com/css2?family=Azeret+Mono:ital,wght@0,100..900;1,100..900&family=Bodoni+Moda:ital,opsz,wght@0,6..96,400..900;1,6..96,400..900&display=swap" rel="stylesheet"> | ||
|
||
<title>Vite + React + TS</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"name": "survivor", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc -b && vite build", | ||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", | ||
"preview": "vite preview", | ||
"storybook": "storybook dev -p 6006", | ||
"build-storybook": "storybook build" | ||
}, | ||
"dependencies": { | ||
"@radix-ui/react-slider": "^1.2.0", | ||
"@radix-ui/react-slot": "^1.1.0", | ||
"@radix-ui/react-tabs": "^1.1.0", | ||
"class-variance-authority": "^0.7.0", | ||
"clsx": "^2.1.1", | ||
"framer-motion": "^11.3.19", | ||
"lucide-react": "^0.416.0", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"tailwind-merge": "^2.4.0", | ||
"tailwindcss-animate": "^1.0.7", | ||
"@lootsurvivor/core": "workspace:^" | ||
}, | ||
"devDependencies": { | ||
"@chromatic-com/storybook": "^1.6.1", | ||
"@storybook/addon-essentials": "^8.2.6", | ||
"@storybook/addon-interactions": "^8.2.6", | ||
"@storybook/addon-links": "^8.2.6", | ||
"@storybook/addon-onboarding": "^8.2.6", | ||
"@storybook/blocks": "^8.2.6", | ||
"@storybook/builder-vite": "^8.2.6", | ||
"@storybook/react": "^8.2.6", | ||
"@storybook/react-vite": "^8.2.6", | ||
"@storybook/test": "^8.2.6", | ||
"@types/node": "^20.14.12", | ||
"@types/react": "^18.3.3", | ||
"@types/react-dom": "^18.3.0", | ||
"@typescript-eslint/eslint-plugin": "^7.15.0", | ||
"@typescript-eslint/parser": "^7.15.0", | ||
"@vitejs/plugin-react": "^4.3.1", | ||
"autoprefixer": "^10.4.19", | ||
"eslint": "^8.57.0", | ||
"eslint-plugin-react-hooks": "^4.6.2", | ||
"eslint-plugin-react-refresh": "^0.4.7", | ||
"eslint-plugin-storybook": "^0.8.0", | ||
"postcss": "^8.4.40", | ||
"storybook": "^8.2.6", | ||
"tailwindcss": "^3.4.7", | ||
"typescript": "^5.2.2", | ||
"vite": "^5.3.4", | ||
"vite-plugin-svgr": "^4.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#root { | ||
max-width: 1280px; | ||
margin: 0 auto; | ||
padding: 2rem; | ||
text-align: center; | ||
} | ||
|
||
.logo { | ||
height: 6em; | ||
padding: 1.5em; | ||
will-change: filter; | ||
transition: filter 300ms; | ||
} | ||
.logo:hover { | ||
filter: drop-shadow(0 0 2em #646cffaa); | ||
} | ||
.logo.react:hover { | ||
filter: drop-shadow(0 0 2em #61dafbaa); | ||
} | ||
|
||
@keyframes logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
a:nth-of-type(2) .logo { | ||
animation: logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.card { | ||
padding: 2em; | ||
} | ||
|
||
.read-the-docs { | ||
color: #888; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { useState } from "react"; | ||
|
||
import "./App.css"; | ||
|
||
import { useGameStateStore } from "@lootsurvivor/core"; | ||
|
||
function App() { | ||
const [count, setCount] = useState(0); | ||
|
||
const { gameState } = useGameStateStore.getState(); | ||
|
||
return <></>; | ||
} | ||
|
||
export default App; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { Button } from "../ui/button"; | ||
import { RoundedContainer } from "./RoundedContainer"; | ||
import { motion } from "framer-motion"; | ||
|
||
export interface Beast { | ||
name: string; | ||
level: number; | ||
health: number; | ||
maxHealth: number; | ||
image: string; | ||
} | ||
|
||
export const BeastCard = ({ beast }: { beast: Beast }) => { | ||
return ( | ||
<RoundedContainer inner className="text-primary bg-beast-red/50 relative"> | ||
<div className="text-5xl p-10 text-center uppercase">{beast.name}</div> | ||
<RoundedContainer inner> | ||
<div className="flex justify-between gap-8 p-6 py-4"> | ||
<div className="self-center">Tier 1</div> | ||
<div className="flex-grow mx-2 relative"> | ||
<div className="w-full rounded-2xl h-6 border border-primary overflow-hidden"> | ||
<motion.div | ||
className="bg-beast-red/50 h-full rounded-2xl border-r border-primary" | ||
initial={{ width: "0%" }} | ||
animate={{ | ||
width: `${(beast.health / beast.maxHealth) * 100}%`, | ||
}} | ||
transition={{ duration: 1, ease: "easeOut" }} | ||
></motion.div> | ||
</div> | ||
<div className="text-xs text-center mt-1 flex justify-center absolute top-0 px-3 w-full"> | ||
<div> | ||
{beast.health}/{beast.maxHealth} HP | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div className="self-center">lvl. {beast.level}</div> | ||
</div> | ||
<RoundedContainer inner> | ||
<img | ||
src={beast.image} | ||
alt="" | ||
className="w-full object-cover border border-primary rounded-2xl" | ||
/> | ||
</RoundedContainer> | ||
</RoundedContainer> | ||
<RoundedContainer className="absolute bottom-36 left-0 right-0 p-4 bg-black/90 mx-8"> | ||
{/* Add your content here */} | ||
<div> | ||
Giant: argghhh, who do you think you are!!! I will crush your skull | ||
and eat your flesh! Time to die human. | ||
</div> | ||
</RoundedContainer> | ||
<RoundedContainer | ||
inner | ||
className="absolute bottom-0 left-0 right-0 p-4 bg-black/90 flex justify-between" | ||
> | ||
<div className="flex flex-col gap-4"> | ||
<Button variant="destructive">Attack</Button> | ||
<Button variant="default">Attack Till Death</Button> | ||
</div> | ||
<div className="flex flex-col gap-4"> | ||
<Button variant="default">Flee</Button> | ||
<Button variant="default">Flee Till Death</Button> | ||
</div> | ||
</RoundedContainer> | ||
</RoundedContainer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { RoundedContainer } from "./RoundedContainer"; | ||
|
||
const items = [ | ||
{ | ||
title: "+2 Strength", | ||
}, | ||
{ | ||
title: "Equip Sword", | ||
}, | ||
]; | ||
|
||
export const Confirmation = () => { | ||
return ( | ||
<RoundedContainer className="bg-primary/40"> | ||
<div className="text-4xl p-4 text-center ">Upgrading...</div> | ||
|
||
<RoundedContainer className="p-4 grid grid-cols-3 gap-4" inner> | ||
{items.map((item) => ( | ||
<ConfirmationCard> | ||
<div>{item.title}</div> | ||
</ConfirmationCard> | ||
))} | ||
</RoundedContainer> | ||
</RoundedContainer> | ||
); | ||
}; | ||
|
||
export const ConfirmationCard = ({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) => { | ||
return ( | ||
<div className="border border-primary bg-primary/40 text-center rounded-2xl p-4 animate-pulse"> | ||
{children} | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.