added image lightboxes with Parvus

This commit is contained in:
Sam Dalfuss 2024-12-29 22:41:30 +01:00
parent 5991ad2d04
commit ea4a6c5b38
16 changed files with 1780 additions and 19 deletions

View file

@ -1,6 +1,6 @@
body {
background-color: #161618;
color: white;
color: #f2f5f4;
}
a {
@ -11,6 +11,10 @@ a:visited {
color: #5BCEFA;
}
a.lightbox {
margin: 10px;
}
/* Container to hold the images */
.image-container {
display: flex;
@ -26,4 +30,18 @@ a:visited {
max-width: 300px; /* Max width of each image */
height: auto; /* Ensure aspect ratio is maintained */
object-fit: contain; /* Ensure images fit within the container */
}
:root {
--parvus-background-color: #161618;
--parvus-color: #f2f5f4;
--parvus-caption-color: #f2f5f4;
--parvus-btn-background-color: #F5A9B8;
--parvus-btn-color: #ffffff;
--parvus-btn-disabled-background-color: #5BCEFA;
--parvus-btn-disabled-color: #161618;
}
.parvus-trigger:has(img) .parvus-zoom__indicator {
display: none;
}

228
css/parvus.css Normal file
View file

@ -0,0 +1,228 @@
:root {
--parvus-transition-duration: 300ms;
--parvus-transition-timing-function: cubic-bezier(0.62, 0.16, 0.13, 1.01);
--parvus-background-color: hsl(23deg 44% 96%);
--parvus-color: hsl(228deg 24% 23%);
--parvus-btn-background-color: hsl(228deg 24% 23%);
--parvus-btn-color: hsl(0deg 0% 100%);
--parvus-btn-hover-background-color: hsl(229deg 24% 33%);
--parvus-btn-hover-color: hsl(0deg 0% 100%);
--parvus-btn-disabled-background-color: hsla(229deg 24% 33% / 60%);
--parvus-btn-disabled-color: hsl(0deg 0% 100%);
--parvus-caption-background-color: transparent;
--parvus-caption-color: hsl(228deg 24% 23%);
--parvus-loading-error-background-color: hsl(0deg 0% 100%);
--parvus-loading-error-color: hsl(228deg 24% 23%);
--parvus-loader-background-color: hsl(23deg 40% 96%);
--parvus-loader-color: hsl(228deg 24% 23%);
}
body:has(.parvus[aria-hidden=false]) {
touch-action: none;
}
/**
* Parvus trigger
*
*/
.parvus-trigger:has(img) {
display: block;
position: relative;
}
.parvus-trigger:has(img) .parvus-zoom__indicator {
align-items: center;
background-color: var(--parvus-btn-background-color);
color: var(--parvus-btn-color);
display: flex;
justify-content: center;
padding: 0.5rem;
position: absolute;
inset-inline-end: 0.5rem;
inset-block-start: 0.5rem;
}
.parvus-trigger:has(img) img {
display: block;
}
/**
* Parvus
*
*/
.parvus {
box-sizing: border-box;
contain: strict;
inset: 0;
overflow: hidden;
overscroll-behavior: contain;
position: fixed;
z-index: 1337;
}
.parvus *, .parvus *::before, .parvus *::after {
box-sizing: border-box;
}
.parvus[aria-hidden=true] {
display: none;
}
.parvus__overlay {
background-color: var(--parvus-background-color);
color: var(--parvus-color);
inset: 0;
position: absolute;
}
.parvus__slider {
inset: 0;
position: absolute;
}
.parvus__slider[aria-hidden=true] {
display: none;
}
@media screen and (prefers-reduced-motion: no-preference) {
.parvus__slider--animate:not(.parvus__slider--is-dragging) {
transition: transform var(--parvus-transition-duration) var(--parvus-transition-timing-function);
will-change: transform;
}
}
.parvus__slider--is-draggable {
cursor: grab;
}
.parvus__slider--is-dragging {
cursor: grabbing;
}
.parvus__slide {
block-size: 100%;
display: grid;
inline-size: 100%;
padding-block: 3.75rem 1rem;
padding-inline: 1rem;
place-items: center;
}
.parvus__slide img {
block-size: auto;
display: block;
inline-size: auto;
margin-inline: auto;
transform-origin: left top;
}
.parvus__content--error {
background-color: var(--parvus-loading-error-background-color);
color: var(--parvus-loading-error-color);
padding-block: 0.5rem;
padding-inline: 1rem;
}
.parvus__caption {
background-color: var(--parvus-caption-background-color);
color: var(--parvus-caption-color);
padding-block-start: 0.5rem;
text-align: start;
}
.parvus__loader {
display: inline-block;
block-size: 6.25rem;
inset-inline-start: 50%;
position: absolute;
inset-block-start: 50%;
transform: translate(-50%, -50%);
inline-size: 6.25rem;
}
.parvus__loader::before {
animation: spin 1s infinite;
border-radius: 100%;
border: 0.25rem solid var(--parvus-loader-background-color);
border-block-start-color: var(--parvus-loader-color);
content: "";
inset: 0;
position: absolute;
z-index: 1;
}
.parvus__toolbar {
align-items: center;
display: flex;
inset-block-start: 1rem;
inset-inline: 1rem;
justify-content: space-between;
position: absolute;
}
.parvus__controls {
display: flex;
gap: 0.5rem;
}
.parvus__btn {
appearance: none;
background-color: var(--parvus-btn-background-color);
background-image: none;
border-radius: 0;
border: 0.0625rem solid transparent;
color: var(--parvus-btn-color);
cursor: pointer;
display: flex;
font: inherit;
padding: 0.3125rem;
position: relative;
touch-action: manipulation;
will-change: transform, opacity;
z-index: 7;
}
.parvus__btn:hover, .parvus__btn:focus-visible {
background-color: var(--parvus-btn-hover-background-color);
color: var(--parvus-btn-hover-color);
}
.parvus__btn--previous {
inset-inline-start: 0;
position: absolute;
inset-block-start: calc(50svh - 1rem);
transform: translateY(-50%);
}
.parvus__btn--next {
position: absolute;
inset-inline-end: 0;
inset-block-start: calc(50svh - 1rem);
transform: translateY(-50%);
}
.parvus__btn svg {
pointer-events: none;
}
.parvus__btn[aria-hidden=true] {
display: none;
}
.parvus__btn[aria-disabled=true] {
background-color: var(--parvus-btn-disabled-background-color);
color: var(--parvus-btn-disabled-color);
}
.parvus__counter {
position: relative;
z-index: 7;
}
.parvus__counter[aria-hidden=true] {
display: none;
}
@media screen and (prefers-reduced-motion: no-preference) {
.parvus__overlay, .parvus__counter, .parvus__btn--close, .parvus__btn--previous, .parvus__btn--next, .parvus__caption {
transition: transform var(--parvus-transition-duration) var(--parvus-transition-timing-function), opacity var(--parvus-transition-duration) var(--parvus-transition-timing-function);
will-change: transform, opacity;
}
.parvus--is-opening .parvus__overlay, .parvus--is-opening .parvus__counter, .parvus--is-opening .parvus__btn--close, .parvus--is-opening .parvus__btn--previous, .parvus--is-opening .parvus__btn--next, .parvus--is-opening .parvus__caption, .parvus--is-closing .parvus__overlay, .parvus--is-closing .parvus__counter, .parvus--is-closing .parvus__btn--close, .parvus--is-closing .parvus__btn--previous, .parvus--is-closing .parvus__btn--next, .parvus--is-closing .parvus__caption {
opacity: 0;
}
.parvus--is-vertical-closing .parvus__counter, .parvus--is-vertical-closing .parvus__btn--close {
transform: translateY(-100%);
opacity: 0;
}
.parvus--is-vertical-closing .parvus__btn--previous {
transform: translate(-100%, -50%);
opacity: 0;
}
.parvus--is-vertical-closing .parvus__btn--next {
transform: translate(100%, -50%);
opacity: 0;
}
.parvus--is-vertical-closing .parvus__caption {
transform: translateY(100%);
opacity: 0;
}
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}

View file

@ -5,31 +5,58 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>elftwinks.gay!</title>
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
<link rel="stylesheet" href="./css/parvus.css">
<link rel="stylesheet" href="./css/custom.css">
</head>
<body>
<p> You want to display your Elf Twink on elftwinks.gay? Message me on Matrix <a href="https://matrix.to/#/@dalfuss:catgirl.cloud" target="_blank">@dalfuss:catgirl.cloud!</a></p>
<div class="image-container">
<img src="./static/jax_ori.jpg" title="OC Jax by: @dalfuss@corteximplant.com Art by: orifans.com" width="300">
<img src="./static/jax_river.jpg" title="OC Jax by: @dalfuss@corteximplant.com Art by: @river_stubs (Instagram)" width="300">
<img src="./static/jax_yume.png" title="OC Jax by: @dalfuss@corteximplant.com Art by: Yume_ShiroKuro (Twitch)" width="300">
<img src="./static/moon_moon.png" title="OC Lateu by: @flatfuckfan@corteximplant.com Art by: @babyrage.art (Instagram)" width="300">
<img src="./static/endali1.png" title="OC Endali by: @endali@tech.lgbt" width="300">
<img src="./static/endali2.jpeg" title="OC Endali by: @endali@tech.lgbt Art by: artstation.com/cosmicspades" width="300">
<a href="./static/jax_ori.jpg" class="lightbox" data-caption="OC Jax by: @dalfuss@corteximplant.com Art by: orifans.com" data-group="elftwinks">
<img src="./static/jax_ori_thumb.jpg">
</a>
<a href="./static/jax_river.jpg" class="lightbox" data-caption="OC Jax by: @dalfuss@corteximplant.com Art by: @river_stubs (Instagram)" data-group="elftwinks">
<img src="./static/jax_river_thumb.jpg">
</a>
<a href="./static/jax_yume.png" class="lightbox" data-caption="OC Jax by: @dalfuss@corteximplant.com Art by: Yume_ShiroKuro (Twitch)" data-group="elftwinks">
<img src="./static/jax_yume_thumb.png">
</a>
<a href="./static/moon_moon.png" class="lightbox" data-caption="OC Lateu by: @flatfuckfan@corteximplant.com Art by: @babyrage.art (Instagram)" data-group="elftwinks">
<img src="./static/moon_moon_thumb.png">
</a>
<a href="./static/endali1.png" class="lightbox" data-caption="OC Endali by: @endali@tech.lgbt" data-group="elftwinks">
<img src="./static/endali1_thumb.png">
</a>
<a href="./static/endali2.jpeg" class="lightbox" data-caption="OC Endali by: @endali@tech.lgbt Art by: artstation.com/cosmicspades" data-group="elftwinks">
<img src="./static/endali2_thumb.jpeg">
</a>
</div>
<footer>
<p>made by <a href="https://dalfuss.link" target="_blank">Sam Dalfuss</a> with ♥ for elf twinks.</p>
<div style="position:fixed; bottom:0; height:auto; margin-top:40px; width:100%">
<img src="./hc/elftwinks.php"></img>
<a href="https://elftwinks.gay/" rel="nofollow" target="_blank">
<img src="./static/88x31_ElfTwinks.png"></img>
</a>
<a href="https://dalfuss.net/" rel="nofollow" target="_blank">
<img src="./static/88x31_dalfuss.png"></img>
</a>
</div>
</footer>
<script src="./js/parvus.js"></script>
<script>
const prvs = new Parvus()
</script>
</body>
<footer>
<p>made by <a href="https://dalfuss.link" target="_blank">Sam Dalfuss</a> with ♥ for elf twinks.</p>
<div style="position:fixed; bottom:0; height:auto; margin-top:40px; width:100%">
<img src="./hc/elftwinks.php"></img>
<a href="https://elftwinks.gay/" rel="nofollow" target="_blank">
<img src="./static/88x31_ElfTwinks.png"></img>
</a>
<a href="https://dalfuss.net/" rel="nofollow" target="_blank">
<img src="./static/88x31_dalfuss.png"></img>
</a>
</div>
</footer>
</html>
<!---TEST-->

1488
js/parvus.js Normal file

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1,009 KiB

BIN
static/endali1_thumb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 KiB

After

Width:  |  Height:  |  Size: 235 KiB

BIN
static/endali2_thumb.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

After

Width:  |  Height:  |  Size: 222 KiB

BIN
static/jax_ori_thumb.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 192 KiB

BIN
static/jax_river_thumb.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
static/jax_yume_thumb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
static/moon_moon_thumb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 KiB