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.........完整代码请登录后点击上方下载按钮下载查看

网友评论0