Giter Club home page Giter Club logo

blog's Introduction

blog

blog's People

Contributors

creamymilk avatar

Watchers

 avatar

blog's Issues

Making the hover card component

So this is how I approached making the card component

Pre-requisites

  • I downloaded the 2 photos lime & profile photo images
  • I used a color picker to get the exact colors for the text
Screenshot 2024-05-17 at 7 13 37 AM

This is how I split up the layout in index.html

blog/simpler/index.html

Lines 137 to 154 in 56da855

<div class="card">
<div class="card-image">
<img src="./mapicha/lime.jpg" />
</div>
<div class="card-info">
<h2>What I Do When My Skin is Freaking Out</h2>
<div class="userinfo">
<img src="./mapicha/florrie.png" alt="">
<div class="metadata-text">
<span class="author">Florrie Jackobs</span>
<span class="publish-date">May 16, 2020 . <span>⏲ 1 min</span> </span>
</div>
</div>
</div>
</div>

This is the css I added to the style.css file

blog/simpler/style.css

Lines 131 to 203 in 56da855

.card{
display: flex;
box-sizing:border-box;
box-shadow: 1px 1px 5px 0 rgba(1,1,1,.05);
overflow: hidden;
background-color: white;
padding: 10px;
width: 60%;
border-radius: 15px;
transition: all .3s ease-out;
}
.card:hover{
transform: translate(0, -5px);
box-shadow: 10px 5px 10px 0 rgba(1,1,1,.05);
}
.card-image{
width: 240px;
height: 180px;
margin-right: 20px;
}
.card-image>img{
border-radius: 15px;
object-fit:cover;
width: 100%;
height: 100%;
}
.card-info{
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 10px;
}
.card-info > h2 {
font-size: 18px;
}
.userinfo{
display: flex;
flex-direction: row;
}
.userinfo > img{
background-color: #E2E8F0;
padding: 1px;
border-radius: 50%;
}
.metadata-text{
display: flex;
margin-left: 5px;
justify-content: space-around;
flex-direction: column;
}
.author{
color:#718096;
font-size: 14px;
}
.author:hover{
color:#667EEA;
font-size: 14px;
}
.publish-date{
color:#A0AEC0;
font-size: 12px;
}

This is the final result 🤩

Screen.Recording.2024-05-17.at.7.16.37.AM.mov

Hope you notice the card moving 😅

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.