aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Card.astro
blob: efcfaeb8ec69bf36f3ba11ec0be36cb725c97a34 (plain) (blame)
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
---
interface Props {
  title: string;
  body: string;
  href: string;
  language: string;
  languageColor: string;
}

const { href, title, body, language, languageColor } = Astro.props;
---

<li class="link-card">
  <a href={href}>
    <div class="content-container">
      <h2>{title}</h2>
      <div class="language-container">
        <span class="dot" style={{ backgroundColor: languageColor }}></span>
        <span class="language">{language}</span>
      </div>
      <div class="separator"></div>
      <p>{body}</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; /* Add position property */
    box-sizing: border-box; /* Include padding in the element's total width/height. */
    height: 100%; /* Ensure it takes the full height of its parent. */
  }

  .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;
    }
  }
</style>
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage