开屏动画彻底完善
This commit is contained in:
parent
df51da0ae8
commit
cb0226b852
@ -4,15 +4,58 @@ import { useBootstrapBreakpoint } from './useBreakpoint.js';
|
|||||||
const { breakpoint } = useBootstrapBreakpoint();
|
const { breakpoint } = useBootstrapBreakpoint();
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "HeaderVideo"
|
name: "HeaderVideo",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// timestamp: new Date().getTime()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
handleVideoEnded:function (event){
|
||||||
|
window.location.href = "/Homepage";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
if(this.$isMobile.phone)
|
||||||
|
{
|
||||||
|
// 重置 GIF 图片的 src 以确保从第一帧开始播放
|
||||||
|
const img = document.getElementById('beginwep');
|
||||||
|
if (img) {
|
||||||
|
const src = img.getAttribute('src');
|
||||||
|
img.setAttribute('src', '');
|
||||||
|
setTimeout(() => {
|
||||||
|
img.setAttribute('src', src);
|
||||||
|
}, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
// 在这里写入你的跳转语句
|
||||||
|
window.location.href = "/Homepage";
|
||||||
|
}, 5100);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const videos = document.querySelectorAll('.startvideo');
|
||||||
|
// 检查是否找到了视频元素 (可选,但好习惯)
|
||||||
|
if (videos.length > 0) {
|
||||||
|
videos.forEach(video => {
|
||||||
|
video.addEventListener('ended', this.handleVideoEnded);
|
||||||
|
console.log('为视频添加了 ended 事件监听器:', video);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.warn("没有找到视频元素。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div id="beginroot" class="pageroot">
|
<div id="beginroot" class="pageroot">
|
||||||
<div id="videodiv">
|
<div id="videodiv">
|
||||||
<img v-if="$isMobile.phone" src="/beginwepgif.gif" id="beginwep"/>
|
<img v-if="$isMobile.phone"
|
||||||
<video v-if="$isMobile.tablet" poster="/logobeginPCpld.png"
|
src="/beginwepgif.gif" id="beginwep"/>
|
||||||
|
<video v-else-if="$isMobile.tablet" poster="/logobeginPCpld.png"
|
||||||
id="tbstart" muted autoplay controls="controls"
|
id="tbstart" muted autoplay controls="controls"
|
||||||
playsinline webkit-playsinline
|
playsinline webkit-playsinline
|
||||||
class="startvideo"
|
class="startvideo"
|
||||||
@ -43,7 +86,7 @@ name: "HeaderVideo"
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "src/publicstyle.scss";
|
@import "src/publicstyle.scss";
|
||||||
#beginroot{
|
#beginroot{
|
||||||
height: 100vh;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
@ -66,6 +109,7 @@ name: "HeaderVideo"
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#beginbottom {
|
#beginbottom {
|
||||||
|
flex-shrink: 0; /* 添加这一行,防止此元素被压缩 */
|
||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
width: 100%; /* 确保链接占满整个宽度 */
|
width: 100%; /* 确保链接占满整个宽度 */
|
||||||
@ -97,7 +141,9 @@ name: "HeaderVideo"
|
|||||||
}
|
}
|
||||||
#videodiv{
|
#videodiv{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
//height: 100%;
|
||||||
|
flex:1;
|
||||||
|
min-height: 0;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@include media-breakpoint-between(xs, md) {
|
@include media-breakpoint-between(xs, md) {
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
#start {
|
#start {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user