用HTML & CSS 制作超炫的分享转发按钮-【网页前端设计】cid1030

 

index.html

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css">
  </head>
  <body>
    <div class="share-button">
      <span><i class="fas fa-share-alt"></i> Share!</span>
      <a href="#"><i class="fab fa-facebook-f"></i></a>
      <a href="#"><i class="fab fa-twitter"></i></a>
      <a href="#"><i class="fab fa-instagram"></i></a>
      <a href="#"><i class="fab fa-linkedin-in"></i></a>
    </div>
  </body>
</html>

style.css

body{
  margin: 0;
  padding: 0;
  font-family: "montserrat",sans-serif;
  background: #f1f1f1;
  display: flex;
  height: 100vh;
  align-items: center;
  justify-content: center;
}

.share-button{
  width: 280px;
  height: 80px;
  background: #dfe6e9;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: .3s linear;
}

.share-button:hover{
  transform: scale(1.1);
}

.share-button span{
  position: absolute;
  width: 100%;
  height: 100%;
  background: #2d3436;
  color: #f1f1f1;
  text-align: center;
  line-height: 80px;
  z-index: 999;
  transition: .6s linear;
  border-radius: 40px;
}

.share-button:hover span{
  transform: translateX(-100%);
  transition-delay: .3s;
}

.share-button a{
  flex: 1;
  font-size: 26px;
  color: #2d3436;
  text-align: center;
  transform: translateX(-100%);
  opacity: 0;
  transition: 0.3s linear;
}

.share-button:hover a{
  opacity: 1;
  transform: translateX(0);
}

.share-button a:nth-of-type(1){
  transition-delay: 1s;
}

.share-button a:nth-of-type(2){
  transition-delay: 0.8s;
}

.share-button a:nth-of-type(3){
  transition-delay: 0.6s;
}

.share-button a:nth-of-type(4){
  transition-delay: 0.4s;
}

 

让链接同时具备两种打开方式

获取源码: Share Button
下载数:48人次, 文件大小: 1.1 KB, 上传日期: 2020年-11月-26日

公众号回复:gcode  获取解压密码

qrcode_for_gh_6ea2c28a1709_258 (1)

1,074 人查阅

获取资源构建和完善自己的源码库
源码可以在本地直接演示
同时研究和体验 如何将一些具体的想法的实现过程
源码可以直接嫁接到自己的网站里复用
稍作修改成为自己的作品
下载 (4)

您需要先支付 6元 才能查看此处内容!立即支付