0% found this document useful (0 votes)
12 views3 pages

Profile and Place Management Script

The document is a JavaScript code that manages a user interface for a profile and a list of places. It includes functionalities for opening and closing forms, submitting profile information, adding new places, and displaying a popup with images. The code also handles events such as clicks and keyboard inputs to enhance user interaction with the interface.

Uploaded by

Nathaly
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views3 pages

Profile and Place Management Script

The document is a JavaScript code that manages a user interface for a profile and a list of places. It includes functionalities for opening and closing forms, submitting profile information, adding new places, and displaying a popup with images. The code also handles events such as clicks and keyboard inputs to enhance user interaction with the interface.

Uploaded by

Nathaly
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

INDEX.

JS

const open = [Link]("open");


const forms = [Link]("forms");
const profileInfo = [Link]("profile-info");
const formProfile = [Link]("form_profile");
const closeButton = [Link](".form__button");
const nameInput = [Link]("#nombre");
const jobInput = [Link]("#ocupacion");
const nameNode = [Link](".profile__jacques");
const jobNode = [Link](".profile__explorador");
const links = [Link]("links");
const closeLink = [Link](".form__button");
const edit = [Link]("edit");
const placesArea = [Link](".elements");
const popup = [Link](".popup");
const formPlace = [Link]("#form_place");
const titlePlace = [Link]("#title_place");
const linkPlace = [Link]("#link_place");
const datos = [
{
titulo: "Valle de Yosemite",
image: (src = "./images/[Link]"),
},
{
titulo: "Montañas Calvas",
image: (src = "./images/[Link]"),
},
{
titulo: "Lago Louis",
image: (src = "./images/[Link]"),
},
{
titulo: "Central Park",
image: (src = "./images/[Link]"),
},
{
titulo: "Gran Cañon",
image: (src = "./images/el-grancañ[Link]"),
},
{
titulo: "Islas Galapagos",
image: (src = "./images/[Link]"),
},
];

[Link](function (elemento) {
const nuevoLugar = crearPlace(elemento);
[Link](nuevoLugar);
});

[Link]("click", () => {
[Link]("show");
});

[Link]("click", () => {
[Link]("show");
});
[Link]("click", () => {
[Link]("show");
});

[Link]("click", () => {
[Link]("show");
});

[Link]("submit", (event) => {


[Link]();

[Link] = [Link];
[Link] = [Link];
[Link]("show");
});

[Link]("submit", (event) => {


[Link]();

const nuevoLugar = crearPlace({


titulo: [Link],
image: [Link],
});

[Link]("show");
[Link](nuevoLugar);
});

/*clonar template*/
function crearPlace({ titulo, image }) {
const template = [Link](".template-place");
const copyTemplateContent = [Link](".element");
const nuevoPlace = [Link](true);

[Link](".element__image").src = image;
[Link](".element__text").textContent = titulo;

nuevoPlace
.querySelector(".element__button--vector")
.addEventListener("click", function () {
[Link]();
});

nuevoPlace
.querySelector(".element__image")
.addEventListener("click", function (event) {
[Link]("popup_show");
[Link](".popup__image").src = [Link];
});

nuevoPlace
.querySelector(".element__button-trs")
.addEventListener("click", function (evt) {
[Link]("element__trash_active");
});

return nuevoPlace;
}
[Link](".popup__button").addEventListener("click", function () {
[Link]("popup_show");
});

[Link]("keydown", function (evt) {


if ([Link] === "Escape") {
[Link]("show");
[Link]("popup_show");
[Link]("show");
}
});

[Link]("click", function (evt) {


if (
[Link]("show") ||
[Link]("popup_show")
) {
[Link]("show");
[Link]("popup_show");
[Link]("show");
}
});

You might also like