css+js实现左侧旋转菜单点击效果代码

代码语言:html

所属分类:菜单导航

代码描述:css+js实现左侧旋转菜单点击效果代码,点击后整个页面向右倾斜旋转。

代码标签: css js 左侧 旋转 菜单 点击

下面为部分代码预览,完整代码请点击下载或在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.3.0.css">
<style>
    * {
  margin: 0;
  box-sizing: border-box;
}

body {
  font-family: verdana, sans-serif;
  margin: 0;
  overflow-x: hidden;
  background-color: rgb(6, 63, 58);
  color: #222;
}

.container {
  background-color: #fafafa;
  transform-origin: top left;
  transition: transform 0.5s linear;
  min-height: 100vh;
  padding: 50px;
}
.container.rotated {
  transform: rotate(-20deg);
}

.menu-trigger {
  position: fixed;
  top: -100px;
  left: -100px;
  background-color: rgb(6, 63, 58);
  height: 200px;
  width: 200px;
  border-radius: 50%;
  transition: transform 0.5s linear;
}
.container.rotated .menu-trigger {
  transform: rotate(-70deg);
}
.container.rotated + nav {
  transform: translateX(0);
}
.menu-trigger .open,
.menu-trigger .close {
  position: absolute;
  top: 60%;
  left: 40%;
  background: transparent;
  border: 0;
  font-size: 26px;
  color: #fff;
  cursor: pointer;
}
.menu-trigger .open {
  left: 60%;
}
.menu-trigger .close {
  left: 25%;
  /* transform: rotate(90deg);
  transform-origin: top left; */
}
.content {
  padding: 30px;
}
.content img {
  width: 100%;
}
.menu-items {
  position: fixed;
  bottom: 15px;
  left: 0;
  list-style: none;
  z-index: -1;
  color: #fff;
  transform: translateX(-150%);
  transition: all 0.5s linear;
}
.container.rotated + .menu-items {
  transform: translateX(0);
}

.menu-items li {
  color: #fff;
  margin-bottom: 20px;
  cursor: pointer;
}
.menu-items li:nth-of-type(2) {
  margin-left: 15px;
}
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0