<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/modaal/0.4.4/css/modaal.min.css">
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modaal/0.4.4/js/modaal.min.js">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js">
</script>
<style>@charset "utf-8";

/*========= モーダル表示のためのCSS ===============*/

/*動画表示のモーダルの余白を変更したい場合*/
.modaal-video .modaal-inner-wrapper {
  padding: 0px;
}

/*モーダルのボタンの色を変更したい場合*/
.modaal-close:after,
.modaal-close:before {
  background: #ccc;
}

.modaal-close:focus:after,
.modaal-close:focus:before,
.modaal-close:hover:after,
.modaal-close:hover:before {
  background: #666;
}

/*========= レイアウトのためのCSS ===============*/

body {
  vertical-align: middle;
  text-align: center;
  width: 100%;
  height: 100vh;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-image: radial-gradient(
    circle farthest-corner at 10% 20%,
    rgba(222, 168, 248, 1) 0%,
    rgba(168, 222, 248, 1) 21.8%,
    rgba(189, 250, 205, 1) 35.6%,
    rgba(243, 250, 189, 1) 52.9%,
    rgba(250, 227, 189, 1) 66.8%,
    rgba(248, 172, 172, 1) 90%,
    rgba(254, 211, 252, 1) 99.7%
  );
}

h1 {
  font-size: 1.5rem;
  text-align: center;
  text-transform: uppercase;
  padding: 20px;
  color: #fff;
}

h2 {
  font-size: 1.2rem;
  text-align: center;
  margin: 0 0 30px 0;
}

p {
  margin-top: 20px;
  text-align: center;
}

a {
  color: #333;
  outline: none;
}

section {
  padding: 30px;
}</style>
</head>
<body>
<body>
<section>
<p>使用したライブラリ:<a href="http://humaan.com/modaal/" target="_blank">http://humaan.com/modaal/</a>
</p>
<p>
<a href="https://www.youtube.com/embed/s6y2VKBO1QQ?end=170&modestbranding=1&rel=0&controls=0" class="video-open">動画を開く</a>
</p>
</section>
<section id="info">
<h2>Sale情報</h2>
<p>11月1日~12月31日まで年末セールを開催!</p>
</section>
<!--/area1-->
<script>//初回のみモーダルをすぐ出す判定。flagがモーダル表示のstart_open後に代入される
var access = $.cookie("access");
if (!access) {
  flag = true;
  $.cookie("access", false);
} else {
  flag = false;
}

//モーダル表示
$(".video-open").modaal({
  start_open: flag, // ページロード時に表示するか
  overlay_close: true, //モーダル背景クリック時に閉じるか
  type: "video",
  background:
  "linear-gradient( 109.6deg,  rgba(218,185,252,1) 11.2%, rgba(125,89,252,1) 91.1% )", // 背景色
  overlay_opacity: 0.8, // 透過具合
  before_open: function () {
    // モーダルが開く前に行う動作
    $("html").css("overflow-y", "hidden"); /*縦スクロールバーを出さない*/
  },
  after_close: function () {
    // モーダルが閉じた後に行う動作
    $("html").css("overflow-y", "scroll"); /*縦スクロールバーを出す*/
  } });
//# sourceURL=pen.js</script>
</body>
</html>
/* 
   外部依存 CSS:
     - https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css
     - https://cdnjs.cloudflare.com/modaal.min.css
   外部依存 JS (このデモは下記の JS にも依存します):
     - https://code.jquery.com/jquery-3.4.1.min.js
     - https://cdnjs.cloudflare.com/modaal.min.js
     - https://cdnjs.cloudflare.com/jquery.cookie.js
 */

@charset "utf-8";

/*========= モーダル表示のためのCSS ===============*/

/*動画表示のモーダルの余白を変更したい場合*/
.modaal-video .modaal-inner-wrapper {
  padding: 0px;
}

/*モーダルのボタンの色を変更したい場合*/
.modaal-close:after,
.modaal-close:before {
  background: #ccc;
}

.modaal-close:focus:after,
.modaal-close:focus:before,
.modaal-close:hover:after,
.modaal-close:hover:before {
  background: #666;
}

/*========= レイアウトのためのCSS ===============*/

body {
  vertical-align: middle;
  text-align: center;
  width: 100%;
  height: 100vh;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-image: radial-gradient(
    circle farthest-corner at 10% 20%,
    rgba(222, 168, 248, 1) 0%,
    rgba(168, 222, 248, 1) 21.8%,
    rgba(189, 250, 205, 1) 35.6%,
    rgba(243, 250, 189, 1) 52.9%,
    rgba(250, 227, 189, 1) 66.8%,
    rgba(248, 172, 172, 1) 90%,
    rgba(254, 211, 252, 1) 99.7%
  );
}

h1 {
  font-size: 1.5rem;
  text-align: center;
  text-transform: uppercase;
  padding: 20px;
  color: #fff;
}

h2 {
  font-size: 1.2rem;
  text-align: center;
  margin: 0 0 30px 0;
}

p {
  margin-top: 20px;
  text-align: center;
}

a {
  color: #333;
  outline: none;
}

section {
  padding: 30px;
}
/* 
   外部依存 JS:
     - https://code.jquery.com/jquery-3.4.1.min.js
     - https://cdnjs.cloudflare.com/modaal.min.js
     - https://cdnjs.cloudflare.com/jquery.cookie.js
   外部依存 CSS (このデモは下記の CSS にも依存します):
     - https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css
     - https://cdnjs.cloudflare.com/modaal.min.css
 */

//初回のみモーダルをすぐ出す判定。flagがモーダル表示のstart_open後に代入される
var access = $.cookie("access");
if (!access) {
  flag = true;
  $.cookie("access", false);
} else {
  flag = false;
}

//モーダル表示
$(".video-open").modaal({
  start_open: flag, // ページロード時に表示するか
  overlay_close: true, //モーダル背景クリック時に閉じるか
  type: "video",
  background:
  "linear-gradient( 109.6deg,  rgba(218,185,252,1) 11.2%, rgba(125,89,252,1) 91.1% )", // 背景色
  overlay_opacity: 0.8, // 透過具合
  before_open: function () {
    // モーダルが開く前に行う動作
    $("html").css("overflow-y", "hidden"); /*縦スクロールバーを出さない*/
  },
  after_close: function () {
    // モーダルが閉じた後に行う動作
    $("html").css("overflow-y", "scroll"); /*縦スクロールバーを出す*/
  } });
//# sourceURL=pen.js