From 5bf781f3ac381744fbec035f938d69a201f75fa4 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Wed, 5 Mar 2025 12:21:25 +0100 Subject: Replace all impl with vite --- .gitignore | 24 + README.md | 54 + _redirects | 1 - base.css | 183 -- chart/index.html | 282 --- chart/styles.css | 132 -- eslint.config.js | 28 + ico/apple-touch-icon.png | Bin 1750 -> 0 bytes ico/favicon.ico | Bin 5238 -> 0 bytes ico/icon-192-maskable.png | Bin 1632 -> 0 bytes ico/icon-192.png | Bin 6033 -> 0 bytes ico/icon-512-maskable.png | Bin 7621 -> 0 bytes ico/icon-512.png | Bin 20242 -> 0 bytes index.html | 362 +-- morsehero/.gitignore | 24 - morsehero/README.md | 54 - morsehero/eslint.config.js | 28 - morsehero/index.html | 33 - morsehero/package-lock.json | 3264 ---------------------------- morsehero/package.json | 31 - morsehero/public/ico/apple-touch-icon.png | Bin 1750 -> 0 bytes morsehero/public/ico/favicon.ico | Bin 5238 -> 0 bytes morsehero/public/ico/icon-192-maskable.png | Bin 1632 -> 0 bytes morsehero/public/ico/icon-192.png | Bin 6033 -> 0 bytes morsehero/public/ico/icon-512-maskable.png | Bin 7621 -> 0 bytes morsehero/public/ico/icon-512.png | Bin 20242 -> 0 bytes morsehero/public/site.webmanifest | 31 - morsehero/public/vite.svg | 1 - morsehero/src/App.css | 42 - morsehero/src/App.tsx | 18 - morsehero/src/assets/react.svg | 1 - morsehero/src/base.css | 183 -- morsehero/src/index.css | 68 - morsehero/src/main.tsx | 10 - morsehero/src/pages/HomePage.tsx | 294 --- morsehero/src/pages/chart/ChartPage.tsx | 178 -- morsehero/src/pages/chart/styles.css | 132 -- morsehero/src/styles.css | 605 ------ morsehero/src/vite-env.d.ts | 1 - morsehero/tsconfig.app.json | 27 - morsehero/tsconfig.json | 7 - morsehero/tsconfig.node.json | 24 - morsehero/vite.config.ts | 7 - package-lock.json | 3264 ++++++++++++++++++++++++++++ package.json | 31 + public/ico/apple-touch-icon.png | Bin 0 -> 1750 bytes public/ico/favicon.ico | Bin 0 -> 5238 bytes public/ico/icon-192-maskable.png | Bin 0 -> 1632 bytes public/ico/icon-192.png | Bin 0 -> 6033 bytes public/ico/icon-512-maskable.png | Bin 0 -> 7621 bytes public/ico/icon-512.png | Bin 0 -> 20242 bytes public/site.webmanifest | 31 + public/vite.svg | 1 + site.webmanifest | 31 - src/App.css | 42 + src/App.tsx | 18 + src/assets/react.svg | 1 + src/base.css | 183 ++ src/index.css | 0 src/main.tsx | 10 + src/pages/HomePage.tsx | 294 +++ src/pages/chart/ChartPage.tsx | 178 ++ src/pages/chart/styles.css | 132 ++ src/styles.css | 605 ++++++ src/vite-env.d.ts | 1 + styles.css | 605 ------ tsconfig.app.json | 27 + tsconfig.json | 7 + tsconfig.node.json | 24 + vite.config.ts | 7 + 70 files changed, 4987 insertions(+), 6634 deletions(-) create mode 100644 .gitignore create mode 100644 README.md delete mode 100644 _redirects delete mode 100644 base.css delete mode 100644 chart/index.html delete mode 100644 chart/styles.css create mode 100644 eslint.config.js delete mode 100644 ico/apple-touch-icon.png delete mode 100644 ico/favicon.ico delete mode 100644 ico/icon-192-maskable.png delete mode 100644 ico/icon-192.png delete mode 100644 ico/icon-512-maskable.png delete mode 100644 ico/icon-512.png delete mode 100644 morsehero/.gitignore delete mode 100644 morsehero/README.md delete mode 100644 morsehero/eslint.config.js delete mode 100644 morsehero/index.html delete mode 100644 morsehero/package-lock.json delete mode 100644 morsehero/package.json delete mode 100644 morsehero/public/ico/apple-touch-icon.png delete mode 100644 morsehero/public/ico/favicon.ico delete mode 100644 morsehero/public/ico/icon-192-maskable.png delete mode 100644 morsehero/public/ico/icon-192.png delete mode 100644 morsehero/public/ico/icon-512-maskable.png delete mode 100644 morsehero/public/ico/icon-512.png delete mode 100644 morsehero/public/site.webmanifest delete mode 100644 morsehero/public/vite.svg delete mode 100644 morsehero/src/App.css delete mode 100644 morsehero/src/App.tsx delete mode 100644 morsehero/src/assets/react.svg delete mode 100644 morsehero/src/base.css delete mode 100644 morsehero/src/index.css delete mode 100644 morsehero/src/main.tsx delete mode 100644 morsehero/src/pages/HomePage.tsx delete mode 100644 morsehero/src/pages/chart/ChartPage.tsx delete mode 100644 morsehero/src/pages/chart/styles.css delete mode 100644 morsehero/src/styles.css delete mode 100644 morsehero/src/vite-env.d.ts delete mode 100644 morsehero/tsconfig.app.json delete mode 100644 morsehero/tsconfig.json delete mode 100644 morsehero/tsconfig.node.json delete mode 100644 morsehero/vite.config.ts create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 public/ico/apple-touch-icon.png create mode 100644 public/ico/favicon.ico create mode 100644 public/ico/icon-192-maskable.png create mode 100644 public/ico/icon-192.png create mode 100644 public/ico/icon-512-maskable.png create mode 100644 public/ico/icon-512.png create mode 100644 public/site.webmanifest create mode 100644 public/vite.svg delete mode 100644 site.webmanifest create mode 100644 src/App.css create mode 100644 src/App.tsx create mode 100644 src/assets/react.svg create mode 100644 src/base.css create mode 100644 src/index.css create mode 100644 src/main.tsx create mode 100644 src/pages/HomePage.tsx create mode 100644 src/pages/chart/ChartPage.tsx create mode 100644 src/pages/chart/styles.css create mode 100644 src/styles.css create mode 100644 src/vite-env.d.ts delete mode 100644 styles.css create mode 100644 tsconfig.app.json create mode 100644 tsconfig.json create mode 100644 tsconfig.node.json create mode 100644 vite.config.ts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# 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? diff --git a/README.md b/README.md new file mode 100644 index 0000000..40ede56 --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# 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: + +```js +export default tseslint.config({ + extends: [ + // Remove ...tseslint.configs.recommended and replace with this + ...tseslint.configs.recommendedTypeChecked, + // Alternatively, use this for stricter rules + ...tseslint.configs.strictTypeChecked, + // Optionally, add this for stylistic rules + ...tseslint.configs.stylisticTypeChecked, + ], + languageOptions: { + // other options... + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + }, +}) +``` + +You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: + +```js +// eslint.config.js +import reactX from 'eslint-plugin-react-x' +import reactDom from 'eslint-plugin-react-dom' + +export default tseslint.config({ + plugins: { + // Add the react-x and react-dom plugins + 'react-x': reactX, + 'react-dom': reactDom, + }, + rules: { + // other rules... + // Enable its recommended typescript rules + ...reactX.configs['recommended-typescript'].rules, + ...reactDom.configs.recommended.rules, + }, +}) +``` diff --git a/_redirects b/_redirects deleted file mode 100644 index 232f1e7..0000000 --- a/_redirects +++ /dev/null @@ -1 +0,0 @@ -https://www.morsehero.com/* https://morsehero.com/:splat 301! \ No newline at end of file diff --git a/base.css b/base.css deleted file mode 100644 index dc8d1f0..0000000 --- a/base.css +++ /dev/null @@ -1,183 +0,0 @@ -/* Morse Hero Base Styles */ -:root { - --primary-color: #3498db; - --primary-dark: #2980b9; - --secondary-color: #f39c12; - --secondary-dark: #e67e22; - --accent-color: #e74c3c; - --accent-dark: #c0392b; - --success-color: #2ecc71; - --success-dark: #27ae60; - --bg-dark: #2c3e50; - --bg-darker: #1a2530; - --bg-light: #34495e; - --text-light: #ecf0f1; - --text-dim: rgba(255, 255, 255, 0.7); - --border-radius-sm: 12px; - --border-radius-md: 20px; - --border-radius-lg: 30px; - --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1); - --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.15); - --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.2); - --transition-fast: 0.2s ease; - --transition-normal: 0.3s ease; -} - -* { - box-sizing: border-box; - margin: 0; - padding: 0; -} - -body { - font-family: 'Poppins', 'Fredoka', sans-serif; - margin: 0; - padding: 0; - background: radial-gradient(ellipse at top, var(--bg-dark) 0%, var(--bg-darker) 100%); - color: var(--text-light); - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: 18px; - line-height: 1.6; -} - -.container { - max-width: 900px; - margin: 0 auto; - padding: 30px 20px; - text-align: center; - width: 100%; -} - -h1 { - color: var(--secondary-color); - text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3), - 0 0 15px rgba(243, 156, 18, 0.5); - margin-bottom: 20px; - font-family: 'Fredoka', sans-serif; - font-weight: 600; - position: relative; - display: inline-block; -} - -h1::after { - content: ""; - position: absolute; - bottom: -10px; - left: 50%; - transform: translateX(-50%); - width: 60px; - height: 4px; - background: linear-gradient(90deg, var(--accent-color), var(--secondary-color)); - border-radius: 2px; -} - -button { - cursor: pointer; - font-family: 'Poppins', 'Fredoka', sans-serif; - transition: all var(--transition-normal); - font-weight: 600; - letter-spacing: 1px; - text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2); - border: none; - outline: none; - position: relative; - overflow: hidden; -} - -button::after { - content: ""; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0)); - opacity: 0; - transition: opacity var(--transition-fast); -} - -button:hover::after { - opacity: 1; -} - -.title-link { - color: inherit; - text-decoration: none; - transition: all var(--transition-normal); - position: relative; - display: inline-block; -} - -.title-link:hover { - color: var(--secondary-color); - text-shadow: 0 0 15px rgba(243, 156, 18, 0.6); -} - -.footer { - margin-top: 40px; - padding: 20px; - text-align: center; - font-size: 16px; - color: var(--text-dim); - width: 100%; - border-top: 1px solid rgba(255, 255, 255, 0.1); -} - -.footer a { - color: var(--primary-color); - text-decoration: none; - font-weight: bold; - transition: color var(--transition-normal); - position: relative; -} - -.footer a::after { - content: ''; - position: absolute; - width: 100%; - transform: scaleX(0); - height: 2px; - bottom: -2px; - left: 0; - background-color: var(--primary-color); - transform-origin: bottom right; - transition: transform 0.3s ease-out; -} - -.footer a:hover { - color: var(--secondary-color); -} - -.footer a:hover::after { - transform: scaleX(1); - transform-origin: bottom left; -} - -/* Common Media Queries */ -@media (max-width: 768px) { - .container { - padding: 20px 15px; - } - - h1 { - font-size: 36px; - } - - button { - font-size: 16px; - } -} - -@media (max-width: 480px) { - h1 { - font-size: 28px; - } - - .container { - padding: 15px 10px; - } -} \ No newline at end of file diff --git a/chart/index.html b/chart/index.html deleted file mode 100644 index de53cd9..0000000 --- a/chart/index.html +++ /dev/null @@ -1,282 +0,0 @@ - - - -
- - -Learn Morse code the fun way!
- - -