this.trick = [];
this.user_icons = new Map();
- this.suits_background = create_svg_element(this.svg, "rect", [], [["x", "340"], ["y", "235"], ["width", "100"], ["height", "30"], ["rx", "10"], ["fill", "darkgreen"]]);
+ this.suits_background = create_svg_element(this.svg, "rect", ["suit-background"], [["x", "340"], ["y", "235"], ["width", "100"], ["height", "30"], ["rx", "10"], ["fill", "darkgreen"]]);
this.glyphs = new Map();
this.glyph_highlights = new Map();
highlight.classList.toggle("trumps", suit === this.trumps);
}
const is_choosing_trumps = this.call === this.username && this.trumps === null;
- const transform = is_choosing_trumps ? "translate(-160 250) scale(3 3) translate(-250 -250)" : "";
- this.suits_background.setAttribute("transform", transform);
+ this.suits_background.classList.toggle("suit-expand", is_choosing_trumps);
for (const [suit, glyph] of this.glyphs) {
- glyph.setAttribute("transform", transform);
+ glyph.classList.toggle("suit-expand", is_choosing_trumps);
}
for (const [suit, highlight] of this.glyph_highlights) {
- highlight.setAttribute("transform", transform);
+ highlight.classList.toggle("suit-expand", is_choosing_trumps);
}
}
transform: translateY(-20px);
}
+.suit-background, .suit-glyph, .suit-highlight {
+ transition: transform 0.5s;
+}
+
.suit-glyph {
pointer-events: none;
}
.active-indicator.active {
fill: #2020ff;
}
+
+.suit-expand {
+ transform: matrix(3, 0, 0, 3, -910, -500);
+}