Skip to content

Commit

Permalink
Merge pull request #3 from maitrakhatri/avtar-badge
Browse files Browse the repository at this point in the history
feat: avatar and badge DONE
  • Loading branch information
maitrakhatri authored Jan 30, 2022
2 parents 7f5397a + e2823ca commit 8c18245
Show file tree
Hide file tree
Showing 7 changed files with 377 additions and 0 deletions.
24 changes: 24 additions & 0 deletions avatar/avatar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@import url(../style.css);

.avatar {
height: 32px;
width: 32px;
}

.avatar-xl {
height: 48px;
width: 48px;
}

.avatar-xxl {
height: 64px;
width: 64px;
}

.avatar-round {
border-radius: 50%;
}

.avatar-square {
border-radius: 10%;
}
24 changes: 24 additions & 0 deletions avatar/avatar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!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>avatar</title>
<link rel="stylesheet" href="avatar.css">
</head>
<body>

<img class="avatar avatar-round" src="avatar.svg" alt="avatar">
<img class="avatar-xl avatar-round" src="avatar.svg" alt="avatar">
<img class="avatar-xxl avatar-round" src="avatar.svg" alt="avatar">

<div><br></div> <div><br></div>

<img class="avatar avatar-square" src="avatar.svg" alt="avatar">
<img class="avatar-xl avatar-square" src="avatar.svg" alt="avatar">
<img class="avatar-xxl avatar-square" src="avatar.svg" alt="avatar">


</body>
</html>
102 changes: 102 additions & 0 deletions avatar/avatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 102 additions & 0 deletions badge/avatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions badge/badge.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@import url(../style.css);
@import url(../avatar/avatar.css);

.icon-with-badge {
position: relative;
width: fit-content;
}

.badge {
position: absolute;
top: -0.7rem;
right: -0.7rem;
color: white;
height: 1.25rem;
width: 1.5rem;
padding: 0.375rem;
text-align: center;
border-radius: 50%;
}

.red {
background-color: var(--danger);
}

.blue {
background-color: var(--secondary);
}

.dark-blue {
background-color: var(--primary);
}

.yellow {
background-color: var(--warning);
}

.green {
background-color: var(--success);
}

.avatar-with-badge {
position: relative;
width: max-content;
}

.badge-avatar {
position: absolute;
bottom: 0;
right: 0;
padding: .375rem;
border-radius: 50%;
}
72 changes: 72 additions & 0 deletions badge/badge.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!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>badge</title>
<link rel="stylesheet" href="badge.css">
<style>

/* ONLY FOR DISPLAY PURPOSES. NOT PART OF COMPONENT */

.badge-on-icon, .badge-on-avatar {
display: flex;
gap: 2rem;
padding: 2rem;
}

</style>
</head>
<body>

<div class="badge-on-icon">

<div class="icon-with-badge">
<img src="chat_black_48dp.svg" alt="chat icon with badge">
<span class="badge red">5</span>
</div>

<div class="icon-with-badge">
<img src="chat_black_48dp.svg" alt="chat icon with badge">
<div class="badge blue">13</div>
</div>

<div class="icon-with-badge">
<img src="chat_black_48dp.svg" alt="chat icon with badge">
<div class="badge dark-blue">2</div>
</div>

<div class="icon-with-badge">
<img src="chat_black_48dp.svg" alt="chat icon with badge">
<div class="badge yellow">13</div>
</div>

<div class="icon-with-badge">
<img src="chat_black_48dp.svg" alt="chat icon with badge">
<div class="badge green">56</div>
</div>

</div>

<div class="badge-on-avatar">

<div class="avatar-with-badge">
<img class="avatar avatar-round" src="avatar.svg" alt="avatar">
<div class="badge-avatar green"> </div>
</div>

<div class="avatar-with-badge">
<img class="avatar avatar-round" src="avatar.svg" alt="avatar">
<div class="badge-avatar red"> </div>
</div>

<div class="avatar-with-badge">
<img class="avatar avatar-round" src="avatar.svg" alt="avatar">
<div class="badge-avatar yellow"> </div>
</div>

</div>

</body>
</html>
1 change: 1 addition & 0 deletions badge/chat_black_48dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8c18245

Please sign in to comment.