File size: 4,845 Bytes
8a6b560 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Upload and Predict</title>
<style>
body {
font-family: 'Arial', "Times New Roman";
background-color: #88AB8E;
text-align: center;
margin: 50px;
background-image: url('https://img.freepik.com/premium-vector/circuit-board-motherboard-blue-technology-background_322958-38.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100% 100%;
}Yes B
.topnav {
overflow: hidden;
background-color: #333;
margin-top: -40px;
}
.camera {
overflow: hidden;
}
.topnav a {
float: left;
color: #f2f2f2;
text-align: center;
padding: 12px 10px;
text-decoration: none;
font-size: 25px;
}
.topnav a:hover {
background-color: #ddd;
color: black;
}
.topnav a.active {
background-color: #333;
color: white;
}
h1 {
color: white;
font-size: 90px;
}
h2 {
color: yellow;
font-size: 30px;
}
h3{
color: white;
font-size: 30px;
}
form {
max-width: 400px;
margin: 0 auto;
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
label {
display: block;
margin-bottom: 10px;
font-weight: bold;
color: #333;
}
input[type="file"] {
display: none;
}
.custom-file-upload {
cursor: pointer;
background-color: #4caf50;
color: #fff;
border: none;
padding: 10px 20px;
font-size: 16px;
border-radius: 4px;
transition: background-color 0.3s;
}
.custom-file-upload:hover {
background-color: #45a049;
}
button[type="submit"] {
background-color: #3498db;
color: #fff;
border: none;
padding: 10px 20px;
font-size: 16px;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}
button[type="submit"]:hover {
background-color: #2980b9;
}
#image-preview {
max-width: 100%;
height: auto;
margin-top: 20px;
display: none;
}
#image-name {
font-size: 14px;
color: #555;
margin-top: 10px;
display: none;
}
</style>
</head>
<body>
<div class="topnav">
<a class="navbar-brand" href="http://127.0.0.1:8000/predict/">
<img alt="Attendify" src="https://t4.ftcdn.net/jpg/02/29/42/89/240_F_229428944_GrooUMPzQskyvYcYhFcY9SYrhslHnBdt.jpg" width="30" height="30">
</a>
<a class="active"><i>Attendify</i></a>
<a class="active"> | Welcome to DS Attendance System</a>
</div>
<h1><i>Attendify</i></h1>
<h2>Mark Attendance</h2>
<form method="post" enctype="multipart/form-data">
<fieldset>
{% csrf_token %}
<label for="id_image" class="custom-file-upload">
<div class="camera">
<a class="navbar-brand">
<img alt="Attendify" src="https://cdn-icons-png.flaticon.com/128/11312/11312727.png" width="30" height="30">
</a>
</div>
Select Image
</label>
<input type="file" id="id_image" name="image" onchange="previewImage(this)">
<img id="image-preview" alt="Selected Image">
<div id="image-name"></div>
<br>
<br>
<br>
</fieldset>
<br>
<button type="submit">Save</button>
</form>
<script>
function previewImage(input) {
var preview = document.getElementById('image-preview');
var imageName = document.getElementById('image-name');
var file = input.files[0];
var reader = new FileReader();
reader.onload = function (e) {
preview.src = e.target.result;
preview.style.display = 'block';
imageName.innerText = 'Selected Image: ' + file.name;
imageName.style.display = 'block';
};
if (file) {
reader.readAsDataURL(file);
} else {
preview.src = '';
preview.style.display = 'none';
imageName.innerText = '';
imageName.style.display = 'none';
}
}
</script>
</body>
</html>
|