小辣椒 发表于 2023-3-17 21:22

不再流泪 不再喝醉 (学习黑黑熊猫脸效果)


<style>
#papa {
      --state: paused;
      margin: 120px 0 0 calc(50% - 760px);
      width: 1365px;
      height: 700px;
      background: lightgreen url('https://wj.zp68.com/lxx//yunhua/2023/03/17/62.gif') center/cover no-repeat;
      box-shadow: 3px 3px 20px #000;
      display: grid;
      place-items: center;
      position: relative;
}
#lrc {
      --motion: cover2;
      --tt: 2s;
      --bg: linear-gradient(180deg, hsla(120, 70%, 50%, .75), hsla(120, 70%, 50%, .75));
      position: absolute;
      top: 520px;
         left: 780px;
      font: bold 2.4em sans-serif;
      color: snow;
      white-space: pre;
      -webkit-background-clip: text;
      filter: drop-shadow(1px 1px 1px hsla(0, 0%, 0%, .95));
}
#lrc::before {
      position: absolute;
      content: attr(data-lrc);
      width: 20%;
      height: 100%;
      color: transparent;
      overflow: hidden;
      white-space: pre;
      background: var(--bg);
      filter: inherit;
      -webkit-background-clip: text;
      animation: var(--motion) var(--tt) linear forwards;
      animation-play-state: var(--state);
}

#face {
      position: absolute;
      left: 380px;
      top: 30px;
      width: 110px;
      height: 93px;
      border: 1px solid #;
      border-radius: 100% 100% 80% 80%;
      cursor: pointer;
}

#face > span {
      position: absolute;
      top: 39px;
      width: 10px;
      height: 16px;
      border-radius: 50%;
      background: #000;
}
#face > span:nth-of-type(1) {
      left: 25px;
      animation: mov .5s infinitealternate var(--state);
      --xx: 10px;
}
#face > span:nth-of-type(2) {
      left: 70px;
      animation: mov .5s infinite linear alternate var(--state);
      --xx: -10px;
}
#face > span:nth-of-type(3) {
      height: 8px;
      background: none;
      border: 1px solid #000;
      top: 68px;
      left: 45px;
      transform: scale(.5);
      animation: scale .15s infinite alternate var(--state);
}
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
@keyframes mov {to { transform: translate(var(--xx)); } }
@keyframes scale { to {transform: scale(1.5); } }

#dt2{ position: absolute; width: 200px; height: 113px; top: 160px; left: 775px; }
</style>

<div id="papa">

<img id="dt2" src="https://wj.zp68.com/lxx//yunhua/2023/03/17/btf.gif" alt="" style="position: absolute; mix-blend-mode: multiply; transform: translate(30px, 40px) rotate(360deg); " />

      <audio id="aud" src="https://wj.zp68.com/lxx//yunhua/2023/03/17/bzll.mp3" loop autoplay></audio>
      <div id="lrc" data-lrc="HCPlayer">HCPlayer</div>
      <div id="face">
                <span></span>
                <span></span>
                <span></span>
</div>
</div>

<script>

let averAdd = 0, offset = 0, mKey = 0, mFlag = true;

let lrcTime = (ar) => {let tmpAr = [];for (j = 0; j < ar.length - 1; j++) {if (j !== ar.length - 1) tmpAr = parseFloat((ar - ar).toFixed(1));}let aver = parseInt(tmpAr.reduce((a, b) => a + b) / (tmpAr.length - 1)) + averAdd;tmpAr.push(aver);tmpAr.forEach((item, key) => {ar = item > aver ? aver : item;});return ar;};
let getLrcAr = (text) => {let lrcAr = [];let calcRule = ;for (x of text.split('\n')) {let ar = [];let re = /\d+[\.:]\d+([\.:]\d+)?/g;let geci = x.replace(re, '');if (geci) {geci = geci.replace(/[\[\]\'\"\t,]s?/g, '');let time = x.match(re);if (time != null) {for (y of time) {let tmp = y.match(/\d+/g);let sec = 0;for (z in tmp) sec += tmp * calcRule;ar = ;lrcAr.push(ar);}}}}lrcAr.sort((a, b) => a - b);return (lrcTime(lrcAr));}
let showLrc = (time) => {let name = mFlag ? 'cover1' : 'cover2';lrc.innerHTML = lrcAr;lrc.dataset.lrc = lrcAr;lrc.style.setProperty('--motion', name);lrc.style.setProperty('--tt', time + 's');lrc.style.setProperty('--state', 'running');mKey += 1;mFlag = !mFlag;};
let calcKey = () => { for (j = 0; j < lrcAr.length; j++) { if (aud.currentTime <= lrcAr) { mKey = j - 1; break; } } if (mKey < 0) mKey = 0; if (mKey > lrcAr.length - 1) mKey = lrcAr.length - 1; let time = lrcAr - (aud.currentTime - lrcAr); showLrc(time); };
let mState = () => papa.style.setProperty('--state', aud.paused ? 'paused' : 'running');

let lrcAr = [
                ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];

aud.addEventListener('timeupdate', () => {for (j = 0; j < lrcAr.length; j++) {if (aud.currentTime >= lrcAr) {cKey = j;if (mKey === j) showLrc(lrcAr);else continue;}}});
aud.addEventListener('pause', () => mState());
aud.addEventListener('play', () => mState());
aud.addEventListener('seeked', () => calcKey());
face.addEventListener('click', () => aud.paused ? aud.play() : aud.pause());
</script>

小辣椒 发表于 2023-3-17 21:25

小辣椒抄个作业都抄的累S,吃了饭就做了,才做好@緑叶清舟 @ 雨中悄然

抄你们2个的{:4_170:}

小辣椒 发表于 2023-3-17 21:26

谢谢黑黑,想不出这个笑脸做什么好了,就放月亮上了@马黑黑

小辣椒 发表于 2023-3-17 21:28

做一首郭力的新歌,不过一面做,一面听感觉不好听。。。。。

红影 发表于 2023-3-17 21:31

漂亮,亲爱的底图还是明暗变化的,笑脸用在这里也很很好呢{:4_187:}

马黑黑 发表于 2023-3-17 21:37

小辣椒 发表于 2023-3-17 21:26
谢谢黑黑,想不出这个笑脸做什么好了,就放月亮上了@马黑黑

这也想得出来{:5_106:}

小辣椒 发表于 2023-3-17 21:47

红影 发表于 2023-3-17 21:31
漂亮,亲爱的底图还是明暗变化的,笑脸用在这里也很很好呢

亲爱的,想不出这个笑脸放哪里好了

小辣椒 发表于 2023-3-17 21:48

马黑黑 发表于 2023-3-17 21:37
这也想得出来

怎么样?反正看看月亮也是变可爱的{:4_170:}

马黑黑 发表于 2023-3-17 22:04

小辣椒 发表于 2023-3-17 21:48
怎么样?反正看看月亮也是变可爱的

是的,和雨中悄然放在书包背后有异曲同工之妙

小辣椒 发表于 2023-3-17 22:12

马黑黑 发表于 2023-3-17 22:04
是的,和雨中悄然放在书包背后有异曲同工之妙

我想不出放那里了,找个月亮放进去,也是不错的,马上发微信看看{:4_189:}

起个网名好难 发表于 2023-3-17 22:21

欣赏美帖

马黑黑 发表于 2023-3-17 22:36

小辣椒 发表于 2023-3-17 22:12
我想不出放那里了,找个月亮放进去,也是不错的,马上发微信看看

应该没问题

小辣椒 发表于 2023-3-17 22:39

起个网名好难 发表于 2023-3-17 22:21
欣赏美帖

谢谢难难欣赏{:4_187:}

小辣椒 发表于 2023-3-17 22:39

马黑黑 发表于 2023-3-17 22:36
应该没问题

非常完美{:4_173:}

红影 发表于 2023-3-17 22:55

小辣椒 发表于 2023-3-17 21:47
亲爱的,想不出这个笑脸放哪里好了

放在这里也很好啊,月亮的新功用{:4_173:}

雨中悄然 发表于 2023-3-17 23:08

小辣椒 发表于 2023-3-17 21:25
小辣椒抄个作业都抄的累S,吃了饭就做了,才做好@緑叶清舟 @ 雨中悄然

抄你们2个的

{:4_170:}不是吧,我居然还有被抄作业的份儿

雨中悄然 发表于 2023-3-17 23:09

哎哟,乐S我了{:4_199:}

雨中悄然 发表于 2023-3-17 23:10

这个明明暗暗的好看,小辣椒厉害{:4_187:}

马黑黑 发表于 2023-3-17 23:31

小辣椒 发表于 2023-3-17 22:39
非常完美

是的吧

庶民 发表于 2023-3-18 05:02

很有热度的。
页: [1] 2 3 4 5
查看完整版本: 不再流泪 不再喝醉 (学习黑黑熊猫脸效果)