mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-01-11 22:40:31 +00:00
Merge pull request #1059 from Stremio/feat/details-selected-video-styles
Some checks are pending
Build / build (push) Waiting to run
Some checks are pending
Build / build (push) Waiting to run
Details: improve selected video logic
This commit is contained in:
commit
0c833330a1
2 changed files with 28 additions and 6 deletions
|
|
@ -73,15 +73,19 @@ const Video = ({ className, id, title, thumbnail, season, episode, released, upc
|
|||
const blurThumbnail = profile.settings.hideSpoilers && season && episode && !watched;
|
||||
|
||||
React.useEffect(() => {
|
||||
selected && !watched && ref.current?.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'nearest',
|
||||
inline: 'start'
|
||||
});
|
||||
if (selected && ref.current) {
|
||||
if ((progress && watched) || !watched) {
|
||||
ref.current.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'nearest',
|
||||
inline: 'start'
|
||||
});
|
||||
}
|
||||
}
|
||||
}, [selected]);
|
||||
|
||||
return (
|
||||
<Button {...props} ref={ref} className={classnames(className, styles['video-container'])} title={title}>
|
||||
<Button {...props} ref={ref} className={classnames(className, styles['video-container'], { [styles['selected']]: selected })} title={title}>
|
||||
{
|
||||
typeof thumbnail === 'string' && thumbnail.length > 0 ?
|
||||
<div className={styles['thumbnail-container']}>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@
|
|||
margin-bottom: 0.5rem;
|
||||
border-radius: var(--border-radius);
|
||||
|
||||
@supports (scroll-margin: 1.25rem) {
|
||||
scroll-margin: 1.25rem;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus,
|
||||
&:global(.active) {
|
||||
|
|
@ -172,6 +176,20 @@
|
|||
}
|
||||
}
|
||||
|
||||
&.selected {
|
||||
animation: border 3s ease-in-out forwards;
|
||||
}
|
||||
|
||||
@keyframes border {
|
||||
0% {
|
||||
border: 0.15rem solid var(--primary-accent-color);
|
||||
}
|
||||
100% {
|
||||
border: 0.15rem solid transparent;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.context-menu-container {
|
||||
max-width: calc(90% - 1.5rem);
|
||||
z-index: 2;
|
||||
|
|
|
|||
Loading…
Reference in a new issue