landjj321
2021-03-20 569c2c468b02d4b9021a8b4713b5f4056a995be4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<template>
  <div class="first-video-container">
    <div class="top-color" />
    <div class="bottom-color" />
    <div class="video-content">
      <video class="video-bg" ref="vid"  src="/first-video.mov" loop="loop" preload="load" controls="controls" playsinline="">
      </video>
    </div>
    <div class="overlay-info" @click="pauseVideo($event)">
      <div class="header">
        <div class="navbar">
          <span class="navbar__item" :class="{'active': navbarActive===0}" @click="navbarActive=0">强军思想</span>
          <span class="navbar__item" :class="{'active': navbarActive===1}" @click="navbarActive=1">军委机关</span>
          <span class="navbar__item" :class="{'active': navbarActive===2}" @click="navbarActive=2">中心概览</span>
          <span class="navbar__item" :class="{'active': navbarActive===3}" @click="navbarActive=3">影视部</span>
          <span class="navbar__item" :class="{'active': navbarActive===4}" @click="navbarActive=4">文艺部</span>
          <span class="navbar__item" :class="{'active': navbarActive===5}" @click="navbarActive=5">军乐团</span>
          <span class="navbar__item" :class="{'active': navbarActive===6}" @click="navbarActive=6">文艺咨询</span>
          <span class="navbar__item" :class="{'active': navbarActive===7}" @click="navbarActive=7">官兵信箱</span>
        </div>
        <div class="search">
          <div class="search-space">
            <input type="text">
            <svg-icon icon-class="search" />
          </div>
        </div>
        <div class="login-or-register-action">
          <span class="login-action">登录</span>
          <span>/</span>
          <span class="register-action">注册</span>
        </div>
      </div>
      <div class="navicon">
        <ul>
          <li class="sidebar__item"><img src="@/assets/home/first_video/hsdyy.png" alt="红色电影院"></li>
          <li class="sidebar__item"><img src="@/assets/home/first_video/wydwt.png" alt="文艺大舞台"></li>
          <li class="sidebar__item"><img src="@/assets/home/first_video/qjyyt.png" alt="强军音乐厅"></li>
          <li class="sidebar__item"><img src="@/assets/home/first_video/jzzyk.png" alt="剧作资源库"></li>
          <li class="sidebar__item"><img src="@/assets/home/first_video/jlshy.png" alt="军旅书画院"></li>
          <li class="sidebar__item"><img src="@/assets/home/first_video/wyyzb.png" alt="文艺云直播"></li>
          <li class="sidebar__item"><img src="@/assets/home/first_video/wyykt.png" alt="文艺云课堂"></li>
          <li class="sidebar__item"><img src="@/assets/home/first_video/szhsg.png" alt="数字化史官"></li>
          <li class="sidebar__item"><img src="@/assets/home/first_video/xxfww.png" alt="信息服务网"></li>
        </ul>
      </div>
      <div class="logo">
        <img class="logo-img" src="@/assets/home/first_video/logo.png">
        <img class="logo-text" src="@/assets/home/first_video/logo_text.png">
      </div>
      <div class="pull-down" @click="toHome">
        <span>》</span>
      </div>
      <img v-if="!playing" class="player-btn" src="@/assets/home/first_video/player.png" @click="playVideo">
    </div>
  </div>
</template>
 
<script>
 
export default {
  // 首屏开启视频页面
  name: 'FirstVideo',
  data() {
    return {
      navbarActive: 0, // 0, 1, 2, 3, 4, 5, 6, 7
      playing: false
    }
  },
  methods: {
    toHome() {
      this.$emit('hideVideo', true)
    },
    playVideo() {
      // 如果视频播放就暂停,如果是暂停就播放
      if (this.$refs.vid.paused) {
        this.$refs.vid.play();
      } else {
        this.$refs.vid.pause();
      }
      this.playing = true
    },
    pauseVideo(event) {
      if (event.target.className === 'overlay-info') {
        this.$refs.vid.pause();
        this.playing = false
      }
    }
  }
}
</script>
 
<style lang="scss" scoped>
  @import "~@/styles/variables.scss";
  .first-video-container {
    // 背景图片
    position: relative;
    height: 100%;
    width: 100%;
    min-width: $appWidth;
    min-height: 681px;
    background-image: url("../../../assets/home/first_video/first-video-bg.png");
    background-size: 100% 100%;
    overflow: hidden;
    .top-color {
      position: absolute;
      background-image: url(../../../assets/home/first_video/top-color.png);
      background-size: 100% 100%;
      z-index: 3;
      top: 0;
      width: 100%;
      height: 286px;
      // background-image: linear-gradient(to bottom, rgba(186,52,47,1) , rgba(255,255,255,0));
    }
 
    .bottom-color {
      position: absolute;
      z-index: 3;
      bottom: 0;
      width: 100%;
      height: 90px;
      background-image: url(../../../assets/home/first_video/bottom-color.png);
      background-size: 100% 100%;
      background-position: -5px;
    }
 
    .video-content {
      position: absolute;
      width: 100%;
      height: 100%;
      z-index: 2;
      .video-bg {
        width: 100%;
        height: 100%;
        transition: .35s;
        object-fit: cover;
      }   
    }
 
    // 图标上面的导航,logo 等信息
    .overlay-info {
      position: absolute;
      z-index: 4;
      width: 100%;
      height: 100%;
      // 头部导航
      .header {
        position: absolute;
        top: 0;
        height: 215px;
        width: 100%;
        // background-image: linear-gradient(to bottom, rgba(202,34,38,1) , rgba(255,255,255,0));
        color: #000;
        z-index: 2;
        color: #FFE0B8;
        text-align: center;
        font-size: 14px;
        .navbar {
          display: inline-block;
          margin-top: 22.5px;
          margin-left: 194px;
          .navbar__item {
            display: inline-block;
            position: relative;
            cursor: pointer;
            margin-left: 40px;
            &:first-child {
              margin-left: 0;
            }
            &.active {
              font-weight: 500;
              &::after {
                content: '';
                width: 100%;
                height: 1px;
                background: #FFE0B8;
                position: absolute;
                left: 0;
                bottom: -5px;
              }
            }
          }
        }
        .search {
          display: inline-block;
          width: 80px;
          height: 15px;
          border-radius: 10px;
          border: solid 1px #FFE0B8;
          margin-left: 24px;
          vertical-align: -3px;
          input {
            border: none;
            outline: none;
            background: transparent;
            width: 60px;
            height: 13px;
            vertical-align: 2.5px;
            color: #FFE0B8;
          }
          svg {
            width: 8px;
            height: 13px;
            vertical-align: 0.5px;
          }
        }
        .login-or-register-action {
          display: inline-block;
          width: 80px;
          margin-left: 10px;
          .login-action {
            margin-right: 5px;
          }
          .register-action {
            margin-left: 5px;
          }
        }
      }
 
      // 坐标图标导航
      .navicon {
        position: absolute;
        z-index: 2;
        left: 0;
        width: 75px;
        height: 460px;
        text-align: center;
        // 左边导航
        top: 85px;
        &:after {
          clear: both;
        }
        ul {
          position: absolute;
          left: -55px;
          padding: 5px 0;
          display: block;
          width: 55px;
          height: 460px;
          background: #FFFFFF;
          opacity: 0.9;
          margin: 0;
          display: block;
          transition: left 0.5s;
          -webkit-transition: left 0.5s;
          li {
            list-style-type: none;
            display: inline-block;
            cursor: pointer;
            width: 32px;
            height: 32px;
            margin: 0 auto;
            margin-top:  13px;
            img {
              width: 100%;
              height: 100%;
            }
          }
        }
        &:hover ul {
          display: block;
          left: 0;
        }
      }
 
      // 中间 logo 与大文字
      .logo {
        position: absolute;
        text-align: center;
        width: 100%;
        left: 0;
        top: 100px;
        margin: -12px auto;
        display: inline-block;
        height: 126px;
        text-align: center;
        .logo-img {
          width: 135px;
          height: 126px;
        }
        .logo-text {
          width: 627px;
          height: 106px;
          margin-left: 38px;
          margin-bottom: 10px;
        }
      }
      // 下拉图标
      .pull-down {
        position: absolute;
        cursor: pointer;
        bottom: 30px;
        width: 90px;
        left: calc(50% - 5px);
        span {
          display: inline-block;
          transform: rotate(90deg);
          color: #fff;
          text-shadow: 0px 3px 13px rgba(117, 12, 13, 0.29);
          font-size: 86px;
        }
      }
 
      // 点击播放的按钮
      .player-btn {
        position: absolute;
        cursor: pointer;
        z-index: 5;
        top: 43%;
        left: 50%;
      } 
    }
  }
</style>