WEBデザインの勉強

WEB制作初心者が1から勉強するブログ。

丸メニュー

デモ
http://efu.sakura.ne.jp/web/menu4/

<!DOCTYPE html>
<html lang="ja">
<head>
  <meta charset="UTF-8">
  <title>丸メニュー</title>
  <link rel="stylesheet" href="http://efu.sakura.ne.jp/web/common/css/reset.css">
  <link rel="stylesheet" href="style.css">
  <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
  <script src="script.js"></script>
</head>
<body>
  <div class="content">
    <div class="overlay"></div>
    <p class="btn_menu">MENU</p>
  </div>
</body>
</html>
@charset "utf-8";

body, html {
  height: 100%;
  overflow: hidden;
}

body {
  background: #eee;
}

.content {
  position: relative;
  width: 750px;
  height: 100%;
  margin: 0 auto;
  background: #FFF;
  overflow: hidden;
}

.content .btn_menu {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width:80px;
  height: 80px;
  cursor: pointer;
  color: #FFF;
  line-height: 60px;
  text-align: center;
  -webkit-transition: all .3s linear;
  -o-transition: all .3s linear;
  transition: all .3s linear;
}

.content .btn_menu:hover {
  opacity: 0.6;
}

.content .overlay {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width:80px;
  height: 80px;
  background: #38817A;
  border-radius: 0 0 70px 0;
  -webkit-transition: all .5s cubic-bezier(0.23, 1, 0.32, 1);
  -o-transition: all .5s cubic-bezier(0.23, 1, 0.32, 1);
  transition: all .5s cubic-bezier(0.23, 1, 0.32, 1);
}

.content .overlay.open {
  width: 110%;
  height: 110%;
}
$(function(){
  $('.btn_menu').on('click', function(){
    $('.overlay').toggleClass('open');
  });
});