Better opacity handling. Remove debug logs

d5b845345e2cb03fae086b446aad08eb484cb20e

Cohee <18619528+Cohee1207@users.noreply.github.com>

3 files changed, +17 -10Showing whitespace changes
public/script.js+12 -8
@@ -7493,29 +7493,33 @@ export function showSwipeButtons() {
7493 const currentMessage = $('#chat').children().filter(`[mesid="${chat.length - 1}"]`);7493 const currentMessage = $('#chat').children().filter(`[mesid="${chat.length - 1}"]`);
7494 const swipeId = chat[chat.length - 1].swipe_id;7494 const swipeId = chat[chat.length - 1].swipe_id;
7495 const swipeCounterText = (`${(swipeId + 1)}\u200B/\u200b${(chat[chat.length - 1].swipes.length)}`);7495 const swipeCounterText = (`${(swipeId + 1)}\u200B/\u200b${(chat[chat.length - 1].swipes.length)}`);
7496 const swipeRight = currentMessage.find('.swipe_right');
7497 const swipeLeft = currentMessage.find('.swipe_left');
7498 const swipeCounter = currentMessage.find('.swipes-counter');
74967499
7497 if (swipeId !== undefined && (chat[chat.length - 1].swipes.length > 1 || swipeId > 0)) {7500 if (swipeId !== undefined && (chat[chat.length - 1].swipes.length > 1 || swipeId > 0)) {
7498 currentMessage.children('.swipe_left').css('display', 'flex');7501 swipeLeft.css('display', 'flex');
7499 }7502 }
7500 //only show right when generate is off, or when next right swipe would not make a generate happen7503 //only show right when generate is off, or when next right swipe would not make a generate happen
7501 if (is_send_press === false || chat[chat.length - 1].swipes.length >= swipeId) {7504 if (is_send_press === false || chat[chat.length - 1].swipes.length >= swipeId) {
7502 console.error('showingSwipeButtons: showing.');7505 // console.error('showingSwipeButtons: showing.');
7503 currentMessage.find('.swipe_right').css('display', 'flex');7506 swipeRight.css('display', 'flex').css('opacity', '0.3');
7504 currentMessage.find('.swipe_right').css('opacity', '0.3');7507 swipeCounter.css('opacity', '0.3');
7505 }7508 }
7506 //console.log((chat[chat.length - 1]));7509 //console.log((chat[chat.length - 1]));
7507 if ((chat[chat.length - 1].swipes.length - swipeId) === 1) {7510 if ((chat[chat.length - 1].swipes.length - swipeId) === 1) {
7508 console.error('highlighting R swipe');7511 // console.error('highlighting R swipe');
75097512
7510 //chevron was moved out of hardcode in HTML to class toggle dependent on last_mes or not7513 //chevron was moved out of hardcode in HTML to class toggle dependent on last_mes or not
7511 //necessary for 'swipe_right' div in past messages to have no chevron if 'show swipes for all messages' is turned on7514 //necessary for 'swipe_right' div in past messages to have no chevron if 'show swipes for all messages' is turned on
7512 currentMessage.find('.swipe_right').css('opacity', '0.7');7515 swipeRight.css('opacity', '0.7');
7516 swipeCounter.css('opacity', '0.7');
7513 }7517 }
7514 //console.log(swipesCounterHTML);7518 //console.log(swipesCounterHTML);
75157519
7516 //allows for writing individual swipe counters for past messages7520 //allows for writing individual swipe counters for past messages
7517 $('.last_mes .swipes-counter').text(swipeCounterText);7521 const lastSwipeCounter = $('.last_mes .swipes-counter');
7518 $('.last_mes .swipes-counter').show();7522 lastSwipeCounter.text(swipeCounterText).show();
75197523
7520 //console.log(swipeId);7524 //console.log(swipeId);
7521 //console.log(chat[chat.length - 1].swipes.length);7525 //console.log(chat[chat.length - 1].swipes.length);
public/scripts/power-user.js+1 -1
@@ -472,7 +472,7 @@ function switchCompactInputArea() {
472472
473export function switchSwipeNumAllMessages() {473export function switchSwipeNumAllMessages() {
474 $('#show_swipe_num_all_messages').prop('checked', power_user.show_swipe_num_all_messages);474 $('#show_swipe_num_all_messages').prop('checked', power_user.show_swipe_num_all_messages);
475 $('.mes:not(.last_mes) .swipes-counter').toggle(power_user.show_swipe_num_all_messages);475 $('.mes:not(.last_mes) .swipes-counter').css('opacity', '').toggle(power_user.show_swipe_num_all_messages);
476}476}
477477
478var originalSliderValues = [];478var originalSliderValues = [];
public/style.css+4 -1
@@ -1010,11 +1010,14 @@ body .panelControlBar {
1010 min-width: 40px;1010 min-width: 40px;
1011 display: flex;1011 display: flex;
1012 justify-content: center;1012 justify-content: center;
1013 opacity: 0.7;
1014 margin-bottom: var(--swipeCounterMargin);1013 margin-bottom: var(--swipeCounterMargin);
1015 height: var(--swipeCounterHeight);1014 height: var(--swipeCounterHeight);
1016}1015}
10171016
1017.mes:not(.last_mes) .swipes-counter {
1018 opacity: 0.3;
1019}
1020
1018.swipe_left {1021.swipe_left {
1019 right: auto;1022 right: auto;
1020 left: 20px;1023 left: 20px;