Skip to content

Instantly share code, notes, and snippets.

@ABD-01
Created January 14, 2021 16:31
Show Gist options
  • Save ABD-01/f1caeceebc63b241c18db7019636b002 to your computer and use it in GitHub Desktop.
Save ABD-01/f1caeceebc63b241c18db7019636b002 to your computer and use it in GitHub Desktop.
UI #3 - Profile Card
<div class="card">
<div class="ds-top"></div>
<div class="avatar-holder">
<img src="https://avatars0.githubusercontent.com/u/63636498?s=460&u=e711a0f4189d9511a2b22b2749d9b09735599dcd&v=4" alt="ABD">
</div>
<div class="name">
<a href="https://github.com/ABD-01" target="_blank">ABD-01</a>
<!-- <h6 title="Followers"><i class="fas fa-users"></i> <span class="followers">18</span></h6> -->
</div>
<div class="button">
<a href="https://github.com/ABD-01" class="btn" onmousedown="follow();">Follow <i class="fas fa-user-plus"></i></a>
</div>
<div class="ds-info">
<div class="ds pens">
<h6 title="Number of pens created by the user">Repositories <i class="fas fa-project-diagram"></i></h6>
<p>19</p>
</div>
<div class="ds projects">
<h6 title="Number of projects created by the user">Stars <i class="fas fa-star"></i></h6>
<p>65</p>
</div>
<div class="ds posts">
<h6 title="Number of posts">Followers <i class="fas fa-users"></i></h6>
<p>18</p>
</div>
</div>
<div class="ds-skill">
<h6>Languages Used <i class="fa fa-code" aria-hidden="true"></i></h6>
<div class="skill html">
<h6><i class="fab fa"></i> Jupyter Notebook </h6>
<div class="bar bar-html">
<p>79.68%</p>
</div>
</div>
<div class="skill css">
<h6><i class="fab fa-cuttlefish"></i> C </h6>
<div class="bar bar-css">
<p>11.25%</p>
</div>
</div>
<div class="skill javascript">
<h6><i class="fab fa-python"></i> Python </h6>
<div class="bar bar-js">
<p>3.01%</p>
</div>
</div>
</div>
</div>
const target = {
clicked: 0,
currentFollowers: 90,
btn: document.querySelector("a.btn"),
fw: document.querySelector("span.followers")
};
const follow = () => {
target.clicked += 1;
target.btn.innerHTML = 'Following <i class="fas fa-user-times"></i>';
if (target.clicked % 2 === 0) {
target.currentFollowers -= 1;
target.btn.innerHTML = 'Follow <i class="fas fa-user-plus"></i>';
}
else {
target.currentFollowers += 1;
}
target.fw.textContent = target.currentFollowers;
target.btn.classList.toggle("following");
}
@import url('https://fonts.googleapis.com/css?family=Krub:400,700');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
width: 100%;
height: 100%;
}
body {
background: #202020;
font-family: 'Krub', sans-serif;
}
.card {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 250px;
height: 400px;
border-radius: 10px;
box-shadow: 0 10px 25px 5px rgba(0, 0, 0, 0.2);
background: #151515;
overflow: hidden;
.ds-top {
position: absolute;
margin: auto;
top: 0;
right: 0;
left: 0;
width: 300px;
height: 80px;
background: crimson;
animation: dsTop 1.5s;
}
.avatar-holder {
position: absolute;
margin: auto;
top: 40px;
right: 0;
left: 0;
width: 100px;
height: 100px;
border-radius: 50%;
box-shadow: 0 0 0 5px #151515,
inset 0 0 0 5px #000000,
inset 0 0 0 5px #000000,
inset 0 0 0 5px #000000,
inset 0 0 0 5px #000000,;
background: white;
overflow: hidden;
animation: mvTop 1.5s;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
.name {
position: absolute;
margin: auto;
top: -60px;
right: 0;
bottom: 0;
left: 0;
width: inherit;
height: 40px;
text-align: center;
animation: fadeIn 2s ease-in;
a {
color: white;
text-decoration: none;
font-weight: 700;
font-size: 18px;
&:hover {
text-decoration: underline;
color: crimson;
}
}
h6 {
position: absolute;
margin: auto;
left: 0;
right: 0;
bottom: 0;
color: white;
width: 40px;
}
}
.button {
position: absolute;
margin: auto;
padding: 8px;
top: 20px;
right: 0;
bottom: 0;
left: 0;
width: inherit;
height: 40px;
text-align: center;
animation: fadeIn 2s ease-in;
outline: none;
a {
padding: 5px 20px;
border-radius: 10px;
color: white;
letter-spacing: 0.05em;
text-decoration: none;
font-size: 10px;
transition: all 1s;
&:hover {
color: white;
background: crimson;
}
}
}
.ds-info {
position: absolute;
margin: auto;
top: 120px;
bottom: 0;
right: 0;
left: 0;
width: inherit;
height: 40px;
display: flex;
.pens, .projects, .posts {
position: relative;
left: -300px;
width: calc(250px / 3);
text-align: center;
color: white;
animation: fadeInMove 2s;
animation-fill-mode: forwards;
h6 {
text-transform: uppercase;
color: crimson;
}
p {
font-size: 12px;
}
}
.ds {
&:nth-of-type(2) {
animation-delay: .5s;
}
&:nth-of-type(1) {
animation-delay: 1s;
}
}
}
.ds-skill {
position: absolute;
margin: auto;
bottom: 10px;
right: 0;
left: 0;
width: 200px;
height: 100px;
animation: mvBottom 1.5s;
h6 {
margin-bottom: 5px;
font-weight: 700;
text-transform: uppercase;
color: crimson;
}
.skill {
h6 {
font-weight: 400;
font-size: 8px;
letter-spacing: 0.05em;
margin: 4px 0;
color: white;
}
.fab {
color: crimson;
font-size: 14px;
}
.bar {
height: 5px;
background: crimson;
text-align: right;
p {
color: white;
font-size: 8px;
padding-top: 5px;
animation: fadeIn 5s;
}
&:hover {
background: white;
}
}
.bar-html {
width: 95%;
animation: htmlSkill 1s;
animation-delay: .4s;
}
.bar-css {
width: 90%;
animation: cssSkill 2s;
animation-delay: .4s;
}
.bar-js {
width: 75%;
animation: jsSkill 3s;
animation-delay: .4s;
}
}
}
}
@keyframes fadeInMove {
0% {
opacity: 0;
left: -300px;
}
100% {
opacity: 1;
left: 0;
}
}
@keyframes fadeIn {
0% {opacity: 0;}
100% {opacity: 1;}
}
@keyframes htmlSkill {
0% {width: 0;}
100% {width: 95%;}
}
@keyframes cssSkill {
0% {width: 0;}
100% {width: 90%;}
}
@keyframes jsSkill {
0% {width: 0;}
100% {width: 75%;}
}
@keyframes mvBottom {
0% {bottom: -150px;}
100% {bottom: 10px;}
}
@keyframes mvTop {
0% {top: -150px;}
100% {top: 40px;}
}
@keyframes dsTop {
0% {top: -150px;}
100% {top: 0;}
}
.following {
color: white;
background: crimson;
}
<link href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" rel="stylesheet" />

UI #3 - Profile Card

Codepen profile card. Full page view works best.

A Pen by ABD on CodePen.

License.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment