-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
master1lan
committed
Jan 5, 2023
1 parent
17ba774
commit e03b2e0
Showing
5 changed files
with
179 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,20 @@ | ||
| .imgWrapper { | ||
| position: relative; | ||
| overflow: hidden; | ||
| border-radius: 8px; | ||
| outline: 0.5px solid rgba(0, 0, 0, .05); | ||
|
|
||
| &>img { | ||
| width: 100%; | ||
| display: inline-block; | ||
| border-radius: 8px; | ||
| outline: 0.5px solid rgba(0, 0, 0, .05); | ||
| object-fit: cover; | ||
| transition: opacity .5s linear; | ||
| -webkit-transition: opacity .5s linear; | ||
| transition: transform .2s linear; | ||
| -webkit-transition: transform .2s linear; | ||
|
|
||
| &:hover { | ||
| transform: scale(1.1); | ||
| } | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,9 +14,7 @@ | |
|
|
||
| .element-item { | ||
| min-width: 180px; | ||
|
|
||
| .footer { | ||
| padding: 12px; | ||
| } | ||
| box-sizing: border-box; | ||
| padding: 0 5px; | ||
| } | ||
| } | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| import Image from "@components/image"; | ||
| import { FC } from "react"; | ||
| import SlowMotionVideoSharpIcon from "@mui/icons-material/SlowMotionVideoSharp"; | ||
| import SubjectSharpIcon from "@mui/icons-material/SubjectSharp"; | ||
| import Link from "@mui/material/Link"; | ||
| import { VideoRouterImageCardType } from "./videotype"; | ||
| import getrealtiveTime, { getVideoTime } from "@utils/time"; | ||
| import styles from "./video.module.less"; | ||
| import { Omit, Pick } from "@utils/index"; | ||
|
|
||
| export const VideoRouterImageCard: FC<{ data: VideoRouterImageCardType }> = ({ | ||
| data, | ||
| }) => { | ||
| const { pic, bvid } = data; | ||
| return ( | ||
| <section className='element-item'> | ||
| <Link | ||
| target='_blank' | ||
| href={`https://www.bilibili.com/video/${bvid}`} | ||
| underline='none' | ||
| color='inherit' | ||
| > | ||
| <Image | ||
| url={pic} | ||
| {...Omit( | ||
| data, | ||
| "pic", | ||
| "bvid", | ||
| "name", | ||
| "tname", | ||
| "title", | ||
| "tag", | ||
| "view", | ||
| "coin", | ||
| "share", | ||
| "like", | ||
| "updated_at", | ||
| "danmaku", | ||
| "duration" | ||
| )} | ||
| > | ||
| {/* todo:lost tag */} | ||
| <VideoData {...Pick(data, "view", "danmaku", "duration")} /> | ||
| </Image> | ||
| </Link> | ||
| <VideoInfo {...Pick(data, "title", "name", "updated_at", "bvid")} /> | ||
| </section> | ||
| ); | ||
| }; | ||
| const VideoData: FC< | ||
| Pick<VideoRouterImageCardType, "view" | "danmaku" | "duration"> | ||
| > = (props) => { | ||
| const { view, danmaku, duration } = props; | ||
| return ( | ||
| <div className={styles["video-data"]}> | ||
| <div className={styles["video-data-left"]}> | ||
| <span title='播放量'> | ||
| <SlowMotionVideoSharpIcon fontSize='small' /> | ||
| {view} | ||
| </span> | ||
| <span title='弹幕数'> | ||
| <SubjectSharpIcon fontSize='small' /> | ||
| {danmaku} | ||
| </span> | ||
| </div> | ||
| <span title='视频时长'>{getVideoTime(duration)}</span> | ||
| </div> | ||
| ); | ||
| }; | ||
| const VideoInfo: FC< | ||
| Pick<VideoRouterImageCardType, "title" | "name" | "updated_at" | "bvid"> | ||
| > = (props) => { | ||
| const { title, name, bvid, updated_at } = props; | ||
| return ( | ||
| <div className={styles["video-info"]}> | ||
| <p title={title}> | ||
| <Link | ||
| target='_blank' | ||
| href={`https://www.bilibili.com/video/${bvid}`} | ||
| underline='none' | ||
| color='inherit' | ||
| > | ||
| {title} | ||
| </Link> | ||
| </p> | ||
| <div className={styles["video-up-info"]}> | ||
| <Link underline='none' color='inherit'> | ||
| <span title={name}>{name}</span> | ||
| <span>{getrealtiveTime(updated_at * 1000)}</span> | ||
| </Link> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
| // 1-6 todo:写完视频页面展示瀑布图 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters