svg+css实现一个信用卡银行卡布局效果代码

代码语言:html

所属分类:布局界面

代码描述:svg+css实现一个信用卡银行卡布局效果代码

代码标签: svg css 信用卡 银行卡 布局

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  


  
  
<style>
@import url("https://fonts.cdnfonts.com/css/credit-card");
:root {
  font-family: "Credit Card";
}

*, *:before, *:after {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  width: 100%;
  background: #0c0c0c;
  overflow: hidden;
  display: grid;
  place-content: center;
}

@property --anim {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
.card {
  --anim: 0;
  --radius: 0.75rem;
  width: 20rem;
  height: 12rem;
  border-radius: var(--radius);
  position: relative;
  display: grid;
  transition: --anim 300ms ease;
}

.card:hover {
  --anim: 1;
}

.cardglow, .cardbg, .cardborder, .numbers {
  grid-area: 1/1/2/2;
}

.cardglow, .cardborder, .numbers {
  background: conic-gradient(#ff3b3b, #ffa801, #ffeb3b, #6cff3b, #0fbcf9, #5d62fb, #eb3bff, #ff3b3b);
}

.cardglow {
  border-radius: 0.25rem;
  filter: blur(calc(0.375rem + var(--anim) * 0.25rem)) hue-rotate(calc(20deg * var(--anim)));
}

.cardborder {
  border-radius: var(--radius);
  filter: hue-rotate(calc(20deg * var(--anim)));
}

.cardbg {
  margin: 0.125rem;
  border-radius: calc(var(--radius) - 0.125rem);
  background: none;
  -webkit-backdrop-filter: contrast(50%) brightness(15%) blur(1.25rem);
          backdrop-filter: contrast(50%) brightness(15%) blur(1.25rem);
  box-shadow: inset rgba(0, 0, 0, 0.5) 0 0 0.625rem;
  display: grid;
}

.logo {
  position: absolute;
  width: 3rem;
  height: 2.5rem;
  margin: 1.25rem;
  -webkit-clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 50% 100%, 0% 25%);
          clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 50% 100%, 0% 25%);
  -webkit-backdrop-filter: brightness(666%) contrast(200%);
          backdrop-filter: brightness(666%) contrast(200%);
}

.numbers {
  -webkit-background-clip: text;
          background-clip: text;
  z-index: 20;
  color: transparent;
  text-align: center;
  padding-top: 37%;
  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0