revamp creator note & spoiler hide/show

This commit is contained in:
RossAscends
2024-03-03 18:55:16 +09:00
parent 181657cede
commit 77791ae3e9
3 changed files with 60 additions and 54 deletions

View File

@ -4013,6 +4013,17 @@
</div>
</div>
</div>
<hr>
<div id="spoiler_free_desc" class="flex-container flexFlowColumn flex1">
<div id="creators_notes_div" class="marginBot5 title_restorable">
<span data-i18n="Creator's Notes">Creator's Notes</span>
<div id="spoiler_free_desc_button" class="menu_button fa-solid fa-eye" title="Show / Hide Description and First Message" data-i18n="[title]Show / Hide Description and First Message"></div>
</a>
</div>
<textarea readonly id="creator_notes_spoiler" class="flex1" data-i18n="[placeholder]Creator's Notes" placeholder="Creator's Notes" class="marginBot5" name="creator_notes_spoiler"></textarea>
<!-- A button to show / hide description_div and description_textarea and first_message_div and firstmessage_textarea-->
</div>
<div id="descriptionWrapper" class="flex-container flexFlowColumn flex1">
<hr>
<div id="description_div" class="marginBot5 flex-container alignitemscenter">
<span data-i18n="Character Description">Description</span>
@ -4025,6 +4036,8 @@
<div class="extension_token_counter">
Tokens: <span data-token-counter="description_textarea" data-token-permanent="true">counting...</span>
</div>
</div>
<div id="firstMessageWrapper" class="flex-container flexFlowColumn flex1">
<div id="first_message_div" class="marginBot5 title_restorable">
<div class="flex-container alignitemscenter">
<span data-i18n="First message">First message</span>
@ -4043,15 +4056,6 @@
<div class="extension_token_counter">
Tokens: <span data-token-counter="firstmessage_textarea">counting...</span>
</div>
<div id="spoiler_free_desc">
<div id="creators_notes_div" class="marginBot5 title_restorable">
<span data-i18n="Creator's Notes">Creator's Notes</span>
<div id="spoiler_free_desc_button" class="menu_button fa-solid fa-eye" title="Show / Hide Description and First Message" data-i18n="[title]Show / Hide Description and First Message"></div>
</a>
</div>
<hr>
<div id="creator_notes_spoiler" data-i18n="[placeholder]Creator's Notes" placeholder="Creator's Notes" class="marginBot5" name="creator_notes_spoiler"></div>
<!-- A button to show / hide description_div and description_textarea and first_message_div and firstmessage_textarea-->
</div>
<!-- these divs are invisible and used for server communication purposes -->
<div id="hidden-divs">

View File

@ -917,27 +917,24 @@ function switchWaifuMode() {
function switchSpoilerMode() {
if (power_user.spoiler_free_mode) {
$('#description_div').hide();
$('#description_textarea').hide();
$('#firstmessage_textarea').hide();
$('#first_message_div').hide();
$('#spoiler_free_desc').show();
$('#descriptionWrapper').hide();
$('#firstMessageWrapper').hide();
$('#spoiler_free_desc').addClass('flex1');
$('#creator_notes_spoiler').show();
}
else {
$('#description_div').show();
$('#description_textarea').show();
$('#firstmessage_textarea').show();
$('#first_message_div').show();
$('#spoiler_free_desc').hide();
$('#descriptionWrapper').show();
$('#firstMessageWrapper').show();
$('#spoiler_free_desc').removeClass('flex1');
$('#creator_notes_spoiler').hide();
}
}
function peekSpoilerMode() {
$('#description_div').toggle();
$('#description_textarea').toggle();
$('#firstmessage_textarea').toggle();
$('#first_message_div').toggle();
$('#descriptionWrapper').toggle();
$('#firstMessageWrapper').toggle();
$('#creator_notes_spoiler').toggle();
$('#spoiler_free_desc').toggleClass('flex1');
}

View File

@ -1028,6 +1028,11 @@ select {
white-space: nowrap;
}
#creator_notes_spoiler {
border: 0;
font-size: calc(var(--mainFontSize)*.8);
}
@media screen and (max-width: 1000px) {
#form_create textarea {
flex-grow: 1;