create-vite-rts 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +166 -0
- package/dist/applyTemplate.js +39 -0
- package/dist/detect.js +22 -0
- package/dist/findCreatedDir.js +15 -0
- package/dist/index.js +33 -0
- package/dist/mergePackageJson.js +26 -0
- package/dist/resolveLatestVersion.js +5 -0
- package/dist/runVite.js +4 -0
- package/package.json +28 -0
- package/templates/react-ts/global.d.ts +5 -0
- package/templates/react-ts/package.partial.json +9 -0
- package/templates/react-ts/src/app/App.tsx +8 -0
- package/templates/react-ts/src/app/index.ts +1 -0
- package/templates/react-ts/src/app/layouts/MainLayout/MainLayout.tsx +15 -0
- package/templates/react-ts/src/app/layouts/MainLayout/index.ts +1 -0
- package/templates/react-ts/src/app/layouts/NotFoundLayout/NotFoundLayout.tsx +9 -0
- package/templates/react-ts/src/app/layouts/NotFoundLayout/index.ts +1 -0
- package/templates/react-ts/src/app/routing/router.tsx +28 -0
- package/templates/react-ts/src/app/styles/fonts.scss +0 -0
- package/templates/react-ts/src/app/styles/globals.scss +88 -0
- package/templates/react-ts/src/app/styles/main.scss +5 -0
- package/templates/react-ts/src/app/styles/normalize.scss +109 -0
- package/templates/react-ts/src/app/styles/utils.scss +27 -0
- package/templates/react-ts/src/app/styles/variables.scss +22 -0
- package/templates/react-ts/src/app/vite-default/main.scss +179 -0
- package/templates/react-ts/src/app/vite-default/react.svg +1 -0
- package/templates/react-ts/src/app/vite-default/vite.svg +1 -0
- package/templates/react-ts/src/main.tsx +11 -0
- package/templates/react-ts/src/pages/home-page/index.ts +1 -0
- package/templates/react-ts/src/pages/home-page/ui/HomePage.tsx +11 -0
- package/templates/react-ts/src/pages/not-found-page/index.ts +1 -0
- package/templates/react-ts/src/pages/not-found-page/ui/NotFoundPage.tsx +7 -0
- package/templates/react-ts/src/shared/tools/scss/functions.scss +28 -0
- package/templates/react-ts/src/shared/tools/scss/index.scss +3 -0
- package/templates/react-ts/src/shared/tools/scss/media.scss +70 -0
- package/templates/react-ts/src/shared/tools/scss/mixins.scss +64 -0
- package/templates/react-ts/src/widgets/footer/index.ts +1 -0
- package/templates/react-ts/src/widgets/footer/ui/Footer.module.scss +0 -0
- package/templates/react-ts/src/widgets/footer/ui/Footer.tsx +9 -0
- package/templates/react-ts/src/widgets/header/index.ts +1 -0
- package/templates/react-ts/src/widgets/header/ui/Header.module.scss +0 -0
- package/templates/react-ts/src/widgets/header/ui/Header.tsx +9 -0
- package/templates/react-ts/src/widgets/vite-default/index.ts +1 -0
- package/templates/react-ts/src/widgets/vite-default/ui/ViteDefault.tsx +79 -0
- package/templates/react-ts/tsconfig.app.json +44 -0
- package/templates/react-ts/vite.config.ts +19 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alex Borov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# create-vite-rts
|
|
2
|
+
|
|
3
|
+
A custom `npm create` wrapper around **Vite** that scaffolds a **React + TypeScript** project with a production-ready setup and a clean FSD-based architecture.
|
|
4
|
+
|
|
5
|
+
This tool keeps the full **Vite interactive CLI experience**, but when **React + TypeScript** is selected, it automatically applies an extended template with opinionated defaults that save time on every new project.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Why create-vite-rts?
|
|
10
|
+
|
|
11
|
+
Default `npm create vite` gives you a minimal React setup.
|
|
12
|
+
**create-vite-rts** goes further and gives you a **ready-to-build frontend foundation** instead of a demo project.
|
|
13
|
+
|
|
14
|
+
### What problem it solves
|
|
15
|
+
|
|
16
|
+
- No repeated manual setup after every Vite project
|
|
17
|
+
- No reconfiguring aliases, SVG handling, routing, styles, or structure
|
|
18
|
+
- No messy migrations from “Vite demo” to a real project
|
|
19
|
+
|
|
20
|
+
You scaffold once - and start building features immediately.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## How it works
|
|
25
|
+
|
|
26
|
+
1. Runs the **Official Vite CLI**
|
|
27
|
+
2. Lets you choose:
|
|
28
|
+
- project name
|
|
29
|
+
- framework
|
|
30
|
+
- variant (JS / TS)
|
|
31
|
+
- package manager install (handled by Vite itself)
|
|
32
|
+
3. Detects the created project
|
|
33
|
+
4. **If React + TypeScript is selected**, it:
|
|
34
|
+
- replaces the default Vite scaffold with a custom template
|
|
35
|
+
- merges additional dependencies
|
|
36
|
+
- keeps Vite defaults where possible
|
|
37
|
+
5. For all other project types - behaves exactly like plain Vite
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## What you get (React + TypeScript only)
|
|
42
|
+
|
|
43
|
+
### ⚛️ React & Routing
|
|
44
|
+
- React
|
|
45
|
+
- **react-router-dom** preinstalled
|
|
46
|
+
- Basic routing setup
|
|
47
|
+
- **Configured 404 (Not Found) page**
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
### 🎨 Styling
|
|
52
|
+
- **Sass** preinstalled
|
|
53
|
+
- Normalize styles included
|
|
54
|
+
- Global styles entry point
|
|
55
|
+
- Custom SCSS:
|
|
56
|
+
- variables
|
|
57
|
+
- mixins
|
|
58
|
+
- media-mixins
|
|
59
|
+
- Clean separation between global styles and feature styles
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### 🧱 Architecture (FSD-inspired)
|
|
64
|
+
|
|
65
|
+
A scalable folder structure inspired by Feature-Sliced Design:
|
|
66
|
+
- src/
|
|
67
|
+
- app/
|
|
68
|
+
- layouts/
|
|
69
|
+
- routing/
|
|
70
|
+
- styles/
|
|
71
|
+
- vite-default/ `Vite demo files`
|
|
72
|
+
- App.tsx
|
|
73
|
+
- pages/
|
|
74
|
+
- home-page/
|
|
75
|
+
- not-found-page/
|
|
76
|
+
- widgets/
|
|
77
|
+
- header/
|
|
78
|
+
- footer/
|
|
79
|
+
- vite-default/ `Vite demo files`
|
|
80
|
+
- features/
|
|
81
|
+
- entities/
|
|
82
|
+
- shared/
|
|
83
|
+
- assets/
|
|
84
|
+
- tools/
|
|
85
|
+
- main.tsx
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
- Default Vite demo components are **isolated**
|
|
89
|
+
- Easy to delete demo code without touching real app logic
|
|
90
|
+
- Clear growth path for large applications
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### 🧩 SVG handling
|
|
95
|
+
|
|
96
|
+
- **vite-plugin-svgr** preconfigured
|
|
97
|
+
- Import SVGs as React components:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import Icon from '@/shared/assets/icon.svg?react'
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### 🔧 Vite configuration
|
|
106
|
+
|
|
107
|
+
Aliases configured:
|
|
108
|
+
- `'@' → src`
|
|
109
|
+
|
|
110
|
+
Dev server exposed to network:
|
|
111
|
+
```ts
|
|
112
|
+
server: {
|
|
113
|
+
host: true
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### 🧠 TypeScript
|
|
120
|
+
|
|
121
|
+
- Strict TypeScript configuration
|
|
122
|
+
- Path aliases configured in `tsconfig`
|
|
123
|
+
- Global SVG typings included (`global.d.ts`)
|
|
124
|
+
- Clean separation of app, node, and build configs
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### 📦 Dependencies
|
|
129
|
+
|
|
130
|
+
- Extra dependencies are merged, not overwritten
|
|
131
|
+
- No forced package manager - Vite stays in control
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
### 🚀 Installation & Usage
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
npm create vite-rts
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Then follow the standard Vite prompts.
|
|
142
|
+
|
|
143
|
+
When asked:
|
|
144
|
+
- **Framework → React**
|
|
145
|
+
- **Variant → TypeScript**
|
|
146
|
+
|
|
147
|
+
That’s it.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
### 📝 Commands (after scaffold)
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
npm install
|
|
155
|
+
npm run dev
|
|
156
|
+
npm run build
|
|
157
|
+
npm run preview
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Exactly the same as a standard Vite project.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
### 📄 License
|
|
165
|
+
|
|
166
|
+
MIT
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = path.dirname(__filename);
|
|
6
|
+
function copyDir(from, to) {
|
|
7
|
+
fs.mkdirSync(to, { recursive: true });
|
|
8
|
+
for (const entry of fs.readdirSync(from, { withFileTypes: true })) {
|
|
9
|
+
const srcPath = path.join(from, entry.name);
|
|
10
|
+
const destPath = path.join(to, entry.name);
|
|
11
|
+
if (entry.isDirectory()) {
|
|
12
|
+
copyDir(srcPath, destPath);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
fs.copyFileSync(srcPath, destPath);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function applyTemplate(projectRoot) {
|
|
20
|
+
const templateRoot = path.resolve(__dirname, '..', 'templates', 'react-ts');
|
|
21
|
+
const srcDir = path.join(projectRoot, 'src');
|
|
22
|
+
fs.rmSync(srcDir, { recursive: true, force: true });
|
|
23
|
+
copyDir(path.join(templateRoot, 'src'), srcDir);
|
|
24
|
+
const publicDir = path.join(projectRoot, 'public');
|
|
25
|
+
fs.rmSync(publicDir, { recursive: true, force: true });
|
|
26
|
+
fs.mkdirSync(publicDir);
|
|
27
|
+
const rootFiles = [
|
|
28
|
+
'vite.config.ts',
|
|
29
|
+
'tsconfig.app.json',
|
|
30
|
+
'global.d.ts',
|
|
31
|
+
];
|
|
32
|
+
for (const file of rootFiles) {
|
|
33
|
+
const from = path.join(templateRoot, file);
|
|
34
|
+
const to = path.join(projectRoot, file);
|
|
35
|
+
if (fs.existsSync(from)) {
|
|
36
|
+
fs.copyFileSync(from, to);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
package/dist/detect.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
export function detectProjectKind(rootDir) {
|
|
4
|
+
const hasMainTsx = fs.existsSync(path.join(rootDir, 'src', 'main.tsx'));
|
|
5
|
+
const hasTsConfig = fs.existsSync(path.join(rootDir, 'tsconfig.json'));
|
|
6
|
+
if (!hasMainTsx || !hasTsConfig) {
|
|
7
|
+
return 'other';
|
|
8
|
+
}
|
|
9
|
+
const pkgPath = path.join(rootDir, 'package.json');
|
|
10
|
+
if (!fs.existsSync(pkgPath)) {
|
|
11
|
+
return 'other';
|
|
12
|
+
}
|
|
13
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
14
|
+
const deps = {
|
|
15
|
+
...pkg.dependencies,
|
|
16
|
+
...pkg.devDependencies
|
|
17
|
+
};
|
|
18
|
+
if (deps?.react) {
|
|
19
|
+
return 'react-ts';
|
|
20
|
+
}
|
|
21
|
+
return 'other';
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
export function getDirectories(root) {
|
|
3
|
+
return new Set(fs
|
|
4
|
+
.readdirSync(root, { withFileTypes: true })
|
|
5
|
+
.filter((d) => d.isDirectory())
|
|
6
|
+
.map((d) => d.name));
|
|
7
|
+
}
|
|
8
|
+
export function findNewDirectory(before, after) {
|
|
9
|
+
for (const dir of after) {
|
|
10
|
+
if (!before.has(dir)) {
|
|
11
|
+
return dir;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { runVite } from './runVite.js';
|
|
5
|
+
import { detectProjectKind } from './detect.js';
|
|
6
|
+
import { getDirectories, findNewDirectory } from './findCreatedDir.js';
|
|
7
|
+
import { applyTemplate } from './applyTemplate.js';
|
|
8
|
+
import { mergePackageJson } from './mergePackageJson.js';
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
async function main() {
|
|
12
|
+
const cwd = process.cwd();
|
|
13
|
+
const before = getDirectories(cwd);
|
|
14
|
+
await runVite();
|
|
15
|
+
const after = getDirectories(cwd);
|
|
16
|
+
const createdDir = findNewDirectory(before, after);
|
|
17
|
+
if (!createdDir) {
|
|
18
|
+
console.log('No project directory detected');
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const projectRoot = path.join(cwd, createdDir);
|
|
22
|
+
const kind = detectProjectKind(projectRoot);
|
|
23
|
+
if (kind === 'react-ts') {
|
|
24
|
+
applyTemplate(projectRoot);
|
|
25
|
+
const templateRoot = path.resolve(__dirname, '..', 'templates', 'react-ts');
|
|
26
|
+
await mergePackageJson(projectRoot, templateRoot);
|
|
27
|
+
console.log('React + TypeScript project scaffolded');
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
console.log(`Detected project type: ${kind}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
main();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { resolveLatestVersion } from './resolveLatestVersion.js';
|
|
4
|
+
export async function mergePackageJson(projectRoot, templateRoot) {
|
|
5
|
+
const projectPkgPath = path.join(projectRoot, 'package.json');
|
|
6
|
+
const templatePkgPath = path.join(templateRoot, 'package.partial.json');
|
|
7
|
+
if (!fs.existsSync(templatePkgPath))
|
|
8
|
+
return;
|
|
9
|
+
const projectPkg = JSON.parse(fs.readFileSync(projectPkgPath, 'utf-8'));
|
|
10
|
+
const templatePkg = JSON.parse(fs.readFileSync(templatePkgPath, 'utf-8'));
|
|
11
|
+
projectPkg.dependencies ||= {};
|
|
12
|
+
projectPkg.devDependencies ||= {};
|
|
13
|
+
for (const name of Object.keys(templatePkg.dependencies || {})) {
|
|
14
|
+
if (!projectPkg.dependencies[name]) {
|
|
15
|
+
projectPkg.dependencies[name] =
|
|
16
|
+
await resolveLatestVersion(name);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
for (const name of Object.keys(templatePkg.devDependencies || {})) {
|
|
20
|
+
if (!projectPkg.devDependencies[name]) {
|
|
21
|
+
projectPkg.devDependencies[name] =
|
|
22
|
+
await resolveLatestVersion(name);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
fs.writeFileSync(projectPkgPath, JSON.stringify(projectPkg, null, 2));
|
|
26
|
+
}
|
package/dist/runVite.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-vite-rts",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"create-vite-rts": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"templates",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "tsx src/index.ts",
|
|
17
|
+
"build": "tsc -p tsconfig.build.json",
|
|
18
|
+
"lint": "eslint ."
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/node": "^25.0.8",
|
|
22
|
+
"tsx": "^4.21.0",
|
|
23
|
+
"typescript": "^5.9.3"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"execa": "^9.6.1"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './App'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Outlet } from 'react-router-dom'
|
|
2
|
+
import Header from '@/widgets/header'
|
|
3
|
+
import Footer from '@/widgets/footer'
|
|
4
|
+
|
|
5
|
+
const MainLayout = () => {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<Header />
|
|
9
|
+
<Outlet />
|
|
10
|
+
<Footer />
|
|
11
|
+
</>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default MainLayout
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './MainLayout'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './NotFoundLayout'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createBrowserRouter } from 'react-router-dom'
|
|
2
|
+
import MainLayout from '@/app/layouts/MainLayout'
|
|
3
|
+
import NotFoundLayout from '@/app/layouts/NotFoundLayout'
|
|
4
|
+
import HomePage from '@/pages/home-page'
|
|
5
|
+
import NotFoundPage from '@/pages/not-found-page'
|
|
6
|
+
|
|
7
|
+
const router = createBrowserRouter([
|
|
8
|
+
{
|
|
9
|
+
element: <MainLayout />,
|
|
10
|
+
children: [
|
|
11
|
+
{
|
|
12
|
+
path: '/',
|
|
13
|
+
element: <HomePage />,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
element: <NotFoundLayout />,
|
|
19
|
+
children: [
|
|
20
|
+
{
|
|
21
|
+
path: '*',
|
|
22
|
+
element: <NotFoundPage />,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
])
|
|
27
|
+
|
|
28
|
+
export default router
|
|
File without changes
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
@use '@/shared/tools/scss' as *;
|
|
2
|
+
|
|
3
|
+
body {
|
|
4
|
+
@include fluid-text(16, 14);
|
|
5
|
+
|
|
6
|
+
font-family: sans-serif;
|
|
7
|
+
color: var(--text-color-dark);
|
|
8
|
+
background-color: var(--bg-color);
|
|
9
|
+
font-weight: 300;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
section {
|
|
13
|
+
&:not(:first-child) {
|
|
14
|
+
padding-top: fluid(100, 70);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&:last-child {
|
|
18
|
+
padding-bottom: fluid(100, 70);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
h1,
|
|
23
|
+
h2,
|
|
24
|
+
h3,
|
|
25
|
+
h4,
|
|
26
|
+
h5,
|
|
27
|
+
h6 {
|
|
28
|
+
color: var(--text-color-dark);
|
|
29
|
+
font-weight: 500;
|
|
30
|
+
margin: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
h1 {
|
|
34
|
+
@include fluid-text(60, 48);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
h2 {
|
|
38
|
+
@include fluid-text(48, 40);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
h3 {
|
|
42
|
+
@include fluid-text(40, 32);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
h4 {
|
|
46
|
+
@include fluid-text(32, 26);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
p {
|
|
50
|
+
--paragraphMarginBottom: #{rem(24)};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
a,
|
|
54
|
+
button,
|
|
55
|
+
label,
|
|
56
|
+
input,
|
|
57
|
+
textarea,
|
|
58
|
+
select,
|
|
59
|
+
svg * {
|
|
60
|
+
transition-duration: var(--transition-duration);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
a,
|
|
64
|
+
button {
|
|
65
|
+
color: var(--text-color-dark);
|
|
66
|
+
font-weight: 400;
|
|
67
|
+
text-decoration: none;
|
|
68
|
+
background-color: transparent;
|
|
69
|
+
border: none;
|
|
70
|
+
|
|
71
|
+
@include hover {
|
|
72
|
+
color: var(--hover-color);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
a,
|
|
77
|
+
button {
|
|
78
|
+
&[aria-label] {
|
|
79
|
+
position: relative;
|
|
80
|
+
|
|
81
|
+
&::before {
|
|
82
|
+
@include abs-center;
|
|
83
|
+
@include square(rem(44));
|
|
84
|
+
|
|
85
|
+
content: '';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
@use '@/shared/tools/scss' as *;
|
|
2
|
+
|
|
3
|
+
*,
|
|
4
|
+
::before,
|
|
5
|
+
::after {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
ul, ol {
|
|
10
|
+
padding-left: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
body,
|
|
14
|
+
:where(blockquote, figure):where([class]) {
|
|
15
|
+
margin: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl):where([class]) {
|
|
19
|
+
margin-block: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:where(dd[class]) {
|
|
23
|
+
margin-left: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:where(fieldset[class]) {
|
|
27
|
+
margin-left: 0;
|
|
28
|
+
padding: 0;
|
|
29
|
+
border: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
ul {
|
|
33
|
+
list-style: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:where(address[class]) {
|
|
37
|
+
font-style: normal;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
p {
|
|
41
|
+
--paragraphMarginBottom: 24px;
|
|
42
|
+
|
|
43
|
+
margin-block: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
p:where(:not([class]):not(:last-child)) {
|
|
47
|
+
margin-bottom: var(--paragraphMarginBottom);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
img,
|
|
51
|
+
video {
|
|
52
|
+
display: block;
|
|
53
|
+
max-width: 100%;
|
|
54
|
+
height: auto;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
input,
|
|
58
|
+
textarea,
|
|
59
|
+
select,
|
|
60
|
+
button {
|
|
61
|
+
font: inherit;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
html {
|
|
65
|
+
height: 100%;
|
|
66
|
+
scrollbar-gutter: stable;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
html,
|
|
70
|
+
:has(:target) {
|
|
71
|
+
scroll-behavior: smooth;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
body {
|
|
75
|
+
min-height: 100%;
|
|
76
|
+
line-height: 1.5;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
a:where([class]) {
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
button,
|
|
84
|
+
label {
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[fill] {
|
|
89
|
+
fill: currentColor;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
[stroke] {
|
|
93
|
+
stroke: currentColor;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
svg * {
|
|
97
|
+
transition-property: fill, stroke;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@media (prefers-reduced-motion: reduce) {
|
|
101
|
+
*,
|
|
102
|
+
::before,
|
|
103
|
+
::after {
|
|
104
|
+
animation-duration: 0.01ms !important;
|
|
105
|
+
animation-iteration-count: 1 !important;
|
|
106
|
+
transition-duration: 0.01ms !important;
|
|
107
|
+
scroll-behavior: auto !important;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@use '@/shared/tools/scss' as *;
|
|
2
|
+
|
|
3
|
+
.container {
|
|
4
|
+
max-width: calc(var(--container-width) + var(--container-padding-x) * 2);
|
|
5
|
+
margin-inline: auto;
|
|
6
|
+
padding-inline: var(--container-padding-x);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.visually-hidden {
|
|
10
|
+
@include visually-hidden;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.hidden-mobile {
|
|
14
|
+
@include mobile {
|
|
15
|
+
display: none !important;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.visible-mobile {
|
|
20
|
+
@include mobile-above {
|
|
21
|
+
display: none !important;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.accented {
|
|
26
|
+
color: var(--color-accent);
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@use '@/shared/tools/scss' as *;
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--bg-color: #FFFFFF;
|
|
5
|
+
|
|
6
|
+
--color-accent: red;
|
|
7
|
+
|
|
8
|
+
--hover-color: red;
|
|
9
|
+
|
|
10
|
+
--error-color: red;
|
|
11
|
+
|
|
12
|
+
--text-color-light: #FFFFFF;
|
|
13
|
+
--text-color-dark: #000000;
|
|
14
|
+
|
|
15
|
+
--transition-duration: 0.2s;
|
|
16
|
+
|
|
17
|
+
--border-radius: #{fluid(25, 15)};
|
|
18
|
+
--border: #{rem(1)} solid black;
|
|
19
|
+
|
|
20
|
+
--container-width: #{rem(1440)};
|
|
21
|
+
--container-padding-x: #{fluid(100, 30)};
|
|
22
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
3
|
+
line-height: 1.5;
|
|
4
|
+
font-weight: 400;
|
|
5
|
+
color-scheme: light dark;
|
|
6
|
+
color: rgba(255, 255, 255, 0.87);
|
|
7
|
+
background-color: #242424;
|
|
8
|
+
font-synthesis: none;
|
|
9
|
+
text-rendering: optimizeLegibility;
|
|
10
|
+
-webkit-font-smoothing: antialiased;
|
|
11
|
+
-moz-osx-font-smoothing: grayscale;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
body {
|
|
15
|
+
margin: 0;
|
|
16
|
+
display: flex;
|
|
17
|
+
place-items: center;
|
|
18
|
+
min-width: 320px;
|
|
19
|
+
min-height: 100vh;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
header,
|
|
23
|
+
footer {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
h1 {
|
|
28
|
+
font-size: 3.2em;
|
|
29
|
+
line-height: 1.1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
h3 {
|
|
33
|
+
margin: 0 0 0.75rem;
|
|
34
|
+
font-size: 1.1rem;
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
color: #646cff;
|
|
37
|
+
text-align: center;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ol {
|
|
41
|
+
margin: 0;
|
|
42
|
+
padding-left: 1.25rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
li {
|
|
46
|
+
margin: 0.4rem 0;
|
|
47
|
+
line-height: 1.5;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
ul {
|
|
51
|
+
margin-top: 0.4rem;
|
|
52
|
+
padding-left: 1.25rem;
|
|
53
|
+
|
|
54
|
+
li {
|
|
55
|
+
margin: 0.25rem 0;
|
|
56
|
+
list-style: disc;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
a {
|
|
61
|
+
font-weight: 500;
|
|
62
|
+
color: #646cff;
|
|
63
|
+
text-decoration: inherit;
|
|
64
|
+
|
|
65
|
+
&:hover {
|
|
66
|
+
color: #535bf2;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
button {
|
|
72
|
+
border-radius: 8px;
|
|
73
|
+
border: 1px solid transparent;
|
|
74
|
+
padding: 0.6em 1.2em;
|
|
75
|
+
font-size: 1em;
|
|
76
|
+
font-weight: 500;
|
|
77
|
+
font-family: inherit;
|
|
78
|
+
background-color: #1a1a1a;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
transition: border-color 0.25s;
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
border-color: #646cff;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:focus,
|
|
87
|
+
&:focus-visible {
|
|
88
|
+
outline: 4px auto -webkit-focus-ring-color;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
code, i {
|
|
93
|
+
padding: 0.15em 0.35em;
|
|
94
|
+
border-radius: 4px;
|
|
95
|
+
color: #cdd6ff;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
code {
|
|
99
|
+
font-size: 1.2em;
|
|
100
|
+
background: rgba(0, 0, 0, 0.35);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
i {
|
|
104
|
+
background: rgba(0, 0, 0, 0.125);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@media (prefers-color-scheme: light) {
|
|
108
|
+
:root {
|
|
109
|
+
color: #213547;
|
|
110
|
+
background-color: #ffffff;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
a:hover {
|
|
114
|
+
color: #747bff;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
button {
|
|
118
|
+
background-color: #f9f9f9;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
#root {
|
|
123
|
+
max-width: 1280px;
|
|
124
|
+
margin: 0 auto;
|
|
125
|
+
padding: 2rem;
|
|
126
|
+
text-align: center;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.logo {
|
|
130
|
+
height: 6em;
|
|
131
|
+
padding: 1.5em;
|
|
132
|
+
will-change: filter;
|
|
133
|
+
transition: filter 300ms;
|
|
134
|
+
|
|
135
|
+
&:hover {
|
|
136
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&.react:hover {
|
|
140
|
+
filter: drop-shadow(0 0 2em #61dafbaa);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@keyframes logo-spin {
|
|
145
|
+
from {
|
|
146
|
+
transform: rotate(0deg);
|
|
147
|
+
}
|
|
148
|
+
to {
|
|
149
|
+
transform: rotate(360deg);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
154
|
+
a:nth-of-type(2) .logo {
|
|
155
|
+
animation: logo-spin infinite 20s linear;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.github {
|
|
160
|
+
font-size: 1.2em;
|
|
161
|
+
|
|
162
|
+
& code {
|
|
163
|
+
all: revert;
|
|
164
|
+
font-size: 1.2em;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.docs {
|
|
169
|
+
color: #888;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.next-steps {
|
|
173
|
+
margin-top: 1.5rem;
|
|
174
|
+
padding: 1.25rem 1.5rem;
|
|
175
|
+
text-align: left;
|
|
176
|
+
border-radius: 8px;
|
|
177
|
+
border: 1px solid rgba(100, 108, 255, 0.25);
|
|
178
|
+
background: rgba(100, 108, 255, 0.08);
|
|
179
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
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>
|
|
@@ -0,0 +1 @@
|
|
|
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="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StrictMode } from 'react'
|
|
2
|
+
import { createRoot } from 'react-dom/client'
|
|
3
|
+
import App from '@/app'
|
|
4
|
+
// import '@/app/styles/main.scss'
|
|
5
|
+
import '@/app/vite-default/main.scss'
|
|
6
|
+
|
|
7
|
+
createRoot(document.getElementById('root')!).render(
|
|
8
|
+
<StrictMode>
|
|
9
|
+
<App />
|
|
10
|
+
</StrictMode>
|
|
11
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ui/HomePage'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ui/NotFoundPage'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
3
|
+
@function rem($pixel) {
|
|
4
|
+
@if math.is-unitless($pixel) {
|
|
5
|
+
@return math.div($pixel, 16) + rem;
|
|
6
|
+
} @else {
|
|
7
|
+
@error 'Don’t use units when working with the rem() function - pass numbers only as its arguments.';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@function fluid($max: 100, $min: 10) {
|
|
12
|
+
$maxViewportWidth: 1920;
|
|
13
|
+
$minViewportWidth: 360;
|
|
14
|
+
|
|
15
|
+
$maxSize: math.div($max, 16);
|
|
16
|
+
$minSize: math.div($min, 16);
|
|
17
|
+
$maxWidth: math.div($maxViewportWidth, 16);
|
|
18
|
+
$minWidth: math.div($minViewportWidth, 16);
|
|
19
|
+
|
|
20
|
+
$slope: math.div(($maxSize - $minSize), ($maxWidth - $minWidth));
|
|
21
|
+
$yAxisIntersection: -$minWidth * $slope + $minSize;
|
|
22
|
+
|
|
23
|
+
@return clamp(
|
|
24
|
+
#{$minSize * 1rem},
|
|
25
|
+
#{$yAxisIntersection * 1rem} + #{$slope * 100vw},
|
|
26
|
+
#{$maxSize * 1rem}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
@use 'functions' as *;
|
|
2
|
+
|
|
3
|
+
$laptop: 1439.98;
|
|
4
|
+
$tablet: 1023.98;
|
|
5
|
+
$mobile: 767.98;
|
|
6
|
+
$mobile-s: 479.98;
|
|
7
|
+
|
|
8
|
+
@mixin laptop-above {
|
|
9
|
+
@media (width > rem($laptop)) {
|
|
10
|
+
@content;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@mixin laptop {
|
|
15
|
+
@media (width <= rem($laptop)) {
|
|
16
|
+
@content;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@mixin tablet-above {
|
|
21
|
+
@media (width > rem($tablet)) {
|
|
22
|
+
@content;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@mixin tablet {
|
|
27
|
+
@media (width <= rem($tablet)) {
|
|
28
|
+
@content;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@mixin mobile-above {
|
|
33
|
+
@media (width > rem($mobile)) {
|
|
34
|
+
@content;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@mixin mobile {
|
|
39
|
+
@media (width <= rem($mobile)) {
|
|
40
|
+
@content;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@mixin mobile-s-above {
|
|
45
|
+
@media (width > rem($mobile-s)) {
|
|
46
|
+
@content;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@mixin mobile-s {
|
|
51
|
+
@media (width <= rem($mobile-s)) {
|
|
52
|
+
@content;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@mixin hover($hasActiveEffectOnMobile: true) {
|
|
57
|
+
@media (any-hover: hover) {
|
|
58
|
+
&:hover {
|
|
59
|
+
@content;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@if ($hasActiveEffectOnMobile) {
|
|
64
|
+
@media (any-hover: none) {
|
|
65
|
+
&:active {
|
|
66
|
+
@content;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
@use 'functions' as *;
|
|
3
|
+
|
|
4
|
+
@mixin fluid-text($max: 48, $min: 16) {
|
|
5
|
+
font-size: fluid($max, $min);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@mixin hide {
|
|
9
|
+
opacity: 0;
|
|
10
|
+
visibility: hidden;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@mixin show {
|
|
14
|
+
opacity: 1;
|
|
15
|
+
visibility: visible;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@mixin flex-center($isInline: false) {
|
|
19
|
+
@if $isInline {
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
} @else {
|
|
22
|
+
display: flex;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
justify-content: center;
|
|
26
|
+
align-items: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@mixin abs-center {
|
|
30
|
+
position: absolute;
|
|
31
|
+
top: 50%;
|
|
32
|
+
left: 50%;
|
|
33
|
+
translate: -50% -50%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@mixin abs-x {
|
|
37
|
+
position: absolute;
|
|
38
|
+
left: 50%;
|
|
39
|
+
translate: -50%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@mixin abs-y {
|
|
43
|
+
position: absolute;
|
|
44
|
+
top: 50%;
|
|
45
|
+
translate: 0 -50%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@mixin square($size) {
|
|
49
|
+
width: $size;
|
|
50
|
+
height: $size;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@mixin visually-hidden {
|
|
54
|
+
position: absolute !important;
|
|
55
|
+
width: 1px !important;
|
|
56
|
+
height: 1px !important;
|
|
57
|
+
margin: -1px !important;
|
|
58
|
+
border: 0 !important;
|
|
59
|
+
padding: 0 !important;
|
|
60
|
+
white-space: nowrap !important;
|
|
61
|
+
clip-path: inset(100%) !important;
|
|
62
|
+
clip: rect(0 0 0 0) !important;
|
|
63
|
+
overflow: hidden !important;
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ui/Footer'
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ui/Header'
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ui/ViteDefault'
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import viteLogo from '@/app/vite-default/vite.svg'
|
|
3
|
+
import reactLogo from '@/app/vite-default/react.svg'
|
|
4
|
+
|
|
5
|
+
const ViteDefault = () => {
|
|
6
|
+
const [count, setCount] = useState(0)
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<div>
|
|
11
|
+
<a
|
|
12
|
+
href="https://vite.dev"
|
|
13
|
+
target="_blank"
|
|
14
|
+
rel="noopener noreferrer"
|
|
15
|
+
>
|
|
16
|
+
<img
|
|
17
|
+
src={viteLogo}
|
|
18
|
+
className="logo"
|
|
19
|
+
alt="Vite logo"
|
|
20
|
+
/>
|
|
21
|
+
</a>
|
|
22
|
+
<a
|
|
23
|
+
href="https://react.dev"
|
|
24
|
+
target="_blank"
|
|
25
|
+
rel="noopener noreferrer"
|
|
26
|
+
>
|
|
27
|
+
<img
|
|
28
|
+
src={reactLogo}
|
|
29
|
+
className="logo react"
|
|
30
|
+
alt="React logo"
|
|
31
|
+
/>
|
|
32
|
+
</a>
|
|
33
|
+
</div>
|
|
34
|
+
<h1>Vite + React</h1>
|
|
35
|
+
<a
|
|
36
|
+
className="github"
|
|
37
|
+
href="https://github.com/alexborovdev/create-vite-rts"
|
|
38
|
+
target="_blank"
|
|
39
|
+
rel="noopener noreferrer"
|
|
40
|
+
>
|
|
41
|
+
GitHub Repository <code>create-vite-rts</code>
|
|
42
|
+
</a>
|
|
43
|
+
<p>
|
|
44
|
+
Edit <code>src/widgets/vite-default/ui/ViteDefault.tsx</code> and save to test HMR
|
|
45
|
+
</p>
|
|
46
|
+
<p className="docs">
|
|
47
|
+
Click on the Vite and React logos to learn more
|
|
48
|
+
</p>
|
|
49
|
+
<button
|
|
50
|
+
onClick={() => setCount((count) => count + 1)}
|
|
51
|
+
>
|
|
52
|
+
count is {count}
|
|
53
|
+
</button>
|
|
54
|
+
<div className="next-steps">
|
|
55
|
+
<h3>Next steps</h3>
|
|
56
|
+
<ol>
|
|
57
|
+
<li>
|
|
58
|
+
Delete folder <code>src/app/vite-default</code>
|
|
59
|
+
</li>
|
|
60
|
+
<li>
|
|
61
|
+
Delete folder <code>src/widgets/vite-default</code>
|
|
62
|
+
</li>
|
|
63
|
+
<li>
|
|
64
|
+
Remove <i>import ViteDefault from '@/widgets/vite-default'</i> in <code>src/pages/home-page/ui/HomePage.tsx</code>
|
|
65
|
+
</li>
|
|
66
|
+
<li>
|
|
67
|
+
In <code>src/main.tsx</code>:
|
|
68
|
+
<ul>
|
|
69
|
+
<li>Remove <i>import '@/app/vite-default/main.scss'</i></li>
|
|
70
|
+
<li>Uncomment <i>import '@/app/styles/main.scss'</i></li>
|
|
71
|
+
</ul>
|
|
72
|
+
</li>
|
|
73
|
+
</ol>
|
|
74
|
+
</div>
|
|
75
|
+
</>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default ViteDefault
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": ".",
|
|
4
|
+
"paths": {
|
|
5
|
+
"@/*": [
|
|
6
|
+
"src/*"
|
|
7
|
+
]
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
11
|
+
"target": "ES2022",
|
|
12
|
+
"useDefineForClassFields": true,
|
|
13
|
+
"lib": [
|
|
14
|
+
"ES2022",
|
|
15
|
+
"DOM",
|
|
16
|
+
"DOM.Iterable"
|
|
17
|
+
],
|
|
18
|
+
"module": "ESNext",
|
|
19
|
+
"types": [
|
|
20
|
+
"vite/client"
|
|
21
|
+
],
|
|
22
|
+
"skipLibCheck": true,
|
|
23
|
+
|
|
24
|
+
/* Bundler mode */
|
|
25
|
+
"moduleResolution": "bundler",
|
|
26
|
+
"allowImportingTsExtensions": true,
|
|
27
|
+
"verbatimModuleSyntax": true,
|
|
28
|
+
"moduleDetection": "force",
|
|
29
|
+
"noEmit": true,
|
|
30
|
+
"jsx": "react-jsx",
|
|
31
|
+
|
|
32
|
+
/* Linting */
|
|
33
|
+
"strict": true,
|
|
34
|
+
"noUnusedLocals": true,
|
|
35
|
+
"noUnusedParameters": true,
|
|
36
|
+
"erasableSyntaxOnly": true,
|
|
37
|
+
"noFallthroughCasesInSwitch": true,
|
|
38
|
+
"noUncheckedSideEffectImports": true
|
|
39
|
+
},
|
|
40
|
+
"include": [
|
|
41
|
+
"src",
|
|
42
|
+
"global.d.ts"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
import svgr from 'vite-plugin-svgr'
|
|
4
|
+
import path from 'path'
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
plugins: [
|
|
8
|
+
svgr(),
|
|
9
|
+
react()
|
|
10
|
+
],
|
|
11
|
+
resolve: {
|
|
12
|
+
alias: {
|
|
13
|
+
'@': path.resolve(__dirname, 'src')
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
server: {
|
|
17
|
+
host: true
|
|
18
|
+
}
|
|
19
|
+
})
|