svg+css实现清爽订单卡片效果代码
代码语言:html
所属分类:布局界面
代码描述:svg+css实现清爽订单卡片效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
:root {
--clr--neutral--900: hsl(223, 50%, 9%);
--clr--neutral--800: hsl(223, 49%, 18%);
--clr--neutral--600: hsl(223, 47%, 23%);
--clr--primary--400: hsl(245, 75%, 52%);
--clr--neutral--300: hsl(224, 23%, 55%);
--clr--neutral--200: hsl(225, 100%, 98%);
--clr--neutral--100: hsl(0, 0%, 100%);
--clr--primary--Bblue: hsl(245, 75%, 52%);
--clr--primary--Pblue: hsl(225, 100%, 94%);
}
* {
margin: 0;
padding: 0;
font-family: "Red Hat Display", sans-serif;
box-sizing: border-box;
}
/*TYPOGRAPHY & BUTTONS*/
h1 {
font-size: 1.35rem;
font-weight: 900;
margin-bottom: 0.8em;
text-align: center;
color: var(--clr--neutral--900);
}
h3 {
color: var(--clr--neutral--900);
font-size: 1.25rem;
margin-bottom: 0.8em;
}
p {
color: var(--clr--neutral--300);
font-size: 1rem;
margin-bottom: 1.25em;
max-width: 17rem;
}
button {
height: 1.125rem;
}
body {
display: grid;
place-items: center;
width: 100%;
height: 100vh;
background: url(images/pattern-background-desktop.svg);
background-color: var(--clr--primary--Pblue);
background-repeat: no-repeat;
background-size: contain;
overflow-x: hidden;
}
main {
display: flex;
align-items: center;
justify-content: center;
width: 70%;
}
.summary-card {
display: flex;
flex-direction: column;
overflow: hidden;
padding: 1.5em 1.8em;
min-width: 375px;
width: 50%;
max-width: 33%;
border-radius: 20px;
background-color: var(--clr--neutral--100);
position: relative;
box-shadow: -5px 30px 25px 10px hsla(223, 32%, 71%, 0.3);
}
#head-svg {
position: absolute;
left: 0;
top: 0;
max-width: 100%;
margin-bottom: 1.5rem;
}
.order-info {
margin-top: 14rem;
}
.order-text {
display: grid;
place-items: center;
text-align: center;
}
.order-plan {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0.8rem 0;
width: 100%;
border-radius: 15px;
padding: 1.25em 1em;
background-color: var(--clr--neutral--200);
}
.order-details > * {
margin: 0;
padding: 0;
}
.order-details h4 {
font-size: 1rem;
font-weight: 700;
margin-bottom: 0.2em;
margin-right: 3em;
margin-left: 1.5em;
}
.order-details p {
margin-right: 3em;
margin-left: 1.5em;
font-style: italic;
}
.order-plan a {
font-weight: 600;
text-decoration: none;
margin-right: 0.25em;
}
.order-plan a:hover {
text-decoration: underline;
color: var(--clr--neutral--400);
}
.order-actions {
display: flex;
flex-direction: column;
}
.btn {
cursor: pointer;
height: 3em;
font-size: 1rem;
font-weight: 700;
text-decoration: none;
border: none;
border-radius: 12px;
margin: 0.25em 0;
}
.btn-primary {
background-color: var(--clr--primary--Bblue);
color: var(--clr--neutral--200);
box-shadow: -2px 15px 15px 5px hsla(223, 47%, 80%, 0.486);
}
.btn-primary:hover {
background-color: var(--clr--neutral--800);
color: var(--clr--neutral--200);
}
.btn-no-outline {
background: none;
color: var(--clr--neutral--300);
}
.btn-no-outline:hover {
background: rgb(211, 0, 0);
color: var(--clr--neutral--100);
}
.attribution {
font-size: 11px;
text-align: center;
}
.attribution a {
color: hsl(228, 45%, 44%);
}
.attribution a:hover {
color: var(--clr--neutral--900);
}
</style>
<link href="https://fonts.googleapis.com/css2?family=Red+Hat+Display:wght@500;700;900&display=swap" rel="stylesheet">
</head>
<body>
<!-- HERE IS THE HEADER -->
<header></header>
<!-- NAVIGATION BAR GOES HERE -->
<nav class="nav-bar"></nav>
<!-- MAIN CONTENT GOES HERE -->
<main>
<div class="summary-card">
<svg id="head-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="450"
height="220">
<defs>
<path id="a" d="M0 0h450v220H0z" />
</defs>
<g fill="none" fill-rule="evenodd">
<mask id="b" fill="#fff">
<use xlink:href="#a" />
</mask>
<use fill="#382AE1" xlink:href="#a" />
<path fill="#1E1FCD" fill-rule="nonzero"
d="M218.812 46v13.368h1.685v3.623h6.303v77.983l12.758 6.699v-12.891h3.046v14.545l2.984 1.543v112.908L31.9 266.214v-72.237h7.013V124.52h2.548v-9.55h3.045v9.55h14.15l-.001.014v.196c-.01 2..........完整代码请登录后点击上方下载按钮下载查看
















网友评论0