added basic project page
This commit is contained in:
49
src/components/ProjectCard.astro
Normal file
49
src/components/ProjectCard.astro
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
interface Props {
|
||||
name: string;
|
||||
href?: string;
|
||||
}
|
||||
|
||||
const { name, href } = Astro.props;
|
||||
---
|
||||
|
||||
<style lang="scss">
|
||||
@import "../styles/_var.scss";
|
||||
|
||||
a {
|
||||
color: white;
|
||||
&.project-external {
|
||||
text-decoration: none;
|
||||
&::after {
|
||||
background-color: white;
|
||||
width: 20px;
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
top: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.content {
|
||||
padding: 20px;
|
||||
margin: 20px;
|
||||
max-width: 40vw;
|
||||
transition: border-color 0.3s;
|
||||
h2 {
|
||||
font-size: 20px;
|
||||
}
|
||||
&:hover {
|
||||
border-color: $link;
|
||||
}
|
||||
}
|
||||
.no-hover {
|
||||
&:hover {
|
||||
border: 1px solid lighten($highlight, 12%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class={href ? "content" : "content no-hover"}>
|
||||
<a class="project-external" target={href ? "_blank" : ""} href={href}>
|
||||
<h2>{name}</h2><slot />
|
||||
</a>
|
||||
</div>
|
Reference in New Issue
Block a user