js+css实现凹凸切换开关动画效果代码

代码语言:html

所属分类:表单美化

代码描述:js+css实现凹凸切换开关动画效果代码

代码标签: js css 凹凸 切换 开关

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

<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
  
  
<style>
html,
body,
.root {
  height: 100vh;
  width: 100vw;
  margin: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: system-ui;
}

.bump-toggle {
  box-shadow: 1px 2px 8px -2px rgba(10, 10, 10, 0.1);
  overflow: hidden;
  width: 250px;
  height: 80px;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  position: relative;
  cursor: pointer;
}
.bump-toggle > div {
  position: relative;
  display: grid;
  place-items: center;
  font-size: 2.25rem;
  background-color: #fafafa;
  flex: 1.01;
  transform-origin: center center;
}
.bump-toggle > div.shrunk {
  animation: squeeze 320ms ease-in 100ms;
}
.bump-toggle > div:not(.shrunk) {
  transition: all 90ms ease 40ms;
  animation: expand 320ms ease-in;
}
.bump-toggle .off {
  transform-origin: right center;
}
.bump-tog.........完整代码请登录后点击上方下载按钮下载查看

网友评论0