fix(ux): refine hero slider, update shop copy, fix admin product save validation, add soundcloud waveform & fix player controls, improve reviews layout
Deploy Canina / deploy (push) Successful in 1m39s

This commit is contained in:
parsa aghaei committed 2026-08-18 12:00:54 +03:30
1 parent f9dad098ef
commit f0f50c75cc
7 files changed
+386 -246

No files matched your search

@@ -173,7 +173,7 @@ export default function VideoModalPlayer({ isOpen, onClose, video }: VideoModalP
if (navigator.share) {
try {
await navigator.share({
title: video?.title || 'ویدئوی آموزشی کنینا',
title: video?.title || 'ویدئوی راهنمای کنینا',
text: video?.description || '',
url: shareUrl
});
@@ -213,6 +213,8 @@ export default function VideoModalPlayer({ isOpen, onClose, video }: VideoModalP
if (!isOpen || !video) return null;
const isIframe = video.videoUrl?.includes("<iframe");
const progressPercent = duration > 0 ? (currentTime / duration) * 100 : 0;
const volumePercent = isMuted ? 0 : volume * 100;
return (
<AnimatePresence>
@@ -370,12 +372,19 @@ export default function VideoModalPlayer({ isOpen, onClose, video }: VideoModalP
</div>
)}
{/* Progress / Seek Bar */}
{/* Progress / Seek Bar with filled progress track */}
<div className="flex items-center gap-3 dir-ltr" dir="ltr">
<span className="text-[11px] font-mono font-bold text-white/70 w-10 text-right">
{formatTime(currentTime)}
</span>
<div className="relative flex-1 flex items-center">
<div className="relative flex-1 flex items-center h-4">
{/* Background Track */}
<div className="absolute inset-x-0 h-1.5 bg-white/20 rounded-lg overflow-hidden pointer-events-none">
<div
className="h-full bg-canina-blue transition-all"
style={{ width: `${progressPercent}%` }}
/>
</div>
<input
type="range"
min={0}
@@ -383,7 +392,12 @@ export default function VideoModalPlayer({ isOpen, onClose, video }: VideoModalP
step={0.1}
value={currentTime}
onChange={handleSeek}
className="w-full h-1.5 bg-white/20 rounded-lg appearance-none cursor-pointer accent-canina-blue hover:h-2 transition-all"
className="w-full h-4 opacity-0 absolute inset-0 cursor-pointer z-10"
/>
{/* Visual Scrubber Thumb */}
<div
className="absolute w-3.5 h-3.5 bg-white rounded-full shadow-md pointer-events-none -translate-x-1/2 transition-transform hover:scale-125"
style={{ left: `${progressPercent}%` }}
/>
</div>
<span className="text-[11px] font-mono font-bold text-white/70 w-10 text-left">
@@ -393,8 +407,8 @@ export default function VideoModalPlayer({ isOpen, onClose, video }: VideoModalP
{/* Action Buttons Row */}
<div className="flex items-center justify-between">
{/* Left Controls (Playback & Jumps) */}
<div className="flex items-center gap-2 sm:gap-4">
{/* Left Controls (Playback & Jumps with - on Left and + on Right in RTL) */}
<div className="flex items-center gap-2 sm:gap-3" dir="rtl">
{/* Play/Pause */}
<button
type="button"
@@ -405,47 +419,59 @@ export default function VideoModalPlayer({ isOpen, onClose, video }: VideoModalP
{isPlaying ? <Pause className="w-5 h-5 fill-white" /> : <Play className="w-5 h-5 fill-white ml-0.5" />}
</button>
{/* -10s */}
{/* -10s button */}
<button
type="button"
onClick={() => skipTime(-10)}
className="p-2 text-white/70 hover:text-white rounded-lg hover:bg-white/10 transition-colors cursor-pointer flex items-center gap-1 text-xs font-mono font-bold"
className="px-2.5 py-1.5 text-white/80 hover:text-white rounded-lg hover:bg-white/10 transition-colors cursor-pointer flex items-center gap-1 text-xs font-mono font-bold border border-white/10"
title="۱۰ ثانیه عقب"
>
<RotateCcw className="w-4 h-4" />
<span className="text-[10px]">10s</span>
<RotateCcw className="w-3.5 h-3.5" />
<span>-10s</span>
</button>
{/* +10s */}
{/* +10s button */}
<button
type="button"
onClick={() => skipTime(10)}
className="p-2 text-white/70 hover:text-white rounded-lg hover:bg-white/10 transition-colors cursor-pointer flex items-center gap-1 text-xs font-mono font-bold"
className="px-2.5 py-1.5 text-white/80 hover:text-white rounded-lg hover:bg-white/10 transition-colors cursor-pointer flex items-center gap-1 text-xs font-mono font-bold border border-white/10"
title="۱۰ ثانیه جلو"
>
<RotateCw className="w-4 h-4" />
<span className="text-[10px]">10s</span>
<RotateCw className="w-3.5 h-3.5" />
<span>+10s</span>
</button>
{/* Volume slider */}
<div className="hidden sm:flex items-center gap-2 group/vol">
{/* Volume Slider: Increases towards the speaker icon */}
<div className="hidden sm:flex items-center gap-2 pr-2" dir="ltr">
<div className="relative w-20 flex items-center h-4">
<div className="absolute inset-x-0 h-1.5 bg-white/20 rounded-lg overflow-hidden pointer-events-none">
<div
className="h-full bg-canina-blue transition-all"
style={{ width: `${volumePercent}%` }}
/>
</div>
<input
type="range"
min={0}
max={1}
step={0.05}
value={isMuted ? 0 : volume}
onChange={handleVolumeChange}
className="w-full h-4 opacity-0 absolute inset-0 cursor-pointer z-10"
/>
<div
className="absolute w-2.5 h-2.5 bg-white rounded-full shadow pointer-events-none -translate-x-1/2"
style={{ left: `${volumePercent}%` }}
/>
</div>
<button
type="button"
onClick={toggleMute}
className="p-2 text-white/70 hover:text-white rounded-lg hover:bg-white/10 transition-colors cursor-pointer"
className="p-1.5 text-white/80 hover:text-white rounded-lg hover:bg-white/10 transition-colors cursor-pointer"
title={isMuted ? "صدا وصل" : "بی‌صدا"}
>
{isMuted || volume === 0 ? <VolumeX className="w-4 h-4" /> : <Volume2 className="w-4 h-4" />}
</button>
<input
type="range"
min={0}
max={1}
step={0.05}
value={isMuted ? 0 : volume}
onChange={handleVolumeChange}
className="w-16 h-1 bg-white/20 rounded-lg appearance-none cursor-pointer accent-canina-blue"
/>
</div>
</div>
@@ -456,7 +482,7 @@ export default function VideoModalPlayer({ isOpen, onClose, video }: VideoModalP
<button
type="button"
onClick={() => setShowRateMenu(!showRateMenu)}
className="px-2.5 py-1 rounded-xl bg-white/10 hover:bg-white/20 text-white text-xs font-mono font-bold transition-all cursor-pointer flex items-center gap-1"
className="px-2.5 py-1 rounded-xl bg-white/10 hover:bg-white/20 text-white text-xs font-mono font-bold transition-all cursor-pointer flex items-center gap-1 border border-white/10"
title="سرعت پخش"
>
<span>{playbackRate}x</span>