diff --git a/EcoleDirect.py b/EcoleDirect.py index 610ca5c..455c885 100644 --- a/EcoleDirect.py +++ b/EcoleDirect.py @@ -125,3 +125,4 @@ def getCloud(self): else: # self.token = connection.json()['token'] return connection.json()['data'] + \ No newline at end of file diff --git a/main.py b/main.py index 7b1b5dd..eeabc74 100644 --- a/main.py +++ b/main.py @@ -1,31 +1,22 @@ - from EcoleDirect import * from flask import Flask -from flask import render_template, url_for, request, redirect +from flask import render_template, url_for, request, redirect , send_from_directory from json import * -app = Flask(__name__) +app = Flask(__name__,static_folder='./templates') utilisateur = EcoleDirect("LUDOVICDEBORDE", "Sylvainc1") @app.route('/') def index(): - return f""" - travail -

- note -

- message - """ - - + lien = ['travail','note','message'] + return render_template('index.html',lien=lien) @app.route('/travail') def travail(): xzdfazfa = utilisateur.getHW() json_dump = json.dumps(xzdfazfa) json_object = json.loads(json_dump) - return render_template('travail.html',json_object=json_object) @app.route('/travail/') def travailjours(jours): @@ -36,19 +27,14 @@ def travailjours(jours): return render_template('travailjours.html',json_object=json_object) - @app.route('/note') def note(): xzdfazfa = utilisateur.getNotes() json_dump = json.dumps(xzdfazfa) json_object = json.loads(json_dump) - test = " " - for y in json_object['notes']: - test = f"{y['libelleMatiere']}: {y['valeur']} / {y['noteSur']} pour une moyenne de classe à {y['moyenneClasse']}" - return f""" - {test} - """ - + liste = " " + return render_template('note.html',json_object=json_object, liste=liste) + @app.route('/message') def message(): xzdfazfa = utilisateur.getmes() @@ -65,4 +51,8 @@ def message(): {test} """ -app.run(host='0.0.0.0', port=80) \ No newline at end of file + + + +app.run(host='127.0.0.1', port=8080) + \ No newline at end of file diff --git a/templates/css/index.css b/templates/css/index.css new file mode 100644 index 0000000..9679593 --- /dev/null +++ b/templates/css/index.css @@ -0,0 +1,30 @@ +* { + padding: 0px; + margin: 0px; + color: #ddccff; + } + body { + height: 100vh; + width: 100vw; + overflow: none; + background: #333; + } + .scroll{ + padding: 50px; + height: calc(100vh - 100px); + display: flex; + align-items: center; + justify-content: space-evenly; + flex-direction: column; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + border-radius: 40px; + } + .link { + padding: 20px; + border: 1px solid #ddf; + border-radius: 20px; + font-size: 1.5em; + } \ No newline at end of file diff --git a/templates/css/note.css b/templates/css/note.css new file mode 100644 index 0000000..2641113 --- /dev/null +++ b/templates/css/note.css @@ -0,0 +1,48 @@ +* { + color: #ffd; +} +body, html { + margin: 0px; + padding: 0px; + background: #333; +} +.boite { + padding: 25px; + border: 1px solid #ffd; + border-radius: 25px; + margin: 5vh; + display: flex; + align-items: center; + justify-content: space-evenly; + flex-direction: column; +} +.boite h1 { + text-align: center; + margin-bottom: 25px; +} +.boite text { + display: flex; + color: #33ff33; +} +.boite div { + position: relative; + width: 100%; + display: flex; + align-items: center; + justify-content: center; +} +.boite div .test { + margin-right: 25px; + font-size: 1.5rem; +} +.boite div .test p { + display: none; + cursor: pointer; +} +.boite div .test:hover { + font-size: 0px; +} +.boite div .test:hover p { + display: block; + font-size: 1.5rem; +} \ No newline at end of file diff --git a/templates/css/travail.css b/templates/css/travail.css new file mode 100644 index 0000000..a8fb242 --- /dev/null +++ b/templates/css/travail.css @@ -0,0 +1,35 @@ +body html, h1, p{ + padding: 0px; + margin: 0px; +} +.jours { + position: relative; + margin-bottom: 10vh; + left: 50%; + transform: translate(-50%); + border: 1px solid currentColor; + border-radius: 40px; + padding: 50px 0px; + width: 80vw; + height: 10vh; + display: flex; + flex-direction: column; + justify-content: space-evenly; + align-items: center; + cursor: pointer; + transition: 0.25s ease-in-out; + color: blueviolet; +} +.jours:hover { + background: #222; + color: hsl(241, 92%, 58%); +} +.jours h1 { + position: absolute; + top: 0px; + left: 50%; + transform: translate(-50%); +} +body, html { + background: #333 +} \ No newline at end of file diff --git a/templates/css/travailjours.css b/templates/css/travailjours.css new file mode 100644 index 0000000..056ad57 --- /dev/null +++ b/templates/css/travailjours.css @@ -0,0 +1,8 @@ +body html, h1, p{ + padding: 0px; + margin: 0px; +} +body, html { +background: #333; +color: coral; +} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..3e2534d --- /dev/null +++ b/templates/index.html @@ -0,0 +1,25 @@ + + + + + + + école direct + + + +
+ + + +
+ + + + \ No newline at end of file diff --git a/templates/note.html b/templates/note.html new file mode 100644 index 0000000..ba2bf1d --- /dev/null +++ b/templates/note.html @@ -0,0 +1,52 @@ + + + + + + + notes + + + + +
+

histoire géographie

+
+
+
+

allemand

+
+
+
+

physique chimie

+
+
+
+

anglais

+
+
+
+

mathématique

+
+
+ + + {%for i in json_object['notes']%} + + {%endfor%} + + + + + + \ No newline at end of file diff --git a/templates/travail.html b/templates/travail.html index 6bb5451..02c2058 100644 --- a/templates/travail.html +++ b/templates/travail.html @@ -7,7 +7,7 @@ travail - + {%for i in json_object.keys()%}

travail a faire pour le: {{i}}

@@ -24,42 +24,5 @@ {%endfor%} - - - \ No newline at end of file + + \ No newline at end of file diff --git a/templates/travailjours.html b/templates/travailjours.html index 4147740..09b91c0 100644 --- a/templates/travailjours.html +++ b/templates/travailjours.html @@ -7,7 +7,7 @@ devoir du {{json_object['date']}} - +


@@ -27,14 +27,3 @@ - - \ No newline at end of file