Favorite images were cut from the program and fix errors

This commit is contained in:
Данил 2023-05-13 09:07:44 +03:00
parent 92f3204572
commit 9949e5a87b
No known key found for this signature in database
GPG key ID: 5051BCD5AB064A7B

View file

@ -68,13 +68,7 @@ function wallpaperLoad(data) {
const title = document.querySelector(".w-modal-title"); const title = document.querySelector(".w-modal-title");
const button = document.querySelector(".modal-footer"); const button = document.querySelector(".modal-footer");
button.innerHTML = `<lottie-player id="favorite" button.innerHTML = `<button type="button" class="btn btn-primary" id="setWallpaper">Download</button>`;
src="/static/assets/lottie/lf30_rcvcAS.json"
background="transparent"
speed="1">
</lottie-player>
<button type="button" class="btn btn-primary" id="setWallpaper">Download</button>
`;
const wallpaper_img = $(`img#${id}.card-img-top`); const wallpaper_img = $(`img#${id}.card-img-top`);
if (wallpaper_img && wallpaper_img.src === "http://localhost:4000/static/assets/placeholder.png") { if (wallpaper_img && wallpaper_img.src === "http://localhost:4000/static/assets/placeholder.png") {
@ -86,7 +80,6 @@ function wallpaperLoad(data) {
} }
const setWallpaper = document.querySelector("#setWallpaper"); const setWallpaper = document.querySelector("#setWallpaper");
const favorite = document.querySelector("#favorite");
title.innerHTML = `<h5 class="modal-title">${ids[card_id]['title']}</h5>`; title.innerHTML = `<h5 class="modal-title">${ids[card_id]['title']}</h5>`;
@ -123,7 +116,6 @@ function wallpaperLoad(data) {
if (ids[card_id]['copyright'] !== undefined) { if (ids[card_id]['copyright'] !== undefined) {
return modale_window.innerHTML += `<p>© ${ids[card_id]['copyright']}</p>`; return modale_window.innerHTML += `<p>© ${ids[card_id]['copyright']}</p>`;
} }
});
$(window).scroll(function () { $(window).scroll(function () {
if (($(window).scrollTop() > $(document).height() - $(window).height() - 100)) { if (($(window).scrollTop() > $(document).height() - $(window).height() - 100)) {
@ -149,6 +141,7 @@ function wallpaperLoad(data) {
}); });
} }
}); });
});
} }
function updateWallpaper(url) { function updateWallpaper(url) {
@ -163,7 +156,7 @@ function updateWallpaper(url) {
} }
function notify(message) { function notify(message) {
if (!("Notification" in window)) return; if (!("Notification" in window)) return null;
else if (Notification.permission === "granted") { else if (Notification.permission === "granted") {
new Notification(message); new Notification(message);
@ -174,6 +167,6 @@ function notify(message) {
if (permission === "granted") { if (permission === "granted") {
new Notification(message); new Notification(message);
} }
}); }).then(r => console.log(r));
} }
} }