Browse Source

React Project added

master
caliskanbi 11 months ago
parent
commit
25678bab00
34 changed files with 17964 additions and 8 deletions
  1. 1
    0
      .idea/1_2_oder_3_repos.iml
  2. 8
    8
      src_folder/BackEnd/test_flask_server.py
  3. 23
    0
      src_folder/FrontEnd/app/.gitignore
  4. 5
    0
      src_folder/FrontEnd/app/.idea/.gitignore
  5. 13
    0
      src_folder/FrontEnd/app/.idea/app.iml
  6. 6
    0
      src_folder/FrontEnd/app/.idea/inspectionProfiles/Project_Default.xml
  7. 8
    0
      src_folder/FrontEnd/app/.idea/modules.xml
  8. 6
    0
      src_folder/FrontEnd/app/.idea/vcs.xml
  9. 70
    0
      src_folder/FrontEnd/app/README.md
  10. 17346
    0
      src_folder/FrontEnd/app/package-lock.json
  11. 39
    0
      src_folder/FrontEnd/app/package.json
  12. BIN
      src_folder/FrontEnd/app/public/12oder3-logo.png
  13. BIN
      src_folder/FrontEnd/app/public/17580.jpg
  14. 11
    0
      src_folder/FrontEnd/app/public/17580.svg
  15. BIN
      src_folder/FrontEnd/app/public/icons8-time.gif
  16. 14
    0
      src_folder/FrontEnd/app/public/index.html
  17. 25
    0
      src_folder/FrontEnd/app/public/manifest.json
  18. BIN
      src_folder/FrontEnd/app/public/massive-marineblaue-betonwand.jpg
  19. 194
    0
      src_folder/FrontEnd/app/src/App.css
  20. 14
    0
      src_folder/FrontEnd/app/src/App.js
  21. 13
    0
      src_folder/FrontEnd/app/src/components/Answers.js
  22. 15
    0
      src_folder/FrontEnd/app/src/components/Body.js
  23. 14
    0
      src_folder/FrontEnd/app/src/components/Buttons.js
  24. 15
    0
      src_folder/FrontEnd/app/src/components/Header.js
  25. 13
    0
      src_folder/FrontEnd/app/src/components/Heading.js
  26. 16
    0
      src_folder/FrontEnd/app/src/components/Question.js
  27. 10
    0
      src_folder/FrontEnd/app/src/components/QuitButton.js
  28. 7
    0
      src_folder/FrontEnd/app/src/components/ScoreBoard.js
  29. 21
    0
      src_folder/FrontEnd/app/src/components/StartButton.js
  30. 21
    0
      src_folder/FrontEnd/app/src/components/TeamsizePopUp.js
  31. 12
    0
      src_folder/FrontEnd/app/src/components/Timer.js
  32. 6
    0
      src_folder/FrontEnd/app/src/components/data_functions.js
  33. 7
    0
      src_folder/FrontEnd/app/src/index.css
  34. 11
    0
      src_folder/FrontEnd/app/src/index.js

+ 1
- 0
.idea/1_2_oder_3_repos.iml View File

@@ -5,6 +5,7 @@
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />

+ 8
- 8
src_folder/BackEnd/test_flask_server.py View File

@@ -1,15 +1,15 @@
from flask import Flask, jsonify
from flask import Flask, jsonify, Response
app = Flask(__name__)


@app.route('/CONNECTION', methods=['GET'])
def connection():
return Response(status=200)

@app.route('/GETQUESTION', methods=['GET'])
def hello():
return jsonify({'TEST': 'Dies ist eine Testfrage',
'firstanswer': 'erste Antwort',
'secondanswer': 'zweite Antwort',
'thirdanswer': 'dritte Antwort'})

def main():
app.run(host='127.0.0.1', port=5555, debug=True)


if __name__ == '__main__':
app.run(host='127.0.0.1', port=5555, debug=True)
main()

+ 23
- 0
src_folder/FrontEnd/app/.gitignore 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*

+ 5
- 0
src_folder/FrontEnd/app/.idea/.gitignore View File

@@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

+ 13
- 0
src_folder/FrontEnd/app/.idea/app.iml View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

+ 6
- 0
src_folder/FrontEnd/app/.idea/inspectionProfiles/Project_Default.xml View File

@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

+ 8
- 0
src_folder/FrontEnd/app/.idea/modules.xml View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/app.iml" filepath="$PROJECT_DIR$/.idea/app.iml" />
</modules>
</component>
</project>

+ 6
- 0
src_folder/FrontEnd/app/.idea/vcs.xml View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
</component>
</project>

+ 70
- 0
src_folder/FrontEnd/app/README.md 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:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm 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.

### `npm run 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.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't 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 you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't 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)

### `npm run 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)

+ 17346
- 0
src_folder/FrontEnd/app/package-lock.json
File diff suppressed because it is too large
View File


+ 39
- 0
src_folder/FrontEnd/app/package.json View File

@@ -0,0 +1,39 @@
{
"name": "app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-modal": "^3.16.1",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"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
src_folder/FrontEnd/app/public/12oder3-logo.png View File


BIN
src_folder/FrontEnd/app/public/17580.jpg View File


+ 11
- 0
src_folder/FrontEnd/app/public/17580.svg View File

@@ -0,0 +1,11 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="6001.000000pt" height="4001.000000pt" viewBox="0 0 6001.000000 4001.000000"
preserveAspectRatio="xMidYMid meet">

<g transform="translate(0.000000,4001.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
</g>
</svg>

BIN
src_folder/FrontEnd/app/public/icons8-time.gif View File


+ 14
- 0
src_folder/FrontEnd/app/public/index.html View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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"/>
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>1_2_oder3</title>
</head>
<body>
<div id="root"></div>
</body>
</html>

+ 25
- 0
src_folder/FrontEnd/app/public/manifest.json View File

@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

BIN
src_folder/FrontEnd/app/public/massive-marineblaue-betonwand.jpg View File


+ 194
- 0
src_folder/FrontEnd/app/src/App.css View File

@@ -0,0 +1,194 @@

.PopUpBackground {
width: 100vw;
height: 100vh;
background-color: rgba(200, 200, 200, 200);
position: absolute;
display: flex;
justify-content: center;
align-items: center;
z-index: 10;
top: 0;
left: 0;
}

.PopUpContainer {
width: 500px;
height: 500px;
border-radius: 20px;
background-color: white;
}



.Header {
display: flex;
align-items: center;
padding: 30px;
}


.HeaderDiv {
margin-left: 50px;
text-align: center;
max-width: 1000px;
width: 100%;
padding: 10px;
box-shadow: 5px 5px black;
background: linear-gradient(white, white) padding-box,
linear-gradient(to right, #a10012 0%, #fba51b 50%, #3b5da4 100%) border-box;
border-style: solid;
border-width: 5px;
border-radius: 20px;
border-color: transparent;
}

.TimerDiv {
background: linear-gradient(white, white) padding-box,
linear-gradient(to right, #a10012 0%, #fba51b 50%, #3b5da4 100%) border-box;
border-style: solid;
border-width: 5px;
border-radius: 20px;
border-color: transparent;
padding: 20px;
box-shadow: 5px 5px black;
margin-left: 50px;
}

#TimerPic {
visibility: hidden;
}

#Seconds {
visibility: hidden;
border: solid 2px black;
border-radius: 10px;
padding: 2px;
}
#QuestionHeaderDiv {
background-color: white;
border: solid #0C134F 2px;
margin-bottom: 5px;
border-radius: 10px;
box-shadow: 2px 2px #0C134F;
}

#QuestionHeader {
color: #0C134F;
}
#QuestionDiv {
background-color: white;
border: solid #0C134F 2px;
margin-bottom: 5px;
border-radius: 10px;
box-shadow: 2px 2px black;

}
#Question {
color: black;
}

#headingimage {
width: 250px;
height: auto;
padding: 10px ;
background: linear-gradient(white, white) padding-box,
linear-gradient(to right, #a10012 0%, #fba51b 50%, #3b5da4 100%) border-box;
border-style: solid;
border-width: 5px;
border-radius: 20px;
border-color: transparent;
box-shadow: 5px 5px black;
cursor: pointer;
}

#headingimage:hover {
background-color: #F6F6F6;
}

.Body{
text-align: center;
}

.Answers {
padding: 10px;
float: left;
width: 100%;
max-width: 1000px;;
height: 500px;
margin-left: 80px;
}

.AnswerBox {
margin-left: 6px;
position: relative;
height: 500px;
width: 32%;
float: left;
border: solid 2px;
}

#firstans {
border: solid 2px #a10012;
}

#secondans {
border: solid 2px #fba51b;
}

#thirdans {
border: solid 2px #3b5da4;
}

.Buttons {
float: left;
max-width: 250px;
padding-top: 10px;
padding-left: 30px;
}

.MyButton {
margin-bottom: 20px;
padding: 10px 20px;
font-size: 30px;
font-weight: bold;
color: white;
border-style: solid;
border-radius: 20px;
box-shadow: 5px 5px black;
cursor: pointer;
}

.ScoreBoard {
float: left;
padding: 10px;
width: 100px;
height: 500px;
margin-left: 40px;
background: linear-gradient(white, white) padding-box,
linear-gradient(to right, #a10012 0%, #fba51b 50%, #3b5da4 100%) border-box;
border-style: solid;
border-width: 5px;
border-radius: 20px;
border-color: transparent;
box-shadow: 5px 5px black;

}

#StartButton {
background-color: #4CAF50;
}

#QuitButton {
background-color: red;
}
.MyButton:hover {
background-color: #3E8E41; /* darker shade of green */
}


#QuitButton {
visibility: hidden;

}


+ 14
- 0
src_folder/FrontEnd/app/src/App.js View File

@@ -0,0 +1,14 @@
import { useEffect, useState} from "react";
import './App.css';
import Header from "./components/Header";
import Body from "./components/Body";

function App() {
return (<>
<Header/>
<Body/>
</>
);
}

export default App;

+ 13
- 0
src_folder/FrontEnd/app/src/components/Answers.js View File

@@ -0,0 +1,13 @@
import React from "react";

function Answers() {
return(
<div className="Answers">
<div className="AnswerBox" id="firstans">AnswerBox1 </div>
<div className="AnswerBox" id="secondans">AnswerBox2</div>
<div className="AnswerBox" id="thirdans">AnswerBox3</div>
</div>
)
}

export default Answers

+ 15
- 0
src_folder/FrontEnd/app/src/components/Body.js View File

@@ -0,0 +1,15 @@
import React from "react";
import Buttons from "./Buttons";
import Answers from "./Answers";
import ScoreBoard from "./ScoreBoard";
function Body() {
return(
<div className="Body">
<Buttons/>
<Answers/>
<ScoreBoard/>
</div>
)
}

export default Body

+ 14
- 0
src_folder/FrontEnd/app/src/components/Buttons.js View File

@@ -0,0 +1,14 @@
import React from "react";
import StartButton from "./StartButton";
import QuitButton from "./QuitButton";
function Buttons() {
return(
<div className="Buttons">
<StartButton/>
<QuitButton/>

</div>
)
}

export default Buttons

+ 15
- 0
src_folder/FrontEnd/app/src/components/Header.js View File

@@ -0,0 +1,15 @@
import React from "react";
import Heading from "./Heading";
import Timer from "./Timer";
import Question from "./Question";
function Header() {
return(
<header className="Header">
<Heading/>
<Question/>
<Timer/>
</header>
)
}

export default Header

+ 13
- 0
src_folder/FrontEnd/app/src/components/Heading.js View File

@@ -0,0 +1,13 @@
import React from "react";

function Heading() {
return(
<div className="Heading">
<img src={process.env.PUBLIC_URL + "12oder3-logo.png"} alt="1_2_oder_3" id="headingimage"/>
</div>

)

}

export default Heading

+ 16
- 0
src_folder/FrontEnd/app/src/components/Question.js View File

@@ -0,0 +1,16 @@
import React from "react";

function Question() {
return(
<div className="HeaderDiv">
<div id="QuestionHeaderDiv">
<h2 id="QuestionHeader">Frage:</h2>
</div>
<div id="QuestionDiv">
<h2 id="Question">?</h2>
</div>
</div>
)
}

export default Question

+ 10
- 0
src_folder/FrontEnd/app/src/components/QuitButton.js View File

@@ -0,0 +1,10 @@
import React from "react";
function QuitButton() {
return(
<button className="MyButton" id="QuitButton">
Abbruch
</button>
)
}

export default QuitButton

+ 7
- 0
src_folder/FrontEnd/app/src/components/ScoreBoard.js View File

@@ -0,0 +1,7 @@
import React from "react";

function ScoreBoard() {
return(<div className={"ScoreBoard"}>ScoreBoard</div>)
}

export default ScoreBoard

+ 21
- 0
src_folder/FrontEnd/app/src/components/StartButton.js View File

@@ -0,0 +1,21 @@
import {useState} from "react";
import TeamSizePopUp from "./TeamsizePopUp";

function StartButton() {
const [openPopUp, setOpenPopUp] = useState(false)

function startclicked() {
setOpenPopUp(true);
}

return(
<>
<button className="MyButton" id="StartButton" onClick={startclicked}>
Start Game
</button>
{openPopUp && <TeamSizePopUp closeModal={setOpenPopUp}/>}
</>
)
}

export default StartButton

+ 21
- 0
src_folder/FrontEnd/app/src/components/TeamsizePopUp.js View File

@@ -0,0 +1,21 @@
import React from "react";
import setTeamsize from "./data_functions";

function TeamSizePopUp({closeModal}) {

function closePopUp() {
closeModal(false);
}
return (
<div className="PopUpBackground">
<div className="PopUpContainer">
<h2>Bitte Teamgröße wählen</h2>
<input type="number" id="TeamSizeInput"/>
<button className="MyButton" onClick={closePopUp}>Bestätigen</button>
</div>
</div>
)

}

export default TeamSizePopUp

+ 12
- 0
src_folder/FrontEnd/app/src/components/Timer.js View File

@@ -0,0 +1,12 @@
import React from "react";

function Timer() {
return(
<div className="TimerDiv">
<img src={process.env.PUBLIC_URL + "icons8-time.gif"} alt="timer" id="TimerPic"/>
<h2 id="Seconds">0:00 s</h2>
</div>
)
}

export default Timer

+ 6
- 0
src_folder/FrontEnd/app/src/components/data_functions.js View File

@@ -0,0 +1,6 @@
let teamsize
function setTeamsize(_teamsize) {
teamsize = _teamsize;
}

export default setTeamsize

+ 7
- 0
src_folder/FrontEnd/app/src/index.css View File

@@ -0,0 +1,7 @@
body {
background-image: url("../public/17580.jpg");
background-size: 1920px;

}



+ 11
- 0
src_folder/FrontEnd/app/src/index.js View File

@@ -0,0 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);

Loading…
Cancel
Save