diff --git a/public/characters/Aqua.png b/public/characters/Aqua.png index 62552dd74..6da8e87e1 100644 Binary files a/public/characters/Aqua.png and b/public/characters/Aqua.png differ diff --git a/public/css/notes.css b/public/css/notes.css index 2041c33fe..91dc543f9 100644 --- a/public/css/notes.css +++ b/public/css/notes.css @@ -1,12 +1,46 @@ - -#main{ - width: 100%; - height: 100%; - +body { + margin: 0; + padding:0; + width: 100%; + background-color: rgb(36, 37, 37); + background-repeat: no-repeat; + background-attachment: fixed; + background-size: cover; + font-family: "Noto Sans", "Noto Color Emoji", sans-serif; + font-size:16px; /*1rem*/ + color: #999; + box-sizing: border-box; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + /*z-index:0;*/ } -#content{ - margin-left: 6px; - max-width: 700px; -} \ No newline at end of file +#main { + padding-top: 20px; + /*z-index:1;*/ + } + +#content{ + margin: 0 auto; + max-width: 700px; + border: 1px solid #333; + padding: 20px; + border-radius: 20px; + background-color: rgba(0,0,0,0.5); + line-height: 1.5rem; + box-shadow: 0 0 5px black; + /*z-index: 2;*/ +} + +code { + border: 1px solid #999; + background-color: rgba(0,0,0,0.5); + padding: 5px; + border-radius:5px; + display: block; + } + +a {color: orange; text-decoration:none; border-bottom: 1px dotted orange; } +h2, h3 {margin: 0; color:#ccc;} +hr {border: 1px solid #999;} \ No newline at end of file diff --git a/public/index.html b/public/index.html index 1190135b4..0fa353918 100644 --- a/public/index.html +++ b/public/index.html @@ -58,6 +58,25 @@ }]; var chat_create_date = 0; + + //RossAscends: Added function to format dates used in files and chat timestamps to a humanized format. + //Mostly I wanted this to be for file names, but couldn't figure out exactly where the filename save code was as everything seemed to be connected. + //During testing, this performs the same as previous date.now() structure. + //It also does not break old characters/chats, as the code just uses whatever timestamp exists in the chat. + //New chats made with characters will use this new formatting. + //Useable variable is (( humanizedISO8601Datetime )) + + var baseDate = new Date(Date.now()); + var humanYear = baseDate.getFullYear(); + var humanMonth = (baseDate.getMonth()+1); + var humanDate = baseDate.getDate(); + var humanHour = (baseDate.getHours() < 10? '0' : '') + baseDate.getHours(); + var humanMinute = (baseDate.getMinutes() < 10? '0' : '') + baseDate.getMinutes(); + var humanSecond = (baseDate.getSeconds() < 10? '0' : '') + baseDate.getSeconds(); + var humanMillisecond = (baseDate.getMilliseconds() < 10? '0' : '') + baseDate.getMilliseconds(); + var humanizedISO8601DateTime = (humanYear+"-"+humanMonth+"-"+humanDate+" @"+humanHour+"h "+humanMinute+"m "+humanSecond+"s "+humanMillisecond+"ms"); + + var default_ch_mes = "Hello"; var count_view_mes = 0; var mesStr = ''; @@ -1538,7 +1557,6 @@ } }); var save_chat = [{user_name:default_user_name, character_name:name2,create_date: chat_create_date}, ...chat]; - jQuery.ajax({ type: 'POST', url: '/savechat', @@ -2177,7 +2195,7 @@ }else{ $("#mes_example_textarea").val(create_save_mes_example); } - $("#avatar_div").css("display", "flex"); + $("#avatar_div").css("display", "grid"); $("#avatar_load_preview").attr('src',default_avatar); $("#name_div").css("display", "block"); @@ -2476,7 +2494,8 @@ if(popup_type == 'new_chat' && this_chid != undefined && menu_type != "create"){//Fix it; New chat doesn't create while open create character menu clearChat(); chat.length = 0; - characters[this_chid].chat = Date.now(); + characters[this_chid].chat = Date.now(); //RossAscends: added character name to new chat filenames and replaced Date.now() with humanizedISO8601DateTime; + //characters[this_chid].chat = (name2 +' - '+ humanizedISO8601DateTime); //RossAscends: added character name to new chat filenames and replaced Date.now() with humanizedISO8601DateTime; $("#selected_chat_pole").val(characters[this_chid].chat); timerSaveEdit = setTimeout(() => {$("#create_button").click();},durationSaveEdit); getChat(); @@ -2577,15 +2596,17 @@ }); function read_avatar_load(input) { + if (input.files && input.files[0]) { var reader = new FileReader(); if(selected_button == 'create'){ + create_save_avatar = input.files; } reader.onload = function (e) { if(selected_button == 'character_edit'){ - + timerSaveEdit = setTimeout(() => {$("#create_button").click();},durationSaveEdit); } $('#avatar_load_preview') @@ -2600,15 +2621,18 @@ } } $("#add_avatar_button").change(function(){ + is_mes_reload_avatar = Date.now(); read_avatar_load(this); }); $( "#form_create" ).submit(function(e) { + $('#rm_info_avatar').html(''); var formData = new FormData($("#form_create").get(0)); if($("#form_create").attr("actiontype") == "createcharacter"){ if($("#character_name_pole").val().length > 0){ + jQuery.ajax({ type: 'POST', url: '/createcharacter', @@ -2644,6 +2668,7 @@ $('#create_button').removeAttr("disabled"); $("#add_avatar_button").replaceWith($("#add_avatar_button").val('').clone(true)); + $('#create_button').attr('value','Create'); if(true){ $('#rm_info_block').transition({ opacity: 0 ,duration: 0}); @@ -2652,6 +2677,7 @@ select_rm_info("Character created"); $('#rm_info_block').transition({ opacity: 1.0 ,duration: 2000}); + getCharacters(); }else{ $('#result_info').html(html); @@ -2665,7 +2691,8 @@ $('#result_info').html("Name not entered"); } }else{ - //console.log($("#add_avatar_button").val()); + console.log($("#add_avatar_button").val()); + jQuery.ajax({ type: 'POST', url: '/editcharacter', @@ -2703,12 +2730,13 @@ } } $('#create_button').removeAttr("disabled"); + getCharacters(); - + $("#add_avatar_button").replaceWith($("#add_avatar_button").val('').clone(true)); $('#create_button').attr('value','Save'); - + var count_tokens = encode(JSON.stringify(characters[this_chid].description+characters[this_chid].personality+characters[this_chid].scenario+characters[this_chid].mes_example)).length; if(count_tokens < 1024){ $('#result_info').html(count_tokens+" Tokens"); @@ -3609,7 +3637,7 @@ //console.log(characters[this_chid].chat); jQuery.ajax({ type: 'POST', - url: '/getallchatsofchatacter', + url: '/getallchatsofcharacter', data: JSON.stringify({avatar_url: characters[this_chid].avatar}), beforeSend: function(){ //$('#create_button').attr('value','Creating...'); @@ -3628,7 +3656,7 @@ if(mes.length > strlen){ mes = '...'+mes.substring(mes.length - strlen); } - $('#select_chat_div').append('
'+data[key]['file_name']+'
'+mes+'
'); + $('#select_chat_div').append('
'+data[key]['file_name']+'
'+mes+'
'); if(characters[this_chid]['chat'] == data[key]['file_name'].replace('.jsonl', '')){ //children().last() $('#select_chat_div').children(':nth-last-child(1)').attr('highlight', true); @@ -3785,7 +3813,7 @@ $("#character_import_file_type").val(format); //console.log(format); var formData = new FormData($("#form_import").get(0)); - + jQuery.ajax({ type: 'POST', url: '/importcharacter', @@ -4386,7 +4414,7 @@ -
+
@@ -4601,10 +4629,10 @@