fix: Make panel responsive and remove forced chat margins
- Removed margin-left/right on #sheld that was pushing chat to center - Panel now overlays instead of pushing content - Added responsive breakpoints for different screen sizes - Width: 380px default, max 30vw, scales down on smaller screens - Mobile: Full width at bottom on very small screens - Panel no longer breaks layout on different screen sizes
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/* ============================================
|
/* ============================================
|
||||||
RPG COMPANION - GAME-LIKE UI
|
RPG COMPANION - GAME-LIKE UI - RESPONSIVE
|
||||||
============================================ */
|
============================================ */
|
||||||
|
|
||||||
/* CSS Variables for Theming - Default uses SillyTavern's variables */
|
/* CSS Variables for Theming - Default uses SillyTavern's variables */
|
||||||
@@ -14,14 +14,14 @@
|
|||||||
--rpg-shadow: rgba(0, 0, 0, 0.5);
|
--rpg-shadow: rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Main Panel Container - Fixed height, no overflow */
|
/* Main Panel Container - Flexible width, responsive */
|
||||||
.rpg-panel {
|
.rpg-panel {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: var(--topBarBlockSize);
|
top: var(--topBarBlockSize);
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: min(380px, 25vw);
|
width: 380px;
|
||||||
max-width: 450px;
|
max-width: 30vw;
|
||||||
min-width: 300px;
|
min-width: 280px;
|
||||||
background: var(--rpg-bg);
|
background: var(--rpg-bg);
|
||||||
box-shadow: 0 0 20px var(--rpg-shadow);
|
box-shadow: 0 0 20px var(--rpg-shadow);
|
||||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
@@ -33,28 +33,20 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Right Position (Default) */
|
/* Right Position (Default) - Panel overlays on the right */
|
||||||
.rpg-panel.rpg-position-right {
|
.rpg-panel.rpg-position-right {
|
||||||
right: 0;
|
right: 0;
|
||||||
border-left: 3px solid var(--rpg-border);
|
border-left: 3px solid var(--rpg-border);
|
||||||
box-shadow: -5px 0 20px var(--rpg-shadow);
|
box-shadow: -5px 0 20px var(--rpg-shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
body:has(.rpg-panel.rpg-position-right) #sheld {
|
/* Left Position - Panel overlays on the left */
|
||||||
margin-right: min(380px, 25vw);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Left Position */
|
|
||||||
.rpg-panel.rpg-position-left {
|
.rpg-panel.rpg-position-left {
|
||||||
left: 0;
|
left: 0;
|
||||||
border-right: 3px solid var(--rpg-border);
|
border-right: 3px solid var(--rpg-border);
|
||||||
box-shadow: 5px 0 20px var(--rpg-shadow);
|
box-shadow: 5px 0 20px var(--rpg-shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
body:has(.rpg-panel.rpg-position-left) #sheld {
|
|
||||||
margin-left: min(380px, 25vw);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Top Position */
|
/* Top Position */
|
||||||
.rpg-panel.rpg-position-top {
|
.rpg-panel.rpg-position-top {
|
||||||
left: 0;
|
left: 0;
|
||||||
@@ -68,10 +60,6 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
|
|||||||
box-shadow: 0 5px 20px var(--rpg-shadow);
|
box-shadow: 0 5px 20px var(--rpg-shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
body:has(.rpg-panel.rpg-position-top) #sheld {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Top Position Layout Adjustments */
|
/* Top Position Layout Adjustments */
|
||||||
.rpg-panel.rpg-position-top .rpg-content-box {
|
.rpg-panel.rpg-position-top .rpg-content-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -98,25 +86,47 @@ body:has(.rpg-panel.rpg-position-top) #sheld {
|
|||||||
|
|
||||||
.rpg-panel.rpg-position-top .rpg-stat-label {
|
.rpg-panel.rpg-position-top .rpg-stat-label {
|
||||||
min-width: 90px;
|
min-width: 90px;
|
||||||
font-size: 11px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.rpg-panel.rpg-position-top .rpg-stat-bar {
|
.rpg-panel.rpg-position-top .rpg-stat-bar {
|
||||||
height: 16px;
|
height: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rpg-panel.rpg-position-top .rpg-stat-value {
|
/* Mobile Responsiveness */
|
||||||
font-size: 11px;
|
@media (max-width: 1024px) {
|
||||||
|
.rpg-panel {
|
||||||
|
width: 320px;
|
||||||
|
max-width: 35vw;
|
||||||
|
min-width: 260px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.rpg-panel.rpg-position-top .rpg-section-title {
|
@media (max-width: 768px) {
|
||||||
font-size: 14px;
|
.rpg-panel {
|
||||||
padding: 8px 12px;
|
width: 280px;
|
||||||
|
max-width: 40vw;
|
||||||
|
min-width: 240px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rpg-section-title {
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.rpg-panel.rpg-position-top .rpg-user-portrait {
|
@media (max-width: 480px) {
|
||||||
width: 40px;
|
.rpg-panel.rpg-position-right,
|
||||||
height: 40px;
|
.rpg-panel.rpg-position-left {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
height: 50vh;
|
||||||
|
top: auto;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rpg-panel.rpg-position-top {
|
||||||
|
max-height: 40vh;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.rpg-panel.rpg-position-top .rpg-stats-title {
|
.rpg-panel.rpg-position-top .rpg-stats-title {
|
||||||
|
|||||||
Reference in New Issue
Block a user