<div class="contents">text</div>
<div class="cp_snslink11">
<div class="cp_link_list">
<input type="checkbox" id="cp_toggle" />
<label for="cp_toggle" class="share"></label>
<ul class="cp_link">
<li class="twitter"><a href="#" title="Twitter"></a></li>
<li class="facebook"><a href="#" title="Facebook"></a></li>
<li class="instagram"><a href="#" title="Instagram"></a></li>
</ul>
</div>
</div>
body {
/*設置する親要素ページ全体ならbodyなど*/
position: relative;
height: 100vh;
margin: 0;
padding: 0;
}
.contents {
/*サンプルはfixedの確認のためにheight指定しています。*/
height: 2000px;
}
.cp_snslink11 {
position: fixed;
bottom: 0;
right: 20px;
display: block;
margin: 0;
}
.cp_snslink11 .cp_link_list{
position: relative;
perspective: 1000px;
}
.cp_snslink11 .cp_link_list input{
display: none;
}
/*シェアボタン*/
.cp_snslink11 .cp_link_list label.share {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 50px;
background: #eeeeee;
border-radius: 50%;
cursor: pointer;
transition: all 0.3s;
}
.cp_snslink11 .cp_link_list label.share::before{
position: absolute;
content: '';
background-image: url(share_icon_black.svg);
background-size: contain;
background-repeat: no-repeat;
width: 25px;
height: 25px;
}
/*各種SNSリンク*/
.cp_snslink11 .cp_link_list .cp_link li {
position: absolute;
bottom: 0;/*最初の位置*/
right: 0;
opacity: 0;
display: flex;
align-items: center;
justify-content: center;
list-style: none;
margin: 0 0 0 0;
padding: 0;
width: 50px;
height: 50px;
border-radius: 50%;
cursor: pointer;
transition: all 0.5s;
z-index: -1;
}
.cp_snslink11 .cp_link_list .cp_link li.twitter {
background: #000000;
}
.cp_snslink11 .cp_link_list .cp_link li.facebook {
background: #0866ff;
}
.cp_snslink11 .cp_link_list .cp_link li.instagram {
background: linear-gradient(45deg, #FF7A00 0%, #FF0169 50.06%, #D300C5 99.36%);
}
/*SNS各種ロゴ*/
.cp_snslink11 .cp_link .facebook::before,
.cp_snslink11 .cp_link .twitter::before,
.cp_snslink11 .cp_link .instagram::before {
position: absolute;
content: '';
background-size: contain;
background-repeat: no-repeat;
width: 25px;
height: 25px;
}
/*facebook*/
.cp_snslink11 .cp_link .facebook::before {
background-image: url(facebook_logo_secondary.svg);
}
/*twitter*/
.cp_snslink11 .cp_link .twitter::before {
background-image: url(x-logo.svg);
}
/*instagram*/
.cp_snslink11 .cp_link .instagram::before {
background-image: url(instagram_glyph_white.svg);
}
/* シェアボタンクリック時の動きの設定 */
.cp_snslink11 .cp_link_list input:checked ~ label {
transform: scale(0.8, 0.8);
}
.cp_snslink11 .cp_link_list input:checked ~ .cp_link li{
opacity: 1;
transform: translateY(0) rotate(360deg);
transition: all 0.3s;
opacity: 0.7;
}
.cp_snslink11 .cp_link_list input:checked ~ .cp_link li.twitter{
bottom: 60px;
transition-delay: 0;
z-index: 4;
}
.cp_snslink11 .cp_link_list input:checked ~ .cp_link li.facebook{
bottom: 120px;
transition-delay: 0.1s;
z-index: 3;
}
.cp_snslink11 .cp_link_list input:checked ~ .cp_link li.instagram{
bottom: 180px;
transition-delay: 0.2s;
z-index: 2;
}
.cp_snslink11 .cp_link_list input:checked ~ .cp_link li:hover {
opacity: 1;
transform: scale(1.1, 1.1);
}