Compare commits
No commits in common. 'main' and 'feature/geolocalize' have entirely different histories.
main
...
feature/ge
@ -1,24 +0,0 @@
|
|||||||
.no-style {
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
padding: 0;
|
|
||||||
font: inherit;
|
|
||||||
color: inherit;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.no-style:focus {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.grid-4 {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 992px) {
|
|
||||||
.grid-4 {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
document.addEventListener('DOMContentLoaded', function() {
|
|
||||||
document.querySelectorAll('.like-toggle').forEach(button => {
|
|
||||||
button.addEventListener('click', function (event) {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
let isLiked = this.classList.contains('liked');
|
|
||||||
let url = isLiked ? this.dataset.unlikeUrl : this.dataset.likeUrl;
|
|
||||||
|
|
||||||
fetch(url, { method: 'POST' })
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.success) {
|
|
||||||
let likesCountElement = this.parentElement.querySelector('.likes-count');
|
|
||||||
likesCountElement.textContent = data.likesCount;
|
|
||||||
this.classList.toggle('liked');
|
|
||||||
this.classList.toggle('not-liked');
|
|
||||||
this.innerHTML = isLiked ? '♡' : '❤️';
|
|
||||||
} else {
|
|
||||||
console.error('Erreur lors du traitement du like/unlike.');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.error('Erreur lors de la requête fetch:', error);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
Reference in new issue