Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 7c9c550

Browse files
authored
[ROOT]: added playgrounds. (#157)
1 parent 0429114 commit 7c9c550

File tree

15 files changed

+817
-7
lines changed

15 files changed

+817
-7
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
# Vite Js
88
.vite
9-
# Vitebook
10-
.cache
11-
.temp
129

1310
# Build output
1411
**/dist/

playgrounds/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

playgrounds/package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "playgrounds",
3+
"private": true,
4+
"version": "0.0.0",
5+
"scripts": {
6+
"dev": "vite",
7+
"build": "tsc && vite build",
8+
"preview": "vite preview"
9+
},
10+
"dependencies": {
11+
"react": "^17.0.2",
12+
"react-dom": "^17.0.2"
13+
},
14+
"devDependencies": {
15+
"@types/react": "^17.0.33",
16+
"@types/react-dom": "^17.0.10",
17+
"@vitejs/plugin-react": "^1.0.7",
18+
"typescript": "^4.5.4",
19+
"vite": "^2.8.0"
20+
}
21+
}

playgrounds/src/App.css

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.App {
2+
text-align: center;
3+
}
4+
5+
.App-logo {
6+
height: 40vmin;
7+
pointer-events: none;
8+
}
9+
10+
@media (prefers-reduced-motion: no-preference) {
11+
.App-logo {
12+
animation: App-logo-spin infinite 20s linear;
13+
}
14+
}
15+
16+
.App-header {
17+
background-color: #282c34;
18+
min-height: 100vh;
19+
display: flex;
20+
flex-direction: column;
21+
align-items: center;
22+
justify-content: center;
23+
font-size: calc(10px + 2vmin);
24+
color: white;
25+
}
26+
27+
.App-link {
28+
color: #61dafb;
29+
}
30+
31+
@keyframes App-logo-spin {
32+
from {
33+
transform: rotate(0deg);
34+
}
35+
to {
36+
transform: rotate(360deg);
37+
}
38+
}
39+
40+
button {
41+
font-size: calc(10px + 2vmin);
42+
}

playgrounds/src/App.tsx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { useState } from "react"
2+
3+
import "./App.css"
4+
import logo from "./logo.svg"
5+
6+
function App() {
7+
const [count, setCount] = useState(0)
8+
9+
return (
10+
<div className="App">
11+
<header className="App-header">
12+
<img src={logo} className="App-logo" alt="logo" />
13+
<p>Hello Vite + React!</p>
14+
<p>
15+
<button type="button" onClick={() => setCount((count) => count + 1)}>
16+
count is: {count}
17+
</button>
18+
</p>
19+
<p>
20+
Edit <code>App.tsx</code> and save to test HMR updates.
21+
</p>
22+
<p>
23+
<a
24+
className="App-link"
25+
href="https://reactjs.org"
26+
target="_blank"
27+
rel="noopener noreferrer"
28+
>
29+
Learn React
30+
</a>
31+
{" | "}
32+
<a
33+
className="App-link"
34+
href="https://vitejs.dev/guide/features.html"
35+
target="_blank"
36+
rel="noopener noreferrer"
37+
>
38+
Vite Docs
39+
</a>
40+
</p>
41+
</header>
42+
</div>
43+
)
44+
}
45+
46+
export default App

playgrounds/src/favicon.svg

Lines changed: 15 additions & 0 deletions
Loading

playgrounds/src/index.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
body {
2+
margin: 0;
3+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
4+
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
5+
-webkit-font-smoothing: antialiased;
6+
-moz-osx-font-smoothing: grayscale;
7+
}
8+
9+
code {
10+
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
11+
}

playgrounds/src/logo.svg

Lines changed: 7 additions & 0 deletions
Loading

playgrounds/src/main.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from "react"
2+
import ReactDOM from "react-dom"
3+
4+
import App from "./App"
5+
import "./index.css"
6+
7+
ReactDOM.render(
8+
<React.StrictMode>
9+
<App />
10+
</React.StrictMode>,
11+
document.getElementById("root"),
12+
)

playgrounds/src/vite-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

0 commit comments

Comments
 (0)