Update templates/index.html
Browse files- templates/index.html +1 -16
templates/index.html
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
-
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8">
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
@@ -16,7 +15,6 @@
|
|
| 16 |
height: 100vh;
|
| 17 |
margin: 0;
|
| 18 |
}
|
| 19 |
-
|
| 20 |
.container {
|
| 21 |
background: #fff;
|
| 22 |
padding: 20px;
|
|
@@ -26,12 +24,10 @@
|
|
| 26 |
max-width: 700px;
|
| 27 |
width: 100%;
|
| 28 |
}
|
| 29 |
-
|
| 30 |
h1 {
|
| 31 |
color: #333;
|
| 32 |
margin-bottom: 20px;
|
| 33 |
}
|
| 34 |
-
|
| 35 |
video,
|
| 36 |
canvas,
|
| 37 |
img {
|
|
@@ -41,7 +37,6 @@
|
|
| 41 |
height: auto;
|
| 42 |
margin-bottom: 20px;
|
| 43 |
}
|
| 44 |
-
|
| 45 |
button {
|
| 46 |
background-color: #4CAF50;
|
| 47 |
color: white;
|
|
@@ -52,32 +47,26 @@
|
|
| 52 |
font-size: 16px;
|
| 53 |
transition: background-color 0.3s, transform 0.3s;
|
| 54 |
}
|
| 55 |
-
|
| 56 |
button:hover {
|
| 57 |
background-color: #45a049;
|
| 58 |
transform: scale(1.05);
|
| 59 |
}
|
| 60 |
-
|
| 61 |
.result {
|
| 62 |
margin-top: 20px;
|
| 63 |
font-size: 18px;
|
| 64 |
font-weight: bold;
|
| 65 |
}
|
| 66 |
-
|
| 67 |
.good {
|
| 68 |
color: green;
|
| 69 |
}
|
| 70 |
-
|
| 71 |
.normal {
|
| 72 |
color: orange;
|
| 73 |
}
|
| 74 |
-
|
| 75 |
.dangerous {
|
| 76 |
color: red;
|
| 77 |
}
|
| 78 |
</style>
|
| 79 |
</head>
|
| 80 |
-
|
| 81 |
<body>
|
| 82 |
<div class="container">
|
| 83 |
<h1>성분분석표</h1>
|
|
@@ -93,7 +82,6 @@
|
|
| 93 |
const snap = document.getElementById('snap');
|
| 94 |
const context = canvas.getContext('2d');
|
| 95 |
const analysisResult = document.getElementById('analysisResult');
|
| 96 |
-
|
| 97 |
navigator.mediaDevices.getUserMedia({ video: true })
|
| 98 |
.then(stream => {
|
| 99 |
video.srcObject = stream;
|
|
@@ -108,7 +96,6 @@
|
|
| 108 |
const sugarContent = parseInt(match[0], 10);
|
| 109 |
let message = '';
|
| 110 |
let className = '';
|
| 111 |
-
|
| 112 |
if (sugarContent >= 0 && sugarContent <= 20) {
|
| 113 |
message = 'good';
|
| 114 |
className = 'good';
|
|
@@ -119,7 +106,6 @@
|
|
| 119 |
message = 'dangerous';
|
| 120 |
className = 'dangerous';
|
| 121 |
}
|
| 122 |
-
|
| 123 |
analysisResult.textContent = message;
|
| 124 |
analysisResult.className = className;
|
| 125 |
} else {
|
|
@@ -150,5 +136,4 @@
|
|
| 150 |
});
|
| 151 |
</script>
|
| 152 |
</body>
|
| 153 |
-
|
| 154 |
-
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
| 15 |
height: 100vh;
|
| 16 |
margin: 0;
|
| 17 |
}
|
|
|
|
| 18 |
.container {
|
| 19 |
background: #fff;
|
| 20 |
padding: 20px;
|
|
|
|
| 24 |
max-width: 700px;
|
| 25 |
width: 100%;
|
| 26 |
}
|
|
|
|
| 27 |
h1 {
|
| 28 |
color: #333;
|
| 29 |
margin-bottom: 20px;
|
| 30 |
}
|
|
|
|
| 31 |
video,
|
| 32 |
canvas,
|
| 33 |
img {
|
|
|
|
| 37 |
height: auto;
|
| 38 |
margin-bottom: 20px;
|
| 39 |
}
|
|
|
|
| 40 |
button {
|
| 41 |
background-color: #4CAF50;
|
| 42 |
color: white;
|
|
|
|
| 47 |
font-size: 16px;
|
| 48 |
transition: background-color 0.3s, transform 0.3s;
|
| 49 |
}
|
|
|
|
| 50 |
button:hover {
|
| 51 |
background-color: #45a049;
|
| 52 |
transform: scale(1.05);
|
| 53 |
}
|
|
|
|
| 54 |
.result {
|
| 55 |
margin-top: 20px;
|
| 56 |
font-size: 18px;
|
| 57 |
font-weight: bold;
|
| 58 |
}
|
|
|
|
| 59 |
.good {
|
| 60 |
color: green;
|
| 61 |
}
|
|
|
|
| 62 |
.normal {
|
| 63 |
color: orange;
|
| 64 |
}
|
|
|
|
| 65 |
.dangerous {
|
| 66 |
color: red;
|
| 67 |
}
|
| 68 |
</style>
|
| 69 |
</head>
|
|
|
|
| 70 |
<body>
|
| 71 |
<div class="container">
|
| 72 |
<h1>성분분석표</h1>
|
|
|
|
| 82 |
const snap = document.getElementById('snap');
|
| 83 |
const context = canvas.getContext('2d');
|
| 84 |
const analysisResult = document.getElementById('analysisResult');
|
|
|
|
| 85 |
navigator.mediaDevices.getUserMedia({ video: true })
|
| 86 |
.then(stream => {
|
| 87 |
video.srcObject = stream;
|
|
|
|
| 96 |
const sugarContent = parseInt(match[0], 10);
|
| 97 |
let message = '';
|
| 98 |
let className = '';
|
|
|
|
| 99 |
if (sugarContent >= 0 && sugarContent <= 20) {
|
| 100 |
message = 'good';
|
| 101 |
className = 'good';
|
|
|
|
| 106 |
message = 'dangerous';
|
| 107 |
className = 'dangerous';
|
| 108 |
}
|
|
|
|
| 109 |
analysisResult.textContent = message;
|
| 110 |
analysisResult.className = className;
|
| 111 |
} else {
|
|
|
|
| 136 |
});
|
| 137 |
</script>
|
| 138 |
</body>
|
| 139 |
+
</html>
|
|
|