-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
251 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,20 @@ | ||
import React, { useState } from "react"; | ||
import React from "react"; | ||
import { RouterProvider, createHashRouter } from "react-router-dom"; | ||
import "src/assets/styles/styles.scss"; | ||
import { DefaultLayout } from "./layout/DefaultLayout"; | ||
import { Reader } from "./components/Reader/Reader"; | ||
import { CreateExamButton } from "./components/ExamTableChooser/CreateExamButton"; | ||
import { NoTechniquesChosen } from "./components/Reader/NoTechniquesChosen"; | ||
import css from "./components/Reader/Reader.module.scss"; | ||
import { ShowExamTable } from "./components/ShowExamTable/ShowExamTable"; | ||
import { Button } from "react-bootstrap"; | ||
import { Printer } from "react-bootstrap-icons"; | ||
import { TechniqueList } from "./model/TechniqueList"; | ||
|
||
export const router = createHashRouter([ | ||
{ | ||
path: "/", | ||
lazy: () => import("src/pages"), | ||
}, | ||
{ | ||
path: "/chooser", | ||
lazy: () => import("src/pages/chooser"), | ||
}, | ||
]); | ||
|
||
function App(): JSX.Element { | ||
const [techniques, setTechniques] = useState<TechniqueList>(new TechniqueList()); | ||
const [currentTechniqueIndex, setCurrentTechniqueIndex] = useState(-1); | ||
return ( | ||
<DefaultLayout | ||
navbuttons={ | ||
techniques.length > 0 && ( | ||
<> | ||
<CreateExamButton onChoice={setTechniques} /> | ||
<Button className={"ms-2"} variant={"outline-secondary"} onClick={() => window.print()}> | ||
<Printer /> Print | ||
</Button> | ||
</> | ||
) | ||
} | ||
> | ||
<div className={"mt-1"}> | ||
{techniques.length === 0 ? ( | ||
<NoTechniquesChosen className={css.techniqueDisplay} onTechniqueChoice={setTechniques} /> | ||
) : ( | ||
<> | ||
<div className={"no-print"}> | ||
<Reader techniques={techniques.techniques} nextTechniqueChanged={setCurrentTechniqueIndex} /> | ||
</div> | ||
<div className={"mt-4"}> | ||
<ShowExamTable techniques={techniques} currentTechnique={techniques.at(currentTechniqueIndex)} /> | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
</DefaultLayout> | ||
); | ||
return <RouterProvider router={router} />; | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@import "bootstrap/scss/functions"; | ||
@import "bootstrap/scss/variables"; | ||
@import "bootstrap/scss/mixins"; | ||
|
||
$primary: #55aa77; | ||
$info: #66bb33; | ||
$theme-colors: ( | ||
"primary": $primary, | ||
"secondary": $secondary, | ||
"success": $success, | ||
"info": $info, | ||
"warning": $warning, | ||
"danger": $danger, | ||
"light": $light, | ||
"dark": $dark, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
.logo { | ||
width: 10rem; | ||
height: 10rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from "react"; | ||
import css from "./Logo.module.scss"; | ||
import logo from "src/assets/logo.svg"; | ||
|
||
export const Logo: React.FC<{ className?: string }> = ({ className = "" }) => { | ||
return <img src={logo} className={`${className} ${css.logo}`} alt="Logo" />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { useState } from "react"; | ||
import { Button } from "react-bootstrap"; | ||
import { Printer } from "react-bootstrap-icons"; | ||
import { CreateExamButton } from "src/components/ExamTableChooser/CreateExamButton"; | ||
import { NoTechniquesChosen } from "src/components/Reader/NoTechniquesChosen"; | ||
import { Reader } from "src/components/Reader/Reader"; | ||
import { ShowExamTable } from "src/components/ShowExamTable/ShowExamTable"; | ||
import { DefaultLayout } from "src/layout/DefaultLayout"; | ||
import { TechniqueList } from "src/model/TechniqueList"; | ||
import css from "src/components/Reader/Reader.module.scss"; | ||
|
||
export const Component: React.FC = () => { | ||
const [techniques, setTechniques] = useState<TechniqueList>(new TechniqueList()); | ||
const [currentTechniqueIndex, setCurrentTechniqueIndex] = useState(-1); | ||
|
||
return ( | ||
<DefaultLayout | ||
hideNavbar={location.pathname === "/"} | ||
navbuttons={ | ||
techniques.length > 0 && ( | ||
<> | ||
<CreateExamButton onChoice={setTechniques} /> | ||
<Button className={"ms-2"} variant={"outline-secondary"} onClick={() => window.print()}> | ||
<Printer /> Print | ||
</Button> | ||
</> | ||
) | ||
} | ||
> | ||
<div className={"mt-1"}> | ||
{techniques.length === 0 ? ( | ||
<NoTechniquesChosen className={css.techniqueDisplay} onTechniqueChoice={setTechniques} /> | ||
) : ( | ||
<> | ||
<div className={"no-print"}> | ||
<Reader techniques={techniques.techniques} nextTechniqueChanged={setCurrentTechniqueIndex} /> | ||
</div> | ||
<div className={"mt-4"}> | ||
<ShowExamTable techniques={techniques} currentTechnique={techniques.at(currentTechniqueIndex)} /> | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
</DefaultLayout> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@import "src/assets/styles/styles-include.scss"; | ||
|
||
.homepage { | ||
margin-top: 3rem; | ||
margin-left: auto; | ||
margin-right: auto; | ||
max-width: 100vh; | ||
@include media-breakpoint-up(lg) { | ||
max-width: 800px; | ||
} | ||
} | ||
|
||
.subheader { | ||
text-align: center; | ||
font-size: 1.5rem; | ||
} | ||
.header { | ||
text-align: center; | ||
} | ||
|
||
.logo { | ||
text-align: center; | ||
margin: 1rem; | ||
} | ||
|
||
.teaser { | ||
// inline style in component | ||
// --columns: ...; | ||
display: grid; | ||
gap: 1rem; | ||
grid-template-columns: 1fr; | ||
@include media-breakpoint-up(lg) { | ||
grid-template-columns: repeat(var(--columns), 1fr); | ||
} | ||
} | ||
|
||
.action { | ||
text-align: center; | ||
margin: 2rem; | ||
} | ||
.actionButton { | ||
border: 2px solid lighten($warning, 30%); | ||
padding: 0.5rem; | ||
color: darken($warning, 30%); | ||
background-color: lighten($warning, 40%); | ||
font-weight: bold; | ||
text-decoration: none; | ||
transition: background-color 0.2s ease-in-out; | ||
&:hover { | ||
background-color: lighten($warning, 10%); | ||
} | ||
} | ||
|
||
.teaserItem { | ||
background-color: lighten($primary, 40%); | ||
padding: 1rem; | ||
min-height: 200px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from "react"; | ||
import { Link } from "react-router-dom"; | ||
import { Logo } from "src/components/logo/Logo"; | ||
import css from "./index.module.scss"; | ||
import { DefaultLayout } from "src/layout/DefaultLayout"; | ||
|
||
function cssVar(name: string, value: string | number): React.CSSProperties { | ||
return { | ||
[name]: value, | ||
} as React.CSSProperties; | ||
} | ||
|
||
export const Component = () => { | ||
return ( | ||
<DefaultLayout hideNavbar={location.pathname === "/"}> | ||
<div className={css.homepage}> | ||
<p className={css.subheader}>Besser vorbereitet auf deine</p> | ||
<h1 className={css.header}>Aikido-Prüfung</h1> | ||
|
||
<div className={css.logo}> | ||
<Logo /> | ||
</div> | ||
<div className={css.reason}></div> | ||
<div className={css.action}> | ||
<Link className={css.actionButton} to={"/chooser"}> | ||
Gleich anfangen | ||
</Link> | ||
</div> | ||
<div className={css.teaser} style={{ ...cssVar("--columns", 3) }}> | ||
<div className={css.teaserItem}> | ||
<p> | ||
Im Training üben wir Techniken und Prinzipien. Die Techniken werden in der Prüfung abgefragt. Dabei muss | ||
es manchmal schnell gehen. Du musst sofort wissen, welche Technik du machst. Das kann man üben: | ||
</p> | ||
</div> | ||
<div className={css.teaserItem}> | ||
<h4>Prüfungslisten erzeugen</h4> | ||
<p> | ||
Mit <b>Aikido-Prüfung</b> kannst du dir zufällige Listen aus deinen Prüfungen erzeugen. Damit kannst du | ||
dich beim freien Training abfragen lassen. | ||
</p> | ||
</div> | ||
<div className={css.teaserItem}> | ||
<h4>Vorlesen lassen</h4> | ||
<p> | ||
<b>Aikido-Prüfung</b> kann die Techniken vorlesen, die ausgewählt hast. Du musst nur auf "Play" drücken. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</DefaultLayout> | ||
); | ||
}; |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.