CSS3 Neumorphic社交媒体图标

84 篇文章 0 订阅

CSS3 Neumorphic社交媒体图标

教程地址原文地址(YouTube)

B站教程原文转载(bilibili)

两个视频的内容相同,第二个为转载

效果图

在这里插入图片描述

代码区

html

<div class="center">
  <div class="icons first">
    <li><a href="#"><span class="fab fa-facebook-f"></span></a></li>
    <li><a href="#"><span class="fab fa-twitter"></span></a></li>
    <li><a href="#"><span class="fab fa-instagram"></span></a></li>
    <li><a href="#"><span class="fab fa-linkedin-in"></span></a></li>
    <li><a href="#"><span class="fab fa-github"></span></a></li>
  </div>
  <div class="icons second">
    <li><a href="#"><span class="fab fa-facebook-f"></span></a></li>
    <li><a href="#"><span class="fab fa-twitter"></span></a></li>
    <li><a href="#"><span class="fab fa-instagram"></span></a></li>
    <li><a href="#"><span class="fab fa-linkedin-in"></span></a></li>
    <li><a href="#"><span class="fab fa-github"></span></a></li>
  </div>
</div>

CSS

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  background: #dde1e7;
  width: 100%;
}
.icons{
  display: flex;
  margin: 40px 0;
}
li{
  position: relative;
  list-style: none;
  height: 70px;
  width: 70px;
  margin: 0 10px;
  border-radius: 50%;
  background: #dde1e7;
  cursor: pointer;
  box-shadow: -3px -3px 7px #ffffff73,
              3px 3px 5px rgba(94,104,121,0.288);
}
li a{
  line-height: 70px;
  font-size: 27px;
  color: #b6bbc5;
}
.first li.shadow-1{
  box-shadow: inset -3px -3px 7px #ffffff73,
              inset 3px 3px 5px rgba(94,104,121,0.288);
}
.first li.shadow-1 a{
  font-size: 25px;
}
.second li.shadow-2 a{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 55px;
  width: 55px;
  line-height: 55px;
  border-radius: 50%;
  background: #dde1e7;
  font-size: 24px;
  box-shadow: inset -3px -3px 7px #ffffff73,
              inset 3px 3px 5px rgba(94,104,121,0.288);
}
li:nth-child(1).fill-color a{
  color: #4267B2;
}
li:nth-child(2).fill-color a{
  color: #1DA1F2;
}
li:nth-child(3).fill-color a{
  color: #E1306C;
}
li:nth-child(4).fill-color a{
  color: #2867B2;
}
li:nth-child(5).fill-color a{
  color: #333;
}

JS

$('.first li').click(function(){
  $(this).toggleClass("shadow-1").siblings();
  $(this).toggleClass("fill-color").siblings();
});
$('.second li').click(function(){
  $(this).toggleClass("shadow-2").siblings();
  $(this).toggleClass("fill-color").siblings();
});

教程地址原文地址(YouTube)

B站教程原文转载(bilibili)

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值