Skip to content

Commit f544d92

Browse files
authored
Develop: fix UI issues (#169)
2 parents 2cd933f + 3f6565f commit f544d92

File tree

12 files changed

+291
-59
lines changed

12 files changed

+291
-59
lines changed

abcd.code-workspace

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
},
4646
"css.lint.unknownAtRules": "ignore",
4747
"debug.javascript.codelens.npmScripts": "never",
48-
"diffEditor.ignoreTrimWhitespace": false,
48+
"diffEditor.ignoreTrimWhitespace": true,
4949
"editor.accessibilitySupport": "off",
5050
"editor.bracketPairColorization.enabled": true,
5151
"editor.codeActionsOnSave": {

src/assets/styles/canvas.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
--shade: light-dark(#fff, #25354fcc);
33
--box: light-dark(#f5deb3, #0f172acc);
44
}
5+
56
/* Global Styles for the Canvas Generator */
67
.canvas-generator {
78
min-height: 100vh;
@@ -38,7 +39,7 @@
3839
font-size: 1.2rem;
3940
width: 100%;
4041
background: var(--box);
41-
color: #e2e8f0;
42+
color: #4d6f9e;
4243
transition: border-color 0.3s ease;
4344
outline: none;
4445
box-sizing: border-box;
@@ -88,7 +89,8 @@
8889
/* New Styles for Combined Label and Checkbox */
8990
.canvas-generator .label-checkbox-container {
9091
display: flex;
91-
justify-content: space-between; /* Pushes label to left and checkbox to right */
92+
justify-content: space-between;
93+
/* Pushes label to left and checkbox to right */
9294
align-items: center;
9395
width: 100%;
9496
margin-bottom: 1rem;
@@ -253,4 +255,4 @@
253255
padding: 0.75rem;
254256
max-height: 350px;
255257
}
256-
}
258+
}

src/assets/styles/common.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@
1111
outline-offset: 0.5rem;
1212
}
1313

14+
.rdb {
15+
border: 1px solid red;
16+
}
17+
18+
.odb {
19+
outline: 1px solid red;
20+
}
21+
22+
1423
/* Utilities */
1524
.sr-only {
1625
position: absolute;
@@ -61,4 +70,4 @@
6170
text-size-adjust: auto;
6271
text-shadow: #fc0 1px 0 10px;
6372
text-wrap-style: balance;
64-
}
73+
}

src/assets/styles/nakshtra.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
background-color: rgba(var(--card-bg), 0.5);
3232
border-left: 4px solid var(--primary-color);
3333
opacity: 0.8;
34-
}
34+
}

src/assets/styles/quote-designer.css

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ textarea.metallic-textarea {
244244
.right-header-buttons {
245245
display: flex;
246246
align-items: center;
247-
gap: 0.7rem; /* Gap between buttons */
247+
gap: 0.7rem;
248+
/* Gap between buttons */
248249
}
249250

250251
.design-container {
@@ -511,24 +512,26 @@ textarea.metallic-textarea {
511512
}
512513

513514
/* Quote Preview Specific Styles */
514-
#quotePreview .quote-text {
515+
.quote-text {
515516
width: 100%;
516517
font-weight: normal;
517518
font-style: normal;
518519
color: light-dark(#000000, #ffffff);
519520
text-decoration: none;
520521
transition: all var(--transition-speed) ease;
522+
min-height: 4rem;
523+
border-bottom: 1px solid red;
521524
}
522525

523-
#quotePreview .quote-text.bold {
526+
.bold {
524527
font-weight: bold;
525528
}
526529

527-
#quotePreview .quote-text.italic {
530+
.italic {
528531
font-style: italic !important;
529532
}
530533

531-
#quotePreview .quote-text.underline {
534+
.quote-text.underline {
532535
text-decoration: underline;
533536
}
534537

@@ -619,7 +622,7 @@ textarea.metallic-textarea {
619622
transform: rotate(45deg);
620623
}
621624

622-
.popover-details[open] > div {
625+
.popover-details[open]>div {
623626
padding: 0 1rem 1rem 1rem;
624627
margin-top: 0.5rem;
625628
}
@@ -664,7 +667,7 @@ textarea.metallic-textarea {
664667
transform: rotate(45deg);
665668
}
666669

667-
.control-section[open] > div {
670+
.control-section[open]>div {
668671
padding: 0 1rem 1rem 1rem;
669672
margin-top: 0.5rem;
670673
}
@@ -861,4 +864,4 @@ textarea.metallic-textarea {
861864
#quotePreview {
862865
padding: 0.5rem;
863866
}
864-
}
867+
}

src/assets/styles/setting.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
display: flex;
88
justify-items: end;
99
justify-content: center;
10-
top: 4rem;
10+
top: 6rem;
1111
right: 1.5rem;
1212
width: max-content;
1313
height: 3.5rem;
@@ -66,6 +66,7 @@
6666
padding: 1.5rem;
6767
cursor: pointer;
6868
transition: transform 300ms ease-in-out;
69+
appearance: auto;
6970
display: flex;
7071
flex-direction: column;
7172
align-items: center;
@@ -128,7 +129,7 @@
128129
justify-content: center;
129130

130131
:where(button, select) {
131-
background: linear-gradient(90deg, rgb(17, 255, 247) 0%, rgb(39, 96, 241) 100%);
132+
background: linear-gradient(90deg, rgb(17, 255, 247) 0%, rgb(165 39 241) 100%);
132133
transform: scaleZ(1) rotate(5deg);
133134
border-radius: 7px;
134135
}
@@ -147,4 +148,4 @@
147148
transform: scale(1.05) rotate(45deg);
148149
}
149150
}
150-
}
151+
}

src/components/NakshtraCard.astro

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const {
3030
aspect-ratio: 1/1;
3131
display: flex;
3232
flex-direction: column;
33-
justify-content: center;
33+
justify-content: start;
3434
position: relative;
3535
}
3636

@@ -48,13 +48,13 @@ const {
4848
align-items: center;
4949

5050
img {
51-
width: 20vw;
52-
height: 20vw;
51+
width: 100%;
52+
aspect-ratio: 1;
5353
}
54+
5455
h3 {
55-
text-align: center;
5656
font-size: 2rem;
57-
color: brown;
57+
color: #df9f9f;
5858
margin: 0;
5959
}
6060

@@ -65,9 +65,15 @@ const {
6565
width: 100%;
6666
text-align: left;
6767
p {
68-
margin-bottom: 0.5rem;
68+
padding: 0.5rem 1rem;
69+
margin: 0;
6970
font-size: 1.5rem;
70-
gap: 0.5rem;
71+
&:nth-child(even) {
72+
border-block: 1px dashed light-dark(#78818d, #123456);
73+
}
74+
& span {
75+
padding-inline: 0.5rem;
76+
}
7177
}
7278
}
7379
}
@@ -77,8 +83,8 @@ const {
7783
<img src=`/assets/images/nakshatra/${image}` alt={name} />
7884
<h3>{name}</h3>
7985
<div class="nakshatra-details">
80-
<p><span title="ruling planet">🪐</span> {ruling_planet}</p>
81-
<p><span title="deity">📿</span> {deity}</p>
82-
<p><span title="symbol">࿊</span> {symbol}</p>
86+
<p class="planet"><span title="ruling planet">🪐</span>{ruling_planet}</p>
87+
<p class="deity"><span title="deity">📿</span>{deity}</p>
88+
<p class="symbol"><span title="symbol">࿊</span>{symbol}</p>
8389
</div>
8490
</div>

src/components/SpeechButton.astro

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
// SpeechButtons.astro
3+
---
4+
5+
<div class="controls">
6+
<button id="startBtn" title="Start">&#x25B6;</button>
7+
<button id="pauseBtn" title="Pause">&#10074;&#10074;</button>
8+
<button id="resumeBtn" title="Resume">&#8635;</button>
9+
<button id="stopBtn" title="Stop">&#9632;</button>
10+
</div>
11+
12+
<style>
13+
.controls {
14+
display: flex;
15+
gap: 8px;
16+
margin-top: 10px;
17+
}
18+
button {
19+
width: 40px;
20+
height: 40px;
21+
font-size: 20px;
22+
line-height: 1;
23+
border: 1px solid #ccc;
24+
background: #f9f9f9;
25+
cursor: pointer;
26+
border-radius: 6px;
27+
display: flex;
28+
align-items: center;
29+
justify-content: center;
30+
transition:
31+
background-color 0.2s,
32+
transform 0.1s;
33+
}
34+
button:hover {
35+
background: #e0e0e0;
36+
}
37+
button:active {
38+
background: #d0d0d0;
39+
transform: scale(0.96);
40+
}
41+
textarea {
42+
width: 100%;
43+
max-width: 400px;
44+
padding: 8px;
45+
font-size: 16px;
46+
margin-bottom: 10px;
47+
}
48+
</style>
49+
50+
<script type="module" is:inline>
51+
let utterance;
52+
53+
document.getElementById("startBtn")?.addEventListener("click", () => {
54+
const text = document.getElementById("text").value;
55+
utterance = new SpeechSynthesisUtterance(text);
56+
speechSynthesis.cancel();
57+
speechSynthesis.speak(utterance);
58+
});
59+
60+
document.getElementById("pauseBtn")?.addEventListener("click", () => {
61+
if (speechSynthesis.speaking && !speechSynthesis.paused) {
62+
speechSynthesis.pause();
63+
}
64+
});
65+
66+
document.getElementById("resumeBtn")?.addEventListener("click", () => {
67+
if (speechSynthesis.paused) {
68+
speechSynthesis.resume();
69+
}
70+
});
71+
72+
document.getElementById("stopBtn")?.addEventListener("click", () => {
73+
speechSynthesis.cancel();
74+
});
75+
</script>

src/mappers/profession.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const professionData = [
66
{ letter: "C", text: "Chef", emoji: "🍳", description: "Cooks delicious meals!" },
77
{ letter: "D", text: "Doctor", emoji: "⚕️", description: "Helps sick people!" },
88
{ letter: "E", text: "Engineer", emoji: "🛠️", description: "Builds cool machines!" },
9-
{ letter: "F", text: "Firefighter", emoji: "🚒", description: "Saves people fires!" },
9+
{ letter: "F", text: "Fire Fighter", emoji: "🚒", description: "Saves people fires!" },
1010
{ letter: "G", text: "Gardener", emoji: "🌱", description: "Grows beautiful plants!" },
11-
{ letter: "H", text: "Hairdresser", emoji: "💇", description: "Cuts styles hair!" },
11+
{ letter: "H", text: "Hair Dresser", emoji: "💇", description: "Cuts styles hair!" },
1212
{ letter: "I", text: "Inventor", emoji: "🧪", description: "Creates new things!" },
1313
{ letter: "J", text: "Judge", emoji: "⚖️", description: "Makes fair decisions!" },
1414
{ letter: "K", text: "Knight", emoji: "⚔️", description: "Old-time armor hero!" },

src/pages/canvas/quote.astro

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,25 @@ const meta = {
1313
};
1414
---
1515

16+
<style>
17+
.quote-text {
18+
height: auto;
19+
&::after {
20+
content: "";
21+
width: 5px;
22+
height: 20px;
23+
background: #ec7fff;
24+
display: inline-block;
25+
animation: cursor-blink 1.5s steps(2) infinite;
26+
}
27+
}
28+
@keyframes cursor-blink {
29+
0% {
30+
opacity: 0;
31+
}
32+
}
33+
</style>
34+
1635
<BaseLayout meta={meta}>
1736
<Fragment slot="header-right">
1837
<SharePopover title={meta.title} description={meta.description} />
@@ -86,7 +105,7 @@ const meta = {
86105
<div class="preview-container" id="previewContainer">
87106
<div id="aspectRatioWrapper" class="aspect-ratio-free">
88107
<div id="quotePreview">
89-
<div class="quote-text"></div>
108+
<div class="quote-text" contenteditable="plaintext-only"></div>
90109
<div class="author-name"></div>
91110
</div>
92111
</div>
@@ -444,7 +463,7 @@ const meta = {
444463
if (!preview || !quoteData || !quoteTextEl || !authorNameEl) return;
445464
quoteTextEl.textContent = quoteData.quote || "";
446465
authorNameEl.textContent = quoteData.author ? `- ${quoteData.author}` : "";
447-
const selectedTextColor = controls.textColor?.value || "#000000";
466+
const selectedTextColor = controls.textColor?.value || "white";
448467
quoteTextEl.style.color = selectedTextColor;
449468
authorNameEl.style.color = selectedTextColor;
450469
preview.style.fontFamily = controls.fontFamily?.value || "'Space Mono', monospace";

0 commit comments

Comments
 (0)