Files
python-tdd/src/static_src/scss/_applets.scss
Disco DeDisco 6a7464ee4b
Some checks failed
ci/woodpecker/push/pyswiss Pipeline was successful
ci/woodpecker/push/main Pipeline failed
post.html: gear-btn + #id_post_menu (NVM / DEL / BYE) mirror room.html's #id_room_menu — all Posts get the gear w. NVM (→ billboard:my_posts); user-Posts (kind=USER_POST / SHARE_INVITE) additionally surface DEL for the author (POST → billboard:delete_post → hard-deletes the Post; cascades Lines via FK + clears shared_with M2M) and BYE for invitees (POST → billboard:abandon_post → removes request.user from post.shared_with; owner + other invitees keep the thread); admin-Posts (kind=NOTE_UNLOCK) intentionally render gear w. NVM only since the system thread isn't user-owned (defence-in-depth: both delete_post + abandon_post no-op on NOTE_UNLOCK so a forged POST can't bypass the menu's branch); _post_gear.html partial gates DEL/BYE on viewer_is_owner (set by view_post since the buds sprint) + post.kind, then includes the shared apps/applets/_partials/_gear.html btn; styling rides the existing applets.scss page-level pattern — .post-page joins .billboard-page / .room-page / .dashboard-page / .wallet-page / .gameboard-page / .billscroll-page in the > .gear-btn { position: fixed; bottom: 4.2rem; right: 0.5rem } rule (and the landscape footer-sidebar centred variant), #id_post_menu joins the %applet-menu extension list + the page-level fixed-menu rule (bottom: 6.6rem; right: 1rem); 5 FTs in test_bill_post_gear.py (owner DEL flow, invitee BYE flow, 3 menu-shape assertions for owner/invitee/admin) + 11 ITs across DeletePostViewTest + AbandonPostViewTest (302 redirect target, side effect, GET-is-no-op, non-owner / non-invitee / NOTE_UNLOCK protection) — TDD
Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 22:26:12 -04:00

264 lines
7.1 KiB
SCSS

// ── Gear button ────────────────────────────────────────────
.gear-btn {
position: absolute;
bottom: 0.5rem;
right: 0.5rem;
z-index: 1;
font-size: 2rem;
cursor: pointer;
color: rgba(var(--secUser), 1);
display: inline-flex;
align-items: center;
justify-content: center;
width: 3rem;
height: 3rem;
border-radius: 50%;
background-color: rgba(var(--priUser), 1);
border: 0.15rem solid rgba(var(--secUser), 1);
&.active {
color: rgba(var(--quaUser), 1);
border-color: rgba(var(--quaUser), 1);
}
}
// ── Applet menu (shared structure) ─────────────────────────
%applet-menu {
position: absolute;
bottom: 3rem;
right: 0.5rem;
z-index: 100;
background-color: rgba(var(--priUser), 0.95);
border: 0.15rem solid rgba(var(--secUser), 1);
box-shadow:
0 0 0.5rem rgba(var(--secUser), 0.75),
0.12rem 0.12rem 0.5rem rgba(0, 0, 0, 0.25),
;
border-radius: 0.75rem;
padding: 1rem;
.menu-btns {
display: flex;
gap: 0.25rem;
margin-top: 0.75rem;
}
form {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
input[type="checkbox"] {
appearance: none;
-webkit-appearance: none;
width: 0.9em;
height: 0.9em;
border: 0.1rem solid rgba(var(--secUser), 0.4);
border-radius: 0.25rem;
background: transparent;
cursor: pointer;
position: relative;
flex-shrink: 0;
top: 0.1em;
&:checked::after {
content: '';
position: absolute;
left: 0.2em;
bottom: 0.2em;
width: 0.55em;
height: 1em;
border: 0.12em solid rgba(var(--ninUser), 1);
border-top: none;
border-left: none;
transform: rotate(45deg);
}
}
}
#id_dash_applet_menu { @extend %applet-menu; }
#id_game_applet_menu { @extend %applet-menu; }
#id_game_kit_menu { @extend %applet-menu; }
#id_wallet_applet_menu { @extend %applet-menu; }
#id_room_menu { @extend %applet-menu; }
#id_post_menu { @extend %applet-menu; }
#id_billboard_applet_menu { @extend %applet-menu; }
#id_billscroll_menu { @extend %applet-menu; }
// Page-level gear buttons — fixed to viewport bottom-right
.gameboard-page,
.dashboard-page,
.wallet-page,
.room-page,
.post-page,
.billboard-page,
.billscroll-page {
> .gear-btn {
position: fixed;
bottom: 4.2rem;
right: 0.5rem;
z-index: 314;
}
}
#id_dash_applet_menu,
#id_game_applet_menu,
#id_game_kit_menu,
#id_wallet_applet_menu,
#id_post_menu,
#id_billboard_applet_menu,
#id_billscroll_menu {
position: fixed;
bottom: 6.6rem;
right: 1rem;
z-index: 312;
}
// In landscape: shift gear btn and applet menus into the footer-sidebar
// column. Both gear-btn (3rem wide) and the menus are centred in the
// `var(--sidebar-w)` slot via `right: calc((var(--sidebar-w) - 3rem) / 2)`,
// which scales with the rem-fluid root — no per-breakpoint override.
@media (orientation: landscape) {
.gameboard-page,
.dashboard-page,
.wallet-page,
.room-page,
.post-page,
.billboard-page,
.billscroll-page {
> .gear-btn {
right: calc((var(--sidebar-w) - 3rem) / 2);
bottom: 3.95rem;
top: auto;
}
}
#id_dash_applet_menu,
#id_game_applet_menu,
#id_game_kit_menu,
#id_wallet_applet_menu,
#id_room_menu,
#id_post_menu,
#id_billboard_applet_menu,
#id_billscroll_menu {
right: calc((var(--sidebar-w) - 3rem) / 2);
bottom: 6.6rem;
top: auto;
}
}
// ── Applet box visual shell (reusable outside the grid) ────
%applet-box {
border:
0.2rem solid rgba(var(--secUser), 0.5),
;
box-shadow:
inset -0.125rem -0.125rem 0 rgba(var(--ninUser), 0.125),
inset 0.125rem 0.125rem 0 rgba(0, 0, 0, 0.8)
;
background-color: rgba(0, 0, 0, 0.125);
border-radius: 0.75rem;
position: relative;
padding: 0.75rem 0.75rem 0.75rem 2.5rem;
overflow: hidden;
min-width: 0;
// Hide any inner scrollbars (e.g. My Sky applet's #id_applet_sky_form_wrap)
// so they obey the same scrollbar-less treatment as the page apertures
// (gameboard / billboard / dashboard apertures already use this same pair
// — keeps the dark theme consistent w.o. the OS-default white track bleeding
// through inside an applet).
*::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }
> h2 {
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 2rem;
display: flex;
align-items: center;
justify-content: center;
writing-mode: vertical-rl;
transform: rotate(180deg);
font-size: 1rem;
letter-spacing: 0.2em;
text-transform: uppercase;
margin: 0;
padding-right: 0.2rem;
color: rgba(var(--secUser), 1);
text-shadow:
1px 1px 0 rgba(255, 255, 255, 0.06),
-0.06rem -0.06rem 0 rgba(0, 0, 0, 0.25)
;
background-color: rgba(0, 0, 0, 0.125);
box-shadow:
0 0 0.5rem rgba(var(--priUser), 0.5),
0.12rem 0.12rem 0.5rem rgba(0, 0, 0, 0.5),
;
white-space: nowrap;
overflow: hidden;
z-index: 1;
a {
color: rgba(var(--terUser), 1);
text-decoration: none;
&:hover {
color: rgba(var(--ninUser), 1);
text-shadow: 0 0 0.5rem rgba(var(--terUser), 1);
}
}
}
}
// ── Applets grid (shared across all boards) ────────────────
%applets-grid {
container-type: inline-size;
--grid-gap: 0.5rem;
flex: 1;
overflow-y: auto;
overflow-x: hidden;
display: grid;
grid-template-columns: repeat(12, 1fr);
grid-auto-rows: 3rem;
gap: var(--grid-gap);
padding: 0.75rem;
-webkit-overflow-scrolling: touch;
mask-image: linear-gradient(
to bottom,
transparent 0%,
black 2%,
black 99%,
transparent 100%
);
margin-left: 1rem;
margin-top: 1rem;
@media (orientation: landscape) and (min-width: 900px) {
margin-left: 2rem;
margin-top: 2rem;
}
@media (orientation: landscape) and (min-width: 1800px) {
margin-left: 4rem;
margin-top: 4rem;
}
section {
@extend %applet-box;
grid-column: span var(--applet-cols, 12);
grid-row: span var(--applet-rows, 3);
@container (max-width: 550px) {
grid-column: span 12;
}
}
}
#id_applets_container { @extend %applets-grid; }
#id_game_applets_container { @extend %applets-grid; }
#id_wallet_applets_container { @extend %applets-grid; }
#id_billboard_applets_container { @extend %applets-grid; }
#id_gk_sections_container { @extend %applets-grid; }