final updates
All checks were successful
ClarkeIS Build / Build-Docker-Image (push) Successful in 24s
All checks were successful
ClarkeIS Build / Build-Docker-Image (push) Successful in 24s
This commit is contained in:
@@ -15,16 +15,26 @@ let video = document.getElementById("magic_video");
|
|||||||
|
|
||||||
function takepicture() {
|
function takepicture() {
|
||||||
let box = video.getBoundingClientRect();
|
let box = video.getBoundingClientRect();
|
||||||
canvas.width = box.width;
|
|
||||||
canvas.height = box.height;
|
|
||||||
video.classList.add("unbounded");
|
video.classList.add("unbounded");
|
||||||
document.getElementById("endcamera").style.display = "";
|
document.getElementById("endcamera").style.display = "";
|
||||||
ctx.canvas.classList.remove("offscreen");
|
ctx.canvas.classList.remove("offscreen");
|
||||||
document.getElementById("camview").classList.add("took")
|
document.getElementById("camview").classList.add("took")
|
||||||
requestAnimationFrame(() => {
|
// si c'est portrait, nous doivons le tourner à landscape (parce que le canvas ont besoin d'un photo landscape pour marcher bien)
|
||||||
|
if (box.height > box.width) {
|
||||||
|
canvas.width = box.height;
|
||||||
|
canvas.height = box.width;
|
||||||
|
ctx.translate(box.width/2, box.height/2);
|
||||||
|
ctx.rotate(Math.PI / 2);
|
||||||
|
ctx.drawImage(video, -box.width/2, -box.height/2, box.width, box.height);
|
||||||
|
ctx.rotate(-Math.PI / 2);
|
||||||
|
ctx.translate(-box.width/2, -box.height/2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
canvas.width = box.width;
|
||||||
|
canvas.height = box.height;
|
||||||
ctx.drawImage(video, 0, 0, box.width, box.height);
|
ctx.drawImage(video, 0, 0, box.width, box.height);
|
||||||
video.classList.remove("unbounded");
|
}
|
||||||
})
|
video.classList.remove("unbounded");
|
||||||
}
|
}
|
||||||
|
|
||||||
function setdetails() {
|
function setdetails() {
|
||||||
@@ -85,9 +95,9 @@ window.app = {
|
|||||||
ctx.fillText(new Date().toLocaleString(), 0, 76);
|
ctx.fillText(new Date().toLocaleString(), 0, 76);
|
||||||
let lat = document.getElementById("lat").value;
|
let lat = document.getElementById("lat").value;
|
||||||
let long = document.getElementById("long").value;
|
let long = document.getElementById("long").value;
|
||||||
/*reverse_geocode(lat, long).then(res => {
|
reverse_geocode(lat, long).then(res => {
|
||||||
ctx.fillText(res, 0, 104);
|
ctx.fillText(res, 0, 104);
|
||||||
});*/
|
});
|
||||||
ctx.fillText("https://maps.google.com/maps?q=" + lat + "," + long, 0, 128);
|
ctx.fillText("https://maps.google.com/maps?q=" + lat + "," + long, 0, 128);
|
||||||
ctx.fillText("Notes: " + document.getElementById("notes").value, 0, 154);
|
ctx.fillText("Notes: " + document.getElementById("notes").value, 0, 154);
|
||||||
let image = document.getElementById("precanvas");
|
let image = document.getElementById("precanvas");
|
||||||
@@ -117,6 +127,7 @@ function maps_static(lat, long, cbk) {
|
|||||||
document.body.appendChild(img);
|
document.body.appendChild(img);
|
||||||
img.classList.add("offscreen");
|
img.classList.add("offscreen");
|
||||||
img.src = "https://maps.googleapis.com/maps/api/staticmap?size=355x300&key=AIzaSyD_zbdxwN7_aOMNH69eAL9bSS814Ix-UM8&markers=label:S%7C" + lat + "," + long;
|
img.src = "https://maps.googleapis.com/maps/api/staticmap?size=355x300&key=AIzaSyD_zbdxwN7_aOMNH69eAL9bSS814Ix-UM8&markers=label:S%7C" + lat + "," + long;
|
||||||
|
img.crossOrigin = "anonymous";
|
||||||
img.onload = () => {
|
img.onload = () => {
|
||||||
cbk(img);
|
cbk(img);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,12 @@
|
|||||||
{
|
{
|
||||||
"src": "icon.png",
|
"src": "icon.png",
|
||||||
"type": "image/png",
|
"type": "image/png",
|
||||||
"sizes": "64x64"
|
"sizes": "512x512"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icon.png",
|
||||||
|
"type": "image/png",
|
||||||
|
"sizes": "192x192"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"display": "standalone"
|
"display": "standalone"
|
||||||
|
|||||||
Reference in New Issue
Block a user