fix div bug

This commit is contained in:
2025-09-08 22:54:10 -04:00
parent fb3f567a5b
commit 7d45a36f93
2 changed files with 21 additions and 24 deletions

View File

@@ -5,28 +5,26 @@ import { Stylable } from "./toolbox";
export default (props: { handCount: number } & Stylable) => { export default (props: { handCount: number } & Stylable) => {
return ( return (
<div class={props.class} style={props.style}> <For each={Array(props.handCount)}>
<For each={Array(props.handCount)}> {(_, i) => {
{(_, i) => { const midOffset = i() + 0.5 - props.handCount / 2;
const midOffset = i() + 0.5 - props.handCount / 2; return (
return ( <Card
<Card face="down"
face="down" scale={0.4}
scale={0.4} style={{
style={{ "margin-left": "-12px",
"margin-left": "-12px", "margin-right": "-12px",
"margin-right": "-12px", transform: `translate(0px, ${Math.pow(
transform: `translate(0px, ${Math.pow( Math.abs(midOffset),
Math.abs(midOffset), 2
2 )}px) rotate(${midOffset * 0.12}rad)`,
)}px) rotate(${midOffset * 0.12}rad)`, "min-width": "40px",
"min-width": "40px", "box-shadow": "-4px 4px 6px rgba(0, 0, 0, 0.6)",
"box-shadow": "-4px 4px 6px rgba(0, 0, 0, 0.6)", }}
}} />
/> );
); }}
}} </For>
</For>
</div>
); );
}; };

View File

@@ -87,7 +87,6 @@ export default () => {
<Portal <Portal
mount={table.players[playerKey].ref} mount={table.players[playerKey].ref}
ref={(ref) => { ref={(ref) => {
console.log("Setting hand ref");
const midOffset = const midOffset =
i() + 0.5 - Object.values(view().playerHandCounts).length / 2; i() + 0.5 - Object.values(view().playerHandCounts).length / 2;