Diff of /templates/demo1.html [000000] .. [9dc5df]

Switch to unified view

a b/templates/demo1.html
1
<html lang="en">
2
3
<head>
4
    <meta charset="UTF-8">
5
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
    <title>AI Demo</title>
8
    
9
    <link href="{{ url_for('static', filename='css/main.css') }}" rel="stylesheet">  
10
    <link rel="stylesheet" href="C:\Users\junnajamshed\Desktop\projectCopy\static\css\navstyle.css">    
11
    <style>
12
        body{
13
            width: 100%;
14
            height: 100vh;
15
            display: block;
16
            background-size: 300% 300%;
17
            background-image: linear-gradient(
18
            -45deg, 
19
            rgba(59,173,227,1) 0%, 
20
            rgba(87,111,230,1) 25%, 
21
            rgba(152,68,183,1) 51%, 
22
            rgba(255,53,127,1) 100%
23
      );  
24
      animation: AnimateBG 20s ease infinite;
25
    }
26
    
27
    @keyframes AnimateBG { 
28
      0%{background-position:0% 50%}
29
      50%{background-position:100% 50%}
30
      100%{background-position:0% 50%}
31
    }
32
    * {
33
  padding: 0;
34
  margin: 0;
35
  text-decoration: none;
36
  list-style: none;
37
  box-sizing: border-box;
38
}
39
body {
40
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
41
}
42
43
nav {
44
  background: #022f69;
45
  height: 80px;
46
  width: 100%;
47
}
48
label.logo {
49
  color: #fff;
50
  font-size: 35px;
51
  line-height: 80px;
52
  padding: 0 100px;
53
  font-weight: bold;
54
}
55
nav ul {
56
  float: right;
57
  margin-right: 20px;
58
}
59
nav ul li {
60
  display: inline-block;
61
  line-height: 80px;
62
  margin: 0 5px;
63
}
64
nav ul li a {
65
  color: #fff;
66
  font-size: 17px;
67
  padding: 7px 13px;
68
  border-radius: 3px;
69
  text-transform: uppercase;
70
}
71
a.active,
72
a:hover {
73
  background: #fff;
74
  transition: 0.5s;
75
  color: #022f69;
76
}
77
.checkbtn {
78
  font-size: 30px;
79
  color: #fff;
80
  float: right;
81
  line-height: 80px;
82
  margin-right: 40px;
83
  cursor: pointer;
84
  display: none;
85
}
86
#check {
87
  display: none;
88
}
89
@media (max-width: 968px) {
90
  label.logo {
91
    font-size: 30px;
92
    padding-left: 50px;
93
  }
94
  nav ul li a {
95
    font-size: 16px;
96
  }
97
}
98
@media (max-width: 875px) {
99
  .checkbtn {
100
    display: block;
101
  }
102
  nav ul {
103
    position: fixed;
104
    width: 100%;
105
    height: 100vh;
106
    background: #27282c;
107
    top: 80px;
108
    left: -100%;
109
    text-align: center;
110
    transition: all 0.5s;
111
  }
112
  nav ul li {
113
    display: block;
114
    margin: 50px 0;
115
    line-height: 30px;
116
  }
117
  nav ul li a {
118
    font-size: 20px;
119
  }
120
  a:hover,
121
  a.active {
122
    background: none;
123
    color: #0082e6;
124
  }
125
  #check:checked ~ ul {
126
    left: 0;
127
  }
128
}
129
.img-preview {
130
  width: 256px;
131
  height: 256px;
132
  position: relative;
133
  border: 5px solid #f8f8f8;
134
  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
135
  margin-top: 1em;
136
  margin-bottom: 1em;
137
}
138
139
.img-preview > div {
140
  width: 100%;
141
  height: 100%;
142
  background-size: 256px 256px;
143
  background-repeat: no-repeat;
144
  background-position: center;
145
}
146
147
input[type="file"] {
148
  display: none;
149
}
150
151
.upload-label {
152
  display: inline-block;
153
  padding: 12px 30px;
154
  background: #39d2b4;
155
  color: #fff;
156
  font-size: 1em;
157
  transition: all 0.4s;
158
  cursor: pointer;
159
}
160
161
.upload-label:hover {
162
  background: #34495e;
163
  color: #39d2b4;
164
}
165
166
.loader {
167
  border: 8px solid #f3f3f3; /* Light grey */
168
  border-top: 8px solid #3498db; /* Blue */
169
  border-radius: 50%;
170
  width: 50px;
171
  height: 50px;
172
  animation: spin 1s linear infinite;
173
}
174
175
@keyframes spin {
176
  0% {
177
    transform: rotate(0deg);
178
  }
179
  100% {
180
    transform: rotate(360deg);
181
  }
182
}
183
184
    </style>  
185
</head>
186
187
<body>
188
    <nav>
189
        <input type="checkbox" id="check">
190
        <label for="check" class="checkbtn">
191
          <i class="fas fa-bars"></i>
192
        </label>
193
        <label class="logo">Leukemia Cancer Detection</label>
194
        <ul>
195
          <li><a class="active" href="#">Home</a></li>
196
          <li><a href="index.html">Detection</a></li>
197
          <li><a href="about.html">About us</a></li>
198
          <li><a href="#">Contact</a></li>
199
        </ul>
200
      </nav>
201
    <div class="container">
202
        <div id="content" style="margin-top:12em">{% block content %}{% endblock %}</div>
203
    </div>
204
</body>
205
206
<footer>
207
    <script >
208
        $(document).ready(function () {
209
    // Init
210
    $('.image-section').hide();
211
    $('.loader').hide();
212
    $('#result').hide();
213
214
    // Upload Preview
215
    function readURL(input) {
216
        if (input.files && input.files[0]) {
217
            var reader = new FileReader();
218
            reader.onload = function (e) {
219
                $('#imagePreview').css('background-image', 'url(' + e.target.result + ')');
220
                $('#imagePreview').hide();
221
                $('#imagePreview').fadeIn(650);
222
            }
223
            reader.readAsDataURL(input.files[0]);
224
        }
225
    }
226
    $("#imageUpload").change(function () {
227
        $('.image-section').show();
228
        $('#btn-predict').show();
229
        $('#result').text('');
230
        $('#result').hide();
231
        readURL(this);
232
    });
233
234
    // Predict
235
    $('#btn-predict').click(function () {
236
        var form_data = new FormData($('#upload-file')[0]);
237
238
        // Show loading animation
239
        $(this).hide();
240
        $('.loader').show();
241
242
        // Make prediction by calling api /predict
243
        $.ajax({
244
            type: 'POST',
245
            url: '/predict',
246
            data: form_data,
247
            contentType: false,
248
            cache: false,
249
            processData: false,
250
            async: true,
251
            success: function (data) {
252
                // Get and display the result
253
                $('.loader').hide();
254
                $('#result').fadeIn(600);
255
                $('#result').text(' Result:  ' + data);
256
                console.log('Success!');
257
            },
258
        });
259
    });
260
261
});
262
263
    </script>    
264
</footer>
265
266
</html>