1
Fork 0

all bugs fixed, tests should also build now

This commit is contained in:
printfuck 2024-06-23 22:55:04 +02:00
parent 96ef977b06
commit 5afc48ade4
3 changed files with 23 additions and 23 deletions

View File

@ -71,9 +71,10 @@ export function mediaGalleryReducer(
} }
case 'nextSlidePhoto': case 'nextSlidePhoto':
if (state.videoMedia.length != state.media.length){ if (state.videoMedia.length != state.media.length){
let a = (state.activeIndex + 1) % state.media.length; let a: number = (state.activeIndex + 1) % state.media.length;
while (state.media[a].type !== MediaType.Photo) while (state.media[a].type !== MediaType.Photo) {
a = (a + 1) % state.media.length; a = (a + 1) % state.media.length;
}
return { return {
...state, ...state,
activeIndex: a, activeIndex: a,
@ -85,9 +86,10 @@ export function mediaGalleryReducer(
} }
case 'nextSlideVideo': case 'nextSlideVideo':
if (state.videoMedia.length > 0) { if (state.videoMedia.length > 0) {
let b = (state.activeIndex + 1) % state.media.length; let b: number = (state.activeIndex + 1) % state.media.length;
while (state.media[b].type !== MediaType.Video) while (state.media[b].type !== MediaType.Video) {
b = (b + 1) % state.media.length; b = (b + 1) % state.media.length;
}
return { return {
...state, ...state,
activeIndex: b, activeIndex: b,

View File

@ -48,12 +48,14 @@ const OverlayIconContainer = styled.button`
&:hover h1 { &:hover h1 {
visibility: unset; visibility: unset;
opacity: 100%;
filter: drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.6)); filter: drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.6));
} }
&.hide h1 { &.hide h1 {
visibility: hidden; visibility: hidden;
transition: stroke 300ms; transition: stroke 300ms;
transition: fill 300ms;
} }
` `
@ -84,12 +86,14 @@ const OverlayButton = styled.button`
&:hover svg path { &:hover svg path {
stroke: rgba(255, 255, 255, 1); stroke: rgba(255, 255, 255, 1);
fill-opacity: .8;
filter: drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.6)); filter: drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.6));
} }
&.hide svg path { &.hide svg path {
stroke: rgba(255, 255, 255, 0); stroke: rgba(255, 255, 255, 0);
transition: stroke 300ms; transition: stroke 300ms;
fill-opacity: 0;
} }
` `
@ -192,6 +196,7 @@ const PresentNavigationOverlay = ({
useEffect(() => { useEffect(() => {
const interval = setInterval(() => { const interval = setInterval(() => {
if (slide && activeMedia.type === MediaType.Photo) { if (slide && activeMedia.type === MediaType.Photo) {
//dispatchMedia({ type: 'nextImage'})
nextSlide() nextSlide()
} }
}, slideInterval*1000) }, slideInterval*1000)
@ -218,9 +223,8 @@ const PresentNavigationOverlay = ({
// Continue after Video played // Continue after Video played
const playEnd = () => { const playEnd = () => {
console.log("triggered with slideMode: " + slideMode + " smrefnya_: " + smref.current);
if (slide && smref.current < 3) { if (slide && smref.current < 3) {
setAux( (a) => !a ); setAux( (a) => !a );// single repeat might destroy basic repeat
nextSlide(); nextSlide();
} else if (smref.current == 3 && activeMedia.type === MediaType.Video) { } else if (smref.current == 3 && activeMedia.type === MediaType.Video) {
videoRef.current.play(); videoRef.current.play();
@ -235,19 +239,19 @@ const PresentNavigationOverlay = ({
} }
const nextSlide = () => { const nextSlide = () => {
switch (slideMode) { switch (smref.current) {
case 0: case 0:
dispatchMedia({ type: 'nextSlidePhoto'}) dispatchMedia({ type: 'nextSlidePhoto'})
return; break;
case 1: case 1:
dispatchMedia({ type: 'nextSlideVideo'}) dispatchMedia({ type: 'nextSlideVideo'})
return; break;
case 2: case 2:
dispatchMedia({ type: 'nextImage'}) dispatchMedia({ type: 'nextImage'})
return; break;
case 3: case 3:
setAux( (a) => !a ); setAux( (a) => !a );
return; break;
} }
} }
@ -258,13 +262,6 @@ const PresentNavigationOverlay = ({
}); });
} }
useEffect(() => {
if (activeMedia.type === MediaType.Video) {
videoRef.current.removeEventListener('ended', playEnd);
videoRef.current.addEventListener('ended', playEnd);
}
}, [slideMode])
const handlers = useSwipeable({ const handlers = useSwipeable({
onSwipedLeft: () => dispatchMedia({ type: 'nextImage' }), onSwipedLeft: () => dispatchMedia({ type: 'nextImage' }),
onSwipedRight: () => dispatchMedia({ type: 'previousImage' }), onSwipedRight: () => dispatchMedia({ type: 'previousImage' }),

View File

@ -3,7 +3,7 @@ import * as React from 'react'
function SvgRepeat(props: React.SVGProps<SVGSVGElement>) { function SvgRepeat(props: React.SVGProps<SVGSVGElement>) {
return ( return (
<svg <svg
viewBox="25 25 36 36" viewBox="16 0 36 36"
fillRule="evenodd" fillRule="evenodd"
clipRule="evenodd" clipRule="evenodd"
strokeLinecap="round" strokeLinecap="round"
@ -11,13 +11,14 @@ function SvgRepeat(props: React.SVGProps<SVGSVGElement>) {
strokeMiterlimit={1.5} strokeMiterlimit={1.5}
width="1em" width="1em"
height="1em" height="1em"
transform="scale(.4)" transform="scale(1.1)"
fill-opacity=".4"
{...props} {...props}
> >
<g> <g fill="#ffffff">
<path <path
d="m -10.5,10.5 v 69.2 h 95 v -69.2 z m 43.2,4.2 h 8.7 v 7.1 h -8.7 z m -13,0 h 8.7 v 7.1 h -8.7 z m -17.2,60.8 h -8.7 v -7.1 h 8.7 z m 0,-53.6 h -8.7 v -7.1 h 8.7 z m 13,53.6 h -8.7 v -7.1 h 8.7 z m 0,-53.6 h -8.7 v -7.1 h 8.7 z m 13,53.6 h -8.7 v -7.1 h 8.7 z m -2,-18 v -24.8 c 0,-2.1 2.3,-3.4 4.1,-2.3 l 19.8,12.4 c 1.7,1.1 1.7,3.5 0,4.6 l -19.8,12.4 c -1.8,1.1 -4.1,-0.2 -4.1,-2.3 z m 15,18 h -8.7 v -7.1 h 8.7 z m 13,0 h -8.7 v -7.1 h 8.7 z m 0,-53.6 h -8.7 v -7.1 h 8.7 z m 12.9,53.6 h -8.7 v -7.1 h 8.7 z m 0,-53.6 h -8.7 v -7.1 h 8.7 z m 12.8,53.6 h -8.7 v -7.1 h 8.7 z m 0,-53.6 h -8.7 v -7.1 h 8.7 z" d="M 16,19.197085 A 12.010896,12.010896 0 0 1 27.997356,7.1997413 h 18.110395 l -1.723549,-1.723503 a 1.3330772,1.3330772 0 1 1 1.885344,-1.885167 l 3.999095,3.99912 c 0.0047,0.0045 0.007,0.0081 0.01113,0.0124 0.0268,0.02738 0.05244,0.0553 0.07673,0.08487 0.01449,0.01708 0.02668,0.03504 0.04006,0.05259 0.01284,0.01724 0.02675,0.03401 0.03886,0.05201 0.01369,0.02048 0.02602,0.04157 0.0386,0.06244 0.0098,0.0164 0.02088,0.03237 0.02945,0.04924 0.01125,0.02115 0.02112,0.04282 0.0313,0.06439 0.0086,0.01793 0.01729,0.03549 0.02497,0.05382 0.0086,0.02085 0.01606,0.04219 0.02317,0.06341 0.007,0.01987 0.01479,0.03938 0.02108,0.05964 0.0071,0.02141 0.01111,0.04314 0.01678,0.06488 0.0047,0.02048 0.01111,0.04082 0.01499,0.06172 0.0047,0.02507 0.0082,0.05059 0.01165,0.07611 0.0047,0.01772 0.0058,0.03502 0.0072,0.05284 a 1.3368319,1.3368319 0 0 1 0,0.263946 c -0.0048,0.01794 -0.0048,0.03522 -0.0072,0.05284 -0.0047,0.02543 -0.0071,0.05089 -0.01165,0.07612 -0.0048,0.02083 -0.01054,0.04123 -0.01499,0.06172 -0.0048,0.02164 -0.01104,0.04337 -0.01678,0.06484 -0.0069,0.02029 -0.01397,0.03978 -0.02108,0.05964 -0.0071,0.02125 -0.01481,0.04252 -0.02317,0.06341 -0.0071,0.01838 -0.01693,0.03602 -0.02497,0.05382 -0.01094,0.02156 -0.02027,0.04321 -0.0313,0.06444 -0.0086,0.01686 -0.01932,0.0328 -0.02945,0.04923 -0.01281,0.02085 -0.02477,0.04207 -0.0386,0.06243 -0.01251,0.01793 -0.02574,0.03475 -0.03886,0.05201 -0.013,0.01759 -0.02562,0.03551 -0.04006,0.05258 -0.0241,0.02891 -0.04918,0.05653 -0.0752,0.08318 -0.0047,0.0047 -0.0083,0.0094 -0.01284,0.01396 L 46.269385,13.473998 A 1.3330851,1.3330851 0 0 1 44.384032,11.58907 L 46.107554,9.8655743 H 27.997367 a 9.3418149,9.3418149 0 0 0 -9.331276,9.3311507 1.3330409,1.3330409 0 0 1 -2.66608,0 z m 33.325953,-1.333042 a 1.3331047,1.3331047 0 0 0 -1.332955,1.333042 9.3418149,9.3418149 0 0 1 -9.331324,9.331289 H 20.551288 L 22.274822,26.80487 A 1.3330717,1.3330717 0 0 0 20.38949,24.919717 l -3.999104,3.999104 c -0.0046,0.0046 -0.0072,0.0085 -0.01127,0.01268 -0.02661,0.02733 -0.05242,0.05535 -0.07675,0.08492 -0.01397,0.01669 -0.02627,0.03499 -0.03932,0.0526 -0.01279,0.01697 -0.02621,0.03419 -0.03825,0.05202 -0.01363,0.02048 -0.02557,0.04154 -0.03794,0.06241 -0.0095,0.01669 -0.02012,0.03229 -0.02915,0.04925 -0.0113,0.02082 -0.02088,0.04282 -0.03108,0.06441 -0.0079,0.01826 -0.01739,0.03544 -0.02497,0.0538 -0.0083,0.02064 -0.01557,0.04221 -0.02319,0.06339 -0.0071,0.02014 -0.01483,0.03938 -0.02084,0.05965 -0.0065,0.02127 -0.01129,0.04316 -0.01661,0.06487 -0.0047,0.02064 -0.01084,0.04083 -0.01498,0.06172 -0.0047,0.02502 -0.0079,0.0506 -0.01164,0.0761 -0.0028,0.01776 -0.0056,0.03499 -0.0073,0.05286 a 1.3368319,1.3368319 0 0 0 0,0.263924 c 0.0016,0.01827 0.0047,0.03526 0.0073,0.05287 0.0037,0.02544 0.0066,0.05086 0.01164,0.07612 0.0046,0.02048 0.0097,0.04123 0.01498,0.06174 0.0048,0.02168 0.0099,0.04337 0.01661,0.06484 0.006,0.02055 0.01384,0.03978 0.02084,0.05966 0.0072,0.02088 0.01462,0.04252 0.02319,0.06337 0.0072,0.01865 0.01657,0.03602 0.02497,0.05385 0.0099,0.02155 0.01972,0.04321 0.03108,0.06437 0.0087,0.01668 0.01932,0.03265 0.02915,0.04925 0.01241,0.02059 0.02431,0.04205 0.03794,0.06239 0.01205,0.01825 0.02541,0.03469 0.03825,0.05202 0.01302,0.01752 0.0254,0.03558 0.03932,0.05259 0.02377,0.02882 0.04919,0.0565 0.07525,0.08315 0.0047,0.0048 0.0079,0.0092 0.01263,0.01448 l 3.999102,3.999079 a 1.3331263,1.3331263 0 1 0 1.885344,-1.885208 l -1.723487,-1.723329 h 18.110384 a 12.010896,12.010896 0 0 0 11.99736,-11.997233 1.3331047,1.3331047 0 0 0 -1.333065,-1.333042 z m -15.329922,6.665206 a 1.3331047,1.3331047 0 0 0 1.333043,-1.333033 v -7.998244 a 1.3330158,1.3330158 0 0 0 -1.928767,-1.192523 l -2.666091,1.331816 a 1.3330519,1.3330519 0 0 0 1.191477,2.385054 l 0.737305,-0.368259 v 5.842156 a 1.3331047,1.3331047 0 0 0 1.333033,1.333033 z"
/> />
</g> </g>
</svg> </svg>
) )