Toggle navigation
Toggle navigation
This project
Loading...
Sign in
卢阳
/
front_backend_zImage
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
ly0303521
2026-01-12 11:13:29 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
10beaa920e2f19fc09e493688941c72ff956e235
10beaa92
1 parent
27a5f06d
将视频预览区修改成尾帧
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
z-image-generator/components/HistoryBar.tsx
z-image-generator/components/ImageCard.tsx
z-image-generator/components/HistoryBar.tsx
View file @
10beaa9
...
...
@@ -30,6 +30,10 @@ const HistoryBar: React.FC<HistoryBarProps> = ({ images, onSelect }) => {
muted
playsInline
preload="metadata"
onLoadedMetadata={(e) => {
const video = e.target as HTMLVideoElement;
video.currentTime = video.duration || 0;
}}
/>
) : (
<img
...
...
z-image-generator/components/ImageCard.tsx
View file @
10beaa9
...
...
@@ -22,6 +22,7 @@ const ImageCard: React.FC<ImageCardProps> = ({ image, onClick, onLike, currentUs
const handleMouseEnter = () => {
if (videoRef.current) {
videoRef.current.currentTime = 0;
videoRef.current.play().catch(e => console.error("Video play failed", e));
}
}
...
...
@@ -29,6 +30,13 @@ const ImageCard: React.FC<ImageCardProps> = ({ image, onClick, onLike, currentUs
const handleMouseLeave = () => {
if (videoRef.current) {
videoRef.current.pause();
videoRef.current.currentTime = videoRef.current.duration || 0;
}
}
const handleVideoMetadata = () => {
if (videoRef.current) {
videoRef.current.currentTime = videoRef.current.duration || 0;
}
}
...
...
@@ -50,6 +58,7 @@ const ImageCard: React.FC<ImageCardProps> = ({ image, onClick, onLike, currentUs
ref={videoRef}
src={image.url}
className={`w-full h-auto object-cover transition-opacity duration-300 ${isLoaded ? 'opacity-100' : 'opacity-0'}`}
onLoadedMetadata={handleVideoMetadata}
onLoadedData={() => setIsLoaded(true)}
loop
muted
...
...
Please
register
or
login
to post a comment