:doodle { @size: 1200px 675px; box-shadow: 0 0 8px #000; position: relative; z-index: 1; } @match(i ≤ @size - 2) { @size: @r(1,2)px @r(10,60)px; @place: @r(0,1200)px -100px; background: linear-gradient(rgba(255,255,255,0), rgba(255,255,255,.3)); animation: fall @r(.5,1.5)s @r(-4,0)s infinite linear var(--state); } @nth(@size - 1, @size) { @size: 80px; @place:330px 250px; clip-path: @shape(fill: evenodd;points: 300;scale: .45;x: cos(2t) + cos(π - 7t);y: sin(2t) + sin(7t); ); background: Lavender; cursor: pointer; animation: rot 4s infinite linear var(--state); } @nth(@size) { @place:838px 250px; } @keyframes fall { to { transform: translateY(783px); } } @keyframes rot { to { transform: rotate(360deg); } } :doodle { @size: auto 4em; bottom: 40px; --geci: "css-doodle player"; --motion: cover2; --tt: 1s; } /* 单元格两个伪元素显示lrc歌词 */ display: grid; place-items: center start; :before, :after { content: var(--geci); color: LightGrey; /* 歌词底色 */ font: bold 2em sans-serif; text-shadow: 1px 1px 2px #000; white-space: pre; } :after { position: absolute; width: 0; color: DarkSeaGreen; /* 同步歌词颜色 */ overflow: hidden; animation: var(--motion) var(--tt) linear forwards var(--state); } @keyframes cover1 { from { width: 0; } to { width: 100%; } } @keyframes cover2 { from { width: 0; } to { width: 100%; } }