Skip to content

Commit

Permalink
add thumbnail images
Browse files Browse the repository at this point in the history
  • Loading branch information
aleensd committed Nov 25, 2024
1 parent 7ecd69a commit ac06d31
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
19 changes: 10 additions & 9 deletions frontend/src/static/js/components/media-page/MediaPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -623,21 +623,22 @@
z-index: 1000;
}

.dot {
width: 12px;
height: 12px;
background: rgba(255, 255, 255, 0.6);
border-radius: 50%;
.thumbnail {
width: 50px;
height: 50px;
object-fit: cover;
border: 2px solid transparent;
border-radius: 5px;
cursor: pointer;
transition: all 0.3s ease-in-out;
}

.dot.active {
background: rgba(255, 255, 255, 1);
.thumbnail.active {
border-color: rgba(255, 255, 255, 1);
}

.dot:hover {
background: rgba(255, 255, 255, 0.8);
.thumbnail:hover {
opacity: 0.8;
}

.viewer-container .player-container {
Expand Down
12 changes: 7 additions & 5 deletions frontend/src/static/js/components/media-viewer/ImageViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default function ImageViewer() {
</button>
)}
<div className="slideshow-image">
{isImgLoading && <SpinnerLoader size="large"/>}
{isImgLoading && <SpinnerLoader size="large" />}
<img
src={site.url + '/' + slideshowItems[currentIndex]?.original_media_url}
alt={`Slide ${currentIndex + 1}`}
Expand All @@ -122,12 +122,14 @@ export default function ImageViewer() {
</button>
)}
<div className="dots">
{slideshowItems.map((_, index) => (
<span
{slideshowItems.map((item, index) => (
<img
key={index}
className={`dot ${currentIndex === index ? 'active' : ''}`}
src={site.url + '/' + item.thumbnail_url}
alt={`Thumbnail ${index + 1}`}
className={`thumbnail ${currentIndex === index ? 'active' : ''}`}
onClick={() => handleDotClick(index)}
></span>
/>
))}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion static/css/media.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/js/media.js

Large diffs are not rendered by default.

0 comments on commit ac06d31

Please sign in to comment.