Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a70c249

Browse files
online offline system in react
1 parent bae5a17 commit a70c249

File tree

11 files changed

+872
-0
lines changed

11 files changed

+872
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
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="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.jsx"></script>
12+
</body>
13+
</html>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "box-changes-show-div",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"react": "^18.2.0",
13+
"react-dom": "^18.2.0"
14+
},
15+
"devDependencies": {
16+
"@types/react": "^18.0.24",
17+
"@types/react-dom": "^18.0.8",
18+
"@vitejs/plugin-react": "^2.2.0",
19+
"vite": "^3.2.3"
20+
}
21+
}
Lines changed: 1 addition & 0 deletions
Loading[フレーム]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
*{
2+
font-family: monospace;
3+
}
4+
main{
5+
display: flex;
6+
flex-wrap: wrap;
7+
align-items: center;
8+
justify-content: center;
9+
}
10+
.emptySquare{
11+
min-width: 90px;
12+
height: 90px;
13+
margin: 12px;
14+
border: 2.1px solid rgba(60, 60, 60, 0.858);
15+
border-radius: 9px;
16+
box-shadow: 3px 3px 9px -3px rgba(128, 128, 128, 0.703);
17+
background-color: transparent;
18+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from "react";
2+
import "./App.css"
3+
import Empdiv from "./Empdiv"
4+
import boxdata from "./box"
5+
6+
export default function App() {
7+
8+
// const data = boxdata.map()
9+
10+
const [boxstate, setBoxstate] = React.useState(boxdata[0].on)
11+
console.log(boxstate)
12+
return (
13+
<main>
14+
<Empdiv/>
15+
</main>
16+
);
17+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from "react";
2+
3+
export default function Expdiv() {
4+
return(
5+
<div className="emptySquare"></div>
6+
7+
)
8+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export default [
2+
{
3+
id: 1,
4+
on: true,
5+
},
6+
{
7+
id: 2,
8+
on: false,
9+
},
10+
{
11+
id: 3,
12+
on: true,
13+
},
14+
{
15+
id: 4,
16+
on: true,
17+
},
18+
{
19+
id: 5,
20+
on: false,
21+
},
22+
{
23+
id: 6,
24+
on: false,
25+
},
26+
];
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from "react"
2+
import ReactDOM from "react-dom/client"
3+
import App from "./App"
4+
5+
ReactDOM.createRoot(document.getElementById("root")).render(
6+
<App/>
7+
)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'vite'
2+
import react from '@vitejs/plugin-react'
3+
4+
// https://vitejs.dev/config/
5+
export default defineConfig({
6+
plugins: [react()]
7+
})

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /