cambios

parent b934652b
<div id="tomarFotoContainer" style="display:none; background: url('{{asset('manuel/images/selfie-p.jpg')}}') no-repeat center center; background-size:cover;"> <div id="tomarFotoContainer" style="display:none;">
<div id="cameraContainer" class="camera" style="display: block"> <div id="cameraContainer" class="camera" style="display: block">
<img id="imagen_carga_video" src="{{asset('manuel/images/selfie-p.jpg')}}" />
<button id="startbutton"></button>
<video id="video">No se encuentra disponible una camara</video> <video id="video">No se encuentra disponible una camara</video>
</div> </div>
<canvas id="canvas" width="auto" height="auto"> <canvas id="canvas" width="auto" height="auto">
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<div class="app-container"> <div class="app-container">
<img class="img-responsive logo-app" src="{{asset('manuel/images/atrevete-desafio.png')}}" alt="Atrévete al desafío" /> <img class="img-responsive logo-app" src="{{asset('manuel/images/atrevete-desafio.png')}}" alt="Atrévete al desafío" />
<button id="startbutton"></button>
{#CODIGO OCULTO#} {#CODIGO OCULTO#}
{{ include('producto_final/camera_logic.html.twig') }} {{ include('producto_final/camera_logic.html.twig') }}
{#CODIGO OCULTO#} {#CODIGO OCULTO#}
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
</div> </div>
<div> <div>
<button id="subirFoto" name="subirFoto" class="subirFoto" onclick="mostrarSubirFoto(event)">Subir Foto <button id="subirFoto" name="subirFoto" class="subirFoto" onclick="mostrarSubirFoto(event)">Subir Foto
</button> </button>
<label class=" control-label">Sube una foto desde tu galería </br>o desde tu PC</label> <label class=" control-label">Sube una foto desde tu galería </br>o desde tu PC</label>
...@@ -99,8 +98,9 @@ ...@@ -99,8 +98,9 @@
var fileUpload = $("#imgInp"); var fileUpload = $("#imgInp");
function mostrarTomarFoto(event) { function mostrarTomarFoto(event) {
event.preventDefault(); event.preventDefault();
var fotoActual = $("#tomarFotoContainer"); //var fotoActual = $("#tomarFotoContainer");
fotoActual.css("background-image", "url('')"); //fotoActual.css("background-image", "url('')");
$("#imagen_carga_video").attr('src', "");
console.log("mostrando tomar foto..."); console.log("mostrando tomar foto...");
$("#tomarFotoContainer").show(); $("#tomarFotoContainer").show();
$("#cameraContainer").show(); $("#cameraContainer").show();
...@@ -118,6 +118,7 @@ ...@@ -118,6 +118,7 @@
openSeleccionadorArchivos(event); openSeleccionadorArchivos(event);
console.log("mostrando subir foto..."); console.log("mostrando subir foto...");
$("#tomarFotoContainer").hide(); $("#tomarFotoContainer").hide();
$("#imagen_carga_video").attr('src', "");
$("#cameraContainer").hide(); $("#cameraContainer").hide();
$("#startbutton").hide(); $("#startbutton").hide();
//$("#subirFotoContainer").show(); //$("#subirFotoContainer").show();
...@@ -268,15 +269,15 @@ ...@@ -268,15 +269,15 @@
function generateUrlBackground(source, type) { function generateUrlBackground(source, type) {
if (type == "url") { if (type == "url") {
var fotoActual = $("#tomarFotoContainer"); var fotoActual = $("#imagen_carga_video");
var img = new Image(); var img = new Image();
img.src = source; img.src = source;
fotoActual.css("background-image", "url('" + img.src + "')"); fotoActual.attr("src", img.src);
} else { } else {
var fotoActual = $("#tomarFotoContainer"); var fotoActual = $("#imagen_carga_video");
var img = new Image(); var img = new Image();
img.src = source; img.src = source;
fotoActual.css("background-image", "url('" + img.src.replace(/(\r\n|\n|\r)/gm, "") + "')"); fotoActual.css("src", img.src.replace(/(\r\n|\n|\r)/gm, ""));
} }
......
...@@ -85,8 +85,8 @@ ...@@ -85,8 +85,8 @@
var data = canvas.toDataURL('image/png'); var data = canvas.toDataURL('image/png');
photo.setAttribute('src', data); photo.setAttribute('src', data);
var fotoActual = $("#tomarFotoContainer"); //var fotoActual = $("#tomarFotoContainer");
fotoActual.css("background-image", "url('')"); //fotoActual.css("background-image", "url('')");
} }
...@@ -100,10 +100,14 @@ ...@@ -100,10 +100,14 @@
var data = canvas.toDataURL('image/png'); var data = canvas.toDataURL('image/png');
console.log(data); console.log(data);
photo.setAttribute('src', data); photo.setAttribute('src', data);
var fotoActual = $("#tomarFotoContainer"); //var fotoActual = $("#tomarFotoContainer");
//var img = new Image();
//img.src = data;
//fotoActual.css("background-image", "url('" + img.src.replace(/(\r\n|\n|\r)/gm, "") + "')");
var fotoActual = $("#imagen_carga_video");
var img = new Image(); var img = new Image();
img.src = data; img.src = data;
fotoActual.css("background-image", "url('" + img.src.replace(/(\r\n|\n|\r)/gm, "") + "')"); fotoActual.attr("src", img.src.replace(/(\r\n|\n|\r)/gm, "") );
} else { } else {
clearphoto(); clearphoto();
} }
......
...@@ -30,7 +30,7 @@ and open the template in the editor. ...@@ -30,7 +30,7 @@ and open the template in the editor.
/* width: 100%; */ /* width: 100%; */
/* display: inline-block; */ /* display: inline-block; */
margin: 0 auto 2em auto; margin: 0 auto 2em auto;
display:flex; display:flex !important;
justify-content: center; justify-content: center;
position:relative; position:relative;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment