Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
Dishly
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
O Bar da Lora
Dishly
Commits
c8f3d141
Commit
c8f3d141
authored
May 07, 2026
by
Mariana Bongiolo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mudando de lugar o cadastro
parent
78ccb657
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
46 deletions
+46
-46
cadastro.html
templates/cadastro.html
+46
-1
index.html
templates/index.html
+0
-45
No files found.
templates/cadastro.html
View file @
c8f3d141
...
...
@@ -3,9 +3,53 @@
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
D
ocument
</title>
<title>
D
ishly
</title>
</head>
<body>
<h1>
Cadastro com Imagem
</h1>
<form
id=
"formCadastro"
>
<input
type=
"text"
id=
"nome"
placeholder=
"Digite o nome"
required
>
<input
type=
"file"
id=
"imagem"
accept=
"image/*"
required
>
<button
type=
"submit"
>
Cadastrar
</button>
</form>
<div
class=
"cards"
id=
"lista"
></div>
<script>
const
form
=
document
.
getElementById
(
"formCadastro"
);
const
lista
=
document
.
getElementById
(
"lista"
);
form
.
addEventListener
(
"submit"
,
function
(
e
)
{
e
.
preventDefault
();
const
nome
=
document
.
getElementById
(
"nome"
).
value
;
const
arquivo
=
document
.
getElementById
(
"imagem"
).
files
[
0
];
if
(
!
arquivo
)
return
;
const
leitor
=
new
FileReader
();
leitor
.
onload
=
function
(
evento
)
{
const
card
=
document
.
createElement
(
"div"
);
card
.
classList
.
add
(
"card"
);
card
.
innerHTML
=
`
<img src="
${
evento
.
target
.
result
}
">
<h3>
${
nome
}
</h3>
`
;
lista
.
appendChild
(
card
);
form
.
reset
();
};
leitor
.
readAsDataURL
(
arquivo
);
});
</script>
</body>
</html>
\ No newline at end of file
templates/index.html
View file @
c8f3d141
...
...
@@ -6,50 +6,6 @@
<title>
Dishly
</title>
</head>
<body>
<h1>
Cadastro com Imagem
</h1>
<form
id=
"formCadastro"
>
<input
type=
"text"
id=
"nome"
placeholder=
"Digite o nome"
required
>
<input
type=
"file"
id=
"imagem"
accept=
"image/*"
required
>
<button
type=
"submit"
>
Cadastrar
</button>
</form>
<div
class=
"cards"
id=
"lista"
></div>
<script>
const
form
=
document
.
getElementById
(
"formCadastro"
);
const
lista
=
document
.
getElementById
(
"lista"
);
form
.
addEventListener
(
"submit"
,
function
(
e
)
{
e
.
preventDefault
();
const
nome
=
document
.
getElementById
(
"nome"
).
value
;
const
arquivo
=
document
.
getElementById
(
"imagem"
).
files
[
0
];
if
(
!
arquivo
)
return
;
const
leitor
=
new
FileReader
();
leitor
.
onload
=
function
(
evento
)
{
const
card
=
document
.
createElement
(
"div"
);
card
.
classList
.
add
(
"card"
);
card
.
innerHTML
=
`
<img src="
${
evento
.
target
.
result
}
">
<h3>
${
nome
}
</h3>
`
;
lista
.
appendChild
(
card
);
form
.
reset
();
};
leitor
.
readAsDataURL
(
arquivo
);
});
</script>
</body>
</html>
\ No newline at end of file
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