Commit 77df3bd2 by 胡悦

feat(aiVideo): 重构视频播放页面布局并更新样式

- 将单视频布局改为左右分栏,左侧添加装饰图片,右侧为视频播放区
- 为视频容器添加边框、阴影和四角装饰元素,增强视觉效果
- 更新播放/暂停按钮样式,添加悬停动画效果
- 替换视频源地址为新的资源路径
- 新增左右两侧PNG图片资源文件
1 parent b64851fb
<template> <template>
<div class="video-container"> <div class="ai-video-container">
<video controls class="video-box" ref="video"> <!-- 左侧图片 -->
<source :src="videoSrc" type="video/mp4" /> <div class="left-image">
</video> <img src="@/assets/images/left.png" alt="left" class="left-img" />
<div class="video-pause" @click="hanldPlay('pause')" v-if="status == 'play'"> </div>
<img src="@/assets/images/play-icon.png" />
<!-- 右侧视频区 -->
<div class="right-content">
<div class="video-frame">
<div class="video-container">
<video controls class="video-box" ref="video">
<source :src="videoSrc" type="video/mp4" />
</video>
<div class="video-pause" @click="hanldPlay('pause')" v-if="status == 'play'">
<img src="@/assets/images/play-icon.png" />
</div>
<div class="video-play" @click="hanldPlay('play')" v-if="status == 'pause'">
<img src="@/assets/images/pause-icon.png" />
</div>
</div>
<!-- 四角装饰 -->
<div class="corner corner-tl"></div>
<div class="corner corner-tr"></div>
<div class="corner corner-bl"></div>
<div class="corner corner-br"></div>
</div>
</div> </div>
<div class="video-play" @click="hanldPlay('play')" v-if="status == 'pause'"><img src="@/assets/images/pause-icon.png" /></div>
</div> </div>
</template> </template>
...@@ -16,7 +35,7 @@ export default { ...@@ -16,7 +35,7 @@ export default {
data() { data() {
return { return {
videoSrc: 'https://img02.glsx.com.cn/weapp/resource/saas/video/video_20260311.mp4', videoSrc: 'https://img02.glsx.com.cn/weapp/resource/shuke/video/video.mp4',
status: 'play', status: 'play',
timer: null timer: null
} }
...@@ -85,47 +104,121 @@ export default { ...@@ -85,47 +104,121 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.video-container { .ai-video-container {
width: 1824px; width: 100%;
height: 876px;
background: url('../../assets/images/home-bg.png') no-repeat;
background-size: 100%;
// border: 4px solid rgba(18, 117, 248, 0.5);
box-sizing: border-box; box-sizing: border-box;
// margin: 20px calc((100vw - 1560px) / 2);
margin: 20px auto; margin: 20px auto;
position: relative; position: relative;
display: flex; display: flex;
justify-content: center; justify-content: center;
padding: 40px 60px;
gap: 40px;
}
.left-image {
width: 893px;
height: 752px;
display: flex;
flex-direction: column;
}
.right-content {
width: 1112px;
height: 658px;
flex-shrink: 0;
display: flex;
align-items: center; align-items: center;
justify-content: center;
}
.video-frame {
position: relative;
width: 100%;
height: 100%;
}
.video-container {
width: 100%;
height: 100%;
position: relative;
border-radius: 8px;
overflow: hidden;
background: rgba(0, 0, 0, 0.5);
border: 1px solid rgba(0, 184, 255, 0.3);
box-shadow: 0 0 40px rgba(0, 184, 255, 0.2);
.video-box { .video-box {
width: 1440px; width: 100%;
height: 810px; height: 100%;
object-fit: cover;
} }
.video-pause, .video-pause,
.video-play { .video-play {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
width: 120px; transform: translate(-50%, -50%);
height: 120px; width: 80px;
margin-left: -60px; height: 80px;
margin-top: -60px;
border-radius: 50%; border-radius: 50%;
background: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
&:hover {
transform: translate(-50%, -50%) scale(1.1);
background: rgba(0, 184, 255, 0.6);
}
img {
width: 40px;
height: 40px;
object-fit: contain;
}
} }
} }
.video-full {
z-index: 999; .corner {
position: fixed; position: absolute;
top: 0px; width: 20px;
left: 0px; height: 20px;
width: 100%; border: 3px solid #00b8ff;
height: 100%; box-shadow: 0 0 10px rgba(0, 184, 255, 0.5);
background: #000000; }
.video-box {
position: absolute; .corner-tl {
left: 324px; top: -2px;
width: calc(100% - 648px); left: -2px;
} border-right: none;
border-bottom: none;
border-radius: 8px 0 0 0;
}
.corner-tr {
top: -2px;
right: -2px;
border-left: none;
border-bottom: none;
border-radius: 0 8px 0 0;
}
.corner-bl {
bottom: -2px;
left: -2px;
border-right: none;
border-top: none;
border-radius: 0 0 0 8px;
}
.corner-br {
bottom: -2px;
right: -2px;
border-left: none;
border-top: none;
border-radius: 0 0 8px 0;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!