28 lines
802 B
JavaScript
28 lines
802 B
JavaScript
function dodajSnieg() {
|
|
const dziecko = document.querySelector("main");
|
|
const snieg = document.createElement("img");
|
|
snieg.id = "snieg";
|
|
snieg.src = "/assets/images/snieg.png";
|
|
dziecko.insertBefore(snieg, dziecko.firstChild);
|
|
|
|
// const sniezyca = document.createElement("canvas");
|
|
// sniezyca.id = "sniezyca";
|
|
// document.body.insertBefore(sniezyca, document.body.firstChild);
|
|
|
|
// const ctx2D = sniezyca.getContext("2d");
|
|
// sniezyca.imageSmoothingEnabled = false;
|
|
|
|
// var i = 0;
|
|
// function renderowanie() {
|
|
// ctx2D.
|
|
// i++;
|
|
// }
|
|
}
|
|
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
const miesiac = new Date().getMonth();
|
|
console.log(miesiac);
|
|
if (miesiac < 2 || miesiac == 11) {
|
|
dodajSnieg();
|
|
}
|
|
}); |