gsap实现按钮点击图标动画效果代码

代码语言:html

所属分类:其他

代码描述:gsap实现按钮点击图标动画效果代码

代码标签: gsap 按钮 点击 图标 动画

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

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
<style>
    @import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600&display=swap");
body {
  background-color: #EBF2FA;
  color: #253343;
  font-family: "Nunito Sans", sans-serif;
  font-size: 1.25rem;
  margin: 0;
}

.container {
  align-content: center;
  display: grid;
  grid-gap: 2rem;
  height: 100vh;
  justify-items: center;
  padding: 0 1.5rem;
}

.button {
  align-items: center;
  background: #fff;
  border-radius: 90rem;
  box-shadow: 3.3px 3.3px 5px rgba(0, 0, 0, 0.02), 11.2px 11.2px 16.8px rgba(0, 0, 0, 0.03), 50px 50px 75px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  display: flex;
  padding: 0.75rem 1.5rem;
  transition: box-shadow 0.2s ease;
}
.button:hover {
  box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.032), 13.4px 13.4px 16.8px rgba(0, 0, 0, 0.048), 60px 60px 75px rgba(0, 0, 0, 0.08);
}

.button .icon {
  color: #9eb2c9;
  transition: color 0.2s ease;
}

.button-notify.selected .icon {
  color: #6f21db;
}

.button-like.selected .icon {
  color: #f01966;
}

.button-save.selected .icon {
  color: #0f87ff;
}

.icon {
  margin-right: 0.5rem;
}
</style>

</head>
<body>

<div class="container">
  <div class="button button-notify">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20.95 24" width="24" height="24" class="icon icon-bell">
      <path fill="currentColor" d="M10,2.87a7.84,7.84,0,0,0-5.89,7.6v5.24a.88.88,0,0,1-.88.87,1.75,1.75,0,0,0,0,3.49H20.72a1.75,1.75,0,0,0,0-3.49.87.87,0,0,1-.88-.87V10.47A7.84,7.84,0,0,0,14,2.87V2A2,2,0,0,0,10,2Z" transform="translate(-1.53)"/>
      <path fill="currentColor" d="M9,21h6.1A3.05,3.05,0,1,1,9,21Z" transform="translate(-1.53)"/>
    </svg>
    <span>Get Notificaitons</span>
  </div>
  <div class="button button-like">
    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" class="icon icon-heart">
      <path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0.........完整代码请登录后点击上方下载按钮下载查看

网友评论0