/* scss中可以用mixin来扩展 */ @mixin ellipsis($line: 1) { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: $line; -webkit-box-orient: vertical; } .section-title { position: relative; text-align: center; height: 66px; img { display: block; height: 50px; margin: 0 auto; } h3 { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); font-size: 34px; font-weight: normal; } } // 轮播图 .banner { width: 100%; height: 700px; img { display: block; height: 100%; } } .main { .container { margin-top: 120px; .section-title { margin-bottom: 80px; } &.our-brand { .content { .item { position: relative; width: 286px; height: 286px; float: left; background-color: #ddd; &:first-child { width: 592px; height: 592px; } img { display: block; width: 100%; height: 100%; } &:hover { .active { opacity: 1; } } .active { opacity: 0; position: absolute; left: 0; top: 0; z-index: 2; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; flex-direction: column; background-color: rgba(0, 0, 0, 0.5); transition: opacity 0.4s; .title { font-size: 34px; color: #fff; } .line { width: 40px; height: 1px; margin: 32px 0 60px; background-color: #fff; } .link { width: 160px; height: 48px; border: 1px solid #ffffff; text-align: center; line-height: 48px; color: #fff; cursor: pointer; } } } } } &.brand-activity { .content { display: flex; justify-content: center; .item { position: relative; width: 280px; height: 600px; overflow: hidden; flex-shrink: 0; transition: all 0.4s; a { display: block; width: 100%; height: 100%; } img { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: block; width: 640px; height: 600px; } &.hover { width: 640px; } &:nth-child(1) { .cover { &::after { content: '01'; } } } &:nth-child(2) { .cover { &::after { content: '02'; } } } &:nth-child(3) { .cover { &::after { content: '03'; } } } .active { position: absolute; width: 100%; height: 280px; bottom: 0; left: 0; box-sizing: border-box; padding-left: 24px; background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0)); .title { margin-top: 206px; width: 232px; font-size: 24px; color: #fff; @include ellipsis(1); } .line { width: 20px; height: 2px; margin-top: 16px; background-color: #fff; } .description { display: none; } &::after { position: absolute; content: '01'; background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0.2)); -webkit-background-clip: text; color: transparent; font-size: 30px; left: 24px; bottom: 66px; } } .hover-active { position: absolute; width: 486px; height: 160px; padding-top: 32px; padding-left: 32px; box-sizing: border-box; border-top-left-radius: 32px; right: 0; bottom: 0; background: linear-gradient(166deg, #0688d2 25%, rgba(32, 155, 212, 0.8)); transition: opacity 0.4s; .title { font-size: 24px; color: #fff; width: 300px; @include ellipsis(1); } .line { width: 20px; height: 2px; margin: 16px 0 22px; background-color: #fff; } .description { text-align: justify; width: 300px; font-size: 16px; color: #fff; line-height: 1.5; @include ellipsis(2); } &::after { position: absolute; content: '01'; background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0.2)); -webkit-background-clip: text; color: transparent; font-size: 90px; line-height: 90px; right: 32px; bottom: 24px; } } } } } &.company-values { .content { .item { position: relative; float: left; height: 340px; width: 390px; margin-right: 15px; margin-bottom: 15px; box-sizing: border-box; overflow: hidden; img { width: 100%; height: 100%; opacity: 1; transition: all 0.4s; } &.no-mb { margin-bottom: 0; } &.no-mr { margin-right: 0; } &:nth-child(1), &:nth-child(7) { width: 795px; } &:hover { img { transform: scale(1.2); } } &:nth-child(2), &:nth-child(3), &:nth-child(7) { .cover { background: transparent; } &:hover { border: 1px solid #0688d2; img { opacity: 0; } .subtitle, .title { color: #0688d2; } .line { &::before, &::after { background-color: #0688d2; } } } } .cover { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; justify-content: center; flex-direction: column; align-items: center; background: rgba(0, 0, 0, 0.5); .line { width: 180px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotateZ(-45deg); &::after, &::before { position: absolute; left: 0; top: 0; content: ''; display: block; width: 20px; height: 1px; background-color: #fff; } &::before { right: 0; left: unset; } } .title { color: #fff; font-size: 24px; } .subtitle { font-size: 18px; color: #fff; margin-top: 12px; &.en { text-transform: uppercase; } } } } } } &.head_quarter { } &.friendly_link { .content { .item { float: left; position: relative; width: 230px; height: 100px; box-sizing: border-box; border: 1px solid #d8d8d8; overflow: hidden; margin-right: 12px; margin-top: 20px; &:nth-child(5n) { margin-right: 0; } &:nth-child(-n + 5) { margin-top: 0; } img { display: block; width: 100%; position: absolute; left: 0; top: 50%; transform: translateY(-50%); } } } } } }