css实现信封墙拆信封效果代码

代码语言:html

所属分类:布局界面

代码描述:css实现信封墙拆信封效果代码

代码标签: 墙拆 信封 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
  
  
  
<style>
@charset "UTF-8";
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  position: relative;
}

*::before,
*::after {
  content: "";
  display: block;
  position: absolute;
}

h1 {
  font-size: 1.25rem;
  text-align: center;
  padding: 6vh;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
}

body {
  background: #f3e0d4;
}
body .wrapper {
  width: 100%;
  margin: auto;
  padding: 8%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  grid-auto-rows: 3rem;
  grid-row-gap: 3rem;
}

.envelope {
  list-style: none;
  width: 6rem;
  height: 4rem;
  background: blue;
}
.envelope::before {
  width: 6rem;
  height: 2.4rem;
  top: 0;
  left: 0;
  transform-origin: 0% 0%;
  transition: all 0.5s ease-out;
}

.card {
  width: 5rem;
  height: 1rem;
  left: 0.5rem;
  bottom: 3rem;
}
.card::after {
  width: 3rem;
  height: 1.6rem;
  background: #fffefc;
  bottom: 1rem;
  left: 1rem;
  transition: all 3s;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 0.2em;
  font-size: 1.25rem;
}
.card::before {
  height: 0rem;
  width: 6rem;
  left: -0.5rem;
  bottom: -2rem;
  z-index: 2;
}

details[open] .envelope::before {
  transform: rotateX(180deg);
}
details[open] .card::after {
  animation: open 1.5s ease-in-out;
}
details[open] .card::before {
  animation: disappear .8s ease-in-out;
}

details:nth-of-type(6n+1) .envelope {
  background: linear-gradient(transparent 1%, #6a8e53 2%, transparent 5%), linear-gradient(-147deg, #769e5c 50%, transparent 40%) no-repeat 0 0/3rem 2rem, linear-gradient(147deg, #769e5c 50%, transparent 40%) no-repeat 3rem 0/3rem 2rem, linear-gradient(-33deg, #91b27b 67%, #769e5c 68% 69%, transparent 69%) no-repeat 0 2rem/3rem 4rem, linear-gradient(33deg, #91b27b 67%, #769e5c 68% 69%, transparent 69%) no-repeat 3rem 2rem/3rem 4rem, linear-gradient(-33deg, #91b27b 50%, transparent 52%), linear-gradient(33deg, #91b27b 50%, transparent 52%);
}
details:nth-of-type(6n+1) .envelope::before {
  background: linear-gradient(33deg, transparent 50%, #769e5c 50%) 0 0/3rem 2.4rem, linear-gradient(-33deg, transparent 50%, #769e5c 50%) 3rem 0/3rem 2.4rem;
  background-repeat: no-repeat;
}
details:nth-of-type(6n+1) .card {
  background: linear-gradient(33deg, #91b27b 38%, transparent 39%), linear-gradient(-33deg, transparent 38%, #fffefc 39%);
}
details:nth-of-type(6n+1) .card::before {
  background: linear-gradient(-33deg, #91b27b 67%, #769e5c 68% 69%, transparent 69%) no-repeat 0 2rem/3rem 4rem, linear-gradient(33deg, #91b27b 67%, #769e5c 68% 69%, transparent 69%) no-repeat 3rem 2rem/3rem 4rem, linear-gradient(-33deg, #91b27b 50%, transparent 52%), linear-gradient(33deg, #91b27b 50%, transparent 52%);
}

details:nth-of-type(6n+2) .envelope {
  background: linear-gradient(transparent 1%, #016c82 2%, transparent 5%), linear-gradient(-147deg, #01819b 50%, transparent 40%) no-repeat 0 0/3rem 2rem, linear-gradient(147deg, #01819b 50%, transparent 40%) no-repeat 3rem 0/3rem 2rem, linear-gradient(-33deg, #01ABCE 67%, #01819b 68% 69%, transparent 69%) no-repeat 0 2rem/3rem 4rem, linear-gradient(33deg, #01ABCE 67%, #01819b 68% 69%, transparent 69%) no-repeat 3rem 2rem/3rem 4rem, linear-gradient(-33deg, #01ABCE 50%, transparent 52%), linear-gradient(33deg, #01ABCE 50%, transparent 52%);
}
details:nth-of-type(6n+2) .envelope::before {
  background: linear-gradient(33deg, transparent 50%, #01819b 50%) 0 0/3rem 2.4rem, linear-gradient(-33deg, transparent 50%, #01819b 50%) 3rem 0/3rem 2.4rem;
  background-repeat: no-repeat;
}
details:nth-of-type(6n+2) .card {
  background: linear-gradient(33deg, #01ABCE 38%, transparent 39%), linear-gradient(-33deg, transparent 38%, #fffefc 39%);
}
details:nth-of-type(6n+2) .card::before {
  background: linear-gradient(-33deg, #01ABCE 67%, #01819b 68% 69%, transparent 69%) no-repeat 0 2rem/3rem 4rem, linear-gradient(33deg, #01ABCE 67%, #01819b 68% 69%, transparent 69%) no-repeat 3rem 2rem/3rem 4rem, linear-gradient(-33deg, #01ABCE 50%, transparent 52%), linear-gradient(33deg, #01ABCE 50%, transparent 52%);
}

details:nth-of-type(6n+3) .envelope {
  background: linear-gradient(transparent 1%, #bb9200 2%, transparent 5%), linear-gradient(-147deg, #d4a700 50%, transparent 40%) no-repeat 0 0/3rem 2rem, linear-gradient(147deg, #d4a700 50%, transparent 40%) no-repeat 3rem 0/3rem 2rem, linear-gradient(-33deg, #FFCA08 67%, #d4a700 68% 69%, transparent 69%) no-repeat 0 2rem/3rem 4rem, linear-gradient(33deg, #FFCA08 67%, #d4a700 68% 69%, transparent 69%) no-repeat 3rem 2rem/3rem 4rem, linear-gradient(-33deg, #FFCA08 50%, transparent 52%), linear-gradient(33deg, #FFCA08 50%, transparent 52%);
}
details:nth-of-type(6n+3) .envelope::before {
  background: linear-gradient(33deg, transparent 50%, #d4a700 50%) 0 0/3rem 2.4rem, linear-gradient(-33deg, transparent 50%, #d4a700 50%) 3rem 0/3rem 2.4rem;
  background-repeat: no-repeat;
}
details:nth-of-type(6n+3) .card {
  background: linear-gradient(33deg, #FFCA08 38%, transparent 39%), linear-gradient(-33deg, transparent 38%, #fffefc 39%);
}
details:nth-of-type(6n+3) .card::before {
  background: linear-gradient(-33deg, #FFCA08 67%, #d4a700 68% 69%, transparent 69%) no-repeat 0 2rem/3rem 4rem, linear-gradient(33deg, #FFCA08 67%, #d4a700 68% 69%, transparent 69%) no-repeat 3rem 2rem/3rem 4rem, linear-gradient(-33deg, #FFCA08 50%, transparent 52%), linear-gradient(33deg, #FFCA08 50%, transparent 52%);
}

details:nth-of-type(6n+4) .envelope {
  background: linear-gradient(transparent 1%, #c16c07 2%, transparent 5%), linear-gradient(-147deg, #d97a08 50%, transparent 40%) no-repeat 0 0/3rem 2rem, linear-gradient(147deg, #d97a08 50%, transparent 40%) no-repeat 3rem 0/3rem 2rem, linear-gradient(-33deg, #F7941D 67%, #d97a08 68% 69%, transparent 69%) no-repeat 0 2rem/3rem 4rem, linear-gradient(33deg, #F7941D 67%, #d97a08 68% 69%, transparent 69%) no-repeat 3rem 2rem/3rem 4rem, linear-gradient(-33deg, #F7941D 50%, transparent 52%), linear-gradient(33deg, #F7941D 50%, transparent 52%);
}
details:nth-of-type(6n+4) .envelope::before {
  background: linear-gradient(33deg, transparent 50%, #d97a08 50%) 0 0/3rem 2.4rem, linear-gradient(-33deg, transparent 50%, #d97a08 50%) 3rem 0/3rem 2.4rem;
  background-repeat: no-repeat;
}
details:nth-of-type(6n+4) .card {
  background: linear-gradient(33deg, #F7941D 38%, transparent 39%), linear-gradient(-33deg, transparent 38%, #fffefc 39%);
}
details:nth-of-type(6n+4) .card::before {
  background: linear-gradient(-33deg, #F7941D 67%, #d97a08 68% 69%, transparent 69%) no-repeat 0 2rem/3rem 4rem, linear-gradient(33deg, #F7941D 67%, #d97a08 68% 69%, transparent 69%) no-repeat 3rem 2rem/3rem 4rem, linear-gradient(-33deg, #F7941D 50%, transparent 52%), linear-gradient(33deg, #F7941D 50%, transparent 52%);
}

details:nth-of-type(6n+5) .envelope {
  background: linear-gradient(transparent 1%, #a1005f 2%, transparent 5%), linear-gradient(-147deg, #ba006e 50%, transparent 40%) no-repeat 0 0/3rem 2rem, linear-gradient(147deg, #ba006e 50%, transparent 40%) no-repeat 3rem 0/3rem 2rem, linear-gradient(-33deg, #ED008C 67%, #ba006e 68% 69%, transparent 69%) no-repeat 0 2rem/3rem 4rem, linear-gradient(33deg, #ED008C 67%, #ba006e 68% 69%, transparent 69%) no-repeat 3rem 2rem/3rem 4rem, linear-gradient(-33deg, #ED008C 50%, transparent 52%), linear-gradient(33deg, #ED008C 50%, transparent 52%);
}
details:nth-of-type(6n+5) .envelope::before {
  background: linear-gradient(33deg, transparent 50%, #ba006e 50%) 0 0/3rem 2.4rem, linear-gradient(-33deg, transparent 50%, #ba006e 50%) 3rem 0/3rem 2.4rem;
  background-repeat: no-repeat;
}
details:nth-of-type(6n+5) .card {
  background: linear-gradient(33deg, #ED008C 38%, transparent 39%), linear-gradient(-33deg, transparent 38%, #fffefc 39%);
}
details:nth-of-type(6n+5) .card::before {
  background: linear-gradient(-33deg, #ED008C 67%, #ba006e 68% 69%, transparent 69%) no-repeat 0 2rem/3rem 4rem, linear-gradient(33deg, #ED008C 67%, #ba006e 68% 69%, transparent 69%) no-repeat 3rem 2rem/3rem 4rem, linear-gradient(-33deg, #ED008C 50%, transparent 52%), linear-gradient(33deg, #ED008C 50%, transparent 52%);
}

details:nth-of-type(6n+6) .envelope {
  background: linear-gradient(transparent 1%, #371c57 2%, transparent 5%), linear-gradient(-147deg, #43226a 50%, transparent 40%) no-repeat 0 0/3rem 2rem, linear-gradient(147deg, #43226a 50%, transparent 40%) no-repeat 3rem 0/3rem 2rem, linear-gradient(-33deg, #5C2E91 67%, #43226a 68% 69%, transparent 69%) no-repeat 0 2rem/3rem 4rem, linear-gradient(33deg, #5C2E91 67%, #43226a 68% 69%, transparent 69%) no-repeat 3rem 2rem/3rem 4rem, linear-gradient(-33deg, #5C2E91 50%, transparent 52%), linear-gradient(33deg, #5C2E91 50%, transparent 52%);
}
details:nth-of-type(6n+6) .envelope::before {
  background: linear-gradient(33deg, transparent 50%, #43226a 50%) 0 0/3rem 2.4rem, linear-gradient(-33deg, transparent 50%, #43226a 50%) 3rem 0/3rem 2.4rem;
  background-repeat: no-repeat;
}
details:nth-of-type(6n+6) .card {
  background: linear-gradient(33deg, #5C2E91 38%, transparent 39%), linear-gradient(-33deg, transparent 38%, #fffefc 39%);
}
details:nth-of-type(6n+6) .card::before {
  background: linear-gradient(-33deg, #5C2E91 67%, #43226a 68% 69%, transparent 69%) no-repeat 0 2rem/3rem 4rem, linear-gradient(33deg, #5C2E91 67%, #43226a 68% 69%, transparent 69%) no-repeat 3rem 2rem/3rem 4rem, linear-gradient(-33deg, #5C2E91 50%, transparent 52%), linear-gradient(33deg, #5C2E91 50%, transparent 52%);
}

details:nth-of-type(1) {
  transform: rotate(41deg);
}
details:nth-of-type(1) .card::after {
  content: "🤠";
}

details:nth-of-type(2) {
  transform: rotate(7deg);
}
details:nth-of-type(2) .card::after {
  content: "🤖";
}

details:nth-of-type(3) {
  transform: rotate(9deg);
}
details:nth-of-type(3) .card::after {
  content: "🎊";
}

details:nth-of-type(4) {
  transform: rotate(8deg);
}
details:nth-of-type(4) .card::after {
  content: "🥳";
}

details:nth-of-type(5) {
  transform: rotate(-46deg);
}
details:nth-of-type(5) .card::after {
  content: "🤠";
}

details:nth-of-type(6) {
  transform: rotate(-56deg);
}
details:nth-of-type(6) .card::after {
  content: "🤖";
}

details:nth-of-type(7) {
  transform: rotate(8deg);
}
details:nth-of-type(7) .card::after {
  content: "🐍";
}

details:nth-of-type(8) {
  transform: rotate(-55deg);
}
details:nth-of-type(8) .card::after {
  content: "🦄";
}

details:nth-of-type(9) {
  transform: rotate(-26deg);
}
details:nth-of-type(9) .card::after {
  content: "😺";
}

details:nth-of-type(10) {
  transform: rotate(-51deg);
}
details:nth-of-type(10) .card::after {
  content: "😈";
}

details:nth-of-type(11) {
  transform: rotate(-26deg);
}
details:nth-of-type(11) .card::after {
  content: "🤖";
}

details:nth-of-type(12) {
  transform: rotate(9deg);
}
details:nth-of-type(12) .card::after {
  content: "🎊";
}

details:nth-of-type(13) {
  transform: rotate(45deg);
}
details:nth-of-type(13) .card::after {
  content: "🦄";
}

details:nth-of-type(14) {
  transform: rotate(-36deg);
}
details:nth-of-type(14) .card::after {
  content: "🥳";
}

details:nth-of-type(15) {
  transform: rotate(-21deg);
}
details:nth-of-type(15) .card::after {
  content: "🐍";
}

details:nth-of-type(16) {
  transform: rotate(-36deg);
}
details:nth-of-type(16) .card::after {
  content: "😺";
}

details:nth-of-type(17) {
  transform: rotate(-2deg);
}
details:nth-of-type(17) .card::after {
  content: "🤖";
}

details:nth-of-type(18) {
  transform: rotate(37deg);
}
details:nth-of-type(18) .card::after {
  content: "🤖";
}

details:nth-of-type(19) {
  transform: rotate(-3deg);
}
details:nth-of-type(19) .card::after {
  content: "😈";
}

details:nth-of-type(20) {
  transform: rotate(30deg);
}
details:nth-of-type(20) .card::after {
  content: "🤖";
}

details:nth-of-type(21) {
  transform: rotate(13deg);
}
details:nth-of-type(21) .card::after {
  content: "🐍";
}

details:nth-of-type(22) {
  transform: rotate(-42deg);
}
details:nth-of-type(22) .card::after {
  content: "🐍";
}

details:nth-of-type(23) {
  transform: rotate(-44deg);
}
details:nth-of-type(23) .card::after {
  content: "🤖";
}

details:nth-of-type(24) {
  transform: rotate(-9deg);
}
details:nth-of-type(24) .card::after {
  content: "👻";
}

details:nth-of-type(25) {
  transform: rotate(52deg);
}
details:nth-of-type(25) .card::after {
  content: "👻";
}

details:nth-of-type(26) {
  transform: rotate(-19deg);
}
details:nth-of-type(26) .card::after {
  content: "🎊";
}

details:nth-of-type(27) {
  transform: rotate(-57deg);
}
details:nth-of-type(27) .card::after {
  content: "🎊";
}

details:nth-of-type(28) {
  transform: rotate(-44deg);
}
details:nth-of-type(28) .card::after {
  content: "😈";
}

details:nth-of-type(29) {
  transform: rotate(-9deg);
}
details:nth-of-type(29) .card::after {
  content: "😈";
}

details:nth-of-type(30) {
  transform: rotate(-2deg);
}
details:nth-of-type(30) .card::after {
  content: "🤠";
}

details:nth-of-type(31) {
  transform: rotate(19deg);
}
details:nth-of-type(31) .card::after {
  content: "🎊";
}

details:nth-of-type(32) {
  transform: rotate(24deg);
}
details:nth-of-type(32) .card::after {
  content: "🤖";
}

details:nth-of-type(33) {
  transform: rotate(36deg);
}
details:nth-of-type(33) .card::after {
  content: "😈";
}

details:nth-of-type(34) {
  transform: rotate(-33deg);
}
details:nth-of-type(34) .card::after {
  content: "🤠";
}

details:nth-of-type(35) {
  transform: rotate(-59deg);
}
details:nth-of-type(35) .card::after {
  content: "🤠";
}

details:nth-of-type(36) {
  transform: rotate(53deg);
}
details:nth-of-type(36) .card::after {
  content: "🤠";
}

details:nth-of-type(37) {
  transform: rotate(-9deg);
}
details:nth-of-type(37) .card::after {
  content: "🐍";
}

details:nth-of-type(38) {
  transform: rotate(31deg);
}
details:nth-of-type(38) .card::after {
  content: "🥳";
}

details:nth-of-type(39) {
  transform: rotate(-2deg);
}
details:nth-of-type(39) .card::after {
  content: "👻";
}

details:nth-of-type(40) {
  transform: rotate(-27deg);
}
details:nth-of-type(40) .card::after {
  content: "🐍";
}

details:nth-of-type(41) {
  transform: rotate(-16deg);
}
details:nth-of-type(41) .card::after {
  content: "🤠";
}

details:nth-of-type(42) {
  transform: rotate(-31deg);
}
details:nth-of-type(42) .card::after {
  content: "👻";
}

details:nth-of-type(43) {
  transform: rotate(-37deg);
}
details:nth-of-type(43) .card::after {
  content: "🤖";
}

details:nth-of-type(44) {
  transform: rotate(26deg);
}
details:nth-of-type(44) .card::after {
  content: "🦄";
}

details:nth-of-type(45) {
  transform: rotate(5deg);
}
details:nth-of-type(45) .card::after {
  content: "🎊";
}

details:nth-of-type(46) {
  transform: rotate(-9deg);
}
details:nth-of-type(46) .card::after {
  content: "🐍";
}

details:nth-of-type(47) {
  transform: rotate(-54deg);
}
details:nth-of-type(47) .card::after {
  content: "🤖";
}

details:nth-of-type(48) {
  transform: rotate(9deg);
}
details:nth-of-type(48) .card::after {
  content: "🦄";
}

details:nth-of-type(49) {
  transform: rotate(5deg);
}
details:nth-of-type(49) .card::after {
  content: "🥳";
}

details:nth-of-type(50) {
  transform: rotate(13deg);
}
details:nth-of-type(50) .card::after {
  content: "🦄";
}

details:nth-of-type(51) {
  transform: rotate(32deg);
}
details:nth-of-type(51) .card::after {
  content: "😺";
}

details:nth-of-type(52) {
  transform: rotate(39deg);
}
details:nth-of-type(52) .card::after {
  content: "🥳";
}

details:nth-of-type(53) {
  transform: rotate(-45deg);
}
details:nth-of-type(53) .card::after {
  content: "🦄";
}

details:nth-of-type(54) {
  transform: rotate(-50deg);
}
details:nth-of-type(54) .card::after {
  content: "🥳";
}

details:nth-of-type(55) {
  transform: rotate(13deg);
}
details:nth-of-type(55) .card::after {
  content: "🐍";
}

details:nth-of-type(56) {
  transform: rotate(-18deg);
}
details:nth-of-type(56) .card::after {
  content: "🎊";
}

details:nth-of-type(57) {
  transform: rotate(-14deg);
}
details:nth-of-type(57) .card::after {
  content: "🐍";
}

details:nth-of-type(58) {
  transform: rotate(-2deg);
}
details:nth-of-type(58) .card::after {
  content: "🤖";
}

details:nth-of-type(59) {
  transform: rotate(-48deg);
}
details:nth-of-type(59) .card::after {
  content: "😺";
}

details:nth-of-type(60) {
  transform: rotate(43deg);
}
details:nth-of-type(60) .card::after {
  content: "😈";
}

details:nth-of-type(61) {
  transform: rotate(-58deg);
}
details:nth-of-type(61) .card::after {
  content: "🥳";
}

details:nth-of-type(62) {
  transform: rotate(-51deg);
}
details:nth-of-type(62) .card::after {
  content: "🎊";
}

details:nth-of-type(63) {
  transform: rotate(23deg);
}
details:nth-of-type(63) .card::after {
  content: "😈";
}

details:nth-of-type(64) {
  transform: rotate(38deg);
}
details:nth-of-type(64) .card::after {
  content: "🤠";
}

details:nth-of-type(65) {
  transform: rotate(-56deg);
}
details:nth-of-type(65) .card::after {
  content: "🤠";
}

details:nth-of-type(66) {
  transform: rotate(-40deg);
}
details:nth-of-type(66) .card::after {
  content: "🎊";
}

details:nth-of-type(67) {
  transform: rotate(-48deg);
}
details:nth-of-type(67) .card::after {
  content: "🐍";
}

details:nth-of-type(68) {
  transform: rotate(7deg);
}
details:nth-of-type(68) .card::after {
  content: "🎊";
}

details:nth-of-type(69) {
  transform: rotate(45deg);
}
details:nth-of-type(69) .card::after {
  content: "🤖";
}

details:nth-of-type(70) {
  transform: rotate(-13deg);
}
details:nth-of-type(70) .card::after {
  content: "🤖";
}

details:nth-of-type(71) {
  transform: rotate(-9deg);
}
details:nth-of-type(71) .card::after {
  content: "🤠";
}

details:nth-of-type(72) {
  transform: rotate(9deg);
}
details:nth-of-type(72) .card::after {
  content: "🤖";
}

details:nth-of-type(73) {
  transform: rotate(57deg);
}
details:nth-of-type(73) .card::after {
  content: "😈";
}

details:nth-of-type(74) {
  transform: rotate(-14deg);
}
details:nth-of-type(74) .card::after {
  content: "🎊";
}

details:nth-of-type(75) {
  transform: rotate(51deg);
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0