Skip to content

Commit

Permalink
Gradient border card
Browse files Browse the repository at this point in the history
Gradient border card
  • Loading branch information
Samir123786 committed Jul 22, 2022
1 parent 2f3e491 commit 0714b82
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 38 deletions.
42 changes: 35 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>fun with javascript</title>
<title>gradient border effect card</title>
<link rel="stylesheet" href="style.css">
</head>
<body>

<h1>Fun with javascript</h1>
<button id="btn">Generate button</button>
<div class="box">

<body>
<div class="container">
<div class="box">
<span></span>
<div class="content">
<h2>first card</h2>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Autem impedit quisquam harum mollitia eum
reiciendis minima, molestias rem culpa, totam incidunt cumque? Sapiente deleniti officia repellat
nisi necessitatibus perferendis error?</p>
<a href="#">Read More</a>
</div>
</div>
<div class="box">
<span></span>
<div class="content">
<h2>first card</h2>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Autem impedit quisquam harum mollitia eum
reiciendis minima, molestias rem culpa, totam incidunt cumque? Sapiente deleniti officia repellat
nisi necessitatibus perferendis error?</p>
<a href="#">Read More</a>
</div>
</div>
<div class="box">
<span></span>
<div class="content">
<h2>first card</h2>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Autem impedit quisquam harum mollitia eum
reiciendis minima, molestias rem culpa, totam incidunt cumque? Sapiente deleniti officia repellat
nisi necessitatibus perferendis error?</p>
<a href="#">Read More</a>
</div>
</div>
</div>
<script src="scritpt.js"></script>
</body>

</html>
126 changes: 95 additions & 31 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,104 @@
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
}
body{
min-height: 100vh;
background-color: #000;
font-family: sans-serif;}

h1{
text-align: center;
color: #fff;
font-size: 4rem;
text-transform: capitalize;

}
#btn{
margin-top: 100px;
padding: 10px 30px;
width: 50%;
border-radius: 10px;
font-size: 2rem;
margin-left: 250px;
cursor: pointer;
transition: all 0.5s;
}
#btn:hover{
background-color: rgb(8, 255, 247);

}
.container{
position: relative;
display: flex;
justify-content: center;
align-items: center;
padding: 40px 0;
flex-wrap: wrap;

}
.container .box{
position: relative;
width: 320px;
height: 400px;
color: #fff;
background-color: #111;
margin: 20px 30px;
display: flex;
justify-content: center;
align-items: center;
transition: all 0.5s;
}
.container .box:hover{
transform: translateY(-15px);
}

.container .box::before{
content:"" ;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(45deg, #ffbc00,#ff0058);
filter: blur(30px);
}
.container .box:nth-child(2)::before,
.container .box:nth-child(2)::after{
background: linear-gradient(315deg, #03a9f4, #ff0058);

}
.container .box:nth-child(3)::before,
.container .box:nth-child(3)::after{
background: linear-gradient(315deg,#4dff03, #00d0ff);

}
.container .box span{
position: absolute;
top: 6px;
left: 6px;
right: 6px;
bottom: 6px;
background: rgba(0, 0, 0, 0.6);
z-index: 2;
}
.container .box span::before{
content: "";
position: absolute;
top: 0;
left: 0;
width: 50%;
height: 100%;
background: rgba(255, 255, 255, 0.01);
pointer-events: none;
}
.container .box .content {

}
.box{
width: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 400px;
flex-wrap: wrap;
}
position: relative;
z-index: 10;
padding: 20px 40px;
}
.container .box .content h2{
font-size: 2em;
color: #fff;
margin-bottom: 10px;
text-transform: capitalize;
}
.container .box .content p{
font-size: 1.1em;
color: #fff;
margin-bottom: 10px;
line-height: 1.4rem;

}
.container .box .content a {
text-decoration: none;
background: #fff;
padding: 10px;
font-size: 1.1rem;
display: inline-block;
color: #111;
font-weight: bold;
border-radius: 4px;
margin-top: 10px;
}

0 comments on commit 0714b82

Please sign in to comment.