Animated Profile Card || profile card design, profile card design html css





Source Code

Step-1:

<body>
  <div class="card">
    <div class="dp"></div>
    <div class="content">
      <h2>SwapniL</h2>
      <p>India</p>
    </div>
    <div class="connections">
      <span class="material-icons-outlined">
        person
      </span>
      <span class="material-icons-outlined">
        email
      </span>
      <span class="material-icons-outlined">
        phone
      </span>
    </div>
  </div>
</body>

This code represents an HTML webpage with a card-like structure. Inside the "body" section, there is a "card" div that contains several elements. The card has a profile picture (dp), a content section with a name ("SwapniL") and location ("India"), and a connections section with icons for a person, email, and phone. This code is a simple layout for displaying information about a person, with their name and contact information, and it uses classes and elements to style and structure the content on the webpage.

Step-2:

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

This code is written in a programming language called CSS, which is used to style and format web pages. It uses asterisk (*) to select all elements on a web page. The code sets some rules for these elements: it sets the margin and padding to 0, which means there won't be any extra space around them, and it uses "box-sizing" to make sure the width and height of elements include their border and padding. In simple terms, this code ensures that all elements on the web page will have no spacing around them and their size calculations will include borders and padding, which can be helpful for consistent and predictable web page layout.

Step-3:

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

This code is written in CSS, a language used for styling web pages. It's setting the style for the "body" element of a web page. The "height" property is making the body element take up the entire height of the viewport (the visible part of the webpage), which is what "100vh" means. It also makes the content inside the body centered both vertically and horizontally using the "display: flex" property and the "align-items" and "justify-content" properties. Finally, it sets the background color of the body to "burlywood," giving the entire page a background color of that shade. In simpler terms, this code is styling a webpage's background, making it a certain color and centering the content both vertically and horizontally on the page.

Step-4:

.card{
  height: 250px;
  width: 220px;
  display: flex;
  justify-content: center;
  background-color: yellowgreen;
  position: relative;
  overflow: hidden;
  box-shadow:
  0em 0.6em 0.5em rgba(0, 0, 0, 0.3);
}

This code defines the style for a "card" element in a web page. The card will be 250 pixels tall and 220 pixels wide. It uses a flex display to center its content both horizontally and vertically. The card's background color is set to "yellowgreen," and it has a slight shadow to give it a raised appearance on the page. Additionally, the card is set to hide any content that might overflow beyond its boundaries, and it's positioned relative to its parent element, which means it can be positioned in a specific way relative to other elements on the page.

Step-5:

.dp{
  height: 100%;
  width: 100%;
  position: absolute;
  background-image: url('#');
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transition: all 0.5s;
}

This code defines a CSS style for an HTML element with a class called "dp." It sets the height and width of the element to cover the entire available space on the webpage, and it positions the element absolutely on the page. The background image for this element is set to a placeholder '#' (you should replace '#' with the actual image file path or URL you want to use). The background image is centered, doesn't repeat, and is scaled to cover the entire element. Additionally, there's a transition effect that takes 0.5 seconds to smoothly change all properties when there's a change in the element's state, creating a smooth animation when something about the element changes.

Step-6:

.card:hover .dp{
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

This code is for a webpage and it's written in a language called CSS, which is used to style web elements. It's telling the webpage that when someone hovers their mouse over an element with the class "card," a different element inside it with the class "dp" should change its size and shape. Specifically, when you hover over "card," "dp" becomes a small circle with a width and height of 100 pixels each, and it gets rounded edges to look like a circle, creating a visual effect that's commonly used in web design to provide feedback when you hover over or interact with elements on a webpage.

Step-7:

.card:hover span{
  opacity: 1;
  transform:  translateY(0px);
}

This code is describing a simple interaction on a webpage. It is saying that when someone hovers their mouse over an element with the class "card" and within that element, there is a "span" element, two things should happen. First, the "span" element should become fully visible with full opacity (so it's not transparent anymore). Second, it should move upward, or translate, by 0 pixels, which means it stays in the same position. Essentially, this code is making the "span" element inside a "card" visible and stationary when you hover your mouse over it.

Step-8:

.card:hover .content {
  opacity: 1;
  transform:  translateY(20px);
}

This code is used to create an interactive effect on a web page. When you hover your mouse over an element with a class of "card," the code makes another element inside it with a class of "content" become more visible and move downwards. It does this by changing the "opacity" of the "content" to 1, which means it becomes fully visible, and it shifts the "content" down by 20 pixels using the "transform" property. So, when you hover over the "card," it reveals and shifts the content inside it, creating a simple animation effect.

Step-9:

.connections{
  position: absolute;
  bottom: 0px;
  display: flex;
  align-items: flex-end;
}

This code is written in a language called CSS, which is used for designing and styling web pages. In simple terms, this code snippet is defining a style for a class called "connections". The style specifies that elements with this class should be positioned absolutely, meaning they will be placed based on specific coordinates on the web page. The "bottom: 0px;" line ensures these elements are positioned at the bottom of their containing element. Additionally, the elements with this class will be displayed as a flexible box, allowing them to adjust their size and arrangement. The line "align-items: flex-end;" aligns the items inside this class to the bottom of the container. This code is useful for creating a layout where elements with the "connections" class are aligned to the bottom of their container and arranged in a flexible manner.

Step-10:

.connections span{
  display: block;
  height: 50px;
  width: 50px;
  color: white;
  margin: 0.3em;
  padding: 0.27em;
  font-size: 2em;
  background-color: slateblue;
  border-radius: 50%;
  font-family: "Material Icons";
  opacity: 0;
  transition: all 0.6s var(--delay);
  transform:  translateY(50px);
}

This code is written in CSS, a language used to style web pages. It targets HTML elements with the class "connections" and specifically the "span" elements inside them. It sets various visual properties for these elements, making them into circular buttons. They are 50 pixels in height and width, have white text, some spacing, and use a specific font called "Material Icons." Initially, they are invisible (opacity: 0) and positioned 50 pixels below where they should be. When they become visible, these changes happen smoothly over a duration of 0.6 seconds, which is determined by a variable called "--delay." Essentially, this code styles circular buttons that will appear with animation effects when triggered on a web page.

Step-11:

.content{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transform: translateY(40px);
  opacity: 0;
  transition: all 0.6s 0.1s;
  font-size: 1.5em;
}

This code is used to style a web page element with the class "content." It does several things to make the content visually appealing and interactive. It centers the content both vertically and horizontally, making it appear in the middle of its container. The "transform" property moves it 40 pixels down from its original position, and the "opacity" is set to 0, making it initially invisible. There's also a transition effect, which takes 0.6 seconds to animate, and it starts 0.1 seconds after the change. This means that when the content appears, it will smoothly slide down and fade in over the specified time. The "font-size" property sets the text size to 1.5 times the default size. This code is often used for creating animated and centered content on a webpage.

Step-12:

.connections span:nth-child(1){
  --delay : 0ms;
}
.connections span:nth-child(2){
  --delay : 200ms;
}
.connections span:nth-child(3){
  --delay : 400ms;
}

This code appears to be specifying a set of CSS rules for HTML elements. It is targeting specific elements with the class "connections" and then selecting different spans within those elements based on their position. For the first span inside a "connections" element, it sets a custom CSS variable called "--delay" to 0 milliseconds. For the second span, it sets "--delay" to 200 milliseconds, and for the third span, it sets "--delay" to 400 milliseconds. These custom "--delay" variables can be used to control the timing or animation effects on these specific spans, allowing for different delays before certain actions or transitions occur in a web page.



---END---

Comments