diff --git a/src/socket.py b/src/socket.py new file mode 100644 index 0000000000000000000000000000000000000000..3ae0854950f8dd5dd3a0d3e23c35142b5c1e6684 --- /dev/null +++ b/src/socket.py @@ -0,0 +1,11 @@ +from flask_socketio import SocketIO + +class Socket: + + def __init__(self, app) + self.socket = SocketIO(app) + + def init_team(self, team, side): + team_dict = { + + } \ No newline at end of file diff --git a/src/templates/frontend/frontend.css b/src/static/styles/frontend.css similarity index 100% rename from src/templates/frontend/frontend.css rename to src/static/styles/frontend.css diff --git a/src/templates/frontend/frontend.jinja b/src/templates/frontend/frontend.jinja index a4b732f3e3319ca5e5b2c60d045ba45089bed8b0..5135e4bfc41d66a9a9b6d8e3c75b257157f48331 100644 --- a/src/templates/frontend/frontend.jinja +++ b/src/templates/frontend/frontend.jinja @@ -3,8 +3,8 @@ <head> <title>CFD Frontend</title> <meta name="viewport" content="width = device-width, initial-scale = 1"> - <link type="text/css" rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"> - <!--<link type="text/css" rel="stylesheet" href="frontend.css"/>--> + <link type="text/css" rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"/> + <link type="text/css" rel="stylesheet" href="../../static/styles/frontend.css"/> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.8/socket.io.min.js"></script> <script> @@ -86,98 +86,6 @@ }); </script> - <style> - @font-face { font-family: PressStart2P; src: url('../../static/PressStart2P-Regular.ttf'); } - - body{ - font-family: PressStart2P; - } - - #player_select{ - display: none; - } - - #final_screen{ - display: none; - } - - #oponents{ - display: none; - } - - h1, h2, h3, h4, h5 .h1, .h2, .h3, .h4, .h5{ - font-family: PressStart2P; - } - - .defult_row{ - height: 33px; - } - - .answer_row{ - height: 298px; - } - - .team_row{ - height: 200px; - } - - .answer_bg{ - height: 50px; - font-size: 20px; - } - - .fails{ - height: 37px; - color: #c83200; - font-size: 34px; - font-family: PressStart2P; - margin-bottom: 7px; - } - - .largest{ - font-size: 150px; - } - - .xxl{ - font-size: 50px; - } - - .xl{ - font-size: 42px; - } - - .l{ - font-size: 34px; - } - - .ccc-blue{ - color: #0084b0; - } - - .ccc-green{ - color: #00a356; - } - - .bg-black{ - background-color: black !important; - } - - .bg-grey{ - background-color: #1e1e3c; - } - - .table td{ - border: none; - } - - .vertical-center { - min-height: 100%; /* Fallback for browsers do NOT support vh unit */ - min-height: 100vh; /* These two lines are counted as one :-) */ - - display: flex; - align-items: center; - } - </style> </head> <body class="bg-black text-light vertical-center"> diff --git a/src/templates/frontend/frontend.js b/src/templates/frontend/frontend.js index 46e11cedce6f4941b72fcd5445d4672f8e98ed18..0d4bd9e0c81b57c31eff01c60ee5a32f3485dc14 100644 --- a/src/templates/frontend/frontend.js +++ b/src/templates/frontend/frontend.js @@ -30,6 +30,42 @@ class Team{ } } +class Answer{ + constructor (){ + this.points = 0; + this.hidden = True; + this.modifier = 1; + this.answer = ""; + this.uuid = ""; + } +} + +class Question{ + constructor(){ + this.uuid = ""; + this.question = ""; + this.answers = []; + } +} + +class Game{ + constructor (){ + this.name = ""; + this.team_left = null; + this.team_right = null; + this.points_left = 0; + this.ponts_right = 0; + this.round = null; + } +} + +class Round{ + constructor (){ + this.points = 0; + this. + } +} + var socket = io.connect("ws://localhost:5000"); var team_left;