<div class="contents">text</div>
<ul class="cp_snslink06">
<li class="cp_link facebook"><a href="#"><div class="nav-label"><span>facebook Button</span></div></a></li>
<li class="cp_link twitter"><a href="#"><div class="nav-label"><span>X Button</span></div></a></li>
<li class="cp_link instagram"><a href="#"><div class="nav-label"><span>instagram Button</span></div></a></li>
</ul>
body {
/*設置する親要素ページ全体ならbodyなど*/
position: relative;
height: 100vh;
margin: 0;
padding: 0;
}
.contents {
/*サンプルはfixedの確認のためにheight指定しています。*/
height: 2000px;
}
/*SNSリンクブロックの位置設定*/
.cp_snslink06 {
position: fixed;
top: 50%;
transform: translateY(-50%);
display: block;
margin: 0;
padding: 0;
}
/*それぞれのSNS iconの設定*/
.cp_snslink06 .cp_link {
position: relative;
left: -150px;
display: flex;
align-items: center;
justify-content: flex-end;
margin: 5px;
padding: 0 50px 0 10px;
height: 45px;
border-radius: 0 30px 30px 0;
background: #80cbc4;
transition: all 1s;
}
.cp_snslink06 .cp_link a {
text-decoration: none;
color: #009688;
}
/*SNS各種ロゴ背景*/
.cp_snslink06 .cp_link.facebook::before,
.cp_snslink06 .cp_link.twitter::before,
.cp_snslink06 .cp_link.instagram::before {
position: absolute;
content: '';
right: 8px;
background: #009688;
width: 35px;
height: 35px;
border-radius: 50%;
}
/*SNS各種ロゴ*/
.cp_snslink06 .cp_link.facebook::after,
.cp_snslink06 .cp_link.twitter::after,
.cp_snslink06 .cp_link.instagram::after {
position: absolute;
content: '';
right: 16px;
background-size: contain;
background-repeat: no-repeat;
width: 20px;
height: 20px;
}
/*facebook*/
.cp_snslink06 .cp_link.facebook::after {
background-image: url(facebook_logo_secondary.svg);
}
/*twitter*/
.cp_snslink06 .cp_link.twitter::after {
background-image: url(x-logo.svg);
}
/*instagram*/
.cp_snslink06 .cp_link.instagram::after {
background-image: url(instagram_glyph_white.svg);
}
/* hover時の動きの設定 */
.cp_snslink06 .cp_link:hover {
left: -5px;
background: #009688;
}
.cp_snslink06 .cp_link:hover a {
color: #ffffff;
}
/*SNS各種ロゴを回転させる*/
.cp_snslink06 .cp_link:hover::before,
.cp_snslink06 .cp_link:hover::after {
transition: all 1s;
transform: rotate(360deg);
}
/*SNS各種ロゴ背景を変える*/
/* facebook */
.cp_snslink06 .cp_link.facebook:hover::before {
background: #0866ff;
}
/* twitter */
.cp_snslink06 .cp_link.twitter:hover::before {
background: #000000;
}
/* instagram */
.cp_snslink06 .cp_link.instagram:hover::before {
background: linear-gradient(45deg, #FF7A00 0%, #FF0169 50.06%, #D300C5 99.36%);
}