WEBサイト制作の勉強

WEBサイト制作の勉強の為の解説ブログです。

フェリカテクニカルアカデミー

フィルタリングとモーダルウィンドウを導入


chiyo-katsumasa.com



fancyapps.com

www.kunkalabs.com


<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MixItUpとFancyBoxを合体</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/jquery.fancybox.css">
<style>
.fancybox-slide--iframe .fancybox-content {
width  : 800px;
height : 600px;
max-width  : 80%;
max-height : 80%;
margin: 0;
}
</style>
</head>
<body>
<h1>MixItUpとFancyBoxを合体</h1>
<ul class="btn-set">
<li data-filter="all">全部</li>
<li data-filter=".blue">青組</li>
<li data-filter=".red">紅組</li>
<li data-filter=".yt">YouTube</li>
<li data-filter=".two">2番だけ</li>
</ul> 
<div class="garllery">
<p class="mix blue"><a href="img/01.jpg" data-fancybox><img src="img/01.jpg" alt=""></a></p>

<p class="mix blue two"><a href="img/02.jpg" data-fancybox><img src="img/02.jpg" alt=""></a></p>
<p class="mix blue"><a href="img/03.jpg" data-fancybox><img src="img/03.jpg" alt=""></a></p>
<p class="mix red"><a href="img/04.jpg" data-fancybox><img src="img/04.jpg" alt=""></a></p>
<p class="mix red two"><a href="img/05.jpg" data-fancybox><img src="img/05.jpg" alt=""></a></p>
<p class="mix red"><a href="img/06.jpg" data-fancybox><img src="img/06.jpg" alt=""></a></p>


<p class="mix yt"><a href="https://www.youtube.com/watch?v=4kVvhBiN6fM" data-fancybox><img src="img/07.jpg" alt=""></a></p>

<p class="mix yt two"><a href="https://www.youtube.com/watch?v=hE9hUig3zq8" data-fancybox><img src="img/08.jpg" alt=""></a></p>

<p class="mix yt"><a href="https://www.youtube.com/watch?v=nNEPMQQZkh8" data-fancybox><img src="img/09.jpg" alt=""></a></p>

<p class="mix yt"><a href="single-page/index.html" data-fancybox data-type="iframe"><img src="img/10.jpg" alt=""></a></p>

<p class="mix yt"><a href="season/index.html" data-fancybox data-type="iframe"><img src="img/10.jpg" alt=""></a></p>

</div>


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="js/mixitup.js"></script>
<script>
var mixer=mixitup('.garllery');
</script>
<script src="js/jquery.fancybox.js"></script>
</body>
</html>

スタイルシート

@charset "utf-8";

/*!
 * ress.css • v1.2.2
 * MIT License
 * github.com/filipelinhares/ress
 * 全ての要素にbox-sizing: border-box;.
 * 全ての背景画像にbackground-repeat: no-repeat.
 */html{box-sizing:border-box;-webkit-text-size-adjust:100%}*,:after,:before{background-repeat:no-repeat;box-sizing:inherit}:after,:before{text-decoration:inherit;vertical-align:inherit}*{padding:0;margin:0}audio:not([controls]){display:none;height:0}hr{overflow:visible}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}summary{display:list-item}small{font-size:80%}[hidden],template{display:none}abbr[title]{border-bottom:1px dotted;text-decoration:none}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}code,kbd,pre,samp{font-family:monospace,monospace}b,strong{font-weight:bolder}dfn{font-style:italic}mark{background-color:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}input{border-radius:0}[role=button],[type=button],[type=reset],[type=submit],button{cursor:pointer}[disabled]{cursor:default}[type=number]{width:auto}[type=search]{-webkit-appearance:textfield}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}textarea{overflow:auto;resize:vertical}button,input,optgroup,select,textarea{font:inherit}optgroup{font-weight:700}button{overflow:visible}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:0;padding:0}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button:-moz-focusring{outline:1px dotted ButtonText}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}button,select{text-transform:none}button,input,select,textarea{background-color:transparent;border-style:none;color:inherit}select{-moz-appearance:none;-webkit-appearance:none}select::-ms-expand{display:none}select::-ms-value{color:currentColor}legend{border:0;color:inherit;display:table;max-width:100%;white-space:normal}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}img{border-style:none;vertical-align: bottom}progress{vertical-align:baseline}svg:not(:root){overflow:hidden}audio,canvas,progress,video{display:inline-block}@media screen{[hidden~=screen]{display:inherit}[hidden~=screen]:not(:active):not(:focus):not(:target){position:absolute!important;clip:rect(0 0 0 0)!important}}[aria-busy=true]{cursor:progress}[aria-controls]{cursor:pointer}[aria-disabled]{cursor:default}::-moz-selection{background-color:#b3d4fc;color:#000;text-shadow:none}::selection{background-color:#b3d4fc;color:#000;text-shadow:none}ul,ol{list-style:none;}a{text-decoration:none;}.wrapper{overflow:hidden;}body{overflow-y:scroll;}


h1{
text-align: center;
margin: 30px 0;
}
.btn-set{
width: 960px;
margin: 0 auto 50px;
display: flex;
}
.btn-set>li{
margin-right:20px;
padding: 10px 20px;
background-color: #444;
color: #FFF;
cursor: pointer;
}
.btn-set>li:nth-of-type(2){
background-color:darkslateblue;
}
.btn-set>li:nth-of-type(3){
background-color: tomato;
}
.btn-set>li.mixitup-control-active{
border:2px solid #000;
background-color: #FFF;
color: #444;
box-sizing: border-box;
}


.garllery{
width: 960px;
margin: 0 auto 100px;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.garllery>p{
width: calc((100% - 20px) / 3);
margin-bottom: 10px;
}
.garllery>p:nth-of-type(n+7){
border:1px solid #777;
}
.garllery img{
max-width: 100%;
}