Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nutrapharm_producto
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cristian Mauricio Diaz Canales
nutrapharm_producto
Commits
3251160c
Commit
3251160c
authored
Sep 10, 2020
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cambios
parent
b934652b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
14 deletions
+21
-14
app/Resources/views/producto_final/camera_logic.html.twig
app/Resources/views/producto_final/camera_logic.html.twig
+3
-1
app/Resources/views/producto_final/landing_producto.html.twig
...Resources/views/producto_final/landing_producto.html.twig
+9
-8
web/frontend/js/capture-2.js
web/frontend/js/capture-2.js
+8
-4
web/manuel/css/camera.css
web/manuel/css/camera.css
+1
-1
No files found.
app/Resources/views/producto_final/camera_logic.html.twig
View file @
3251160c
<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"
>
<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>
</div>
<canvas
id=
"canvas"
width=
"auto"
height=
"auto"
>
...
...
app/Resources/views/producto_final/landing_producto.html.twig
View file @
3251160c
...
...
@@ -31,7 +31,7 @@
<div
class=
"app-container"
>
<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#}
{{
include
(
'producto_final/camera_logic.html.twig'
)
}}
{#CODIGO OCULTO#}
...
...
@@ -44,7 +44,6 @@
</div>
<div>
<button
id=
"subirFoto"
name=
"subirFoto"
class=
"subirFoto"
onclick=
"mostrarSubirFoto(event)"
>
Subir Foto
</button>
<label
class=
" control-label"
>
Sube una foto desde tu galería
</br>
o desde tu PC
</label>
...
...
@@ -99,8 +98,9 @@
var
fileUpload
=
$
(
"
#imgInp
"
);
function
mostrarTomarFoto
(
event
)
{
event
.
preventDefault
();
var
fotoActual
=
$
(
"
#tomarFotoContainer
"
);
fotoActual
.
css
(
"
background-image
"
,
"
url('')
"
);
//var fotoActual = $("#tomarFotoContainer");
//fotoActual.css("background-image", "url('')");
$
(
"
#imagen_carga_video
"
).
attr
(
'
src
'
,
""
);
console
.
log
(
"
mostrando tomar foto...
"
);
$
(
"
#tomarFotoContainer
"
).
show
();
$
(
"
#cameraContainer
"
).
show
();
...
...
@@ -118,6 +118,7 @@
openSeleccionadorArchivos
(
event
);
console
.
log
(
"
mostrando subir foto...
"
);
$
(
"
#tomarFotoContainer
"
).
hide
();
$
(
"
#imagen_carga_video
"
).
attr
(
'
src
'
,
""
);
$
(
"
#cameraContainer
"
).
hide
();
$
(
"
#startbutton
"
).
hide
();
//$("#subirFotoContainer").show();
...
...
@@ -268,15 +269,15 @@
function
generateUrlBackground
(
source
,
type
)
{
if
(
type
==
"
url
"
)
{
var
fotoActual
=
$
(
"
#
tomarFotoContainer
"
);
var
fotoActual
=
$
(
"
#
imagen_carga_video
"
);
var
img
=
new
Image
();
img
.
src
=
source
;
fotoActual
.
css
(
"
background-image
"
,
"
url('
"
+
img
.
src
+
"
')
"
);
fotoActual
.
attr
(
"
src
"
,
img
.
src
);
}
else
{
var
fotoActual
=
$
(
"
#
tomarFotoContainer
"
);
var
fotoActual
=
$
(
"
#
imagen_carga_video
"
);
var
img
=
new
Image
();
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
,
""
)
);
}
...
...
web/frontend/js/capture-2.js
View file @
3251160c
...
...
@@ -85,8 +85,8 @@
var
data
=
canvas
.
toDataURL
(
'
image/png
'
);
photo
.
setAttribute
(
'
src
'
,
data
);
var
fotoActual
=
$
(
"
#tomarFotoContainer
"
);
fotoActual
.
css
(
"
background-image
"
,
"
url('')
"
);
//
var fotoActual = $("#tomarFotoContainer");
//
fotoActual.css("background-image", "url('')");
}
...
...
@@ -100,10 +100,14 @@
var
data
=
canvas
.
toDataURL
(
'
image/png
'
);
console
.
log
(
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
();
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
{
clearphoto
();
}
...
...
web/manuel/css/camera.css
View file @
3251160c
...
...
@@ -30,7 +30,7 @@ and open the template in the editor.
/* width: 100%; */
/* display: inline-block; */
margin
:
0
auto
2em
auto
;
display
:
flex
;
display
:
flex
!important
;
justify-content
:
center
;
position
:
relative
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment