This commit is contained in:
Michał Gdula 2022-06-17 01:13:50 +01:00
parent 1f21779c5f
commit 1955642f41
8 changed files with 33 additions and 1 deletions

View file

@ -63,9 +63,34 @@ main section img {
-ms-overflow-style: none;
scrollbar-width: none;
}
.gallery:hover {
cursor: grab;
}
.gallery::-webkit-scrollbar {
display: none;
}
/*
#gallery::before,#gallery::after {
content: "";
width: 5rem; height: 10rem;
display: block;
position: absolute; bottom: 1rem;
}
#gallery::before {
left: 1rem;
background: linear-gradient(to right, var(--bg) 0%, transparent 100%);
}
#gallery::after {
right: 1rem;
background: linear-gradient(to left, var(--bg) 0%, transparent 100%);
}
*/
.gallery img {
margin: 0 0.5rem;
@ -75,13 +100,14 @@ main section img {
user-select: none;
transition: transform 0.1s ease-out;
transition: transform 0.2s cubic-bezier(.58,.01,.07,1);
}
.gallery img:hover {
margin: -0.25rem 0.25rem;
border: 0.25rem var(--green) solid;
transform: scale(0.9);
}
.gallery img:first-child {
margin-left: 0;
}

BIN
gallery/animal_smile.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

BIN
gallery/photo_land.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

BIN
gallery/photo_nice.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

BIN
gallery/photo_spook.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

BIN
gallery/photo_train.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 MiB

View file

@ -13,12 +13,18 @@ slider.addEventListener("mousedown", (e) => {
isDown = true;
startX = e.pageX - slider.offsetLeft;
scrollLeft = slider.scrollLeft;
document.querySelector(".gallery").style.cursor= "grabbing";
});
slider.addEventListener("mouseleave", () => {
isDown = false;
document.querySelector(".gallery").style.cursor= "grab";
});
slider.addEventListener("mouseup", () => {
isDown = false;
document.querySelector(".gallery").style.cursor= "grab";
});
slider.addEventListener("mousemove", (e) => {
if (!isDown) return;