一颗很不错的心

想不到豆包还有代码运行的预览图 还是动态的 感觉自己out了哈哈哈哈哈哈哈哈哈哈好像大一的时候才用代码画过爱心 最近完成了毕设的系统 想回家演示一下 让妈妈看看我有多牛哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈#请用你的专业向妈妈表白#
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400" width="400" height="400">
  <style>
    @keyframes heartbeat {
      0% { transform: scale(1); }
      15% { transform: scale(1.2); }
      30% { transform: scale(1); }
      45% { transform: scale(1.2); }
      100% { transform: scale(1); }
    }
    @keyframes float {
      0% { transform: translateY(0px); }
      50% { transform: translateY(-20px); }
      100% { transform: translateY(0px); }
    }
    .heart {
      animation: heartbeat 1.5s infinite;
      transform-origin: center;
      fill: #ff5e87;
      filter: drop-shadow(0 0 15px rgba(255, 94, 135, 0.7));
    }
    .sparkle {
      animation: float 3s infinite ease-in-out;
      fill: white;
      opacity: 0;
    }
    .sparkle:nth-child(odd) {
      animation-delay: 0.5s;
    }
  </style>
  <g transform="translate(200, 180)">
    <path class="heart" d="M0,-60 C-70,-110 -150,-50 -150,30 C-150,100 -70,150 0,200 C70,150 150,100 150,30 C150,-50 70,-110 0,-60 Z" />
    <circle class="sparkle" cx="-80" cy="-30" r="5">
      <animate attributeName="opacity" values="0;1;0" dur="2s" repeatCount="indefinite" />
    </circle>
    <circle class="sparkle" cx="80" cy="-40" r="6">
      <animate attributeName="opacity" values="0;1;0" dur="2.5s" repeatCount="indefinite" />
    </circle>
    <circle class="sparkle" cx="-60" cy="-80" r="4">
      <animate attributeName="opacity" values="0;1;0" dur="3s" repeatCount="indefinite" />
    </circle>
    <circle class="sparkle" cx="60" cy="-90" r="5">
      <animate attributeName="opacity" values="0;1;0" dur="2.2s" repeatCount="indefinite" />
    </circle>
    <circle class="sparkle" cx="-30" cy="-110" r="4">
      <animate attributeName="opacity" values="0;1;0" dur="2.7s" repeatCount="indefinite" />
    </circle>
    <circle class="sparkle" cx="30" cy="-100" r="5">
      <animate attributeName="opacity" values="0;1;0" dur="2.3s" repeatCount="indefinite" />
    </circle>
  </g>
</svg>
全部评论

相关推荐

评论
5
1
分享

创作者周榜

更多
牛客网
牛客企业服务