dengjie commit : header区修改样式

This commit is contained in:
clay
2022-10-06 15:59:33 +08:00
parent c019214c7c
commit 18f1083182
8 changed files with 194 additions and 186 deletions

183
package-lock.json generated
View File

@@ -1786,50 +1786,12 @@
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"big.js": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz",
"integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==",
"dev": true
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"css-select": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/css-select/-/css-select-4.2.1.tgz",
@@ -1883,13 +1845,6 @@
"integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=",
"dev": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"html-webpack-plugin": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz",
@@ -1973,16 +1928,6 @@
"ansi-regex": "^2.0.0"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"util.promisify": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz",
@@ -1992,53 +1937,6 @@
"define-properties": "^1.1.2",
"object.getownpropertydescriptors": "^2.0.3"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"big.js": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
"dev": true,
"optional": true
},
"emojis-list": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
"dev": true,
"optional": true
},
"json5": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
}
}
}
}
},
@@ -12364,6 +12262,87 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.3.tgz",

BIN
src/assets/header/logob.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
src/assets/header/logol.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

55
src/test.html Normal file
View File

@@ -0,0 +1,55 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<style>
.sticky header {
position: sticky;
background: linear-gradient(180deg, #0A51AE 0%, rgba(25,84,167,0.9) 56%, rgba(21,82,167,0.7) 69%, rgba(16,80,168,0.4) 85%, rgba(11,81,173,0) 100%);
width: 120rem;
top: 0;
/*font-size: 20px;*/
/*padding: 10px;*/
z-index: 1;
/*margin: 0 auto;*/
display: flex;
justify-content: center;
align-content: center;
}
/*.sticky shadow::before {*/
/* content: '';*/
/* box-shadow: 0 0 10px 1px #333;*/
/* position: fixed;*/
/* width: 100%;*/
/*}*/
/*.sticky shadow::after {*/
/* content: '';*/
/* width: 100%;*/
/* height: 15px;*/
/* background-color: #fff;*/
/* position: absolute;*/
/* top: 0;*/
/*}*/
.sticky main {
height: 1800px;
/*padding-top: 10px;*/
line-height: 200%;
}
</style>
<title>Document</title>
</head>
<body>
<div class='sticky'>
<header>LOGO</header>
<!-- <shadow></shadow>-->
<main>很多内容文本</main>
</div>
</body>
</html>

View File

@@ -1,69 +1,31 @@
<template>
<div style="background: linear-gradient(180deg, rgba(61, 96, 163, 0.91) 0%, rgba(61, 96, 163, 0.64) 35%, rgba(61, 96, 163, 0.42) 65%, rgba(73, 133, 234, 0.33) 77%, rgba(73, 133, 234, 0.02) 100%);
">
<div class="header">
<!--头部部分-->
<!-- <div class="top">-->
<!-- <el-row>-->
<!-- <el-col :span="2">-->
<!-- <div class="link">-->
<!-- {{ $t('message.student') }}-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :span="2">-->
<!-- <div class="link">-->
<!-- {{ $t('message.staff') }}-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :span="2">-->
<!-- <div class="link">-->
<!-- {{ $t('message.alumni') }}-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :span="2">-->
<!-- <div class="link">-->
<!-- {{ $t('message.examine') }}-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :span="3">-->
<!-- <div class="link">-->
<!-- {{ $t('message.services_portal') }}-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :span="11">-->
<!-- <div style="width: 10px;height: 10px;"></div>-->
<!-- </el-col>-->
<!-- <el-col :offset="11" :span="2">-->
<!-- <div class="switchLang" @click="switchLang">{{ $t('message.switch') }}</div>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </div>-->
<div id="header_bgc" style="background: linear-gradient(180deg, #0A51AE 0%, rgba(25,84,167,0.9) 56%, rgba(21,82,167,0.7) 69%, rgba(16,80,168,0.4) 85%, rgba(11,81,173,0) 100%);">
<div class="header" id="header">
<!--导航部分-->
<div class="bottom">
<el-row>
<!-- <el-col v-show="width" :span="1">-->
<!-- <div class="grid-content"></div>-->
<!-- </el-col>-->
<div class="bottom-div" style="margin-left: 1rem;">
<el-col v-show="width" :xs="1" :sm="1" :md="4" :lg="4" :xl="5">
<div class="icon">
<!-- <div class="icont"><img src="@/assets/header/logo@2x.png" alt=""></div>-->
<div class="icont"><img src="@/assets/header/sy_logo1@2x.png" alt=""></div>
<div class="icont" :style="{display:logoOne}"><img src="@/assets/header/logob.png" alt=""></div>
<div class="icont" :style="{display:logoTwo}"><img src="@/assets/header/logol.png" alt=""></div>
<!-- <div class="iconb"><img src="@/assets/header/sy_logo2@2x.png" alt=""></div>-->
</div>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="19" :xl="19">
<div class="banner">
<router-link to="/home">
<router-link to="/home" v-bind:style="{color:link_color}">
<div class="link_text">
<div v-show="$i18n.locale === 'cn'" class="link_text_title cn_title">首页</div>
<div v-show="$i18n.locale === 'cn'" class="link_text_title cn_title">首页</div>
<div v-show="$i18n.locale === 'en'" class="link_text_title en_title">Home</div>
</div>
</router-link>
<span v-for="(menu,index) in menuData" :key="index">
<!-- v-if="menu.displayType == 1 ||($i18n.locale === 'cn'&& menu.displayType == 3)||($i18n.locale === 'en'&& menu.displayType == 2)">-->
<div class="link_text" v-if="menu.displayType != 4">
<div class="link_text_title">
<div class="link_text" id="link_text" v-if="menu.displayType != 4" v-bind:style="{color:link_color}">
<div class="link_text_title" >
<span class="cn_title" v-if="menu.displayType == 3 || menu.displayType == 1"
v-show="$i18n.locale === 'cn'">{{ menu.title }}</span>
<span class="en_title"v-if="menu.displayType == 2 || menu.displayType == 1"
@@ -119,9 +81,36 @@ export default {
width: document.documentElement.clientWidth >= 1200,
pc: document.documentElement.clientWidth > 992,
menuData: [],
link_color:'#C5DCFE',
logoOne:'block',
logoTwo:'none'
}
},
mounted() {
let Head = document.getElementById('header')
let header_bgc = document.getElementById('header_bgc')
// let link_text = document.getElementById('link_text') 为啥不能更改
window.onscroll = ()=>{
// 获取滚动距离
let top = document.documentElement.scrollTop || document.body.scrollTop;
if (top !== 0) {
Head.style = "position: fixed;top: 0;background-color: #fff;"
header_bgc.style= "position: fixed;top: 0;background-color: #fff;box-shadow: 0px 1px 3px 0px rgba(8,57,122,0.18);"
this.link_color='#0A51AE'
this.logoOne='none'
this.logoTwo='block'
// // link_text.style="color:#fff;"
// link_text.addClass('active')
}else if(top === 0){
Head.style = "position: static;"
header_bgc.style= "position: static;background: linear-gradient(180deg, #0A51AE 0%, rgba(25,84,167,0.9) 56%, rgba(21,82,167,0.7) 69%, rgba(16,80,168,0.4) 85%, rgba(11,81,173,0) 100%);"
this.link_color='#C5DCFE'
this.logoOne='block'
this.logoTwo='none'
}
}
const that = this
window.onresize = () => {
return (() => {
@@ -165,6 +154,10 @@ export default {
</script>
<style scoped lang="scss">
.active{
color: red;
}
.cn_title{
padding: 0 0.7rem;
}
@@ -184,39 +177,18 @@ export default {
height: 2.6rem;
}
}
#header_bgc{
width: 100%;
height: 7.6rem;
display: flex;
justify-content: center;
align-content: center;
}
.header {
//width: 100rem;
width: 124rem;
margin: 0 auto;
.top {
font-size: 1.2rem;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
text-align: center;
width: 100%;
height: 3rem;
//background: #1956BC;
.switchLang {
cursor: pointer;
font-size: 1.6rem;
}
.link {
line-height: 2.2rem;
width: 80%;
margin: .4rem auto;
border-radius: 1.1rem;
}
.link:hover {
background: rgba(255, 255, 255, 0.7);
}
}
width: 124rem;
z-index: 9999;
.bottom {
height: 7.6rem;
//height: 11rem;
@@ -224,7 +196,7 @@ export default {
border-radius: 0rem 0rem 2rem 2rem;
.icon {
margin-left: 1rem;
margin-left: 4rem;
div {
margin-top: 2.4rem;
@@ -234,7 +206,7 @@ export default {
.icont {
img {
// todo logo有问题
width: 23.3rem;
width: 16rem;
//width: 15rem;
}
}
@@ -249,7 +221,8 @@ export default {
.banner {
a {
text-decoration: none;
color: #ffffff;
//color: #ffffff;
//color: #C5DCFE;
}
width: 100%;
@@ -265,7 +238,8 @@ export default {
font-size: 1.6rem;
font-family: "微软雅黑";
font-weight: 400;
color: #C5DCFE;
//color: red!important;
cursor: pointer;
display: flex;
align-items: center;
@@ -273,11 +247,10 @@ export default {
vertical-align: middle;
}
.link_text_title {
.link_text_title {
position: relative;
}
.secondary {
display: none;
width: 25rem;

View File

@@ -135,6 +135,7 @@ export default {
pageNum: 1,
pageSize: 9
}).then(res => {
console.log(res.rows);
this.academyData = res.rows;
});
},