Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-2-capstone-design2
/
2014104149
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Graduate
2020-11-28 18:41:54 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
96ed4b51ce1875fdc7b425e7799a7a9947c690ec
96ed4b51
1 parent
6efb8a5e
Update HTML
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
13 deletions
flask/templates/index.html
flask/templates/index.html
View file @
96ed4b5
...
...
@@ -15,6 +15,27 @@
#canvasOutput
{
background-color
:
#666
;
}
#messagebox
{
height
:
300px
;
overflow-y
:
auto
;
}
.message
{
padding
:
20px
;
font-weight
:
bold
;
color
:
white
;
}
.attend
{
background-color
:
#4CAF50
;
}
.already
{
background-color
:
#2196F3
;
}
.late
{
background-color
:
#ff9800
;
}
.fail
{
background-color
:
#f44336
;
}
</style>
<script
type=
'text/javascript'
src=
"{{url_for('static', filename='js/opencv.js')}}"
></script>
<script
type=
'text/javascript'
src=
"{{url_for('static', filename='js/utils.js')}}"
></script>
...
...
@@ -150,22 +171,22 @@ function main()
data
:
{
'image'
:
b64encoded
},
success
:
function
(
data
){
if
(
data
.
status
==
"attend"
){
var
new
Div
=
document
.
createElement
(
"div"
)
;
var
new
Content
=
document
.
createTextNode
(
'['
+
data
.
student_id
+
'/'
+
data
.
student_name
+
']'
+
"출석"
)
;
newDiv
.
appendChild
(
newContent
)
;
document
.
body
.
appendChild
(
newDiv
);
var
new
Head
=
"<div class='message attend'>"
;
var
new
Tail
=
"</div>"
;
var
newContent
=
'['
+
data
.
student_id
+
'/'
+
data
.
student_name
+
']'
+
"출석되었습니다."
;
$
(
'#messagebox'
).
prepend
(
newDiv
+
newContent
+
newTail
).
stop
().
animate
({
scrollTop
:
$
(
'#messages'
)[
0
].
scrollHeight
},
300
);
}
else
if
(
data
.
status
==
"already"
){
var
new
Div
=
document
.
createElement
(
"div"
)
;
var
new
Content
=
document
.
createTextNode
(
'['
+
data
.
student_id
+
'/'
+
data
.
student_name
+
']'
+
"이미 출석처리 되었습니다."
)
;
newDiv
.
appendChild
(
newContent
)
;
document
.
body
.
appendChild
(
newDiv
);
var
new
Head
=
"<div class='message already'>"
;
var
new
Tail
=
"</div>"
;
var
newContent
=
'['
+
data
.
student_id
+
'/'
+
data
.
student_name
+
']'
+
"이미 출석되었습니다."
;
$
(
'#messagebox'
).
prepend
(
newDiv
+
newContent
+
newTail
).
stop
().
animate
({
scrollTop
:
$
(
'#messages'
)[
0
].
scrollHeight
},
300
);
}
else
{
var
new
Div
=
document
.
createElement
(
"div"
)
;
var
new
Content
=
document
.
createTextNode
(
"실패"
)
;
newDiv
.
appendChild
(
newContent
)
;
document
.
body
.
appendChild
(
newDiv
);
else
if
(
data
.
status
==
"fail"
)
{
var
new
Head
=
"<div class='message fail'>"
;
var
new
Tail
=
"</div>"
;
var
newContent
=
"인식 실패"
;
$
(
'#messagebox'
).
prepend
(
newDiv
+
newContent
+
newTail
).
stop
().
animate
({
scrollTop
:
$
(
'#messages'
)[
0
].
scrollHeight
},
300
);
}
}
});
...
...
@@ -196,5 +217,8 @@ function main()
<video
autoplay=
"true"
id=
"videoInput"
style=
"display: none; object-fit: cover;"
></video>
<canvas
id=
"canvasOutput"
></canvas>
</div>
<div
id=
"messagebox"
>
</div>
</body>
</html>
...
...
Please
register
or
login
to post a comment