Skip to content

Commit 35dedb8

Browse files
Ciphroxxkeshav
authored andcommitted
added alphabet emoji or alphbet text to the back of card in letterCard
1 parent 43eef6a commit 35dedb8

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

src/components/LetterCard.astro

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ const { item, category } = Astro.props;
2828
{
2929
item.image ? (
3030
<img src={`/assets/images/alphabets/${category}/${item.image}`} alt={item.letter} class="image" />
31+
) : item.emoji ? (
32+
<p class="emoji">{item.emoji}</p>
3133
) : (
32-
<p class="character">{item.letter}</p>
34+
<p class="flipped__text">{item.text}</p>
3335
)
3436
}
3537
</div>
@@ -75,9 +77,9 @@ const { item, category } = Astro.props;
7577
width: 100%;
7678
height: 100%;
7779
background-color: var(--border);
78-
}
80+
}
7981

80-
& .character {
82+
& .character, .flipped__text {
8183
display: flex;
8284
justify-content: center;
8385
align-items: center;
@@ -98,6 +100,21 @@ const { item, category } = Astro.props;
98100
text-align: left;
99101
}
100102

103+
& .flipped__text {
104+
font-size: 3.5rem;
105+
}
106+
107+
& .emoji {
108+
display: flex;
109+
justify-content: center;
110+
align-items: center;
111+
height: 100%;
112+
font-size: clamp(5rem, 10vw, 8rem);
113+
margin: 0;
114+
line-height: 1;
115+
text-align: center;
116+
}
117+
101118
& .card {
102119
background: linear-gradient(145deg, var(--background), color-mix(in srgb, var(--background) 97%, var(--text) 3%));
103120
border-radius: 1.25rem;

src/data/alphabets.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"code": 65,
1010
"text": "Apple",
1111
"description": "",
12-
"emoji" : "🍎",
13-
"image": "apple.jpg"
12+
"emoji" : "🍎"
1413
},
1514
{
1615
"id": 2,
@@ -80,8 +79,8 @@
8079
"id": 10,
8180
"letter": "J",
8281
"code": 74,
83-
"text": "Jam",
84-
"emoji" : "🍓",
82+
"text": "Jug",
83+
"emoji" : "🏺",
8584
"description": ""
8685
},
8786
{
@@ -192,8 +191,8 @@
192191
"id": 24,
193192
"letter": "X",
194193
"code": 88,
195-
"text": "X-ray",
196-
"emoji" : "🦴",
194+
"text": "xerox",
195+
"emoji" : "🖨️",
197196
"description": ""
198197
},
199198
{

0 commit comments

Comments
 (0)