feat(tokens): app-local non-player tokens with session moves and UI polish

Add token library/placements, keep play-time moves for the session, lock presentation interactions, and fix export/import modal layout plus freeform trap label.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-07-27 11:04:12 +08:00
parent bdeb64e356
commit f270812219
44 changed files with 2617 additions and 341 deletions
@@ -90,22 +90,6 @@
opacity: 0.75;
}
.select {
width: 100%;
box-sizing: border-box;
padding: 7px 28px 7px 10px;
border-radius: 8px;
border: 1px solid var(--stroke, #2a2f3a);
background-color: rgba(0, 0, 0, 0.25);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.25L6 7.75L9.5 4.25' stroke='rgba(255,255,255,0.72)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 8px center;
background-size: 12px 12px;
color: inherit;
font: inherit;
appearance: none;
}
.range {
width: 100%;
accent-color: #f5c542;
@@ -200,7 +184,7 @@
.trap {
position: absolute;
z-index: 1;
z-index: 2;
transform: translate(-50%, -50%);
border-radius: 50%;
border: 2px solid rgba(255, 255, 255, 0.55);
@@ -252,6 +236,189 @@
opacity: 0.7;
}
.tokensPanel {
display: grid;
gap: 8px;
padding: 10px 12px 12px;
}
.tokensToolbar {
display: grid;
}
.tokensToolbar button {
width: 100%;
box-sizing: border-box;
}
.tokenGrid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.tokenTile {
display: grid;
gap: 4px;
padding: 6px;
border-radius: 8px;
border: 1px solid var(--stroke, #2a2f3a);
background: rgba(0, 0, 0, 0.22);
cursor: grab;
user-select: none;
}
.tokenTile:active {
cursor: grabbing;
}
.tokenThumb {
aspect-ratio: 1;
border-radius: 6px;
overflow: hidden;
background: rgba(0, 0, 0, 0.35);
display: grid;
place-items: center;
}
.tokenThumb img {
width: 100%;
height: 100%;
object-fit: contain;
}
.tokenTileMeta {
display: flex;
align-items: center;
gap: 2px;
min-width: 0;
}
.tokenTileName {
flex: 1 1 auto;
min-width: 0;
font-size: 11px;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tokenTileMore {
flex: 0 0 auto;
width: 22px;
height: 22px;
padding: 0;
border: none;
border-radius: 4px;
background: transparent;
color: inherit;
font-size: 16px;
line-height: 1;
cursor: pointer;
opacity: 0.75;
}
.tokenTileMore:hover,
.tokenTileMore[aria-expanded='true'] {
opacity: 1;
background: rgba(255, 255, 255, 0.08);
}
.tokenCtxMenu {
position: fixed;
z-index: 80;
min-width: 160px;
padding: 6px;
border-radius: 10px;
border: 1px solid var(--stroke, #333);
background: #1a1d24;
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
display: grid;
gap: 2px;
}
.tokenCtxItem,
.tokenCtxItemDanger {
text-align: left;
padding: 8px 10px;
border-radius: 6px;
border: none;
background: transparent;
color: #e8eaef;
font-size: 13px;
cursor: pointer;
width: 100%;
}
.tokenCtxItem:hover {
background: rgba(255, 255, 255, 0.08);
}
.tokenCtxItemDanger {
color: #f87171;
}
.tokenCtxItemDanger:hover {
background: rgba(248, 113, 113, 0.12);
}
.clearSceneBtn {
width: 100%;
box-sizing: border-box;
}
.clearSceneBtn button {
width: 100%;
box-sizing: border-box;
}
.sceneToken {
position: absolute;
z-index: 1;
border-radius: 8px;
border: 2px solid rgba(255, 255, 255, 0.35);
background: rgba(0, 0, 0, 0.25);
overflow: visible;
cursor: move;
touch-action: none;
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.sceneTokenSelected {
border-color: #f5c542;
box-shadow:
0 0 0 1px rgba(0, 0, 0, 0.4),
0 0 0 3px rgba(245, 197, 66, 0.35);
}
.sceneTokenImg {
width: 100%;
height: 100%;
object-fit: contain;
border-radius: 6px;
pointer-events: none;
display: block;
}
.rotateHandle {
position: absolute;
left: 50%;
top: -18px;
transform: translateX(-50%);
width: 22px;
height: 22px;
border-radius: 50%;
border: 1px solid #000;
background: #f5c542;
color: #111;
font-size: 12px;
line-height: 1;
cursor: grab;
touch-action: none;
padding: 0;
}
.toolbar {
display: flex;
gap: 8px;