1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
---
interface Props {
title: string;
body: string;
href: string;
language: string;
languageColor: string;
logoSrc?: string;
logoWidth?: string;
contribution?: string;
}
const { href, title, body, language, languageColor, logoSrc, logoWidth = '60%', contribution="" } = Astro.props;
---
<li class="link-card">
<a href={href}>
{logoSrc && <div class="logo-container"><img src={logoSrc} alt="Project Logo" style={{ maxWidth: logoWidth }} /></div>}
<div class="content-container">
<h2>{title}</h2>
<div class="language-container">
<span class="dot" style={{ backgroundColor: languageColor }}></span>
<span class="language">{language}</span>
</div>
<p>{body}</p>
<p>{contribution}</p>
</div>
</a>
</li>
<style>
.link-card {
list-style: none;
display: flex;
padding: 1px;
background-color: #23262d;
background-image: none;
background-size: 400%;
border-radius: 7px;
background-position: 100%;
align-items: flex-start;
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
position: relative;
overflow: hidden;
}
.link-card > a {
width: 100%;
text-decoration: none;
line-height: 1.4;
padding: calc(1.5rem - 1px);
border-radius: 8px;
color: white;
background-color: #23262d;
opacity: 0.8;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-between;
position: relative;
box-sizing: border-box;
height: 100%;
}
.content-container {
display: flex;
flex-direction: column;
gap: 10px;
margin-bottom: 0;
}
h2 {
margin: 0;
font-size: 1.25rem;
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
p {
margin-top: 0.5rem;
margin-bottom: 0;
}
.separator {
height: 1px;
width: 100%;
background-color: rgba(255, 255, 255, 0.1);
}
.language-container {
display: flex;
align-items: center;
gap: 5px;
margin: 0;
}
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
display: inline-block;
}
.language {
font-weight: bold;
font-size: 1rem;
color: rgba(255, 255, 255, 0.8);
}
.link-card:is(:hover, :focus-within) {
background-position: 0;
background-image: var(--accent-gradient);
}
.link-card:is(:hover, :focus-within) h2 {
color: rgb(var(--accent-light));
}
@media (max-width: 1020px) {
.link-card {
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
overflow: hidden;
max-width: 100%;
width: 100%px;
word-wrap: break-word;
}
p {
margin-top: 0.5rem;
margin-bottom: 0;
font-size: 24px;
}
}
.logo-container {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
padding: 1rem 0;
}
.logo-container img {
max-width: 60%;
height: auto;
border-radius: 8px;
}
</style>
|