webs/驭鑫/new yxsilicon/css/header.css

282 lines
5.4 KiB
CSS
Raw Normal View History

.header{
width: 100%;
height: 12vh;
/* background: palegoldenrod; */
display: flex;
align-items: center;
justify-content: space-between;
box-shadow: 0 0 10px 10px rgba(0, 0, 0, 0.1);
}
.logo{
width: 30%;
height: 100%;
/* background: palegoldenrod; */
display: flex;
align-items: center;
padding-left: 10vw;
}
.logo img{
width: 3vw;
height: auto;
}
.nav{
width: 60%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
padding-right: 6vw;
/* background: palegoldenrod; */
}
.nav-list{
width: 100%;
height: 50%;
display: flex;
align-items: center;
justify-content: space-around;
/* background: paleturquoise; */
}
.nav-item{
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.nav-item a{
color: #9CA0A1;
font-size: 0.9vw;
position: relative;
text-decoration: none;
display: inline-block;
}
.nav-item a.active {
color: #00a0d1;
}
.nav-item a.active::before {
content: '';
width: 100%;
height: 1px;
background: #00a0d1;
position: absolute;
bottom: -5px; /* 修改这行,调整下划线位置 */
left: 0;
display: block; /* 添加这行,确保伪元素显示 */
}
.nav-item a:hover{
color: #00a0d1;
}
/* 下拉菜单 */
.nav-dropdown {
position: relative;
}
.arrow {
margin-left: 4px;
font-size: 0.8em;
}
.dropdown-menu li {
padding: 0;
}
.dropdown-menu li a {
display: flex;
align-items: center;
padding: 10px 24px;
color: #00a0d1;
font-size: 1em;
white-space: nowrap;
transition: background 0.2s;
display: flex;
align-items: center;
justify-content: space-between;
}
.dropdown-menu li a:hover {
background: #f2f8fa;
color: #007a9e;
}
.dropdown-mask {
display: none;
position: fixed;
z-index: 1000;
left: 0; top: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.08);
}
/* 下拉激活时显示 */
.nav-dropdown.open .dropdown-menu {
display: block;
}
.dropdown-mask.active {
display: block;
}
.arrow {
display: inline-block;
margin-left: 6px;
width: 0;
height: 0;
vertical-align: middle;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #00a0d1;
transition: transform 0.2s;
}
.nav-dropdown.open .arrow {
transform: rotate(180deg);
}
/* 下拉菜单动画 */
.dropdown-menu {
display: block; /* 让动画生效实际用visibility控制显示 */
opacity: 0;
transform: translateY(10px);
visibility: hidden;
pointer-events: none;
transition: opacity 0.25s cubic-bezier(.4,0,.2,1),
transform 0.25s cubic-bezier(.4,0,.2,1),
visibility 0.25s;
position: absolute;
top: 10vh;
left: 0;
min-width:25vw;
background: #fff;
box-shadow: 0 4px 24px rgba(0,0,0,0.12);
border-radius: 8px;
z-index: 1001;
padding: 12px 0;
}
.nav-dropdown.open .dropdown-menu {
opacity: 1;
transform: translateY(0);
visibility: visible;
pointer-events: auto;
}
.dropdown-item{
width: 1.6vw;
height: 1.6vw;
border-radius: 50%;
background: #00a0d1;
display: flex;
align-items: center;
justify-content: center;
padding: 0.1vw;
/* border: 1px solid #00a0d1; */
transition: all 0.2s;
}
.dropdown-item img{
width: 50%;
height: auto;
}
/* hover 时去掉背景色,加边框 */
.dropdown-menu li:hover .dropdown-item {
background: transparent;
border: 1px solid #00a0d1;
}
.dropdown-menu li:hover .dropdown-item img {
filter: brightness(0) saturate(100%) invert(41%) sepia(99%) saturate(749%) hue-rotate(162deg) brightness(97%) contrast(101%);
transition: all 0.3s ease;
}
/* 联系我们 */
.contactUs{
background: linear-gradient(90deg, #36c6f0 0%, #1a6dc5 100%);
border-radius: 30px;
transition: box-shadow 0.2s, background 0.3s,transform 0.2s;
}
.contactUs:focus,
.contactUs:hover {
box-shadow: 0 8px 24px rgba(26, 109, 197, 0.22);
background: linear-gradient(100deg, #4fd7fa 0%, #2a7be0 100%);
transform: translateY(-2px) scale(1.03);
}
.contactUs .contactUs-email {
transition:
box-shadow 0.2s,
background 0.2s,
transform 0.2s;
}
.contactUs:focus .contactUs-email,
.contactUs:hover .contactUs-email {
background: #e6f7ff;
box-shadow: 0 0 0 4px rgba(54,198,240,0.15);
transform: scale(1.12) rotate(-6deg);
}
.contactUs a{
color: #fff;
display: inline-block;
display: flex;
align-items: center;
justify-content: space-between;
}
.contactUs a span {
transition: color 0.2s, font-weight 0.2s;
}
.contactUs:focus a span,
.contactUs:hover a span {
color: #fff;
font-weight: 600;
}
.contactUs-email{
display: flex;
align-items: center;
justify-content: center;
width: 1.6vw;
height: 1.6vw;
border-radius: 50%;
background: #fff;
margin-left: 1vw;
}
.contactUs-email img{
width: 60%;
height: auto;
}
2025-05-22 02:58:44 +00:00
.menu-active .dropdown-item {
background: transparent;
border: 1px solid #00a0d1
}
.menu-active .dropdown-item img {
filter: brightness(0) saturate(100%) invert(41%) sepia(99%) saturate(749%) hue-rotate(162deg) brightness(97%) contrast(101%);
transition: all 0.3s ease;
}
.dropdown-menu li a.menu-active {
background: #f2f8fa;
color: #007a9e;
}