梁彦春 6 年前
父节点
当前提交
b789445ec3

+ 222
- 0
src/components/commonComponents/headerNav.vue 查看文件

@@ -0,0 +1,222 @@
1
+<template>
2
+  <div class="header transparent">
3
+    <div class=section>
4
+      <!-- <a class=header-logo href= /></a> -->
5
+      <!-- logo -->
6
+      <img src="../../assets/image/home/logo/logo.png" alt="">
7
+      <div class="header-right-block">
8
+        <ul class=nav-menu>
9
+          <li class="nav-item active">
10
+            首页
11
+          </li>
12
+          
13
+          <li class="nav-item">
14
+            解决方案
15
+          </li>
16
+          <li class="nav-item">
17
+            产品中心
18
+          </li>
19
+          <li class="nav-item">
20
+            新闻资讯
21
+          </li>
22
+          
23
+          <li class="nav-item">
24
+            关于我们
25
+          </li>
26
+        </ul>
27
+      </div>
28
+    </div>
29
+    <div class="sub-nav-menu">
30
+      <div class="section">
31
+        <span >智慧案场</span>
32
+        <span >智慧社区</span>
33
+        <span>产品订制 </span>
34
+      </div>
35
+    </div>
36
+    <div class="sub-nav-menu">
37
+      <div class="section">
38
+        <span >智慧案场</span>
39
+        <span >智慧社区 </span>
40
+        <span>产品订制 </span>
41
+      </div>
42
+    </div>
43
+    </div>
44
+  <!-- </div> -->
45
+<!-- </div> -->
46
+</template>
47
+<script>
48
+export default {
49
+  data() {
50
+      return {
51
+        activeIndex: '1'
52
+      };
53
+    },
54
+    methods: {
55
+      
56
+    }
57
+
58
+}
59
+</script>
60
+<style>
61
+.section {
62
+      width: 1280px;
63
+      height: 100%;
64
+      margin: 0 auto;
65
+      position: relative
66
+    }
67
+    .clearfix:after,
68
+    .clearfix:before {
69
+      content: "";
70
+      display: table
71
+    }
72
+
73
+    .clearfix:after {
74
+      clear: both
75
+    }
76
+
77
+    .clearfix {
78
+      *zoom: 1
79
+    }
80
+
81
+    input:-ms-input-placeholder {
82
+      color: #ccc
83
+    }
84
+
85
+    input::placeholder {
86
+      color: #ccc
87
+    }
88
+
89
+    button,
90
+    input,
91
+    select,
92
+    textarea {
93
+      font-family: inherit;
94
+      font-size: inherit;
95
+      font-style: inherit;
96
+      font-weight: inherit
97
+    }
98
+
99
+    .hide {
100
+      display: none
101
+    }
102
+
103
+    .header {
104
+      height: 64px;
105
+      font-size: 16px;
106
+      position: fixed;
107
+      top: 0;
108
+      left: 0;
109
+      right: 0;
110
+      z-index: 1;
111
+      transition: background-color .5s ease-out
112
+    }
113
+
114
+    .header .header-logo {
115
+      position: absolute;
116
+      width: 125px;
117
+      height: 35px;
118
+      top: 0;
119
+      bottom: 0;
120
+      left: 40px;
121
+      background-size: contain;
122
+      background-repeat: no-repeat;
123
+      margin: auto
124
+    }
125
+
126
+
127
+    .header .header-right-block {
128
+      position: relative;
129
+      float: right;
130
+      height: 64px;
131
+      width: 676px;
132
+      padding-right: 60px
133
+    }
134
+
135
+    .header .nav-menu {
136
+      display: table;
137
+      width: 100%;
138
+      height: 100%;
139
+      table-layout: fixed
140
+    }
141
+
142
+    .header .nav-menu li {
143
+      display: table-cell;
144
+      text-align: center;
145
+      vertical-align: middle;
146
+      position: relative
147
+    }
148
+
149
+    .header .nav-menu li:before {
150
+      content: "";
151
+      position: absolute;
152
+      top: 32px;
153
+      left: 0;
154
+      right: 0;
155
+      margin: auto;
156
+      display: inline-block;
157
+      width: 0;
158
+      height: 12px;
159
+      transition: width .3s ease-out
160
+    }
161
+
162
+    .header .nav-menu li.active:before,
163
+    .header .nav-menu li:hover:before {
164
+      width: 72px
165
+    }
166
+
167
+    .header .nav-menu span {
168
+      display: inline-block;
169
+      width: 100%;
170
+      height: 64px;
171
+      line-height: 64px
172
+    }
173
+
174
+    .header .sub-nav-menu {
175
+      position: absolute;
176
+      top: 64px;
177
+      width: 100%;
178
+      height: 0;
179
+      text-align: center;
180
+      overflow: hidden;
181
+      transition: height .3s ease-out
182
+    }
183
+
184
+    .header .sub-nav-menu span {
185
+      display: inline-block;
186
+      margin-right: 100px;
187
+      height: 72px;
188
+      line-height: 72px
189
+    }
190
+
191
+    .header .sub-nav-menu span.last-item {
192
+      margin-right: 0
193
+    }
194
+
195
+    .header .sub-nav-menu.show {
196
+      height: 72px
197
+    }
198
+
199
+    .header.transparent {
200
+      background-color: hsla(0, 0%, 100%, 0);
201
+      color: red;
202
+    }
203
+    .header.transparent li.active:before,
204
+    .header.transparent li:hover:before {
205
+      
206
+      background: #4e84ff;
207
+      opacity:0.7326;
208
+    }
209
+    body {
210
+      background: #0a0f2c
211
+    }
212
+
213
+    .header {
214
+      z-index: 2
215
+    }
216
+    body,
217
+    html {
218
+      height: 100%
219
+    }
220
+</style>
221
+
222
+

+ 29
- 4
src/components/commonComponents/headerTab.vue 查看文件

@@ -7,9 +7,10 @@
7 7
       <el-col :span="12">
8 8
         <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect" >
9 9
           <el-menu-item index="1">
10
-            <div class="nav_tittle1">
10
+            <div class="tittle">
11
+              <div class="nav_tittle">
11 12
               <span>首页</span>
12
-              
13
+            </div>
13 14
             </div>
14 15
           </el-menu-item>
15 16
           <el-menu-item index="2">
@@ -132,7 +133,7 @@ export default {
132 133
   border: none;
133 134
 }
134 135
 .header-tab .el-menu {
135
-  padding-left: 30px;
136
+  /* padding-left: 30px; */
136 137
   background-color: transparent;
137 138
 }
138 139
 
@@ -147,9 +148,33 @@ export default {
147 148
   padding: 0;
148 149
   margin: 0 20px;
149 150
   color: #fff;
151
+  background-color: rgba(0,0,0,0);
150 152
 }
151 153
 .logo {
152 154
   height: 35px;
153 155
 }
154
-
156
+.header-tab .el-menu--horizontal > .el-menu-item:hover{
157
+  width: 80px;
158
+  /* margin: auto; */
159
+  
160
+}
161
+@keyframes slide{
162
+  from {
163
+    /* margin: auto; */
164
+    width: 0;
165
+  }
166
+  to{
167
+    /* margin: auto; */
168
+    width: 80px;
169
+  }
170
+}
171
+.tittle{
172
+  width: 80px;
173
+}
174
+.nav_tittle:hover {
175
+  width: 80px;
176
+  margin: auto;
177
+  background: linear-gradient(to bottom, rgba(0,0,0,0) 50%, #4e84ff 50%); 
178
+  animation: slide 0.5s ;
179
+}
155 180
 </style>

+ 7
- 7
src/components/pages/index.vue 查看文件

@@ -3,8 +3,8 @@
3 3
     <div class="section" :style="{'height':offsetheight+'px'}">
4 4
       <headerTab></headerTab>
5 5
       <div class="container" :style="{'transform': 'translate3d(0px,-'+ fullPage*offsetheight +'px, 0px)'}">
6
-        <div class="page-1 page">
7
-          <div class="part-1" :class="page1 == true ? 'animated bounceInLeft' :''">
6
+        <div class="page-1 page fp-auto-height">
7
+          <div class="part-1" :class="page1 == true ? 'animated zoomIn 3s' :''">
8 8
             <p class="part1-tit">荟房智慧管家</p>
9 9
             <span>智慧案场</span>
10 10
             <span>迎宾系统</span>
@@ -13,11 +13,11 @@
13 13
             <p class="part1-tip">银城旗下品牌</p>
14 14
           </div>
15 15
         </div>
16
-        <div class="page-2">
16
+        <div class="page-2 fp-auto-height">
17 17
           <p class="title">一站式解决方案</p>
18 18
           <img :class="page2 == true ? 'animated flipInX' :''" src="../../assets/image/home/littleImg/second.png" alt>
19 19
         </div>
20
-        <div class="page-3">
20
+        <div class="page-3 fp-auto-height">
21 21
           <p class="title">产品简介</p>
22 22
           <div class="produce">
23 23
             <div class="list first" :class="page3 == true ? 'animated bounceInLeft' :''">
@@ -42,7 +42,7 @@
42 42
             </div>
43 43
           </div>
44 44
         </div>
45
-        <div class="page-4">
45
+        <div class="page-4 fp-auto-height">
46 46
           <div class="page-4-con">
47 47
             <el-carousel :interval="4000" type="card" height="500px" indicator-position="none" arrow="never">
48 48
               <el-carousel-item>
@@ -72,7 +72,7 @@
72 72
             </el-carousel>
73 73
           </div>
74 74
         </div>
75
-        <div class="page-5">
75
+        <div class="page-5 fp-auto-height">
76 76
           <p class="title">我们的客户</p>
77 77
           <div class="logo-box">
78 78
             <img src="../../assets/image/home/logo/Group29.png" alt>
@@ -289,7 +289,7 @@ export default {
289 289
     background: url("../../assets/image/home/background/Group26.jpg") no-repeat
290 290
       center;
291 291
     width: 100%;
292
-    height: 100%;
292
+    height: 1080px;
293 293
     background-size: 100% 100%;
294 294
     color: #fff;
295 295
     .title {

+ 9
- 0
src/router/index.js 查看文件

@@ -19,6 +19,8 @@ import newsInformation from '@/components/pages/newsInformation/newsInformation'
19 19
 
20 20
 import aboutUs from '@/components/pages/aboutUs/aboutUs' // 关于我们
21 21
 
22
+import headerNav from '@/components/commonComponents/headerNav' 
23
+
22 24
 Vue.use(Router)
23 25
 
24 26
 export default new Router({
@@ -90,6 +92,13 @@ export default new Router({
90 92
       name: 'aboutUs',
91 93
       component: aboutUs
92 94
     },
95
+
96
+
97
+    {
98
+      path: '/headerNav',
99
+      name: 'headerNav',
100
+      component: headerNav
101
+    },
93 102
  
94 103
   ]
95 104
 })