Skip to content

Commit

Permalink
fix change appearance button
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmeeks committed Dec 2, 2023
1 parent 50dbf9f commit 19c6a87
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions blob/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ function spawnCharacter(id, state) {
* @param {ChangeAppearance} state
*/
function changeAppearance(id, state) {
console.log(state);
const charElem = getCharElem(id);
const apparelElem = charElem.querySelector(".apparel");
apparelElem.innerHTML = "";
Expand Down Expand Up @@ -244,7 +243,7 @@ function blinkLoop(id) {
function setPosition(id, x, y) {
const elem = getCharElem(id);
elem.style.setProperty("--pos-x", `${x}px`);
elem.style.setProperty("--pos-y", `${y - 50}px`);
elem.style.setProperty("--pos-y", `${y - 30}px`);
elem.style.zIndex = Math.round(y);
}

Expand Down Expand Up @@ -390,6 +389,7 @@ async function spawnScene(id) {
imgElem.style.height = "100%";
imgElem.style.position = "absolute";
imgElem.style.zIndex = layer.z;
imgElem.style.pointerEvents = "none";
sceneElem.appendChild(imgElem);
}

Expand Down
16 changes: 15 additions & 1 deletion blob/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ body {
/* background: orange; */
overflow: hidden;
transform-origin: top left;
position: relative;
}

.character {
Expand Down Expand Up @@ -182,7 +183,7 @@ body {
border-left: solid 3px #0007;
border-right: solid 2px #fff7;
box-sizing: border-box;
transform: translate(-50%, -250%) translate(var(--pos-x), var(--pos-y))
transform: translate(-50%, -50%) translate(var(--pos-x), var(--pos-y))
scaleY(75%) rotate(-30deg);
}

Expand All @@ -191,3 +192,16 @@ body {
height: 100%;
position: absolute;
}

#btn-appearance {
position: absolute;
bottom: 0;
z-index: 100001;
background: blue;
border: 3px solid darkblue;
font-weight: bold;
color: white;
padding: 0.5rem;
border-radius: 0.5rem;
margin: 1rem;
}

0 comments on commit 19c6a87

Please sign in to comment.