最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

動態(tài)Button【手把手教程】【代碼】

2023-04-17 23:52 作者:泥想什么呢想  | 我要投稿


效果截圖

button.html

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Button Effects Javascript</title>

<link rel="stylesheet" type="text/css" href="style.css">

</head>

<body>

<a href="#">

<i></i>

<i></i>

<span>Button</span>

</a>

<script>

let btn = document.querySelector('a');

btn.addEventListener('mousemove',e =>{

let rect = e.target.getBoundingClientRect();

let x = e.clientX*3-rect.left;

btn.style.setProperty('--x',x +'deg');

})

</script>

</body>

</html>

style.css

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

*

{

margin: 0;

padding: 0;

box-sizing: border-box;

font-family: 'Poppins',sans-serif;

}

:root

{

--x: 45deg;

}

body

{

display: flex;

justify-content: center;

align-items: center;

min-height: 100vh;

background: #0e1538;

}

a

{

position: relative;

width: 150px;

height: 55px;

display: inline-block;

border-radius: 5px;

}

a i?

{

position: absolute;

inset: -2px;

display: block;

border-radius: 5px;

}

a i,

a i:nth-child(2)

{

background: linear-gradient(var(--x),#00ccff,#0e1538,#0e1538,#d400d4);

}

a i:nth-child(2)

{

filter: blur(10px);

}

a span

{

position: absolute;

top: 0;

left: 0;

width: 100%;

height: 100%;

display: flex;

justify-content: center;

align-items: center;

text-transform: uppercase;

color: #fff;

letter-spacing: 2px;

border: 1px solid #040a29;

border-radius: 3px;

background: rgba(14, 21, 56, 0.65);

overflow: hidden;

}

a span::before

{

content: '';

position: absolute;

top: 0;

left: -50%;

width: 100%;

height: 100%;

background: rgba(255, 255, 255, 0.075);

transform: skew(25deg);

}


動態(tài)Button【手把手教程】【代碼】的評論 (共 條)

分享到微博請遵守國家法律
福建省| 卢湾区| 桃江县| 绩溪县| 泰顺县| 台州市| 乌兰察布市| 汾阳市| 泰和县| 盘锦市| 永吉县| 汪清县| 霍城县| 镇沅| 奇台县| 高尔夫| 基隆市| 法库县| 鄂尔多斯市| 平乐县| 和林格尔县| 崇义县| 乌鲁木齐县| 韩城市| 镇赉县| 罗城| 长顺县| 乌海市| 曲周县| 皋兰县| 海城市| 贵德县| 泰安市| 鲁甸县| 阿勒泰市| 延安市| 涿州市| 岑溪市| 龙陵县| 陇西县| 象山县|