style: slogan区域移动端样式

This commit is contained in:
2026-03-18 10:22:24 +08:00
parent f2c265e4e7
commit ec4ba64030

View File

@@ -1,9 +1,5 @@
<template> <template>
<div <div class="blocks-list flex" ref="root" :class="{ 'in-view': inView }">
class="blocks-list flex"
ref="root"
:class="{ 'in-view': inView }"
>
<div <div
class="block-item flex flex-col flex-center" class="block-item flex flex-col flex-center"
v-for="(item, idx) in blocksList" v-for="(item, idx) in blocksList"
@@ -47,7 +43,7 @@
onMounted(() => { onMounted(() => {
io = new IntersectionObserver( io = new IntersectionObserver(
entries => { (entries) => {
for (const entry of entries) { for (const entry of entries) {
if (entry.isIntersecting) { if (entry.isIntersecting) {
// 延迟 0.5s 后触发动画并断开观察 // 延迟 0.5s 后触发动画并断开观察
@@ -153,4 +149,132 @@
height: 27.4rem; height: 27.4rem;
} }
} }
/* 移动端 <= 1200px 四宫格布局 */
@media (max-width: 1200px) {
.blocks-list {
height: auto;
flex-wrap: wrap;
padding: 2rem 1.5rem;
column-gap: 0;
row-gap: 0;
.block-item {
flex: none;
width: 50%;
height: 18rem;
padding: 2rem 1rem;
box-sizing: border-box;
.number {
font-size: 2.8rem;
}
.label {
font-size: 1.8rem;
}
.line {
display: none;
}
&:nth-child(1)::after,
&:nth-child(2)::after,
&:nth-child(3)::after {
content: '';
position: absolute;
background-color: #8d8d8d;
}
/* 第一行的两个item底部需要分隔线 */
&:nth-child(1)::after,
&:nth-child(2)::after {
bottom: 0;
left: 0;
width: 100%;
height: 0.1rem;
}
/* 第一个item右侧需要分隔线 */
&:nth-child(1)::before {
content: '';
position: absolute;
right: 0;
top: 0;
height: 100%;
width: 0.1rem;
background-color: #8d8d8d;
}
&:nth-child(4)::before {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0.1rem;
height: 100%;
background-color: #8d8d8d;
transform: translateX(-100%);
}
}
}
.in-view {
.block-item {
&:nth-child(1)::before {
transform-origin: bottom;
transform: scaleY(0);
animation: growUp 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
animation-delay: calc(var(--delay) + 0.5s);
}
&:nth-child(1)::after {
transform-origin: right;
transform: scaleX(0);
animation: growRight 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
animation-delay: calc(var(--delay) + 0.5s);
}
&:nth-child(2)::after {
transform-origin: left;
transform: scaleX(0);
animation: growLeft 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
animation-delay: calc(var(--delay) + 0.5s);
}
&:nth-child(4)::before {
transform: translateX(-100%) scaleY(0);
transform-origin: top;
animation: growDown 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
animation-delay: calc(var(--delay) + 0.5s);
}
}
}
@keyframes growUp {
0% {
transform: scaleY(0);
}
100% {
transform: scaleY(1);
}
}
@keyframes growDown {
0% {
transform: translateX(-100%) scaleY(0);
}
100% {
transform: translateX(-100%) scaleY(1);
}
}
@keyframes growLeft {
0% {
transform: scaleX(0);
}
100% {
transform: scaleX(1);
}
}
@keyframes growRight {
0% {
transform: scaleX(0);
}
100% {
transform: scaleX(1);
}
}
}
</style> </style>