mirror of
https://github.com/chenasraf/stimvisor.git
synced 2026-05-17 17:38:11 +00:00
fix: screenshots count+pos, sidebar theme
This commit is contained in:
@@ -1 +1 @@
|
||||
0d0c98b49fd99dd2c835289a5056e043
|
||||
b3720f3ac2572fdca396795bb24a2756
|
||||
@@ -6,10 +6,8 @@ export function ScreenshotImg({
|
||||
className,
|
||||
screenshot,
|
||||
...rest
|
||||
}: HtmlProps<'div'> & { screenshot: screenshots.ScreenshotEntry }) {
|
||||
}: Omit<HtmlProps<'img'>, 'src'> & { screenshot: screenshots.ScreenshotEntry }) {
|
||||
return (
|
||||
<div className={cn('', rest.onClick && 'cursor-pointer', className)} {...rest}>
|
||||
<img className="rounded-md" src={screenshot.base64} alt={screenshot.name} />
|
||||
</div>
|
||||
<img className={cn('rounded-md', rest.onClick && 'cursor-pointer', className)} src={screenshot.base64} alt={screenshot.name} {...rest} />
|
||||
)
|
||||
}
|
||||
|
||||
@@ -22,14 +22,12 @@ export function ScreenshotsCarouselModal({
|
||||
}) {
|
||||
return (
|
||||
<div className={cn('', className)} {...rest}>
|
||||
<DialogContent className="max-w-[calc(100%_-_128px)]">
|
||||
<DialogContent className="max-w-[calc(100%_-_128px)] max-h-[calc(100%_-_64px)]">
|
||||
<Carousel opts={{ startIndex: activeIndex ?? undefined }}>
|
||||
<CarouselContent>
|
||||
<CarouselContent className="max-w-full max-h-full">
|
||||
{screenshots.map((scr) => (
|
||||
<CarouselItem key={scr.path}>
|
||||
<div className="h-full flex items-center">
|
||||
<ScreenshotImg screenshot={scr} />
|
||||
</div>
|
||||
<CarouselItem key={scr.path} className="flex items-center justify-center">
|
||||
<ScreenshotImg screenshot={scr} className="max-h-[calc(100vh_-_128px)] object-cover mx-auto" />
|
||||
</CarouselItem>
|
||||
))}
|
||||
</CarouselContent>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { cva } from 'class-variance-authority'
|
||||
|
||||
export function Sidebar({ className, ...rest }: HtmlProps<'div'>) {
|
||||
return (
|
||||
<div className={cn('py-3 bg-bg-950 h-screen overflow-y-auto', className)} {...rest}>
|
||||
<div className={cn('py-3 bg-black/30 h-screen overflow-y-auto', className)} {...rest}>
|
||||
<ul>
|
||||
<ListItem label="Games" to="/games" match={(p) => p === '/' || p.startsWith('/games')} />
|
||||
<ListItem
|
||||
|
||||
@@ -74,7 +74,7 @@ func NewScreenshotsDirFromPath(path string, limit int) ScreenshotCollection {
|
||||
continue
|
||||
}
|
||||
s.TotalCount++
|
||||
if limit > 0 && i >= limit {
|
||||
if limit > 0 && i > limit {
|
||||
continue
|
||||
}
|
||||
b64 += base64.StdEncoding.EncodeToString(bytes)
|
||||
|
||||
Reference in New Issue
Block a user