feat 样式整改
This commit is contained in:
@@ -61,59 +61,92 @@ onBeforeUnmount(stopAutoplay)
|
||||
|
||||
<template>
|
||||
<section class="home-banner">
|
||||
<div class="home-banner__carousel" aria-hidden="true">
|
||||
<div
|
||||
v-for="(src, index) in slides"
|
||||
:key="`${src}-${index}`"
|
||||
class="home-banner__slide"
|
||||
:class="{ 'home-banner__slide--active': index === activeIndex }"
|
||||
>
|
||||
<img
|
||||
class="home-banner__image"
|
||||
:class="{ 'home-banner__image--inline': !hasBanners }"
|
||||
:src="src"
|
||||
alt=""
|
||||
<div class="home-banner__stage">
|
||||
<div class="home-banner__carousel" aria-hidden="true">
|
||||
<div
|
||||
v-for="(src, index) in slides"
|
||||
:key="`${src}-${index}`"
|
||||
class="home-banner__slide"
|
||||
:class="{ 'home-banner__slide--active': index === activeIndex }"
|
||||
>
|
||||
<img
|
||||
class="home-banner__image"
|
||||
:class="{ 'home-banner__image--inline': !hasBanners }"
|
||||
:src="src"
|
||||
alt=""
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="home-banner__inner">
|
||||
<h1 class="home-banner__title">虫子智造研发一体化平台</h1>
|
||||
<p class="home-banner__subtitle">一站式智能软硬件研发与量产综合服务商</p>
|
||||
<div class="home-banner__inner">
|
||||
<h1 class="home-banner__title">
|
||||
虫子智造研发一体化平台
|
||||
</h1>
|
||||
<p class="home-banner__subtitle">
|
||||
一站式智能软硬件研发与量产综合服务商
|
||||
</p>
|
||||
|
||||
<div class="home-banner__actions">
|
||||
<button class="home-banner__btn home-banner__btn--primary" type="button" @click="goDemand">
|
||||
需求提报
|
||||
</button>
|
||||
<button class="home-banner__btn home-banner__btn--ghost" type="button" @click="goCases">
|
||||
案例中心
|
||||
</button>
|
||||
<div class="home-banner__actions">
|
||||
<button
|
||||
class="home-banner__btn home-banner__btn--primary"
|
||||
type="button"
|
||||
@click="goDemand"
|
||||
>
|
||||
需求提报
|
||||
</button>
|
||||
<button
|
||||
class="home-banner__btn home-banner__btn--ghost"
|
||||
type="button"
|
||||
@click="goCases"
|
||||
>
|
||||
案例中心
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="slides.length > 1" class="home-banner__dots" role="tablist" aria-label="头图轮播">
|
||||
<button
|
||||
v-for="(_, index) in slides"
|
||||
:key="index"
|
||||
class="home-banner__dot"
|
||||
:class="{ 'home-banner__dot--active': index === activeIndex }"
|
||||
type="button"
|
||||
role="tab"
|
||||
:aria-selected="index === activeIndex"
|
||||
@click="goTo(index)"
|
||||
/>
|
||||
<div
|
||||
v-if="slides.length > 1"
|
||||
class="home-banner__dots"
|
||||
role="tablist"
|
||||
aria-label="头图轮播"
|
||||
>
|
||||
<button
|
||||
v-for="(_, index) in slides"
|
||||
:key="index"
|
||||
class="home-banner__dot"
|
||||
:class="{ 'home-banner__dot--active': index === activeIndex }"
|
||||
type="button"
|
||||
role="tab"
|
||||
:aria-selected="index === activeIndex"
|
||||
@click="goTo(index)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.home-banner {
|
||||
position: relative;
|
||||
height: 661px;
|
||||
overflow: hidden;
|
||||
background: @home-banner-bg;
|
||||
width: 100%;
|
||||
flex: 0 0 auto;
|
||||
padding: @spacing-lg @home-gutter 0;
|
||||
box-sizing: border-box;
|
||||
background: transparent;
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
padding: @spacing-lg @spacing-lg 0;
|
||||
}
|
||||
|
||||
&__stage {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: @home-content;
|
||||
height: 420px;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
border-radius: @radius-base;
|
||||
background: @home-banner-bg;
|
||||
}
|
||||
|
||||
&__carousel {
|
||||
position: absolute;
|
||||
@@ -138,15 +171,14 @@ onBeforeUnmount(stopAutoplay)
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
|
||||
// 内置插图:按设计稿定位与尺寸原样显示,不铺满
|
||||
&--inline {
|
||||
position: absolute;
|
||||
top: 31px;
|
||||
right: 269px;
|
||||
top: 24px;
|
||||
right: 48px;
|
||||
left: auto;
|
||||
bottom: auto;
|
||||
width: 723px;
|
||||
height: 598px;
|
||||
width: 420px;
|
||||
height: 348px;
|
||||
margin-left: auto;
|
||||
object-fit: contain;
|
||||
}
|
||||
@@ -156,50 +188,48 @@ onBeforeUnmount(stopAutoplay)
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
max-width: @container-width;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&__title {
|
||||
position: absolute;
|
||||
top: 184px;
|
||||
left: 150px;
|
||||
top: 96px;
|
||||
left: 64px;
|
||||
margin: 0;
|
||||
color: @banner-title-color;
|
||||
font-size: @font-size-hero-lg;
|
||||
font-size: @font-size-hero;
|
||||
font-weight: 700;
|
||||
line-height: 87px;
|
||||
line-height: 1.25;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__subtitle {
|
||||
position: absolute;
|
||||
top: 287px;
|
||||
left: 150px;
|
||||
top: 168px;
|
||||
left: 64px;
|
||||
margin: 0;
|
||||
color: @banner-title-color;
|
||||
font-size: 24px;
|
||||
font-size: @font-size-lg;
|
||||
font-weight: 500;
|
||||
line-height: 35px;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__actions {
|
||||
position: absolute;
|
||||
top: 392px;
|
||||
left: 150px;
|
||||
top: 232px;
|
||||
left: 64px;
|
||||
.flex(row, flex-start, center);
|
||||
gap: 20px;
|
||||
gap: @spacing-base;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
&__btn {
|
||||
width: 183px;
|
||||
height: 55px;
|
||||
border-radius: 8px;
|
||||
font-size: 18px;
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
border-radius: @radius-base;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
@@ -220,7 +250,7 @@ onBeforeUnmount(stopAutoplay)
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 8px;
|
||||
border-radius: @radius-base;
|
||||
padding: 2px;
|
||||
background: linear-gradient(135deg, @btn-gradient-from 0%, @btn-gradient-to 100%);
|
||||
-webkit-mask:
|
||||
@@ -238,16 +268,17 @@ onBeforeUnmount(stopAutoplay)
|
||||
|
||||
&__dots {
|
||||
position: absolute;
|
||||
left: 929px;
|
||||
top: 594px;
|
||||
left: 50%;
|
||||
bottom: @spacing-base;
|
||||
z-index: 1;
|
||||
.flex(row, flex-start, center);
|
||||
gap: 13px;
|
||||
.flex(row, center, center);
|
||||
gap: @spacing-sm;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
&__dot {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
@@ -255,7 +286,7 @@ onBeforeUnmount(stopAutoplay)
|
||||
cursor: pointer;
|
||||
|
||||
&--active {
|
||||
width: 44px;
|
||||
width: 28px;
|
||||
border-radius: 3px;
|
||||
background: @home-banner-dot;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user