Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
2100031988 committed Oct 13, 2024
1 parent 6b984ef commit c52a1fb
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions FaceRec/static/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@ $(document).ready(function () {
const Name = $("#Name").val();
const gender = $("#Gender").val();
const Department = $("#Department").val();

let image = document.getElementById('Image');
rotateImage(image, 10);

$.ajax({
type: "POST",
url: "/capture",
data: {"EmployeeCode":EmployeeCode,"Name": Name ,"gender":gender,"Department":Department}, // Send Title value in the request
data: {
"EmployeeCode": EmployeeCode,
"Name": Name,
"gender": gender,
"Department": Department
},
success: function (response) {
console.log(response)
console.log(response);
updateImage();
enableImage();
},
Expand All @@ -20,13 +29,17 @@ $(document).ready(function () {
});
});

function rotateImage(imageElement, degree) {
imageElement.style.transform = `rotate(${degree}deg)`;
}

$(document).ready(function () {
$("#captureButton1").on("click", function () {
$.ajax({
type: "POST",
url: "/capturing",
success: function (response) {
console.log(response)
console.log(response);
updateImage();
enableImage();
},
Expand All @@ -37,26 +50,23 @@ $(document).ready(function () {
});
});






function updateImage(){
function updateImage() {
var img = document.getElementById('Image');
img.src = 'static/Images/uploads/final.png';
alert(img.src)
alert(img.src);
}

function enableImage(){
function enableImage() {
var imgElement = document.getElementById('Image');
imgElement.removeAttribute('hidden');
var uploadElement = document.getElementById('Upload');
uploadElement.removeAttribute('hidden');
}

myButton.addEventListener("click", function () {
myPopup.classList.add("show");
});

closePopup.addEventListener("click", function () {
myPopup.classList.remove("show");
});
Expand Down

0 comments on commit c52a1fb

Please sign in to comment.