Skip to content

Commit 41f7c54

Browse files
FIXED text not on top issue and modal not opening and some more. (#152)
2 parents f771133 + e05e71b commit 41f7c54

File tree

4 files changed

+20
-26
lines changed

4 files changed

+20
-26
lines changed

src/assets/icons/close.svg

Lines changed: 3 additions & 3 deletions
Loading

src/assets/styles/bubble.css

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@
1313
position: relative;
1414
}
1515

16-
.slot {
17-
height: 100%;
18-
border-radius: 4px;
19-
z-index: 10;
20-
width: 100%;
21-
display: flex;
22-
box-sizing: border-box;
23-
flex-direction: column;
24-
justify-content: space-evenly;
25-
align-items: center;
16+
.slot , .context{
17+
border-radius: inherit;
18+
position: absolute;
19+
z-index: 10;
20+
width: 100%;
21+
height: 100%;
22+
display: flex;
23+
box-sizing: border-box;
24+
flex-direction: column;
25+
justify-content: space-evenly;
26+
align-items: center;
2627
}
2728

2829
.slot > div {
@@ -78,7 +79,6 @@
7879
animation-delay: 0s;
7980
}
8081

81-
/* copy code from here */
8282
.bubble_square li:nth-child(2) {
8383
left: 10%;
8484
width: 20px;
@@ -183,8 +183,6 @@
183183
animation-duration: 11s;
184184
}
185185

186-
/* copy code till here */
187-
188186
@keyframes animate {
189187
0% {
190188
transform: translateY(0) rotate(0deg);

src/components/PoemDialog.astro

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ import "@/assets/styles/poem-dialog.css";
8585
await ensureVoicesLoaded();
8686

8787
if (availableVoices.length === 0) {
88-
audioToggle.textContent = "🚫";
88+
audioToggle.innerHTML = `<svg id="audio-icon"viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 9.3345 19.8412 6.93964 18 5.29168M5.63605 5.63605L18.364 18.364" stroke-width="1.5" stroke-linecap="round"></path> </g></svg>`;
8989
return;
9090
}
9191

@@ -98,7 +98,7 @@ import "@/assets/styles/poem-dialog.css";
9898
availableVoices[0];
9999

100100
if (!selectedVoice) {
101-
audioToggle.textContent = "🚫";
101+
audioToggle.innerHTML = `<svg id="audio-icon"viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 9.3345 19.8412 6.93964 18 5.29168M5.63605 5.63605L18.364 18.364" stroke-width="1.5" stroke-linecap="round"></path> </g></svg>`;
102102
return;
103103
}
104104

@@ -116,6 +116,7 @@ import "@/assets/styles/poem-dialog.css";
116116
currentText = lines.join(" ");
117117
currentLang = "en-US";
118118
await ensureVoicesLoaded();
119+
modal.showModal();
119120
};
120121

121122
audioToggle.onclick = () => {
@@ -133,12 +134,5 @@ import "@/assets/styles/poem-dialog.css";
133134
resetSpeakerButton();
134135
};
135136

136-
window.addEventListener("click", (e) => {
137-
if (e.target === modal) {
138-
modal.close();
139-
resetSpeakerButton();
140-
}
141-
});
142-
143137
ensureVoicesLoaded();
144138
</script>

src/components/SquareBubble.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import "@/assets/styles/bubble.css";
44

55
<div class="bubble__container">
66
<div class="bubble__board">
7-
<div class="slot"><slot name="bobble-context" /></div>
7+
<div class="slot">
8+
<slot name="bobble-context" />
9+
</div>
810
<div class="bubble__area">
911
<ul class="bubble_square">
1012
{Array.from({ length: 10 }, (_, i) => <li data-id={i + 1} />)}

0 commit comments

Comments
 (0)