forked from external-repos/LifeTrinket
config vite
This commit is contained in:
18
.eslintrc.cjs
Normal file
18
.eslintrc.cjs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
env: { browser: true, es2020: true },
|
||||||
|
extends: [
|
||||||
|
'eslint:recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
'plugin:react-hooks/recommended',
|
||||||
|
],
|
||||||
|
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
plugins: ['react-refresh'],
|
||||||
|
rules: {
|
||||||
|
'react-refresh/only-export-components': [
|
||||||
|
'warn',
|
||||||
|
{ allowConstantExport: true },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
||||||
4
.firebase/hosting.ZGlzdA.cache
Normal file
4
.firebase/hosting.ZGlzdA.cache
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
index.html,1693048446124,b351131379064e36f67109e39cfeb07c303bcc52bd4c7d67325d3522c5184cc7
|
||||||
|
vite.svg,1693048445997,d3bbbc44b3ea71906a72bf2ec1a4716903e2e3d9f85a5007205a65d1f12e2923
|
||||||
|
assets/index-5265c558.css,1693048446124,08c4451946bbdf520fe337edb365417a8bbf91914c018b83866723ef52d57b43
|
||||||
|
assets/index-8f4d569e.js,1693048446124,a0693393f657c18014ccff294601ac1021e94ee930ef4b0aead30146cb9809e0
|
||||||
5
.firebaserc
Normal file
5
.firebaserc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"projects": {
|
||||||
|
"default": "life-trinket"
|
||||||
|
}
|
||||||
|
}
|
||||||
42
.gitignore
vendored
42
.gitignore
vendored
@@ -1,24 +1,24 @@
|
|||||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
# Logs
|
||||||
|
logs
|
||||||
# dependencies
|
*.log
|
||||||
/node_modules
|
|
||||||
/.pnp
|
|
||||||
.pnp.js
|
|
||||||
|
|
||||||
# testing
|
|
||||||
/coverage
|
|
||||||
|
|
||||||
# production
|
|
||||||
/build
|
|
||||||
/.vscode
|
|
||||||
|
|
||||||
# misc
|
|
||||||
.DS_Store
|
|
||||||
.env.local
|
|
||||||
.env.development.local
|
|
||||||
.env.test.local
|
|
||||||
.env.production.local
|
|
||||||
|
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.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?
|
||||||
|
|||||||
16
firebase.json
Normal file
16
firebase.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"hosting": {
|
||||||
|
"public": "dist",
|
||||||
|
"ignore": [
|
||||||
|
"firebase.json",
|
||||||
|
"**/.*",
|
||||||
|
"**/node_modules/**"
|
||||||
|
],
|
||||||
|
"rewrites": [
|
||||||
|
{
|
||||||
|
"source": "**",
|
||||||
|
"destination": "/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
13
index.html
Normal file
13
index.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<!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" />
|
||||||
|
<title>Vite + React + TS</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
67
package.json
67
package.json
@@ -1,55 +1,38 @@
|
|||||||
{
|
{
|
||||||
"name": "my-app",
|
"name": "firebase-project",
|
||||||
"version": "0.1.0",
|
|
||||||
"homepage": "https://vikeo.github.io/LifeTrinket/",
|
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"version": "0.0.0",
|
||||||
|
"type": "commonjs",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite",
|
||||||
|
"build": "tsc && vite build",
|
||||||
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||||
|
"preview": "vite preview",
|
||||||
|
"generate-icons": "npx @svgr/cli src/Icons/svgs",
|
||||||
|
"deploy": "yarn build && firebase deploy --only hosting"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.11.1",
|
|
||||||
"@emotion/styled": "^11.11.0",
|
|
||||||
"@mui/material": "^5.13.6",
|
"@mui/material": "^5.13.6",
|
||||||
"@types/node": "^16.7.13",
|
|
||||||
"@types/react": "^18.0.0",
|
|
||||||
"@types/react-dom": "^18.0.0",
|
|
||||||
"gh-pages": "^5.0.0",
|
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-screen-wake-lock": "^3.0.1",
|
"react-screen-wake-lock": "^3.0.1",
|
||||||
"react-scripts": "5.0.1",
|
"styled-components": "^6.0.7"
|
||||||
"styled-components": "^6.0.1",
|
|
||||||
"typescript": "^4.4.2",
|
|
||||||
"web-vitals": "^2.1.0"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"predeploy": "yarn run build",
|
|
||||||
"deploy": "gh-pages -d build",
|
|
||||||
"dev": "react-scripts start",
|
|
||||||
"build": "react-scripts build",
|
|
||||||
"test": "react-scripts test",
|
|
||||||
"eject": "react-scripts eject",
|
|
||||||
"generate-icons": "npx @svgr/cli src/Icons/svgs"
|
|
||||||
},
|
|
||||||
"eslintConfig": {
|
|
||||||
"extends": [
|
|
||||||
"react-app",
|
|
||||||
"react-app/jest"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"browserslist": {
|
|
||||||
"production": [
|
|
||||||
">0.2%",
|
|
||||||
"not dead",
|
|
||||||
"not op_mini all"
|
|
||||||
],
|
|
||||||
"development": [
|
|
||||||
"last 1 chrome version",
|
|
||||||
"last 1 firefox version",
|
|
||||||
"last 1 safari version"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
"@emotion/react": "^11.11.1",
|
||||||
|
"@emotion/styled": "^11.11.0",
|
||||||
"@svgr/cli": "^8.1.0",
|
"@svgr/cli": "^8.1.0",
|
||||||
"babel-plugin-styled-components": "^2.1.4",
|
"@types/react": "^18.2.15",
|
||||||
|
"@types/react-dom": "^18.2.7",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||||
|
"@typescript-eslint/parser": "^6.0.0",
|
||||||
|
"@vitejs/plugin-react-swc": "^3.3.2",
|
||||||
|
"eslint": "^8.45.0",
|
||||||
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
|
"eslint-plugin-react-refresh": "^0.4.3",
|
||||||
|
"firebase-tools": "^12.5.2",
|
||||||
|
"typescript": "^5.0.2",
|
||||||
|
"vite": "^4.4.5",
|
||||||
"prettier": "2.8.8"
|
"prettier": "2.8.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
5
react-screen-wake-lock.d.ts
vendored
Normal file
5
react-screen-wake-lock.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
declare module 'react-screen-wake-lock' {
|
||||||
|
// Define the types for the module's exports
|
||||||
|
const content: unknown; // Use 'any' as a placeholder for missing types
|
||||||
|
export default content;
|
||||||
|
}
|
||||||
125
src/App copy.tsx
Normal file
125
src/App copy.tsx
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import './App.css';
|
||||||
|
import { Player } from './Types/Player';
|
||||||
|
import Play from './Components/Views/Play';
|
||||||
|
import StartMenu from './Components/Views/StartMenu/StartMenu';
|
||||||
|
import { InitialSettings } from './Data/getInitialPlayers';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import { createGlobalStyle } from 'styled-components';
|
||||||
|
|
||||||
|
import { ThemeProvider } from '@mui/material';
|
||||||
|
import { theme } from './Data/theme';
|
||||||
|
|
||||||
|
const GlobalStyles = createGlobalStyle`
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
background-color: ${theme.palette.background.default};
|
||||||
|
}
|
||||||
|
#root {
|
||||||
|
touch-action: manipulation;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const RootWrapper2 = styled.div`
|
||||||
|
max-width: fit-content;
|
||||||
|
max-height: fit-content;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const RootWrapper = styled.div`
|
||||||
|
max-width: fit-content;
|
||||||
|
max-height: fit-content;
|
||||||
|
@media (orientation: portrait) {
|
||||||
|
rotate: 90deg;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const App = () => {
|
||||||
|
const savedPlayers = localStorage.getItem('players');
|
||||||
|
const savedGameSettings = localStorage.getItem('initialGameSettings');
|
||||||
|
|
||||||
|
const [initialGameSettings, setInitialGameSettings] =
|
||||||
|
useState<InitialSettings | null>(
|
||||||
|
savedGameSettings ? JSON.parse(savedGameSettings) : null
|
||||||
|
);
|
||||||
|
|
||||||
|
const [players, setPlayers] = useState<Player[]>(
|
||||||
|
savedPlayers ? JSON.parse(savedPlayers) : []
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
localStorage.setItem('players', JSON.stringify(players));
|
||||||
|
localStorage.setItem(
|
||||||
|
'initialGameSettings',
|
||||||
|
JSON.stringify(initialGameSettings)
|
||||||
|
);
|
||||||
|
}, [initialGameSettings, players]);
|
||||||
|
|
||||||
|
const handlePlayerChange = (updatedPlayer: Player) => {
|
||||||
|
const updatedPlayers = players.map((player) =>
|
||||||
|
player.index === updatedPlayer.index ? updatedPlayer : player
|
||||||
|
);
|
||||||
|
setPlayers(updatedPlayers);
|
||||||
|
};
|
||||||
|
|
||||||
|
const resetCurrentGame = () => {
|
||||||
|
// loop over all players and reset them
|
||||||
|
players.forEach((player) => {
|
||||||
|
player.commanderDamage.forEach((commanderDamage) => {
|
||||||
|
commanderDamage.damageTotal = 0;
|
||||||
|
commanderDamage.partnerDamageTotal = 0;
|
||||||
|
});
|
||||||
|
player.lifeTotal = 40;
|
||||||
|
player.extraCounters.forEach((counter) => {
|
||||||
|
counter.value = 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
handlePlayerChange(player);
|
||||||
|
});
|
||||||
|
|
||||||
|
setPlayers([...players]); // ensure to trigger a re-render
|
||||||
|
};
|
||||||
|
|
||||||
|
const newGame = () => {
|
||||||
|
localStorage.removeItem('players');
|
||||||
|
localStorage.removeItem('playing');
|
||||||
|
localStorage.removeItem('initialGameSettings');
|
||||||
|
|
||||||
|
window.location.reload();
|
||||||
|
};
|
||||||
|
|
||||||
|
if (players.length > 0 && initialGameSettings) {
|
||||||
|
// If the user has a key, we need to restart since key is deprecated
|
||||||
|
// FIXME: Remove this after a few months
|
||||||
|
if (players[0].key) {
|
||||||
|
newGame();
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<ThemeProvider theme={theme}>
|
||||||
|
<GlobalStyles />
|
||||||
|
<RootWrapper>
|
||||||
|
<Play
|
||||||
|
players={players}
|
||||||
|
onPlayerChange={handlePlayerChange}
|
||||||
|
gridAreas={initialGameSettings?.gridAreas}
|
||||||
|
resetCurrentGame={resetCurrentGame}
|
||||||
|
/>
|
||||||
|
</RootWrapper>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider theme={theme}>
|
||||||
|
<GlobalStyles />
|
||||||
|
<RootWrapper2>
|
||||||
|
<StartMenu
|
||||||
|
initialGameSettings={initialGameSettings}
|
||||||
|
setInitialGameSettings={setInitialGameSettings}
|
||||||
|
setPlayers={setPlayers}
|
||||||
|
/>
|
||||||
|
</RootWrapper2>
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default App;
|
||||||
38
src/App.css
38
src/App.css
@@ -1,38 +0,0 @@
|
|||||||
.App {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.App-logo {
|
|
||||||
height: 40vmin;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: no-preference) {
|
|
||||||
.App-logo {
|
|
||||||
animation: App-logo-spin infinite 20s linear;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.App-header {
|
|
||||||
background-color: #282c34;
|
|
||||||
min-height: 100vmin;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-size: calc(10px + 2vmin);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.App-link {
|
|
||||||
color: #61dafb;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes App-logo-spin {
|
|
||||||
from {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import './App.css';
|
|
||||||
import { Player } from './Types/Player';
|
import { Player } from './Types/Player';
|
||||||
import Play from './Components/Views/Play';
|
import Play from './Components/Views/Play';
|
||||||
import StartMenu from './Components/Views/StartMenu/StartMenu';
|
import StartMenu from './Components/Views/StartMenu/StartMenu';
|
||||||
import { InitialSettings } from './Data/getInitialPlayers';
|
import { InitialSettings } from './Data/getInitialPlayers';
|
||||||
import styled, { createGlobalStyle } from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
|
import { createGlobalStyle } from 'styled-components';
|
||||||
|
|
||||||
import { ThemeProvider } from '@mui/material';
|
import { ThemeProvider } from '@mui/material';
|
||||||
import { theme } from './Data/theme';
|
import { theme } from './Data/theme';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import styled, { css } from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
|
import { css } from 'styled-components';
|
||||||
import { Player, Rotation } from '../../Types/Player';
|
import { Player, Rotation } from '../../Types/Player';
|
||||||
import { useRef, useState } from 'react';
|
import { useRef, useState } from 'react';
|
||||||
import { OutlinedText } from '../Misc/OutlinedText';
|
import { OutlinedText } from '../Misc/OutlinedText';
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { ReactNode, useRef, useState } from 'react';
|
import { ReactNode, useRef, useState } from 'react';
|
||||||
import styled, { css } from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
|
import { css } from 'styled-components';
|
||||||
import { CounterType, Rotation } from '../../Types/Player';
|
import { CounterType, Rotation } from '../../Types/Player';
|
||||||
import { OutlinedText } from '../Misc/OutlinedText';
|
import { OutlinedText } from '../Misc/OutlinedText';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { useRef, useState } from 'react';
|
import { useRef, useState } from 'react';
|
||||||
import styled, { css } from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
|
import { css } from 'styled-components';
|
||||||
|
|
||||||
import { Rotation } from '../../Types/Player';
|
import { Rotation } from '../../Types/Player';
|
||||||
|
|
||||||
export const StyledLifeCounterButton = styled.button`
|
export const StyledLifeCounterButton = styled.button`
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import styled, { css } from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
|
import { css } from 'styled-components';
|
||||||
import { Rotation } from '../../Types/Player';
|
import { Rotation } from '../../Types/Player';
|
||||||
import { Cog } from '../../Icons/generated';
|
import { Cog } from '../../Icons/generated';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Player, Rotation } from '../../Types/Player';
|
import { Player, Rotation } from '../../Types/Player';
|
||||||
import styled, { css } from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
|
import { css } from 'styled-components';
|
||||||
import { CommanderDamage } from '../Buttons/CommanderDamage';
|
import { CommanderDamage } from '../Buttons/CommanderDamage';
|
||||||
|
|
||||||
const CommanderDamageGrid = styled.div<{ rotation: number }>`
|
const CommanderDamageGrid = styled.div<{ rotation: number }>`
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Player } from '../../Types/Player';
|
import { Player } from '../../Types/Player';
|
||||||
import LifeCounter from '../LifeCounter/LifeCounter';
|
import LifeCounter from '../LifeCounter/LifeCounter';
|
||||||
import styled from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
export const CountersWrapper = styled.div`
|
export const CountersWrapper = styled.div`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { CounterType, Player } from '../../Types/Player';
|
import { CounterType, Player } from '../../Types/Player';
|
||||||
import ExtraCounter from '../Buttons/ExtraCounter';
|
import ExtraCounter from '../Buttons/ExtraCounter';
|
||||||
import styled, { css } from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
|
import { css } from 'styled-components';
|
||||||
import { Rotation } from '../../Types/Player';
|
import { Rotation } from '../../Types/Player';
|
||||||
import {
|
import {
|
||||||
CommanderTax,
|
CommanderTax,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import styled, { css, keyframes } from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
|
import { css, keyframes } from 'styled-components';
|
||||||
import { Player, Rotation } from '../../Types/Player';
|
import { Player, Rotation } from '../../Types/Player';
|
||||||
import LifeCounterButton from '../Buttons/LifeCounterButton';
|
import LifeCounterButton from '../Buttons/LifeCounterButton';
|
||||||
import SettingsButton from '../Buttons/SettingsButton';
|
import SettingsButton from '../Buttons/SettingsButton';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import styled from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
import { theme } from '../../Data/theme';
|
import { theme } from '../../Data/theme';
|
||||||
|
|
||||||
const CenteredText = styled.div<{
|
const CenteredText = styled.div<{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import styled from 'styled-components';
|
|||||||
import { Paragraph } from './TextComponents';
|
import { Paragraph } from './TextComponents';
|
||||||
import { BuyMeCoffee, KoFi } from '../../Icons/generated/Support';
|
import { BuyMeCoffee, KoFi } from '../../Icons/generated/Support';
|
||||||
import { theme } from '../../Data/theme';
|
import { theme } from '../../Data/theme';
|
||||||
import { ButtonBase } from '@mui/material';
|
// import { ButtonBase } from '@mui/material';
|
||||||
|
|
||||||
const SupportContainer = styled.div`
|
const SupportContainer = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Player } from '../../Types/Player';
|
import { Player } from '../../Types/Player';
|
||||||
import Settings from './Settings';
|
import Settings from './Settings';
|
||||||
import styled, { css } from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
|
import { css } from 'styled-components';
|
||||||
import { Rotation } from '../../Types/Player';
|
import { Rotation } from '../../Types/Player';
|
||||||
|
|
||||||
const PlayerMenuWrapper = styled.div<{
|
const PlayerMenuWrapper = styled.div<{
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { Checkbox } from '@mui/material';
|
import { Checkbox } from '@mui/material';
|
||||||
import { Player, Rotation } from '../../Types/Player';
|
// import { useWakeLock } from 'react-screen-wake-lock';
|
||||||
import { useWakeLock } from 'react-screen-wake-lock';
|
import styled from 'styled-components';
|
||||||
import styled, { css } from 'styled-components/macro';
|
import { css } from 'styled-components';
|
||||||
import { Energy, Experience, PartnerTax, Poison } from '../../Icons/generated';
|
import { Energy, Experience, PartnerTax, Poison } from '../../Icons/generated';
|
||||||
|
import { Player, Rotation } from '../../Types/Player';
|
||||||
|
|
||||||
type SettingsProps = {
|
type SettingsProps = {
|
||||||
player: Player;
|
player: Player;
|
||||||
@@ -28,18 +29,18 @@ const SettingsContainer = styled.div<{
|
|||||||
props.rotation === Rotation.Side
|
props.rotation === Rotation.Side
|
||||||
) {
|
) {
|
||||||
return css`
|
return css`
|
||||||
flex-direction: row;
|
flex-direction: column-reverse;
|
||||||
padding-top: 36px;
|
/* padding-top: 36px; */
|
||||||
`;
|
`;
|
||||||
} else {
|
} else {
|
||||||
return css`
|
return css`
|
||||||
padding-top: 36px;
|
/* padding-top: 36px; */
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const SettingsSection = styled.div<{ rotation: Rotation }>`
|
const TogglesSection = styled.div<{ rotation: Rotation }>`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
@@ -58,6 +59,26 @@ const SettingsSection = styled.div<{ rotation: Rotation }>`
|
|||||||
}}
|
}}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const ButtonsSections = styled.div<{ rotation: Rotation }>`
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
|
${(props) => {
|
||||||
|
if (
|
||||||
|
props.rotation === Rotation.SideFlipped ||
|
||||||
|
props.rotation === Rotation.Side
|
||||||
|
) {
|
||||||
|
return css`
|
||||||
|
rotate: ${props.rotation}deg;
|
||||||
|
flex-direction: column-reverse;
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
`;
|
||||||
|
|
||||||
const ColorPicker = styled.input<{
|
const ColorPicker = styled.input<{
|
||||||
rotation: Rotation;
|
rotation: Rotation;
|
||||||
}>`
|
}>`
|
||||||
@@ -128,8 +149,8 @@ const CheckboxContainer = styled.div<{ rotation: Rotation }>`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const Settings = ({ player, onChange, resetCurrentGame }: SettingsProps) => {
|
const Settings = ({ player, onChange, resetCurrentGame }: SettingsProps) => {
|
||||||
const { released, request, release } = useWakeLock();
|
// const { released, request, release } = useWakeLock();
|
||||||
const handleWakeLock = () => (released === false ? release() : request());
|
// const handleWakeLock = () => (released === false ? release() : request());
|
||||||
|
|
||||||
const handleColorChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleColorChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const updatedPlayer = { ...player, color: event.target.value };
|
const updatedPlayer = { ...player, color: event.target.value };
|
||||||
@@ -171,7 +192,7 @@ const Settings = ({ player, onChange, resetCurrentGame }: SettingsProps) => {
|
|||||||
value={player.color}
|
value={player.color}
|
||||||
onChange={handleColorChange}
|
onChange={handleColorChange}
|
||||||
/>
|
/>
|
||||||
<SettingsSection rotation={player.settings.rotation}>
|
<TogglesSection rotation={player.settings.rotation}>
|
||||||
{player.settings.useCommanderDamage && (
|
{player.settings.useCommanderDamage && (
|
||||||
<CheckboxContainer rotation={player.settings.rotation}>
|
<CheckboxContainer rotation={player.settings.rotation}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@@ -269,9 +290,9 @@ const Settings = ({ player, onChange, resetCurrentGame }: SettingsProps) => {
|
|||||||
onChange={handleSettingsChange}
|
onChange={handleSettingsChange}
|
||||||
/>
|
/>
|
||||||
</CheckboxContainer>
|
</CheckboxContainer>
|
||||||
</SettingsSection>
|
</TogglesSection>
|
||||||
|
|
||||||
<SettingsSection rotation={player.settings.rotation}>
|
<ButtonsSections rotation={player.settings.rotation}>
|
||||||
<Button rotation={player.settings.rotation} onClick={handleResetGame}>
|
<Button rotation={player.settings.rotation} onClick={handleResetGame}>
|
||||||
Reset All
|
Reset All
|
||||||
</Button>
|
</Button>
|
||||||
@@ -281,10 +302,10 @@ const Settings = ({ player, onChange, resetCurrentGame }: SettingsProps) => {
|
|||||||
<Button rotation={player.settings.rotation} onClick={toggleFullscreen}>
|
<Button rotation={player.settings.rotation} onClick={toggleFullscreen}>
|
||||||
Fullscreen
|
Fullscreen
|
||||||
</Button>
|
</Button>
|
||||||
<Button rotation={player.settings.rotation} onClick={handleWakeLock}>
|
{/* <Button rotation={player.settings.rotation} onClick={handleWakeLock}>
|
||||||
{released === false ? 'Release' : 'Request'} nosleep
|
{released === false ? 'Release' : 'Request'} nosleep
|
||||||
</Button>
|
</Button> */}
|
||||||
</SettingsSection>
|
</ButtonsSections>
|
||||||
</SettingsContainer>
|
</SettingsContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import styled from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
import Counters from '../Counters/Counters';
|
import Counters from '../Counters/Counters';
|
||||||
import { Player } from '../../Types/Player';
|
import { Player } from '../../Types/Player';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
import { GridTemplateAreas } from '../../../Data/GridTemplateAreas';
|
import { GridTemplateAreas } from '../../../Data/GridTemplateAreas';
|
||||||
import { FormControlLabel, Radio, RadioGroup } from '@mui/material';
|
import { FormControlLabel, Radio, RadioGroup } from '@mui/material';
|
||||||
import { theme } from '../../../Data/theme';
|
import { theme } from '../../../Data/theme';
|
||||||
@@ -34,7 +34,6 @@ const LayoutOptions: React.FC<LayoutOptionsProps> = ({
|
|||||||
gridAreas,
|
gridAreas,
|
||||||
onChange,
|
onChange,
|
||||||
}) => {
|
}) => {
|
||||||
const iconSize = '33vmin';
|
|
||||||
const iconHeight = '33vmin';
|
const iconHeight = '33vmin';
|
||||||
const iconWidth = '20vmin';
|
const iconWidth = '20vmin';
|
||||||
|
|
||||||
@@ -382,7 +381,7 @@ const LayoutOptions: React.FC<LayoutOptionsProps> = ({
|
|||||||
<LayoutWrapper>
|
<LayoutWrapper>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
row
|
row
|
||||||
onChange={(e, value) => {
|
onChange={(_e, value) => {
|
||||||
onChange(value as GridTemplateAreas);
|
onChange(value as GridTemplateAreas);
|
||||||
}}
|
}}
|
||||||
value={gridAreas}
|
value={gridAreas}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Button, FormControl, FormLabel, Switch } from '@mui/material';
|
import { Button, FormControl, FormLabel, Switch } from '@mui/material';
|
||||||
import Slider from '@mui/material/Slider';
|
import Slider from '@mui/material/Slider';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import styled from 'styled-components/macro';
|
import styled from 'styled-components';
|
||||||
import { GridTemplateAreas } from '../../../Data/GridTemplateAreas';
|
import { GridTemplateAreas } from '../../../Data/GridTemplateAreas';
|
||||||
import {
|
import {
|
||||||
InitialSettings,
|
InitialSettings,
|
||||||
createInitialPlayers,
|
createInitialPlayers,
|
||||||
@@ -152,7 +152,7 @@ const Start = ({
|
|||||||
getAriaValueText={valuetext}
|
getAriaValueText={valuetext}
|
||||||
step={null}
|
step={null}
|
||||||
marks={playerMarks}
|
marks={playerMarks}
|
||||||
onChange={(e, value) => {
|
onChange={(_e, value) => {
|
||||||
setPlayerOptions({
|
setPlayerOptions({
|
||||||
...playerOptions,
|
...playerOptions,
|
||||||
numberOfPlayers: value as number,
|
numberOfPlayers: value as number,
|
||||||
@@ -169,7 +169,7 @@ const Start = ({
|
|||||||
getAriaValueText={valuetext}
|
getAriaValueText={valuetext}
|
||||||
step={10}
|
step={10}
|
||||||
marks={healthMarks}
|
marks={healthMarks}
|
||||||
onChange={(e, value) =>
|
onChange={(_e, value) =>
|
||||||
setPlayerOptions({
|
setPlayerOptions({
|
||||||
...playerOptions,
|
...playerOptions,
|
||||||
startingLifeTotal: value as number,
|
startingLifeTotal: value as number,
|
||||||
@@ -180,7 +180,7 @@ const Start = ({
|
|||||||
<Switch
|
<Switch
|
||||||
checked={playerOptions.useCommanderDamage}
|
checked={playerOptions.useCommanderDamage}
|
||||||
defaultChecked
|
defaultChecked
|
||||||
onChange={(e, value) =>
|
onChange={(_e, value) =>
|
||||||
setPlayerOptions({
|
setPlayerOptions({
|
||||||
...playerOptions,
|
...playerOptions,
|
||||||
useCommanderDamage: value,
|
useCommanderDamage: value,
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
export { default as FivePlayers } from './FivePlayers';
|
export { default as FivePlayers } from "./FivePlayers";
|
||||||
export { default as FivePlayersSide } from './FivePlayersSide';
|
export { default as FivePlayersSide } from "./FivePlayersSide";
|
||||||
export { default as FourPlayers } from './FourPlayers';
|
export { default as FourPlayers } from "./FourPlayers";
|
||||||
export { default as FourPlayersSide } from './FourPlayersSide';
|
export { default as FourPlayersSide } from "./FourPlayersSide";
|
||||||
export { default as OnePlayerLandscape } from './OnePlayerLandscape';
|
export { default as OnePlayerLandscape } from "./OnePlayerLandscape";
|
||||||
export { default as OnePlayerPortrait } from './OnePlayerPortrait';
|
export { default as OnePlayerPortrait } from "./OnePlayerPortrait";
|
||||||
export { default as SixPlayers } from './SixPlayers';
|
export { default as SixPlayers } from "./SixPlayers";
|
||||||
export { default as SixPlayersSide } from './SixPlayersSide';
|
export { default as SixPlayersSide } from "./SixPlayersSide";
|
||||||
export { default as ThreePlayers } from './ThreePlayers';
|
export { default as ThreePlayers } from "./ThreePlayers";
|
||||||
export { default as ThreePlayersSide } from './ThreePlayersSide';
|
export { default as ThreePlayersSide } from "./ThreePlayersSide";
|
||||||
export { default as TwoPlayersOppositeLandscape } from './TwoPlayersOppositeLandscape';
|
export { default as TwoPlayersOppositeLandscape } from "./TwoPlayersOppositeLandscape";
|
||||||
export { default as TwoPlayersOppositePortrait } from './TwoPlayersOppositePortrait';
|
export { default as TwoPlayersOppositePortrait } from "./TwoPlayersOppositePortrait";
|
||||||
export { default as TwoPlayersSameSide } from './TwoPlayersSameSide';
|
export { default as TwoPlayersSameSide } from "./TwoPlayersSameSide";
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import * as React from 'react';
|
import PropTypes from "prop-types";
|
||||||
import type { SVGProps } from 'react';
|
import { SVGProps } from "react";
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
interface SVGRProps {
|
interface SVGRProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
titleId?: string;
|
titleId?: string;
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
export { default as BuyMeCoffee } from './BuyMeCoffee';
|
export { default as BuyMeCoffee } from "./BuyMeCoffee";
|
||||||
export { default as KoFi } from './KoFi';
|
export { default as KoFi } from "./KoFi";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export { default as Cog } from './Cog';
|
export { default as Cog } from "./Cog";
|
||||||
export { default as CommanderTax } from './CommanderTax';
|
export { default as CommanderTax } from "./CommanderTax";
|
||||||
export { default as Energy } from './Energy';
|
export { default as Energy } from "./Energy";
|
||||||
export { default as Experience } from './Experience';
|
export { default as Experience } from "./Experience";
|
||||||
export { default as PartnerTax } from './PartnerTax';
|
export { default as PartnerTax } from "./PartnerTax";
|
||||||
export { default as Poison } from './Poison';
|
export { default as Poison } from "./Poison";
|
||||||
|
|||||||
1
src/assets/react.svg
Normal file
1
src/assets/react.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
||||||
|
After Width: | Height: | Size: 4.0 KiB |
@@ -1,19 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import ReactDOM from 'react-dom/client';
|
|
||||||
import './index.css';
|
|
||||||
import App from './App';
|
|
||||||
import reportWebVitals from './reportWebVitals';
|
|
||||||
|
|
||||||
const root = ReactDOM.createRoot(
|
|
||||||
document.getElementById('root') as HTMLElement
|
|
||||||
);
|
|
||||||
root.render(
|
|
||||||
<React.StrictMode>
|
|
||||||
<App />
|
|
||||||
</React.StrictMode>
|
|
||||||
);
|
|
||||||
|
|
||||||
// If you want to start measuring performance in your app, pass a function
|
|
||||||
// to log results (for example: reportWebVitals(console.log))
|
|
||||||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
|
||||||
reportWebVitals();
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.6 KiB |
12
src/main.tsx
Normal file
12
src/main.tsx
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import ReactDOM from 'react-dom/client'
|
||||||
|
import App from './App.tsx'
|
||||||
|
import './index.css'
|
||||||
|
|
||||||
|
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
|
||||||
|
|
||||||
|
root.render(
|
||||||
|
<React.StrictMode>
|
||||||
|
<App />
|
||||||
|
</React.StrictMode>,
|
||||||
|
)
|
||||||
1
src/react-app-env.d.ts
vendored
1
src/react-app-env.d.ts
vendored
@@ -1 +0,0 @@
|
|||||||
/// <reference types="react-scripts" />
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import { ReportHandler } from 'web-vitals';
|
|
||||||
|
|
||||||
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
|
||||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
|
||||||
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
|
||||||
getCLS(onPerfEntry);
|
|
||||||
getFID(onPerfEntry);
|
|
||||||
getFCP(onPerfEntry);
|
|
||||||
getLCP(onPerfEntry);
|
|
||||||
getTTFB(onPerfEntry);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default reportWebVitals;
|
|
||||||
1
src/vite-env.d.ts
vendored
Normal file
1
src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
/* eslint-disable no-undef */
|
||||||
|
/* eslint-disable-next-line no-undef */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
template: require('./template'),
|
template: require('./template'),
|
||||||
titleProp: true,
|
titleProp: true,
|
||||||
@@ -25,3 +27,5 @@ module.exports = {
|
|||||||
typescript: true,
|
typescript: true,
|
||||||
outDir: './src/Icons/generated',
|
outDir: './src/Icons/generated',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
26
template.js
26
template.js
@@ -1,5 +1,5 @@
|
|||||||
const propTypesTemplate = (
|
const propTypesTemplate = (
|
||||||
{ imports, interfaces, componentName, props, jsx, exports },
|
{ interfaces, componentName, props, jsx },
|
||||||
{ tpl }
|
{ tpl }
|
||||||
) => {
|
) => {
|
||||||
const title = componentName.split('Svg')[1];
|
const title = componentName.split('Svg')[1];
|
||||||
@@ -17,20 +17,24 @@ const propTypesTemplate = (
|
|||||||
optional: true,
|
optional: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
return tpl`${imports}
|
return tpl`
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
import PropTypes from 'prop-types';
|
${interfaces}
|
||||||
${interfaces}
|
|
||||||
|
|
||||||
const ${title} = (${props}) => {
|
const ${title} = (${props}) => {
|
||||||
return ${jsx};
|
return ${jsx};
|
||||||
}
|
}
|
||||||
|
|
||||||
${title}.propTypes = {
|
${title}.propTypes = {
|
||||||
title: PropTypes.string,
|
title: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ${title}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ${title}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
module.exports = propTypesTemplate;
|
module.exports = propTypesTemplate;
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +1,25 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "ES2020",
|
||||||
"lib": [
|
"useDefineForClassFields": true,
|
||||||
"dom",
|
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||||
"dom.iterable",
|
"module": "ESNext",
|
||||||
"esnext"
|
|
||||||
],
|
|
||||||
"allowJs": true,
|
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"esModuleInterop": true,
|
|
||||||
"allowSyntheticDefaultImports": true,
|
/* Bundler mode */
|
||||||
"strict": true,
|
"moduleResolution": "bundler",
|
||||||
"forceConsistentCasingInFileNames": true,
|
"allowImportingTsExtensions": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
"module": "esnext",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"jsx": "react-jsx"
|
"jsx": "react-jsx",
|
||||||
|
|
||||||
|
/* Linting */
|
||||||
|
"strict": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"noFallthroughCasesInSwitch": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["src", "react-screen-wake-lock.d.ts"],
|
||||||
"src"
|
"references": [{ "path": "./tsconfig.node.json" }]
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
10
tsconfig.node.json
Normal file
10
tsconfig.node.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"composite": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"allowSyntheticDefaultImports": true
|
||||||
|
},
|
||||||
|
"include": ["vite.config.ts"]
|
||||||
|
}
|
||||||
12
vite.config.ts
Normal file
12
vite.config.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import react from '@vitejs/plugin-react-swc'
|
||||||
|
|
||||||
|
// https://vitejs.dev/config/
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [react()],
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
external: ['babel-plugin-macros']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user