Browse Source

Ajout du service main manquant

Nabil Moukhlis 2 years ago
parent
commit
b45f977914
47 changed files with 723 additions and 1 deletions
  1. 0
    1
      main/Dockerfiles/app/App
  2. 5
    0
      main/Dockerfiles/app/App/app/.idea/.gitignore
  3. 12
    0
      main/Dockerfiles/app/App/app/.idea/app.iml
  4. 8
    0
      main/Dockerfiles/app/App/app/.idea/modules.xml
  5. 107
    0
      main/Dockerfiles/app/App/app/app.py
  6. 81
    0
      main/Dockerfiles/app/App/app/app.py.save
  7. 165
    0
      main/Dockerfiles/app/App/app/static/css/homepage.css
  8. 66
    0
      main/Dockerfiles/app/App/app/static/css/play.css
  9. BIN
      main/Dockerfiles/app/App/app/static/images/0OGT77OE.png
  10. BIN
      main/Dockerfiles/app/App/app/static/images/1YBGKB4W.png
  11. BIN
      main/Dockerfiles/app/App/app/static/images/2RSXZ2IT.png
  12. BIN
      main/Dockerfiles/app/App/app/static/images/3EKW3K1A.png
  13. BIN
      main/Dockerfiles/app/App/app/static/images/4EVLZIC0.png
  14. BIN
      main/Dockerfiles/app/App/app/static/images/7J5E86WI.png
  15. BIN
      main/Dockerfiles/app/App/app/static/images/7OXPVDNT.png
  16. BIN
      main/Dockerfiles/app/App/app/static/images/BIHYBMDS.png
  17. BIN
      main/Dockerfiles/app/App/app/static/images/BYKYLYXYJYDYH.png
  18. BIN
      main/Dockerfiles/app/App/app/static/images/D14JMEG4.png
  19. BIN
      main/Dockerfiles/app/App/app/static/images/DVORUQMI.png
  20. BIN
      main/Dockerfiles/app/App/app/static/images/DVVVYVPVKVMVY.png
  21. BIN
      main/Dockerfiles/app/App/app/static/images/EVGVQVVVNVVVR.png
  22. BIN
      main/Dockerfiles/app/App/app/static/images/FUIXIR47.png
  23. BIN
      main/Dockerfiles/app/App/app/static/images/JFZFUFPFWFSFO.png
  24. BIN
      main/Dockerfiles/app/App/app/static/images/JHRLW7IN.png
  25. BIN
      main/Dockerfiles/app/App/app/static/images/JNAQW11Y.png
  26. BIN
      main/Dockerfiles/app/App/app/static/images/KN02NRA4.png
  27. BIN
      main/Dockerfiles/app/App/app/static/images/OI1PW5Z4.png
  28. BIN
      main/Dockerfiles/app/App/app/static/images/PJCJTJNJTJQJJ.png
  29. BIN
      main/Dockerfiles/app/App/app/static/images/PXMCEA4U.png
  30. BIN
      main/Dockerfiles/app/App/app/static/images/QDADRDCDBDYDJ.png
  31. BIN
      main/Dockerfiles/app/App/app/static/images/TEST.png
  32. BIN
      main/Dockerfiles/app/App/app/static/images/THJKM4Z5.png
  33. BIN
      main/Dockerfiles/app/App/app/static/images/UWKWIWZWLWNWQ.png
  34. BIN
      main/Dockerfiles/app/App/app/static/images/WAYARAVAUANAV.png
  35. BIN
      main/Dockerfiles/app/App/app/static/images/WEKQJXVH.png
  36. BIN
      main/Dockerfiles/app/App/app/static/images/YWZWLWVWCWYWP.png
  37. BIN
      main/Dockerfiles/app/App/app/static/images/Z8EWCF6S.png
  38. BIN
      main/Dockerfiles/app/App/app/static/images/ZIND6B2S.png
  39. BIN
      main/Dockerfiles/app/App/app/static/images/game-over.png
  40. BIN
      main/Dockerfiles/app/App/app/static/images/grille.png
  41. BIN
      main/Dockerfiles/app/App/app/static/images/paparazzi.png
  42. BIN
      main/Dockerfiles/app/App/app/static/images/winner.png
  43. 3
    0
      main/Dockerfiles/app/App/app/templates/base.html
  44. 77
    0
      main/Dockerfiles/app/App/app/templates/end.html
  45. 125
    0
      main/Dockerfiles/app/App/app/templates/homepage.html
  46. 37
    0
      main/Dockerfiles/app/App/app/templates/lost.html
  47. 37
    0
      main/Dockerfiles/app/App/app/templates/play.html

+ 0
- 1
main/Dockerfiles/app/App

@@ -1 +0,0 @@
1
-Subproject commit 6b18b1d67ba1bbce134c827e983974a2ac9430dd

+ 5
- 0
main/Dockerfiles/app/App/app/.idea/.gitignore View File

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

+ 12
- 0
main/Dockerfiles/app/App/app/.idea/app.iml View File

@@ -0,0 +1,12 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module type="WEB_MODULE" version="4">
3
+  <component name="NewModuleRootManager">
4
+    <content url="file://$MODULE_DIR$">
5
+      <excludeFolder url="file://$MODULE_DIR$/temp" />
6
+      <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
+      <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+    </content>
9
+    <orderEntry type="inheritedJdk" />
10
+    <orderEntry type="sourceFolder" forTests="false" />
11
+  </component>
12
+</module>

+ 8
- 0
main/Dockerfiles/app/App/app/.idea/modules.xml View File

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

+ 107
- 0
main/Dockerfiles/app/App/app/app.py View File

@@ -0,0 +1,107 @@
1
+# app/__init__.py
2
+
3
+from flask import Flask, render_template , request, redirect, url_for, abort
4
+from flask_bootstrap import Bootstrap
5
+import requests
6
+import shutil
7
+import os
8
+def create_app():
9
+    app = Flask(__name__)
10
+    Bootstrap(app)
11
+
12
+
13
+    NB_QUESTIONS = 8 # Number of questions (i.e attributes handle by yolo)
14
+
15
+
16
+
17
+    @app.route('/', methods=['POST', 'GET'])
18
+    def homepage():
19
+       if request.method == "POST":
20
+            # TO DO
21
+            # GENERATE GRID
22
+            r = requests.get('http://127.0.0.1:50001/')
23
+            filename = r.text
24
+            shutil.copy('/Datasets/grids/'+filename+'.png', './static/images/'+filename+'.png')
25
+            #r = requests.get('http://127.0.0.1:50011/create/TEST/')
26
+            #r = requests.get('http://127.0.0.1:50011/create/'+filename+'/')
27
+            return redirect(url_for('play',n=1,id=filename))
28
+       return render_template('homepage.html')
29
+
30
+
31
+
32
+
33
+
34
+    @app.route('/play/<string:id>/<int:n>/', methods=['POST', 'GET'])
35
+    def play(id="grille",n=1):
36
+       if (n==1):
37
+            # Call YOLO
38
+            r = requests.get('http://127.0.0.1:50015/create/'+id+'/')
39
+            r = requests.get('http://127.0.0.1:50011/create/'+id+'/')
40
+       if (n > NB_QUESTIONS or n < 1) :
41
+            abort(404)
42
+
43
+       # TO DO
44
+       # Get question n from database
45
+       r = requests.get("http://127.0.0.1:50011/question/"+str(n)).json()
46
+       q = r["intitule"]
47
+       attribute = r["attribut"]
48
+       answers=r["response"].split(";")
49
+       if request.method == "POST":
50
+                response=""
51
+                if 'YES' in request.form: # ON CLICK YES
52
+                     response = "0"
53
+                elif 'NO' in request.form: # ON CLICK NO
54
+                     response = "1"
55
+                elif 'STOP' in request.form: # ON CLICK STOP
56
+                    # TO DO
57
+                    # DELETE IMG
58
+                    # parameters : id
59
+                    return redirect(url_for('homepage'))
60
+                else:
61
+                    for a in answers:
62
+                       if a.upper() in request.form :
63
+                          attribute=a
64
+                          response="0"
65
+                # TO DO
66
+                # UPDATE GRID
67
+                # parameters : attribute , response,  id
68
+                r = requests.get("http://127.0.0.1:50009/update/"+id+"/"+attribute+"/"+response)
69
+                nb_characters = int(r.text)
70
+                os.remove('./static/images/'+id+'.png')
71
+                shutil.copy('/Datasets/grids/'+id+'.png', './static/images/'+id+'.png')
72
+                if n == NB_QUESTIONS :
73
+                    # EVERY QUESTIONS HAVE BEEN DONE
74
+                    # Prendre un perso au pif ?
75
+                    return redirect(url_for('end',id=id))
76
+                elif nb_characters == 1  :
77
+                    # OR THE COMPUTER FOUND THE CHARACTER
78
+                    return redirect(url_for('end',id=id))
79
+                elif nb_characters == 0 :
80
+                    return render_template('lost.html')
81
+                else:
82
+                    return redirect(url_for('play',n=n+1, id=id))
83
+       return render_template('play.html', numero = n, question = q, img = id,answers=answers)
84
+
85
+
86
+
87
+
88
+
89
+    @app.route('/end/<string:id>', methods=['POST', 'GET'])
90
+    def end(id = "grille") :
91
+        if request.method == "POST":
92
+            if 'YES' in request.form:
93
+                 # TO DO
94
+                 # GENERATE GRID
95
+                 filename = "grille"
96
+                 return redirect(url_for('play',n=1,id=filename))
97
+            elif 'NO' in request.form:
98
+                # TO DO
99
+                # DELETE IMG
100
+                # parameters : id
101
+                return redirect(url_for('homepage'))
102
+
103
+        return render_template('end.html',img=id)
104
+
105
+
106
+
107
+    return app

+ 81
- 0
main/Dockerfiles/app/App/app/app.py.save View File

@@ -0,0 +1,81 @@
1
+# app/__init__.py
2
+
3
+from flask import Flask, render_template , request, redirect, url_for, abort
4
+from flask_bootstrap import Bootstrap
5
+
6
+def create_app():
7
+    app = Flask(__name__)
8
+    Bootstrap(app)
9
+
10
+
11
+    NB_QUESTIONS = 5 # Number of questions (i.e attributes handle by yolo)
12
+
13
+
14
+
15
+    @app.route('/', methods=['POST', 'GET'])
16
+    def homepage():
17
+ if request.method == "POST":
18
+		# TO DO
19
+		# GENERATE GRID
20
+		r = requests.get('127.0.0.1:50001/')filename = r
21
+		return redirect(url_for('play',n=1,id=filename))
22
+	return render_template('homepage.html')
23
+
24
+
25
+
26
+
27
+
28
+    @app.route('/play/<string:id>/<int:n>/', methods=['POST', 'GET'])
29
+    def play(id="grille",n=1):
30
+       if (n > NB_QUESTIONS or n < 1) :
31
+            abort(404)
32
+       # TO DO
33
+       # Get question n from database
34
+       q = "Does your character wear a hat ?"
35
+       attribute = "Hat"
36
+       if request.method == "POST":
37
+                if 'YES' in request.form: # ON CLICK YES
38
+                     response = 1
39
+                elif 'NO' in request.form: # ON CLICK NO
40
+                     response = 0
41
+                elif 'STOP' in request.form: # ON CLICK STOP
42
+                    # TO DO
43
+                    # DELETE IMG
44
+                    # parameters : id
45
+                    return redirect(url_for('homepage'))
46
+                # TO DO
47
+                # UPDATE GRID
48
+                # parameters : attribute , response,  id
49
+                nb_characters = 2 # TO DO
50
+                if n == NB_QUESTIONS :
51
+                    # EVERY QUESTIONS HAVE BEEN DONE
52
+                    # Prendre un perso au pif ?
53
+                    return redirect(url_for('end',id=id))
54
+                elif nb_characters == 1  :
55
+                    # OR THE COMPUTER FOUND THE CHARACTER
56
+                    return redirect(url_for('end',id=id))
57
+                else:
58
+                    return redirect(url_for('play',n=n+1, id=id))
59
+       return render_template('play.html', numero = n, question = q, img = id)
60
+
61
+
62
+
63
+
64
+
65
+    @app.route('/end/<string:id>', methods=['POST', 'GET'])
66
+    def end(id = "grille") :
67
+        if request.method == "POST":
68
+            if 'YES' in request.form:
69
+                 # TO DO
70
+                 # GENERATE GRID
71
+                 filename = "grille"
72
+                 return redirect(url_for('play',n=1,id=filename))
73
+            elif 'NO' in request.form:
74
+                # TO DO
75
+                # DELETE IMG
76
+                # parameters : id
77
+                return redirect(url_for('homepage'))
78
+
79
+        return render_template('end.html',img=id)
80
+
81
+    return app

+ 165
- 0
main/Dockerfiles/app/App/app/static/css/homepage.css View File

@@ -0,0 +1,165 @@
1
+/* BOUTON */
2
+/* ----------------------------------------------------------------- */
3
+@import url('https://fonts.googleapis.com/css?family=Poppins:900i');
4
+* {
5
+    box-sizing: border-box;
6
+}
7
+
8
+.wrapper {
9
+    display: flex;
10
+    justify-content: center;
11
+    margin-bottom : 50px;
12
+}
13
+
14
+.cta {
15
+    display: flex;
16
+    padding: 10px 45px;
17
+    text-decoration: none;
18
+    font-family: 'Poppins', sans-serif;
19
+    font-size: 40px;
20
+    color: white;
21
+    background: #6225E6;
22
+    transition: 1s;
23
+    box-shadow: 6px 6px 0 black;
24
+    transform: skewX(-15deg);
25
+}
26
+
27
+.cta:focus {
28
+    outline: none;
29
+}
30
+
31
+.cta:hover {
32
+    transition: 0.5s;
33
+    box-shadow: 10px 10px 0 #FBC638;
34
+}
35
+
36
+.cta span:nth-child(2) {
37
+    transition: 0.5s;
38
+    margin-right: 0px;
39
+}
40
+
41
+.cta:hover  span:nth-child(2) {
42
+    transition: 0.5s;
43
+    margin-right: 45px;
44
+}
45
+
46
+span {
47
+    transform: skewX(15deg)
48
+}
49
+
50
+span:nth-child(2) {
51
+    width: 20px;
52
+    margin-left: 30px;
53
+    position: relative;
54
+    top: 12%;
55
+}
56
+
57
+/**************SVG****************/
58
+
59
+path.one {
60
+    transition: 0.4s;
61
+    transform: translateX(-60%);
62
+}
63
+
64
+path.two {
65
+    transition: 0.5s;
66
+    transform: translateX(-30%);
67
+}
68
+
69
+.cta:hover path.three {
70
+    animation: color_anim 1s infinite 0.2s;
71
+}
72
+
73
+.cta:hover path.one {
74
+    transform: translateX(0%);
75
+    animation: color_anim 1s infinite 0.6s;
76
+}
77
+
78
+.cta:hover path.two {
79
+    transform: translateX(0%);
80
+    animation: color_anim 1s infinite 0.4s;
81
+}
82
+
83
+/* SVG animations */
84
+
85
+@keyframes color_anim {
86
+    0% {
87
+        fill: white;
88
+    }
89
+    50% {
90
+        fill: #FBC638;
91
+    }
92
+    100% {
93
+        fill: white;
94
+    }
95
+}
96
+/* ----------------------------------------------------------------- */
97
+body,h1,h2,h3,h4,h5,h6 {font-family: "Lato", sans-serif;}
98
+body, html {
99
+    height: 100%;
100
+    color: black;
101
+    line-height: 1.8;
102
+}
103
+
104
+/* Create a Parallax Effect */
105
+.bgimg-1, .bgimg-2, .bgimg-3 {
106
+    background-attachment: fixed;
107
+    background-position: center;
108
+    background-repeat: no-repeat;
109
+    background-size: cover;
110
+}
111
+
112
+/* First image (Logo. Full height) */
113
+.bgimg-1 {
114
+    background-image: url("/static/images/paparazzi.png");
115
+    min-height: 100%;
116
+}
117
+
118
+.w3-wide {letter-spacing: 10px;}
119
+.w3-hover-opacity {cursor: pointer;}
120
+
121
+/* Turn off parallax scrolling for tablets and phones */
122
+@media only screen and (max-device-width: 1600px) {
123
+    .bgimg-1, .bgimg-2, .bgimg-3 {
124
+        background-attachment: scroll;
125
+        min-height: 400px;
126
+    }
127
+}
128
+
129
+body,h1,h2,h3,h4,h5,h6 {font-family: "Lato", sans-serif;}
130
+body, html {
131
+    height: 100%;
132
+    color: black;
133
+    line-height: 1.8;
134
+}
135
+
136
+/* Create a Parallax Effect */
137
+.bgimg-1, .bgimg-2, .bgimg-3 {
138
+    background-attachment: fixed;
139
+    background-position: center;
140
+    background-repeat: no-repeat;
141
+    background-size: cover;
142
+}
143
+
144
+/* First image (Logo. Full height) */
145
+.bgimg-1 {
146
+    background-image: url("/static/images/paparazzi.png");
147
+    min-height: 100%;
148
+    background-size:300px;
149
+}
150
+
151
+.w3-wide {letter-spacing: 10px;}
152
+.w3-hover-opacity {cursor: pointer;}
153
+
154
+/* Turn off parallax scrolling for tablets and phones */
155
+@media only screen and (max-device-width: 1600px) {
156
+    .bgimg-1, .bgimg-2, .bgimg-3 {
157
+        background-attachment: scroll;
158
+        min-height: 400px;
159
+        margin-top : 50px;
160
+    }
161
+}
162
+
163
+.coloriage{
164
+    background-color: khaki;
165
+}

+ 66
- 0
main/Dockerfiles/app/App/app/static/css/play.css View File

@@ -0,0 +1,66 @@
1
+@import url('https://fonts.googleapis.com/css?family=Patrick+Hand+SC');
2
+*{
3
+    box-sizing:border-box;
4
+}
5
+
6
+body{
7
+    font-family: 'Patrick Hand SC', cursive;
8
+    text-align:center;
9
+}
10
+
11
+.title{
12
+      text-align:center;
13
+      color:#41403E;
14
+      font-size:5rem;
15
+      font-family: 'Patrick Hand SC', cursive;
16
+      border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
17
+      box-shadow:2px 8px 4px -6px hsla(0,0%,0%,.3);
18
+      border:solid 2px #41403E;
19
+      margin: 20px !important;
20
+      background-color: khaki;
21
+  }
22
+
23
+.grid{
24
+    height: 400px;
25
+    padding-left: 20px;
26
+    margin-bottom: 50px;
27
+    margin-top:50px;
28
+    max-width: 100%;
29
+    max-height: 100%;
30
+}
31
+
32
+.question{
33
+    font-family: 'Patrick Hand SC', cursive;
34
+    text-align:center;
35
+}
36
+
37
+.yes_no{
38
+    border:dashed 2px #41403E;
39
+    align-self:center;
40
+    background:transparent;
41
+    padding:1rem 1rem;
42
+    margin:0 1rem;
43
+    transition:all .5s ease;
44
+    color:#41403E;
45
+    font-size:2rem;
46
+    letter-spacing:1px;
47
+    outline:none;
48
+    box-shadow: 20px 38px 34px -26px hsla(0,0%,0%,.2);
49
+    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
50
+}
51
+
52
+.buttons{
53
+    display: flex;
54
+    justify-content: center;
55
+    align-items: center;
56
+}
57
+
58
+.paparazzi{
59
+    height: 200px;
60
+    margin-bottom: 20px;
61
+}
62
+.center{
63
+    display: block;
64
+    margin-left: auto;
65
+    margin-right: auto;
66
+}

BIN
main/Dockerfiles/app/App/app/static/images/0OGT77OE.png View File


BIN
main/Dockerfiles/app/App/app/static/images/1YBGKB4W.png View File


BIN
main/Dockerfiles/app/App/app/static/images/2RSXZ2IT.png View File


BIN
main/Dockerfiles/app/App/app/static/images/3EKW3K1A.png View File


BIN
main/Dockerfiles/app/App/app/static/images/4EVLZIC0.png View File


BIN
main/Dockerfiles/app/App/app/static/images/7J5E86WI.png View File


BIN
main/Dockerfiles/app/App/app/static/images/7OXPVDNT.png View File


BIN
main/Dockerfiles/app/App/app/static/images/BIHYBMDS.png View File


BIN
main/Dockerfiles/app/App/app/static/images/BYKYLYXYJYDYH.png View File


BIN
main/Dockerfiles/app/App/app/static/images/D14JMEG4.png View File


BIN
main/Dockerfiles/app/App/app/static/images/DVORUQMI.png View File


BIN
main/Dockerfiles/app/App/app/static/images/DVVVYVPVKVMVY.png View File


BIN
main/Dockerfiles/app/App/app/static/images/EVGVQVVVNVVVR.png View File


BIN
main/Dockerfiles/app/App/app/static/images/FUIXIR47.png View File


BIN
main/Dockerfiles/app/App/app/static/images/JFZFUFPFWFSFO.png View File


BIN
main/Dockerfiles/app/App/app/static/images/JHRLW7IN.png View File


BIN
main/Dockerfiles/app/App/app/static/images/JNAQW11Y.png View File


BIN
main/Dockerfiles/app/App/app/static/images/KN02NRA4.png View File


BIN
main/Dockerfiles/app/App/app/static/images/OI1PW5Z4.png View File


BIN
main/Dockerfiles/app/App/app/static/images/PJCJTJNJTJQJJ.png View File


BIN
main/Dockerfiles/app/App/app/static/images/PXMCEA4U.png View File


BIN
main/Dockerfiles/app/App/app/static/images/QDADRDCDBDYDJ.png View File


BIN
main/Dockerfiles/app/App/app/static/images/TEST.png View File


BIN
main/Dockerfiles/app/App/app/static/images/THJKM4Z5.png View File


BIN
main/Dockerfiles/app/App/app/static/images/UWKWIWZWLWNWQ.png View File


BIN
main/Dockerfiles/app/App/app/static/images/WAYARAVAUANAV.png View File


BIN
main/Dockerfiles/app/App/app/static/images/WEKQJXVH.png View File


BIN
main/Dockerfiles/app/App/app/static/images/YWZWLWVWCWYWP.png View File


BIN
main/Dockerfiles/app/App/app/static/images/Z8EWCF6S.png View File


BIN
main/Dockerfiles/app/App/app/static/images/ZIND6B2S.png View File


BIN
main/Dockerfiles/app/App/app/static/images/game-over.png View File


BIN
main/Dockerfiles/app/App/app/static/images/grille.png View File


BIN
main/Dockerfiles/app/App/app/static/images/paparazzi.png View File


BIN
main/Dockerfiles/app/App/app/static/images/winner.png View File


+ 3
- 0
main/Dockerfiles/app/App/app/templates/base.html View File

@@ -0,0 +1,3 @@
1
+{# app/templates/base.html #}
2
+{% extends "bootstrap/base.html" %}
3
+

+ 77
- 0
main/Dockerfiles/app/App/app/templates/end.html View File

@@ -0,0 +1,77 @@
1
+<!-- app/templates/play.html -->
2
+{% extends 'base.html' %}
3
+{% block content %}
4
+
5
+<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/play.css') }}">
6
+
7
+<div class="title">Guess Who </div>
8
+
9
+<div class="row">
10
+    <div class="col-md-6">
11
+        <p class="question" style="font-size:3rem;" > End ...  </p>
12
+        <p class="question" style="font-size:3rem;" > Is this your character ? </p>
13
+        <br>
14
+        <img class="paparazzi center" src="{{url_for('static',filename='images/paparazzi.png')}}" alt="Guess who">
15
+        <form  method = "POST">
16
+            <div class="buttons">
17
+                <!-- Button trigger modal -->
18
+                <button type="button" class="yes_no btn btn-primary" data-toggle="modal" data-target="#LOST">Yes </button>
19
+                <button type="button" class="yes_no btn btn-primary" data-toggle="modal" data-target="#WIN">No </button>
20
+            </div>
21
+        </form>
22
+    </div>
23
+    <div class="col-md-6">
24
+        <img class="grid center"
25
+             src="{{url_for('static',filename='images/' + img + '.png')}}"
26
+             alt="grid">
27
+    </div>
28
+</div>
29
+
30
+
31
+
32
+<!-- Win Modal -->
33
+<div class="modal fade" id="WIN" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" data-keyboard="false" data-backdrop="static">
34
+    <div class="modal-dialog" role="document">
35
+        <div class="modal-content">
36
+            <div class="modal-header" style="background-color: #ffc857;">
37
+                <h2 class="modal-title" id="WinLabel">End of the game ...</h2>
38
+            </div>
39
+            <div class="modal-body">
40
+                <h3> WINNER </h3>
41
+                <img class="paparazzi center" src="{{url_for('static',filename='images/winner.png')}}" alt="Winner">
42
+                <h3> Do you want to play again ? </h3>
43
+            </div>
44
+            <div class="modal-footer">
45
+                <form method="POST">
46
+                    <button type="submit" class="yes_no btn btn-secondary" style="background-color: #5c80bc;" name="YES">Yes</button>
47
+                    <button type="submit" class="yes_no btn btn-secondary" style="background-color: #5c80bc;" name="NO">No</button>
48
+                </form>
49
+            </div>
50
+        </div>
51
+    </div>
52
+</div>
53
+
54
+<!-- LOST Modal -->
55
+<div class="modal fade" id="LOST" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" data-keyboard="false" data-backdrop="static">
56
+    <div class="modal-dialog" role="document">
57
+        <div class="modal-content">
58
+            <div class="modal-header" style="background-color: #ffc857;">
59
+                <h2 class="modal-title" id="LostLabel">End of the game ...</h2>
60
+            </div>
61
+            <div class="modal-body">
62
+                <h3> LOSER </h3>
63
+                <img class="paparazzi center" src="{{url_for('static',filename='images/game-over.png')}}" alt="Loser">
64
+                <h3> Do you want to play again ? </h3>
65
+            </div>
66
+            <div class="modal-footer">
67
+                <form method="POST">
68
+                    <button type="submit" class="yes_no btn btn-secondary" style="background-color: #5c80bc;" name="YES">Yes</button>
69
+                    <button type="submit" class="yes_no btn btn-secondary" style="background-color: #5c80bc;" name="NO">No</button>
70
+                </form>
71
+            </div>
72
+        </div>
73
+    </div>
74
+</div>
75
+
76
+
77
+{% endblock %}

+ 125
- 0
main/Dockerfiles/app/App/app/templates/homepage.html View File

@@ -0,0 +1,125 @@
1
+<!-- app/templates/homepage.html -->
2
+{% extends 'base.html' %}
3
+{% block content %}
4
+
5
+    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
6
+    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
7
+    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
8
+    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/homepage.css') }}">
9
+
10
+    <!-- Navbar (sit on top) -->
11
+    <div class="w3-top coloriage">
12
+        <div class="w3-bar" id="myNavbar">
13
+            <a class="w3-bar-item w3-button w3-hover-black w3-hide-medium w3-hide-large w3-right" href="javascript:void(0);" onclick="toggleFunction()" title="Toggle Navigation Menu">
14
+                <i class="fa fa-bars"></i>
15
+            </a>
16
+            <a href="#home" class="w3-bar-item w3-button">HOME</a>
17
+            <a href="#about" class="w3-bar-item w3-button w3-hide-small"><i class="fa fa-user"></i> ABOUT</a>
18
+        </div>
19
+
20
+        <!-- Navbar on small screens -->
21
+        <div id="navDemo" class="w3-bar-block w3-white w3-hide w3-hide-large w3-hide-medium">
22
+            <a href="#about" class="w3-bar-item w3-button" onclick="toggleFunction()">ABOUT</a>
23
+            <a href="#portfolio" class="w3-bar-item w3-button" onclick="toggleFunction()">PORTFOLIO</a>
24
+            <a href="#contact" class="w3-bar-item w3-button" onclick="toggleFunction()">CONTACT</a>
25
+            <a href="#" class="w3-bar-item w3-button">SEARCH</a>
26
+        </div>
27
+    </div>
28
+
29
+    <!-- First Parallax Image with Logo Text -->
30
+    <div class="bgimg-1 w3-display-container w3-opacity-min" id="home">
31
+        <div class="w3-display-middle" style="white-space:nowrap;">
32
+        </div>
33
+    </div>
34
+
35
+    <div class="wrapper">
36
+        <form  method = "POST">
37
+            <button class="cta">Let's play &nbsp;
38
+                <span>
39
+      <svg width="66px" height="43px" viewBox="0 0 66 43" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
40
+        <g id="arrow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
41
+          <path class="one" d="M40.1543933,3.89485454 L43.9763149,0.139296592 C44.1708311,-0.0518420739 44.4826329,-0.0518571125 44.6771675,0.139262789 L65.6916134,20.7848311 C66.0855801,21.1718824 66.0911863,21.8050225 65.704135,22.1989893 C65.7000188,22.2031791 65.6958657,22.2073326 65.6916762,22.2114492 L44.677098,42.8607841 C44.4825957,43.0519059 44.1708242,43.0519358 43.9762853,42.8608513 L40.1545186,39.1069479 C39.9575152,38.9134427 39.9546793,38.5968729 40.1481845,38.3998695 C40.1502893,38.3977268 40.1524132,38.395603 40.1545562,38.3934985 L56.9937789,21.8567812 C57.1908028,21.6632968 57.193672,21.3467273 57.0001876,21.1497035 C56.9980647,21.1475418 56.9959223,21.1453995 56.9937605,21.1432767 L40.1545208,4.60825197 C39.9574869,4.41477773 39.9546013,4.09820839 40.1480756,3.90117456 C40.1501626,3.89904911 40.1522686,3.89694235 40.1543933,3.89485454 Z" fill="#FFFFFF"></path>
42
+          <path class="two" d="M20.1543933,3.89485454 L23.9763149,0.139296592 C24.1708311,-0.0518420739 24.4826329,-0.0518571125 24.6771675,0.139262789 L45.6916134,20.7848311 C46.0855801,21.1718824 46.0911863,21.8050225 45.704135,22.1989893 C45.7000188,22.2031791 45.6958657,22.2073326 45.6916762,22.2114492 L24.677098,42.8607841 C24.4825957,43.0519059 24.1708242,43.0519358 23.9762853,42.8608513 L20.1545186,39.1069479 C19.9575152,38.9134427 19.9546793,38.5968729 20.1481845,38.3998695 C20.1502893,38.3977268 20.1524132,38.395603 20.1545562,38.3934985 L36.9937789,21.8567812 C37.1908028,21.6632968 37.193672,21.3467273 37.0001876,21.1497035 C36.9980647,21.1475418 36.9959223,21.1453995 36.9937605,21.1432767 L20.1545208,4.60825197 C19.9574869,4.41477773 19.9546013,4.09820839 20.1480756,3.90117456 C20.1501626,3.89904911 20.1522686,3.89694235 20.1543933,3.89485454 Z" fill="#FFFFFF"></path>
43
+          <path class="three" d="M0.154393339,3.89485454 L3.97631488,0.139296592 C4.17083111,-0.0518420739 4.48263286,-0.0518571125 4.67716753,0.139262789 L25.6916134,20.7848311 C26.0855801,21.1718824 26.0911863,21.8050225 25.704135,22.1989893 C25.7000188,22.2031791 25.6958657,22.2073326 25.6916762,22.2114492 L4.67709797,42.8607841 C4.48259567,43.0519059 4.17082418,43.0519358 3.97628526,42.8608513 L0.154518591,39.1069479 C-0.0424848215,38.9134427 -0.0453206733,38.5968729 0.148184538,38.3998695 C0.150289256,38.3977268 0.152413239,38.395603 0.154556228,38.3934985 L16.9937789,21.8567812 C17.1908028,21.6632968 17.193672,21.3467273 17.0001876,21.1497035 C16.9980647,21.1475418 16.9959223,21.1453995 16.9937605,21.1432767 L0.15452076,4.60825197 C-0.0425130651,4.41477773 -0.0453986756,4.09820839 0.148075568,3.90117456 C0.150162624,3.89904911 0.152268631,3.89694235 0.154393339,3.89485454 Z" fill="#FFFFFF"></path>
44
+        </g>
45
+      </svg>
46
+    </span>
47
+            </button>
48
+        </form>
49
+    </div>
50
+
51
+    <!-- Container (About Section) -->
52
+    <div class = "coloriage">
53
+        <div class="w3-content w3-container w3-padding-64" id="about">
54
+            <h3 class="w3-center">ABOUT US</h3>
55
+            <p class="w3-center"><em> Team Guess Who  </em></p>
56
+            <p>
57
+                Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
58
+                standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make
59
+                a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
60
+                remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing
61
+                Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions
62
+                of Lorem Ipsum
63
+            </p>
64
+        </div>
65
+    </div>
66
+
67
+    <div class="w3-row w3-center w3-dark-grey w3-padding-16">
68
+        <div class="w3-quarter w3-section">
69
+            <span class="w3-xlarge">270 000 </span><br>
70
+            Images
71
+        </div>
72
+        <div class="w3-quarter w3-section">
73
+            <span class="w3-xlarge">6</span><br>
74
+            Classmates
75
+        </div>
76
+        <div class="w3-quarter w3-section">
77
+            <span class="w3-xlarge">3</span><br>
78
+            Tutors
79
+        </div>
80
+        <div class="w3-quarter w3-section">
81
+            <span class="w3-xlarge">15</span><br>
82
+            Meetings
83
+        </div>
84
+    </div>
85
+
86
+
87
+    <!-- Footer -->
88
+    <footer class="w3-center w3-padding-64 w3-opacity w3-hover-opacity-off coloriage">
89
+        <a href="#home" class="w3-button w3-light-grey"><i class="fa fa-arrow-up w3-margin-right"></i>To the top</a>
90
+    </footer>
91
+
92
+
93
+    <script>
94
+        // Modal Image Gallery
95
+        function onClick(element) {
96
+            document.getElementById("img01").src = element.src;
97
+            document.getElementById("modal01").style.display = "block";
98
+            var captionText = document.getElementById("caption");
99
+            captionText.innerHTML = element.alt;
100
+        }
101
+
102
+        // Change style of navbar on scroll
103
+        window.onscroll = function() {myFunction()};
104
+        function myFunction() {
105
+            var navbar = document.getElementById("myNavbar");
106
+            if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
107
+                navbar.className = "w3-bar" + " w3-card" + " w3-animate-top" + " w3-white";
108
+            } else {
109
+                navbar.className = navbar.className.replace(" w3-card w3-animate-top w3-white", "");
110
+            }
111
+        }
112
+
113
+        // Used to toggle the menu on small screens when clicking on the menu button
114
+        function toggleFunction() {
115
+            var x = document.getElementById("navDemo");
116
+            if (x.className.indexOf("w3-show") == -1) {
117
+                x.className += " w3-show";
118
+            } else {
119
+                x.className = x.className.replace(" w3-show", "");
120
+            }
121
+        }
122
+    </script>
123
+
124
+
125
+{% endblock %}

+ 37
- 0
main/Dockerfiles/app/App/app/templates/lost.html View File

@@ -0,0 +1,37 @@
1
+<!-- Win Modal -->
2
+{% extends 'base.html' %}
3
+
4
+{% block content %}
5
+
6
+<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/play.css') }}">
7
+
8
+<div class="modal fade" id="WIN" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" data-keyboard="false" data-backdrop="static">
9
+    <div class="modal-dialog" role="document">
10
+        <div class="modal-content">
11
+            <div class="modal-header" style="background-color: #ffc857;">
12
+                <h2 class="modal-title" id="WinLabel">End of the game ...</h2>
13
+            </div>
14
+            <div class="modal-body">
15
+                <h3> WINNER </h3>
16
+                <h4> I was not smart enough, I could not find your character...</h4>
17
+                <img class="paparazzi center" src="{{url_for('static',filename='images/winner.png')}}" alt="Winner">
18
+                <h3> Do you want to play again ? </h3>
19
+            </div>
20
+            <div class="modal-footer">
21
+                <form method="POST">
22
+                    <button type="submit" class="yes_no btn btn-secondary" style="background-color: #5c80bc;" name="YES">Yes</button>
23
+                    <button type="submit" class="yes_no btn btn-secondary" style="background-color: #5c80bc;" name="NO">No</button>
24
+                </form>
25
+            </div>
26
+        </div>
27
+    </div>
28
+</div>
29
+
30
+<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
31
+
32
+<script>
33
+    $(document).ready(function() {
34
+        $("#WIN").modal('show')
35
+    })
36
+</script>
37
+{% endblock %}

+ 37
- 0
main/Dockerfiles/app/App/app/templates/play.html View File

@@ -0,0 +1,37 @@
1
+<!-- app/templates/play.html -->
2
+{% extends 'base.html' %}
3
+{% block content %}<div class="title">Guess Who </div>
4
+<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/play.css') }}">
5
+
6
+<div class="row">
7
+    <div class="col-md-6">
8
+        <img class="grid center"
9
+             src="{{url_for('static',filename='images/' + img + '.png')}}"
10
+             alt="grid">
11
+    </div>
12
+    <div class="col-md-6">
13
+        <p class="question" style="font-size:3rem;" > Question {{ numero }} :  </p>
14
+        <p class="question" style="font-size:3rem;" > {{ question }} </p>
15
+        <br>
16
+        <img class="paparazzi center" src="{{url_for('static',filename='images/paparazzi.png')}}" alt="Guess who">
17
+        <form  method = "POST">
18
+            <div class="buttons">
19
+                {% for item in answers %}
20
+    			<button type="submit" class="yes_no btn btn-secondary"  name="{{ item | upper }}"> {{item}} </button>
21
+    		{% endfor %}
22
+            </div>
23
+        </form>
24
+    </div>
25
+</div>
26
+<footer class="text-center text-lg-start bg-light text-muted" style="padding-top: 10px">
27
+    <div class="text-center p-4" style="background-color: rgba(0, 0, 0, 0.05); padding: 10px">
28
+        <p class="question" style="font-style: italic"> Bored and you want to stop ? </p>
29
+        <form  method = "POST">
30
+            <button class="yes_no btn btn-secondary" style="font-size: 1rem;font-style: italic;padding: 5px" type="submit" name="STOP"> Stop </button>
31
+        </form>
32
+    </div>
33
+</footer>
34
+
35
+
36
+
37
+{% endblock %}

Loading…
Cancel
Save