Skip to content

Commit a514b4f

Browse files
committed
way to slam the left param bar shut
1 parent 53eb163 commit a514b4f

File tree

3 files changed

+33
-9
lines changed

3 files changed

+33
-9
lines changed

src/Pages/Text2Image.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<div style="height: 2rem;"></div> <!-- Spacer -->
4545
</div>
4646
</div>
47-
<div class="t2i-top-split-bar splitter-bar" id="t2i-top-split-bar"></div>
47+
<div class="t2i-top-split-bar splitter-bar" id="t2i-top-split-bar"><div class="t2i-split-quickbutton t2i-top-split-quickbutton" id="t2i-top-split-quickbutton">&#x21DA;</div></div>
4848
<div class="main-image-area" id="main_image_area">
4949
<div class="current_image" id="current_image"></div><div class="t2i-top-split-bar splitter-bar" id="t2i-top-2nd-split-bar"></div><div class="current_image_batch" id="current_image_batch"></div>
5050
</div>
@@ -56,7 +56,7 @@
5656
</div>
5757
</div>
5858
</div>
59-
<div class="t2i-mid-split-bar splitter-bar" id="t2i-mid-split-bar"><div class="t2i-mid-split-quickbutton" id="t2i-mid-split-quickbutton">&#x290B;</div></div>
59+
<div class="t2i-mid-split-bar splitter-bar" id="t2i-mid-split-bar"><div class="t2i-split-quickbutton t2i-mid-split-quickbutton" id="t2i-mid-split-quickbutton">&#x290B;</div></div>
6060
<div class="t2i-bottom-bar" id="t2i_bottom_bar">
6161
<div class="bottom-info-bar-container">
6262
<span class="bottom-info-bar-component"><b>Model</b>: <select class="auto-dropdown current_model_view" id="current_model"></select></span>

src/wwwroot/css/genpage.css

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,28 @@ body {
6363
height: 7px;
6464
cursor: row-resize;
6565
}
66-
.t2i-mid-split-quickbutton {
66+
.t2i-split-quickbutton {
6767
position: relative;
68-
float: right;
69-
vertical-align: top;
70-
top: -1.5rem;
71-
right: 2rem;
7268
font-size: 200%;
7369
cursor: pointer;
7470
border-radius: 0.2rem;
7571
color: var(--button-text);
7672
}
77-
.t2i-mid-split-quickbutton:hover {
73+
.t2i-split-quickbutton:hover {
7874
background-color: var(--button-background-hover);
7975
}
76+
.t2i-top-split-quickbutton {
77+
float: right;
78+
vertical-align: top;
79+
top: 0rem;
80+
left: 0.6rem;
81+
}
82+
.t2i-mid-split-quickbutton {
83+
float: right;
84+
vertical-align: top;
85+
top: -1.5rem;
86+
right: 2rem;
87+
}
8088
.t2i-top-bar {
8189
display: block;
8290
height: 50vh;

src/wwwroot/js/genpage.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ let pageBarTop = -1;
484484
let pageBarTop2 = -1;
485485
let pageBarMid = -1;
486486
let midForceToBottom = localStorage.getItem('barspot_midForceToBottom') == 'true';
487+
let leftShut = localStorage.getItem('barspot_leftShut') == 'true';
487488

488489
let setPageBarsFunc;
489490

@@ -496,7 +497,10 @@ function resetPageSizer() {
496497
pageBarTop = -1;
497498
pageBarTop2 = -1;
498499
pageBarMid = -1;
500+
midForceToBottom = false;
501+
leftShut = false;
499502
localStorage.removeItem('barspot_midForceToBottom');
503+
localStorage.removeItem('barspot_leftShut');
500504
setPageBarsFunc();
501505
for (let runnable of layoutResets) {
502506
runnable();
@@ -515,20 +519,23 @@ function pageSizer() {
515519
let currentImage = getRequiredElementById('current_image');
516520
let currentImageBatch = getRequiredElementById('current_image_batch');
517521
let midSplitButton = getRequiredElementById('t2i-mid-split-quickbutton');
522+
let topSplitButton = getRequiredElementById('t2i-top-split-quickbutton');
518523
let topDrag = false;
519524
let topDrag2 = false;
520525
let midDrag = false;
521526
function setPageBars() {
522527
setCookie('barspot_pageBarTop', pageBarTop, 365);
523528
setCookie('barspot_pageBarTop2', pageBarTop2, 365);
524529
setCookie('barspot_pageBarMidPx', pageBarMid, 365);
525-
let barTopLeft = pageBarTop == -1 ? `28rem` : `${pageBarTop}px`;
530+
let barTopLeft = leftShut ? `0px` : pageBarTop == -1 ? `28rem` : `${pageBarTop}px`;
526531
let barTopRight = pageBarTop2 == -1 ? `21rem` : `${pageBarTop2}px`;
527532
inputSidebar.style.width = `${barTopLeft}`;
528533
mainInputsAreaWrapper.style.width = `${barTopLeft}`;
534+
inputSidebar.style.display = leftShut ? 'none' : '';
529535
mainImageArea.style.width = `calc(100vw - ${barTopLeft})`;
530536
currentImage.style.width = `calc(100vw - ${barTopLeft} - ${barTopRight} - 10px)`;
531537
currentImageBatch.style.width = `${barTopRight}`;
538+
topSplitButton.innerHTML = leftShut ? '&#x21DB;' : '&#x21DA;';
532539
midSplitButton.innerHTML = midForceToBottom ? '&#x290A;' : '&#x290B;';
533540
if (pageBarMid != -1 || midForceToBottom) {
534541
let fixed = midForceToBottom ? `9rem` : `${pageBarMid}px`;
@@ -592,11 +599,20 @@ function pageSizer() {
592599
setPageBars();
593600
e.preventDefault();
594601
}, true);
602+
topSplitButton.addEventListener('click', (e) => {
603+
topDrag = false;
604+
leftShut = !leftShut;
605+
localStorage.setItem('barspot_leftShut', leftShut);
606+
pageBarTop = Math.max(pageBarTop, 400);
607+
setPageBars();
608+
e.preventDefault();
609+
}, true);
595610
document.addEventListener('mousemove', (e) => {
596611
let offX = e.pageX;
597612
offX = Math.min(Math.max(offX, 100), window.innerWidth - 100);
598613
if (topDrag) {
599614
pageBarTop = offX - 5;
615+
leftShut = pageBarTop < 280;
600616
setPageBars();
601617
}
602618
if (topDrag2) {

0 commit comments

Comments
 (0)