墨水按钮Demo

源码Demo:

<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<title>ink_button</title>
	<style>
		* {margin: 0; padding: 0;}
		body {
			width: 100%;
			height: 100%;
			font-family: sans-serif;
			background-image: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
		}

		#wrapper {
			width: 800px;
			height: 400px;
			display: flex;
			justify-content: center;
			align-items: center;
			margin: 0 auto;
		}

		.button {
			position: relative;
			width: 260px;
			height: 70px;
			display: flex;
			justify-content: center;
			align-items: center;
			overflow: hidden;
			margin: 0 0.8rem;
			border-radius: 10px;
			box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 3px 8px rgba(0, 0, 0, 0.1);
			cursor: pointer;
			transition: all 0.3s cubic-bezier(0.1, 0.22, 0.3, 1);
		}

		#btn1 {
			background: #2980b9;
		}
		#btn2 {
			background: #8e44ad;
		}
		#btn3 {
			background: #16a085;
		}
		#btn4 {
			background: #e74c3c;
		}

		.button span {
			color: #fff;
			font-size: 1rem;
			z-index: 10;
			text-transform: uppercase;
			letter-spacing: 2px;
		}

		.back {
			position: absolute;
			width: 0;
			height: 0;
			filter: url(#filter);
			border-radius: 50%;
			z-index: 5;
			transition: all 2.5s cubic-bezier(0.1, 0.22, 0.3, 1);
		}

		#btn1 .back {
			left: -50%;
			top: -50%;
			background: #27ae60;
		}
		#btn2 .back {
			right: -50%;
			top: -50%;
			background: #c0392b;
		}
		#btn3 .back {
			left: -50%;
			bottom: -50%;
			background: #34495e;
		}
		#btn4 .back {
			right: -50%;
			bottom: -50%;
			background: #2980b9;
		}
		.button:hover .back {
			width: 330px;
			height: 160px;
		}
	</style>
	</head>
	<body>
	<svg width="0" height="0"> 
		<filter id="filter">
			<feTurbulence type="fractalNoise" baseFrequency=".02" numOctaves="9" />
			<feDisplacementMap in="SourceGraphic" scale="100" />
		</filter>
	</svg>
	<div id="wrapper">
		<div class="button" id="btn1"> 
			<span>hover</span>
			<div class="back"></div>
		</div>
		<div class="button" id="btn2"> 
			<span>hover</span>
			<div class="back"></div>
		</div>
		<div class="button" id="btn3"> 
			<span>hover</span>
			<div class="back"></div>
		</div>
		<div class="button" id="btn4"> 
			<span>hover</span>
			<div class="back"></div>
		</div>
	</div>


</body>
</html>

公众号:
在这里插入图片描述
微信:
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值