css实现悬浮刷卡支付动画效果代码
代码语言:html
所属分类:悬停
代码描述:css实现悬浮刷卡支付动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css?family=Lexend+Deca&display=swap");
:root {
--background: #33837e;
--left-side: #5de2a3;
--card: #c7ffbc;
--card-line: #80ea69;
--button-color-3: #26850e;
--button-color-2: #379e1f;
--button-color-1: #56be3e;
--post: #dddde0;
--numbers: #838183;
--numbers-2: #aaa9ab;
--post-line: #757375;
--post-line2: #545354;
--dollar: #4b953b;
}
html {
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
}
body {
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
width: 100%;
background: var(--background);
}
.container {
background-color: #ffffff;
display: flex;
width: 460px;
height: 120px;
position: relative;
border-radius: 6px;
transition: 0.3s ease-in-out;
}
.container:before {
width: 200vw;
position: absolute;
top: 0;
left: -100vw;
height: 100%;
content: "";
}
.container:hover {
transform: scale(1.03);
width: 220px;
}
.container:hover .left-side {
width: 100%;
}
.left-side {
background-color: var(--left-side);
width: 130px;
height: 120px;
border-radius: 4px;
position: relative;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
transition: 0.3s;
flex-shrink: 0;
overflow: hidden;
}
.right-side {
width: calc(100% - 130px);
display: flex;
align-items: center;
overflow: hidden;
cursor: pointer;
justify-content: space-between;
white-space: nowrap;
transition: 0.3s;
}
.right-side:hover {
background-color: #f9f7f9;
}
.arrow {
width: 20px;
height: 20px;
margin-right: 20px;
}
.new {
font-size: 23px;
font-family: "Lexend Deca", sans-serif;
margin-left: 20px;
}
.card {
width: 70px;
height: 46px;
background-color: var(--card);
border-radius: 6px;
position: absolute;
display: flex;
z-index: 10;
flex-direction: column;
align-items: center;
-webkit-box-shadow: 9px 9px 9px -2px rgba(77, 200, 143, 0.72);
-moz-box-shadow: 9px 9px 9px -2px .........完整代码请登录后点击上方下载按钮下载查看
网友评论0