before switching from sass to styled components

This commit is contained in:
2021-10-02 20:07:16 +02:00
parent 0dbb7f8528
commit ad52fdb08f
20 changed files with 1041 additions and 90 deletions
+15
View File
@@ -0,0 +1,15 @@
import React, { Component } from 'react'
import Card from '../components/Card'
export class AccountManager extends Component {
render() {
return (
<Card>
<h4>Account Manager</h4>
<hr/>
Hello World
</Card>
)
}
}
export default AccountManager
+444
View File
@@ -0,0 +1,444 @@
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
html, body {
margin: 0;
}
#root {
min-height: 100vh;
display: -ms-grid;
display: grid;
-ms-grid-columns: auto 1fr auto;
grid-template-columns: auto 1fr auto;
-ms-grid-rows: auto 1fr 2em;
grid-template-rows: auto 1fr 2em;
grid-template-areas: "header header header" " menu main ." "footer footer footer";
background: #27283A;
overflow: auto;
}
#header {
position: relative;
-ms-grid-row: 1;
-ms-grid-column: 1;
-ms-grid-column-span: 3;
grid-area: header;
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
min-height: auto;
padding: .5em;
-webkit-box-pack: end;
-ms-flex-pack: end;
justify-content: flex-end;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
background: #1F1E2E;
color: #ddd9ebbf;
}
#header h1 {
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
white-space: nowrap;
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
font-size: 1.5em;
}
#header::after {
-ms-grid-column-align: start;
justify-self: start;
position: absolute;
display: block;
content: '';
left: 0;
right: 0;
top: 100%;
background: #438AF4;
height: .1em;
}
#header__search {
margin: .5em;
border-radius: .5rem;
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
white-space: nowrap;
margin-left: auto;
-webkit-transition: ease-in-out all 500ms;
transition: ease-in-out all 500ms;
-webkit-box-flex: 0;
-ms-flex-positive: 0;
flex-grow: 0;
max-width: 20em;
}
#header__search:hover {
-webkit-box-shadow: 0 0 1em #438AF4;
box-shadow: 0 0 1em #438AF4;
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
#header__search:hover__input {
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
#header__search__input {
height: 2rem;
-webkit-transition: ease all 500ms;
transition: ease all 500ms;
border-radius: .5rem 0 0 .5rem;
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
background: #438AF4;
border: none;
outline: none;
color: #ddd9ebbf;
-webkit-box-flex: 0;
-ms-flex-positive: 0;
flex-grow: 0;
margin-left: auto;
width: 100%;
-webkit-box-shadow: 0 0 0.2em #490428c6;
box-shadow: 0 0 0.2em #490428c6;
padding: .5em;
}
#header__search__input:hover, #header__search__input:not(:placeholder-shown) {
-webkit-transition: ease all 500ms;
transition: ease all 500ms;
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
#header__search__input + button {
height: 2rem;
border: none;
color: #ddd9ebbf;
border-radius: 0 .5rem .5rem 0;
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
background: #27283A;
font-size: 1em;
border: 0.1rem inset #438AF4;
border-style: solid;
padding: .5em;
}
#header__search__input + button:hover {
background: #ddd9ebbf;
color: #438AF4;
}
#header__menu {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-ms-flex-negative: 1;
flex-shrink: 1;
}
#header__menu ul {
list-style: none;
padding: 0;
}
#header__menu ul li {
display: inline;
}
#header__menu ul li a {
text-decoration: none;
color: #ddd9ebbf;
padding: .5em;
white-space: nowrap;
}
#header__menu ul li a:hover {
color: #438AF4;
}
#menu {
-ms-grid-row: 2;
-ms-grid-column: 1;
grid-area: menu;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
min-height: 100;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
background: #1F1E2E;
padding: .5em 0;
overflow: visible;
}
#menu h3 {
margin: 0;
color: #ddd9ebbf;
-webkit-text-decoration: bold;
text-decoration: bold;
}
#menu ul {
list-style: none;
padding-left: 0;
margin: .4em 0;
}
#menu ul a {
position: relative;
display: block;
text-decoration: none;
margin-left: .4em;
color: #ddd9ebbf;
padding: .3em .5em;
font-size: 1.05em;
-webkit-transition: ease all 500ms;
transition: ease all 500ms;
}
#menu ul a::after {
-webkit-transition: ease all 500ms;
transition: ease all 500ms;
position: absolute;
top: 0;
bottom: 0;
right: 100%;
width: 0em;
content: '';
background: #ddd9ebbf;
}
#menu ul a:hover {
background: #438AF4;
}
#menu ul a:hover::after {
width: 0.4em;
}
#menu ul a.menu__active {
color: #438AF4;
}
#menu ul a.menu__active::after {
width: 0.4em;
background: #27283A;
}
#menu ul a.menu__active:hover {
color: #fff;
}
#menu ul a.menu__active:hover::after {
width: 0.4em;
background: #ddd9ebbf;
}
#main {
position: relative;
-ms-grid-row: 2;
-ms-grid-column: 2;
grid-area: main;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-line-pack: start;
align-content: flex-start;
-webkit-box-align: start;
-ms-flex-align: start;
align-items: flex-start;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding: 1em;
border-top-left-radius: 1em;
}
.main__card {
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
color: #ddd9ebbf;
background: #1F1E2E;
border-radius: 1em;
padding: 1em;
margin: 1em;
}
.main__card h4 {
margin: 0;
}
.main__card__input {
padding: 1em .2em .1em 0.2em;
display: inline-block;
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
with: auto;
z-index: 1;
border: none;
background: none;
outline: none;
font-size: 1em;
}
.main__card__input__box {
font-size: 1.1em;
overflow: hidden;
position: relative;
margin: 0.2em 0;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-align: stretch;
-ms-flex-align: stretch;
align-items: stretch;
background: #ddd9ebbf;
border-bottom: 0.3em solid #490428c6;
}
.main__card__input__box:hover {
border-bottom: 0.3em solid #438AF4;
outline: auto;
}
.main__card__input__box > button {
position: relative;
background: #27283A;
color: #ddd9ebbf;
border: none;
font-size: 0.8em;
font-weight: bold;
padding: 0 .5em;
-webkit-transition: ease all 300ms;
transition: ease all 300ms;
z-index: 1;
}
.main__card__input__box > button::before {
position: absolute;
display: block;
content: '';
-webkit-clip-path: polygon(0% 0%, 100% 100%, 0% 100%);
clip-path: polygon(0% 0%, 100% 100%, 0% 100%);
-webkit-transform: translateX(-90%) rotate(45deg);
transform: translateX(-90%) rotate(45deg);
height: 1em;
width: 1em;
background: #27283A;
-webkit-transition: ease all 300ms;
transition: ease all 300ms;
}
.main__card__input__box > button:hover {
background: #438AF4;
}
.main__card__input__box > button:hover::before {
background: #438AF4;
-webkit-transform: translateX(-90%) rotate(45deg) scale(1.2);
transform: translateX(-90%) rotate(45deg) scale(1.2);
}
.main__card__input__label {
padding: 0;
color: #27283A;
z-index: 0;
position: absolute;
left: 0.2em;
padding-bottom: 0.2em;
bottom: 0;
-webkit-transition: all ease-in-out 350ms;
transition: all ease-in-out 350ms;
}
.main__card__input:focus + .main__card__input__label, .main__card__input:not(:placeholder-shown) + .main__card__input__label {
color: #490428c6;
font-size: 0.7em;
-webkit-transform: translateY(0);
transform: translateY(0);
bottom: 50%;
font-weight: bold;
}
#footer {
position: relative;
-ms-grid-row: 3;
-ms-grid-column: 1;
-ms-grid-column-span: 3;
grid-area: footer;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
color: #ffffff67;
text-transform: uppercase;
}
#footer::after {
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 2em;
widht: 100vw;
opacity: 0.5;
background: #000;
background: -webkit-gradient(linear, left top, right top, from(#27283A), color-stop(#110d13), color-stop(50%, #490428c6), color-stop(65%, rgba(2, 0, 36, 0.745518)), to(#1F1E2E));
background: linear-gradient(90deg, #27283A 0%, #110d13, #490428c6 50%, rgba(2, 0, 36, 0.745518) 65%, #1F1E2E 100%);
content: '';
}
#footer::before {
position: absolute;
left: 0;
right: 0;
bottom: 100%;
height: .2em;
opacity: 0.5;
content: '';
background: -webkit-gradient(linear, left top, left bottom, from(#27283A), to(#438AF4));
background: linear-gradient(#27283A, #438AF4);
}
/*# sourceMappingURL=AdminUI.css.map */
File diff suppressed because one or more lines are too long
+39
View File
@@ -0,0 +1,39 @@
import React, { Component } from 'react'
import "./AdminUI.sass"
import {Link, NavLink} from 'react-router-dom'
export class AdminUI extends Component {
render() {
const children = this.props.children;
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><Link to="/user_cp">User Settings</Link></li>
<li><Link to="/logout">Logout</Link></li>
</ul>
</div>
</div>
<div id="menu">
<h3>Menu</h3>
<ul>
<li><NavLink activeClassName="menu__active" exact to="/">Status</NavLink></li>
<li><NavLink activeClassName="menu__active" to="/accounts">Account</NavLink></li>
<li><NavLink activeClassName="menu__active" to="/log">Log</NavLink></li>
<li><NavLink activeClassName="menu__active" to="/backup">Backup</NavLink></li>
<li><NavLink activeClassName="menu__active" to="/admin">Admin</NavLink></li>
</ul>
</div>
<div id="main">
{children}
</div>
<div id="footer">Footer</div>
</>
)
}
}
export default AdminUI
+275
View File
@@ -0,0 +1,275 @@
$color1: #1F1E2E
$color2: #27283A
$color3: #438AF4
$color4: rgba(2,0,36,0.7455182756696428)
$color5: #490428c6
$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: flex-end
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: .5em
border-radius: .5rem
display: inline-flex
white-space: nowrap
margin-left: auto
transition: ease-in-out all 500ms
flex-grow: 0
max-width: 20em
&:hover
box-shadow: 0 0 1em $color3
flex-grow: 1
&__input
flex-grow: 1
&__input
height: 2rem
transition: ease all 500ms
border-radius: .5rem 0 0 .5rem
display: inline-flex
background: $color3
border: none
outline: none
color: $color6
flex-grow: 0
margin-left: auto
width: 100%
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: inline-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
text-decoration: none
color: $color6
padding: .5em
white-space: nowrap
&:hover
color: $color3
#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
position: relative
grid-area: main
display: flex
align-content: flex-start
align-items: flex-start
flex-wrap: wrap
padding: 1em
border-top-left-radius: 1em
.main
&__card
flex-grow: 1
color: $color6
background: $color1
border-radius: 1em
padding: 1em
margin: 1em
h4
margin: 0
&__input
padding: 1em .2em .1em 0.2em
display: inline-block
flex-grow: 1
with: auto
z-index: 1
border: none
background: none
outline: none
font-size: 1em
&__box
font-size: 1.1em
overflow: hidden
position: relative
margin: 0.2em 0
display: flex
flex-direction: row
align-items: stretch
background: $color6
border-bottom: .3em solid $color5
&:hover
border-bottom: .3em solid $color3
outline: auto
>button
position: relative
background: $color2
color: $color6
border: none
font-size: 0.8em
font-weight: bold
padding: 0 .5em
transition: ease all 300ms
z-index: 1
&::before
position: absolute
display: block
content: ''
clip-path: polygon(0% 0%, 100% 100%, 0% 100%)
transform: translateX(-90%) rotate(45deg)
height: 1em
width: 1em
background: $color2
transition: ease all 300ms
&:hover
background: $color3
&::before
background: $color3
transform: translateX(-90%) rotate(45deg) scale(1.2)
&__label
padding: 0
color: $color2
z-index: 0
position: absolute
left: 0.2em
padding-bottom: 0.2em
bottom: 0
transition: all ease-in-out 350ms
&:focus + &__label, &:not(:placeholder-shown) + &__label
color: $color5
font-size: 0.7em
transform: translateY(0)
bottom: 50%
font-weight: bold
#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)
+15
View File
@@ -0,0 +1,15 @@
import React, { Component } from 'react'
export class Logger extends Component {
render() {
return (
<div>
<div className="main__card">
</div>
</div>
)
}
}
export default Logger
+4
View File
@@ -0,0 +1,4 @@
import Logger from "./Logger";
import AdminUI from "./AdminUI";
import AccountManager from "./AccountManager";
export {AccountManager, AdminUI, Logger}