Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added article component #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions public/assets/book-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions src/components/Article.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
const {title , body} = Astro.props;
---
<style>
* {
font-family: Helvetica, sans-serif;
}
.container{
position:relative;
border-radius: 0.1em;
width: 30em;
height: 17em;
box-shadow: 0 0px 8px 0 rgba(0,0,0,0.07);
}

.title{
padding: 20px 20px 0px 20px;
font-weight: 500;
font-size:30px;
}

.body{
top: 2em;
left: 2.2em;
display: -webkit-box;
-webkit-line-clamp: 5;
-webkit-box-orient: vertical;
max-width: 100%;
overflow: hidden;
}
.body-container{
padding: 20px 20px 20px 20px;
}

.button {
position: absolute ;
top:209px;
width: 140px;
height: 45px;
margin: 0px 30px 10px 300px;
font-family: 'Roboto', sans-serif;
font-size: 11px;
text-transform: uppercase;
letter-spacing: 2.5px;
font-weight: 500;
color: #000;
background-color: #fff;
border: none;
border-radius: 0.3rem;
transition: all 0.3s ease 0s;
cursor: pointer;
outline: none;
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
}

.button:hover {
background-color: #c40729;
box-shadow: 0px 1px 30px #c40729;
color: #fff;
transform: translateY(-7px);
}
.icon{
width: 20px;
vertical-align:middle;
}
</style>

<div class = "container">
<div class = "title">{title}</div>
<button class="button">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 512 512"><title>Book</title><path d="M256 160c16-63.16 76.43-95.41 208-96a15.94 15.94 0 0116 16v288a16 16 0 01-16 16c-128 0-177.45 25.81-208 64-30.37-38-80-64-208-64-9.88 0-16-8.05-16-17.93V80a15.94 15.94 0 0116-16c131.57.59 192 32.84 208 96zM256 160v288" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/></svg>
Read
Comment on lines +71 to +72
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you save this svg and commit it to our repository? If you put the .svg file in the public folder, it will get hosted along with the rest of the site.

</button>
<div class = "body-container">
<div class = "body"> {body}</div>
</div>

</div>