div+css实现悬浮按钮点击伸缩子菜单圆圈效果代码

代码语言:html

所属分类:菜单导航

代码描述:div+css实现悬浮按钮点击伸缩子菜单圆圈效果代码

代码标签: div css 悬浮 按钮 点击 伸缩 子菜单 圆圈

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

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

<head>
  <meta charset="UTF-8">
  
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.4.0.css">
  
<style>
html {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  font-size: 62.5%;
}
html * {
  box-sizing: inherit;
}

body {

  background-color: #293238;
  display: grid;
  font-family: sans-serif;
  font-size: 1.6rem;
  min-height: 100vh;
  place-content: center;
  position: relative;
}
body::before {
  background-color: #293238;
  content: "";
  height: 100%;
  left: 0;
  opacity: 0.8;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 0;
}

.buttons {
  position: relative;
  z-index: 1;
}
.buttons--active .buttons__ctas {
  transform: translate(-50%, -50%) rotate(0deg);
}
.buttons--active .buttons__cta:nth-child(1) {
  transform: translate(-110%, -150%) rotate(0deg);
}
.buttons--active .buttons__cta:nth-child(2) {
  transform: translate(10%, -150%) rotate(0deg);
}
.buttons--active .buttons__cta:nth-child(3) {
  transform: translate(65%, -50%) rotate(0deg);
}
.buttons--active .buttons__cta:nth-child(4) {
  transform: translate(10%, 50%) rotate(0deg);
}
.buttons--active .buttons__cta:nth-child(5) {
  transform: translate(-110%, 50%) rotate(0deg);
}
.buttons--active .buttons__cta:nth-child(6) {
  transform: translate(-165%, -50%) rotate(0deg);
}
.buttons__toggle {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  align-items: center;
  background-color: #22AA96;
  border: 4px solid #19182B;
  border-radius: 50%;
  box-shadow: inset 0 -8px 0 #168B86;
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  font-size: 0;
  height: 8rem;
  justify-content: center;
  text-decoration: none;
  text-shadow: 0 2px 0 #168B86;
  width: 8rem;
  position: relative;
  z-index: 1;
}
.buttons__toggle:hover {
  text-shadow: 0 2px 0 #168B86, 0 0 4px rgba(255, 255, 255, 0.5);
}
.buttons__toggle:focus, .buttons__toggle--active {
  background-color: #168B86;
  box-shadow: inset 0 8px 0 #0B6F6B;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}
.buttons__toggle i {
  font-size: 3.2rem;
}
.buttons__ctas {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) rotate(180deg);
  transform-origin: center;
  transition: transform 0.75s ease;
  z-index: 0;
}
.buttons__cta {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  align-items: center;
  background-color: #22AA96;
  border: 4px solid #19182B;
  border-radius: 50%;
  box-shadow: inset 0 -8px 0 #168B86;
  color: #FFFFFF;
  cursor: pointer;
  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0