mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
added
- swipes library - CSS for mobile, - swipe left/right on last msg to regenerate
This commit is contained in:
@@ -16,7 +16,8 @@ export {
|
||||
api_server,
|
||||
api_key_novel,
|
||||
getCharacters,
|
||||
is_send_press
|
||||
is_send_press,
|
||||
chat
|
||||
}
|
||||
|
||||
// API OBJECT FOR EXTERNAL WIRING
|
||||
@@ -825,19 +826,23 @@ window['TavernAI'] = {};
|
||||
typeWriter($("#chat").children().filter('[mesid="' + count_view_mes + '"]').children('.mes_block').children('.mes_text'), messageText, 50, 0);
|
||||
}
|
||||
count_view_mes++;
|
||||
//console.log('add mes without animation = '+add_mes_without_animation);
|
||||
//console.log(!add_mes_without_animation);
|
||||
if (!add_mes_without_animation) {
|
||||
$('#chat').children().last().css("opacity", 1.0);
|
||||
$('#chat').children().last().transition({
|
||||
opacity: 1.0,
|
||||
duration: 700,
|
||||
easing: "",
|
||||
complete: function () { }
|
||||
});
|
||||
} else {
|
||||
console.log('adding mes with animation')
|
||||
//$('#chat').children().last().css('transition','all 2s ease-in-out');
|
||||
$('#chat').children().last().css("opacity", "1");
|
||||
//$('#chat').children().last().css('transition','all 2s ease-in-out');
|
||||
|
||||
|
||||
}else {
|
||||
console.log('add mes with animation was false, and is set to false again')
|
||||
add_mes_without_animation = false;
|
||||
}
|
||||
var $textchat = $('#chat');
|
||||
$textchat.scrollTop($textchat[0].scrollHeight);
|
||||
//$('#chat').children().last().css("opacity", "1");
|
||||
$textchat.scrollTop(($textchat[0].scrollHeight));
|
||||
|
||||
}
|
||||
function typeWriter(target, text, speed, i) {
|
||||
if (i < text.length) {
|
||||
@@ -1003,11 +1008,14 @@ window['TavernAI'] = {};
|
||||
if (chat[chat.length - 1]['is_user']) {//If last message from You
|
||||
|
||||
} else {
|
||||
//console.log('about to remove last msg')
|
||||
chat.length = chat.length - 1;
|
||||
count_view_mes -= 1;
|
||||
//console.log('removing last msg')
|
||||
$('#chat').children().last().remove();
|
||||
//$('#chat').children().last().css({'transition':'all 0.5s ease-in-out'});
|
||||
//$('#chat').children().last().css({'transform':'translateX(100vh) scale(0.1,0.1)'});
|
||||
//$('#chat').children().last().css({'opacity':'0'});
|
||||
setTimeout(function(){
|
||||
$('#chat').children().last().remove();
|
||||
},1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user