-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
26 lines (24 loc) · 937 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// "use strict";
// const form = document.querySelector("form");
// const handleSubmit = (e) => {
// e.preventDefault();
// let myForm = e.target;
// let formData = new FormData(myForm);
// fetch("/", {
// method: "POST",
// headers: { "Content-Type": "application/x-www-form-urlencoded" },
// body: new URLSearchParams(formData).toString(),
// })
// .then(() => console.log("Form successfully submitted"))
// .catch((error) => alert(error));
// };
// form.addEventListener("submit", handleSubmit);
// This helps with redraws on the gallery
const cakeimgs = document.querySelectorAll("img.cakeimg");
const cakeimgcss = window.getComputedStyle(cakeimgs[0]);
const cakeimgwidth = cakeimgcss.getPropertyValue("width");
const cakeimgheight = cakeimgcss.getPropertyValue("height");
cakeimgs.forEach((element) => {
element.style.width = `${cakeimgwidth}px`;
element.style.height = `${cakeimgheight}px`;
});