webinterface draft

This commit is contained in:
Jean Jacques Avril 2021-10-02 00:04:27 +02:00
parent 304844daef
commit 0dbb7f8528
11 changed files with 12573 additions and 0 deletions

23
web/.gitignore vendored Normal file
View File

@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

70
web/README.md Normal file
View File

@ -0,0 +1,70 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `yarn start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `yarn test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `yarn build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `yarn eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
### Analyzing the Bundle Size
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
### Making a Progressive Web App
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
### Advanced Configuration
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
### Deployment
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
### `yarn build` fails to minify
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)

39
web/package.json Normal file
View File

@ -0,0 +1,39 @@
{
"name": "web",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"node-sass": "^6.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"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"
]
}
}

BIN
web/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

19
web/public/index.html Normal file
View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<title>Doorlock</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>

3
web/public/robots.txt Normal file
View File

@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

71
web/src/App.jsx Normal file
View File

@ -0,0 +1,71 @@
import "./App.sass"
function App() {
return (
<>
<div id="header">
<h1>Doorlock Systems</h1>
<div id="header__search"><input id="header__search__input" type="text" placeholder="..."></input><button>Search</button></div>
<div id="header__menu">
<ul>
<li><a>User Settings</a></li>
<li><a>Logout</a></li>
</ul>
</div>
</div>
<div id="menu">
<h3>Menu</h3>
<ul>
<li><a className="menu__active">Status</a></li>
<li><a>Account</a></li>
<li><a>Log</a></li>
<li><a>Backup</a></li>
<li><a>Admin</a></li>
</ul>
</div>
<div id="main">
<div className="main__card">
<h4>Add User</h4>
<hr />
<p>Add new user</p>
<p><label>First Name</label><input type="text"></input></p>
<p><label>Last Name</label><input type="text"></input></p>
<p><label>PIN</label><input type="text"></input></p>
<p><label>RFID</label><input type="text"></input><button>Scan</button></p>
<p><label>Expire Date</label><input type="date"></input></p>
<button>Add</button>
</div>
<div className="main__card">
<h4>Recent Activity</h4>
<hr />
<table>
<thead>
<tr>
<td>Name</td>
<td>Method</td>
<td>Time</td>
</tr>
</thead>
<tbody>
<tr>
<td>Max Mustermann</td>
<td>RFID</td>
<td>1.10.2020 08:30</td>
</tr>
</tbody>
</table>
</div>
<div className="main__card">
<h4>System Status</h4>
<hr />
<p>Uptime: since 3days 15hours</p>
<p>LastDB Update: before 7hours</p>
<p>Last administrator login: Admin (12.9.2021 09:30)</p>
</div>
</div>
<div id="footer">Footer</div>
</>
);
}
export default App;

198
web/src/App.sass Normal file
View File

@ -0,0 +1,198 @@
$color1: #1F1E2E
$color2: #27283A
$color3: #438AF4
$color4: rgba(2,0,36,0.7455182756696428)
$color5: rgba(43,2,23,0.7763306005996149)
$color6: #ddd9ebbf
*
box-sizing: border-box
html, body
margin: 0
#root
min-height: 100vh
display: grid
grid-template-columns: auto 1fr auto
grid-template-rows: auto 1fr 2em
grid-template-areas: "header header header" " menu main ." "footer footer footer"
background: $color2
overflow: auto
#header
position: relative
grid-area: header
display: inline-flex
flex-wrap: wrap
flex-direction: row
min-height: auto
padding: .5em
justify-content: space-between
align-items: center
background: $color1
color: $color6
h1
flex-wrap: nowrap
white-space: nowrap
display: inline-flex
font-size: 1.5em
&::after
justify-self: start
position: absolute
display: block
content: ''
left: 0
right: 0
top: 100%
background: $color3
height: .1em
&__search
margin: 1em
position: relative
border-radius: .5rem
display: inline-flex
margin-left: auto
transition: ease all 500ms
&:hover
flex-grow: 1
&__input
height: 2rem
transition: ease all 500ms
border-radius: .5rem 0 0 .5rem
display: flex
background: $color3
border: none
outline: none
color: $color6
flex-grow: 0
margin-left: auto
max-width: 50%
box-shadow: 0 0 .2em $color5
padding: .5em
&:hover, &:not(:placeholder-shown)
transition: ease all 500ms
flex-grow: 1
+ button
height: 2rem
border: none
color: $color6
border-radius: 0 .5rem .5rem 0
display: flex
align-items: center
background: $color2
font-size: 1em
border: .1rem inset $color3
border-style: solid
padding: .5em
&:hover
background: $color6
color: $color3
&__menu
display: inline-flex
flex-wrap: nowrap
flex-shrink: 1
ul
list-style: none
padding: 0
li
display: inline
a
padding: .5em
white-space: nowrap
#menu
grid-area: menu
display: flex
min-height: 100
flex-direction: column
align-items: center
background: $color1
padding: .5em 0
overflow: visible
h3
margin: 0
color: $color6
text-decoration: bold
ul
list-style: none
padding-left: 0
margin: .4em 0
a
position: relative
display: block
text-decoration: none
margin-left: .4em
color: $color6
//margin: .5em 0
padding: .3em .5em
font-size: 1.05em
transition: ease all 500ms
&::after
transition: ease all 500ms
position: absolute
top: 0
bottom: 0
right: 100%
width: 0em
content: ''
background: $color6
&:hover
background: $color3
&::after
width: 0.4em
&.menu__active
color: $color3
&::after
width: 0.4em
background: $color2
&:hover
color: #fff
&::after
width: 0.4em
background: $color6
#main
grid-area: main
display: flex
flex-wrap: wrap
padding: 1em
border-top-left-radius: 1em
.main
&__card
flex-grow: 1
background: $color6
border-radius: 1em
padding: 1em
margin: 1em
h4
margin: 0
#footer
position: relative
grid-area: footer
display: flex
justify-content: center
align-items: center
color: #ffffff67
text-transform: uppercase
&::after
position: absolute
left: 0
right: 0
bottom: 0
height: 2em
widht: 100vw
opacity: 0.5
background: #000
background: linear-gradient(90deg, $color2 0%, $color3% 25%, $color5 50%, $color4 65%, $color1 100%)
content: ''
&::before
position: absolute
left: 0
right: 0
bottom: 100%
height: .2em
opacity: 0.5
content: ''
background: linear-gradient($color2,$color3)

13
web/src/index.css Normal file
View File

@ -0,0 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

13
web/src/index.js Normal file
View File

@ -0,0 +1,13 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);

12124
web/yarn.lock Normal file

File diff suppressed because it is too large Load Diff