Skip to content

Commit b814d9c

Browse files
authored
Merge pull request #700 from DynamiteBob17/fix-speech-bubble-hidden-in-background
Fix/ speech bubble no longer hidden behind background
2 parents 33931d2 + 6cb3480 commit b814d9c

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

media/pets.css

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
/*
2-
* z-index values:
3-
* 1: backgroundEffectCanvas
4-
* 2: background
5-
* 3: petCanvasContainer canvas, ballCanvas, img.pet
6-
* 4: foregroundEffectCanvas
7-
* 5: foreground
8-
* 999: collision
9-
*/
10-
111
:root {
2+
--background-effect-canvas-z-index: 1;
3+
--background-z-index: 2;
4+
--pet-canvas-container-z-index: 3; /* petCanvasContainer canvas, ballCanvas, img.pet */
5+
--bubble-z-index: 4;
6+
--foreground-effect-canvas-z-index: 5;
7+
--foreground-z-index: 6;
8+
--collision-z-index: 999;
9+
1210
--container-paddding: 20px;
1311
--input-padding-vertical: 6px;
1412
--input-padding-horizontal: 4px;
@@ -37,7 +35,7 @@ body {
3735
position: absolute;
3836
top: 0;
3937
left: 0;
40-
z-index: 5;
38+
z-index: var(--foreground-z-index);
4139
background-attachment: fixed;
4240
background-repeat: repeat-x;
4341
background-position: bottom left;
@@ -49,7 +47,7 @@ body {
4947
position: absolute;
5048
top: 0;
5149
left: 0;
52-
z-index: 2;
50+
z-index: var(--background-z-index);
5351
background-attachment: fixed;
5452
background-repeat: repeat-x;
5553
background-position: bottom left;
@@ -140,17 +138,17 @@ textarea::placeholder {
140138
position: fixed;
141139
bottom: 0;
142140
left: 0;
143-
z-index: 3;
141+
z-index: var(--pet-canvas-container-z-index);
144142
}
145143

146144
#ballCanvas {
147-
z-index: 3;
145+
z-index: var(--pet-canvas-container-z-index);
148146
}
149147
#foregroundEffectCanvas {
150-
z-index: 4 !important;
148+
z-index: var(--foreground-effect-canvas-z-index) !important;
151149
}
152150
#backgroundEffectCanvas {
153-
z-index: 1 !important;
151+
z-index: var(--background-effect-canvas-z-index) !important;
154152
}
155153

156154
img.pet {
@@ -160,15 +158,15 @@ img.pet {
160158
left: 0px;
161159
right: 0px;
162160
bottom:0px;
163-
z-index: 3;
161+
z-index: var(--pet-canvas-container-z-index);
164162
}
165163

166164
.collision {
167165
position: absolute;
168166
left: 0px;
169167
right: 0px;
170168
bottom:0px;
171-
z-index: 999;
169+
z-index: var(--collision-z-index);
172170
}
173171

174172
.bubble {
@@ -182,6 +180,7 @@ img.pet {
182180
border: 2px solid #333;
183181
border-radius: 10px;
184182
padding: 10px 0;
183+
z-index: var(--bubble-z-index);
185184
}
186185

187186
.bubble-nano {

0 commit comments

Comments
 (0)