Skip to content

Commit

Permalink
Added User Profile Tooltip (#1319)
Browse files Browse the repository at this point in the history
  • Loading branch information
DharshiBalasubramaniyam committed Aug 3, 2024
1 parent ee8826b commit 0007609
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 0 deletions.
43 changes: 43 additions & 0 deletions Components/Tooltips/User-Profile-Tooltip/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>User Profile Tooltip</title>
</head>

<body>

<div class="tooltip-container">
<div class="tooltip">
<div class="image-name">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 95 114" class="svgIcon">
<rect fill="black" rx="28.5" height="57" width="57" x="19"></rect>
<path fill="black"
d="M0 109.5C0 83.2665 21.2665 62 47.5 62V62C73.7335 62 95 83.2665 95 109.5V114H0V109.5Z"></path>
</svg>

<div>
John Doe <br> <small>Software Developer</small>
</div>
</div>
<div class="follow"><strong>25</strong> Blogs | <strong>1.5K</strong> Followers | <strong>25K</strong> Views
</div>
<div class="description">Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vel, enim?</div>
<button>View profile</button>
</div>
<span class="text">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 95 114" class="svgIcon">
<rect fill="black" rx="28.5" height="57" width="57" x="19"></rect>
<path fill="black"
d="M0 109.5C0 83.2665 21.2665 62 47.5 62V62C73.7335 62 95 83.2665 95 109.5V114H0V109.5Z"></path>
</svg>
John Doe
</span>
</div>

</body>

</html>
118 changes: 118 additions & 0 deletions Components/Tooltips/User-Profile-Tooltip/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

* {
margin: 0;
padding: 0;
box-sizing: border-box;
outline: none;
font-family: "Poppins", sans-serif;
}

body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: whitesmoke;
}

.tooltip-container {
display: flex;
align-items: center;
justify-content: center;
position: relative;
transition: all 0.3s;
background-color: rgb(255, 255, 255);
padding: 11px 18px;
border-radius: 12px;
cursor: pointer;
border: 1px solid rgb(211, 211, 211);
}

.tooltip-container:hover{
background-color: rgb(220, 220, 220);
}

.text {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
font-size: 14px;
font-weight: 600;
color: rgb(0, 0, 0);
}

.svgIcon {
width: 16px;
height: auto;
}

.tooltip {
position: absolute;
left: 50%;
bottom: calc(100% + 0.5rem);
transform: translateX(-50%);
padding: 15px;
opacity: 0;
pointer-events: none;
transition: all 0.3s;
background-color: rgb(255, 255, 255);
box-shadow: 0 0 15px rgb(205, 205, 205);
border-radius: 12px;
color: rgb(34, 34, 34);
width: 370px;
}

.tooltip .image-name {
display: flex;
gap: 15px;
align-items: center;
}

.tooltip .image-name .svgIcon {
height: 50px;
width: 50px;
border: 2px solid black;
padding: 5px;
border-radius: 50%;
}
.tooltip .follow {
margin: 10px 0;
font-size: 13px;
}

.tooltip .description {
font-size: 13px;margin-bottom: 10px;
}

.tooltip button {
background-color: rgb(48, 48, 48);
color: white;
border-radius: 25px;
padding: 7px 12px;
cursor: pointer;
}

.tooltip button:hover {
background-color: black;
}

.tooltip::before {
position: absolute;
content: "";
height: 0.6em;
width: 0.6em;
bottom: -0.2em;
left: 50%;
transform: translate(-50%) rotate(45deg);
background-color: rgb(255, 255, 255);
}

.tooltip-container:hover .tooltip {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
13 changes: 13 additions & 0 deletions assets/html_files/tooltips.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,19 @@ <h1>Show Counts Tooltip</h1>
</a>
</div>
</div>
<div class="box">
<h1>User Profile Tooltip</h1>
<div class="preview">
<a href="../../Components/Tooltips/User-Profile-Tooltip/index.html" title="Live Preview" target="_blank">
<img src="../images/link.png">
</a>
</div>
<div class="source">
<a href="https://github.com/Rakesh9100/Beautiify/tree/main/Components/Tooltips/User-Profile-Tooltip" title="Source Code" target="_blank">
<img src="../images/github.png">
</a>
</div>
</div>
</div>
</section>

Expand Down

0 comments on commit 0007609

Please sign in to comment.