diff --git a/tuesday.js b/tuesday.js index 5025c42..104760f 100755 --- a/tuesday.js +++ b/tuesday.js @@ -195,7 +195,10 @@ function name_block_update(){ var v=''; if(story_json.parameters.buttons[i].sound){v+=(story_json.parameters.buttons[i].sound)?get_sound(story_json.parameters.buttons[i].sound):((story_json.parameters.buttons[i].sound_stop)?";"+get_stop_sound(story_json.parameters.buttons[i].sound_stop):"")+";"} if(story_json.parameters.buttons[i].js){v+=story_json.parameters.buttons[i].js} - button.setAttribute("onclick",v+";"+((story_json.parameters.buttons[i].name=="tue_audio")?"set_audio(this,story_json.parameters.buttons["+i+"]);":"")+((story_json[story_json.parameters.buttons[i].name])?"go_to('"+story_json.parameters.buttons[i].name+"');":"")) + button.setAttribute("onclick",v+";" + +((story_json.parameters.buttons[i].name=="tue_audio")?"set_audio(this,story_json.parameters.buttons["+i+"]);":"") + +((story_json.parameters.buttons[i].name=="tue_fullScreen")?"full_screen(this,story_json.parameters.buttons["+i+"]);":"") + +((story_json[story_json.parameters.buttons[i].name])?"go_to('"+story_json.parameters.buttons[i].name+"');":"")) if(story_json.parameters.buttons[i].className){button.className=story_json.parameters.buttons[i].className;} if(story_json.parameters.buttons[i].style){button.style=story_json.parameters.buttons[i].style;} if(story_json.parameters.buttons[i].text && (typeof story_json.parameters.buttons[i].text!=='object' || (story_json.parameters.buttons[i].text[languare] && typeof story_json.parameters.buttons[i].text[languare]!=='object'))){ @@ -245,7 +248,6 @@ function name_block_update(){ if(document.getElementById('tue_save')){document.getElementById('tue_save').addEventListener('click',function(){save_stag('bookmark')});} if(document.getElementById('tue_load')){document.getElementById('tue_load').addEventListener('click',function(){load_stag('bookmark')});} if(document.getElementById('tue_fastRewind')){document.getElementById('tue_fastRewind').addEventListener('click',function(){fast_rewind()});} - if(document.getElementById('tue_fullScreen')){document.getElementById('tue_fullScreen').addEventListener('click',function(){full_screen()});} if(document.getElementById('tue_load_autosave')){document.getElementById('tue_load_autosave').addEventListener('click',function(){load_stag('auto')});} if(story_json.parameters.languares.length>1){ for(var i=0;i0){el.innerHTML=values_button(art_data(arr["text1"]))} + if(el&&arr&&arr["art1"]&&art_data(arr["art1"]).length>0){el.style.backgroundImage="url('"+art_data(arr["art1"])+"')"} if(tuesday.requestFullscreen){tuesday.requestFullscreen();} else if(tuesday.mozRequestFullScreen){tuesday.mozRequestFullScreen();} else if(tuesday.webkitRequestFullscreen){tuesday.webkitRequestFullscreen();} else if(tuesday.msRequestFullscreen){tuesday.msRequestFullscreen();} }else{ tue_fullScreen=false; + if(arr&&arr["text"]&&art_data(arr["text"]).length>0){el.innerHTML=values_button(art_data(arr["text"]))} + if(arr&&arr["art"]&&art_data(arr["art"]).length>0){el.style.backgroundImage="url('"+art_data(arr["art"])+"')"} if(document.exitFullscreen){document.exitFullscreen();} else if(document.mozCancelFullScreen){document.mozCancelFullScreen();} else if(document.webkitExitFullscreen){document.webkitExitFullscreen();} diff --git a/tuesday_visual.html b/tuesday_visual.html index d7a5abf..077300a 100755 --- a/tuesday_visual.html +++ b/tuesday_visual.html @@ -758,7 +758,7 @@ var img_file=document.getElementById('json_file'); var color_chois=document.getElementById('paletr'); var languare="en"; -var runtime="let story_json=[];var tue_text_view,tue_text_block,tue_text_element,languare,dialog_text,dialog_timeout,tue_story,tue_bg_music,arr_dialog,timers,tuesday=document.getElementById(\"tuesday\"),tue_name_block=document.createElement(\"div\"),scene=0,dialog=0,dialog_speed=50,dialog_letter=0,tue_set_audio=0,tue_fullScreen=!1,controll=!0,ruby_rt=[];function cmenu(){return!1}function get_lang(){languare=void 0!=navigator.languages?navigator.languages[0].substring(0,2):navigator.languagesubstring(0,2);for(var e,t=0;t0&&alert(\"Json structure error\")}base_creation(),tuesday.dispatchEvent(new Event(\"script_loaded\")),story_json.parameters.sounds&&creation_sound()}},a.open(\"GET\",t,!0),a.send(),a.onerror=function(){0==this.status&&alert(\"Error load json file Cross-Origin Resource Sharing(CORS)\")}}}function name_block_update(){story_json.parameters.name_panel.color&&(tue_name_block.style.backgroundColor=story_json.parameters.name_panel.color),story_json.parameters.name_panel.color_text?tue_name_block.style.color=story_json.parameters.name_panel.color_text:tue_name_block.style.color=story_json.parameters.text_panel.color_text,tue_name_block.style.position=\"absolute\",tue_name_block.id=\"tue_name_block\",tue_name_block.style.padding=story_json.parameters.name_panel.indent_text,tue_name_block.style.fontSize=story_json.parameters.name_panel.size_text?story_json.parameters.name_panel.size_text:story_json.parameters.font_size,tue_name_block.style.fontFamily=story_json.parameters.name_panel.font_family?story_json.parameters.name_panel.font_family:story_json.parameters.font,tue_name_block.style.display=\"flex\",tue_name_block.style.justifyContent=story_json.parameters.name_panel.align?story_json.parameters.name_panel.align[0]:\"center\",tue_name_block.style.alignItems=story_json.parameters.name_panel.align?story_json.parameters.name_panel.align[1]:\"center\",(tue_name_block.style.width=0!=story_json.parameters.name_panel.size[0])&&(tue_name_block.style.width=story_json.parameters.name_panel.size[0]),tue_name_block.style.height=story_json.parameters.name_panel.size[1],tue_name_block.style.left=\"\"==story_json.parameters.name_panel.position[0]||\"0\"==story_json.parameters.name_panel.position[0]?null:story_json.parameters.name_panel.position[0],tue_name_block.style.right=\"\"==story_json.parameters.name_panel.position[1]||\"0\"==story_json.parameters.name_panel.position[1]?null:story_json.parameters.name_panel.position[1],tue_name_block.style.top=\"\"==story_json.parameters.name_panel.position[2]||\"0\"==story_json.parameters.name_panel.position[2]?\"\"==story_json.parameters.name_panel.position[3]||\"0\"==story_json.parameters.name_panel.position[3]?\"0px\":null:story_json.parameters.name_panel.position[2],tue_name_block.style.bottom=\"\"==story_json.parameters.name_panel.position[3]||\"0\"==story_json.parameters.name_panel.position[3]?null:story_json.parameters.name_panel.position[3],tue_name_block.style.zIndex=1001}function base_creation(){if(get_lang(),localStorage.getItem(\"tue_set_audio\")&&(tue_set_audio=JSON.parse(localStorage.getItem(\"tue_set_audio\"))),story_json.parameters.style_file&&add_style(story_json.parameters.style_file),dialog_speed=story_json.parameters.text_panel.dialog_speed,story_json.parameters.title&&(story_json.parameters.title[languare]?document.title=story_json.parameters.title[languare]:document.title=story_json.parameters.title),story_json.parameters.pixelmode&&(tuesday.style.imageRendering=\"pixelated\",tuesday.style.fontSmooth=\"never\"),tuesday.style.backgroundRepeat=\"no-repeat\",tuesday.style.backgroundPosition=\"center\",tuesday.style.position=\"relative\",tuesday.style.overflow=\"hidden\",story_json.parameters.cursors&&story_json.parameters.cursors.main&&(tuesday.style.cursor=\"url(\"+art_data(story_json.parameters.cursors.main[0])+\") \"+story_json.parameters.cursors.main[1]+\" \"+story_json.parameters.cursors.main[2]+\",auto\"),tuesday.innerHTML=\"
\",tue_text_block=document.getElementById(\"tue_text_block\"),(tue_text_element=document.getElementById(\"tue_text_element\")).style.position=\"relative\",story_json.parameters.text_panel.className&&(tue_text_block.className=story_json.parameters.text_panel.className),story_json.parameters.text_panel.style&&(tue_text_block.style=story_json.parameters.text_panel.style),tue_text_block.style.position=\"absolute\",story_json.parameters.text_panel.size&&(tue_text_block.style.width=story_json.parameters.text_panel.size[0],tue_text_block.style.height=story_json.parameters.text_panel.size[1]),story_json.parameters.text_panel.position?(story_json.parameters.text_panel.position[0]&&\"0\"!=story_json.parameters.text_panel.position[0]||story_json.parameters.text_panel.position[1]&&\"0\"!=story_json.parameters.text_panel.position[1]?(tue_text_block.style.left=\"0\"!=story_json.parameters.text_panel.position[0]?story_json.parameters.text_panel.position[0]:null,tue_text_block.style.right=\"0\"!=story_json.parameters.text_panel.position[1]?story_json.parameters.text_panel.position[1]:null,tue_text_block.style.margin=null):(tue_text_block.style.marginLeft=\"auto\",tue_text_block.style.marginRight=\"auto\",tue_text_block.style.left=0,tue_text_block.style.right=0),tue_text_block.style.top=\"0\"!=story_json.parameters.text_panel.position[2]?story_json.parameters.text_panel.position[2]:null):(tue_text_block.style.left=0,tue_text_block.style.right=0),tue_text_block.style.bottom=\"0\"!=story_json.parameters.text_panel.indent_bottom?story_json.parameters.text_panel.indent_bottom:null,tue_text_block.style.zIndex=1e3,tue_text_block.style.borderSpacing=0,(tue_text_view=document.getElementById(\"tue_text_view\")).style.boxSizing=\"border-box\",tue_text_view.style.padding=story_json.parameters.text_panel.indent_text,tue_text_view.style.fontSize=story_json.parameters.text_panel.size_text?story_json.parameters.text_panel.size_text:story_json.parameters.font_size,tue_text_view.style.fontFamily=story_json.parameters.text_panel.font_family?story_json.parameters.text_panel.font_family:story_json.parameters.font,tue_text_view.style.whiteSpace=\"pre-wrap\",tue_text_view.style.height=\"100%\",story_json.parameters.text_panel.scroll&&(tue_text_block.style.paddingTop=story_json.parameters.text_panel.indent_text,tue_text_view.style.height=tue_text_view.offsetHeight,tue_text_view.style.position=\"relative\",tue_text_view.style.overflowY=\"hidden\"),story_json.parameters.name_panel&&(story_json.parameters.name_panel.className&&(tue_name_block.className=story_json.parameters.name_panel.className),story_json.parameters.name_panel.style&&(tue_name_block.style=story_json.parameters.name_panel.style),tue_text_element.appendChild(tue_name_block),name_block_update()),(tue_bg_music=document.createElement(\"AUDIO\")).id=\"tue_bg_music\",tuesday.appendChild(tue_bg_music),story_json.parameters.launch_story)tue_story=story_json.parameters.launch_story;else for(var e=0;e<2;e++)if(\"parameters\"!=Object.getOwnPropertyNames(story_json)[e]){story_json.parameters.launch_story=Object.getOwnPropertyNames(story_json)[1],tue_story=story_json.parameters.launch_story;break}bg_art(story_json.parameters.text_panel,\"tue_text_block\"),tuesday.dispatchEvent(new Event(\"script_executed\")),story_json.parameters.autosave&&localStorage.getItem(\"tue_auto_data\")&&(story_json.parameters.variables=JSON.parse(localStorage.getItem(\"tue_auto_data\"))),creation_buttons(),creation_scene()}function bg_art(e,t,a){if((t=document.getElementById(t)).style.backgroundRepeat=\"no-repeat\",t.style.backgroundPosition=e.art_align?e.art_align[0]+\" \"+e.art_align[1]:\"center\",a=a||e.art){var r=art_data(a);r.length>0&&(t.style.backgroundImage=\"url('\"+r+\"')\")}e.art_size&&(\"patch\"==e.art_size&&(t.style.backgroundImage=\"none\"),\"object\"==typeof e.art_size?t.style.backgroundSize=e.art_size[0]+\" \"+e.art_size[1]:\"patch\"==e.art_size?(t.style.backgroundImage=\"none\",t.style.backgroundSize=\"none\",t.style.backgroundClip=\"padding-box\",t.style.borderStyle=\"solid\",t.style.borderWidth=e.patch[0]+\"px \"+e.patch[1]+\"px \"+e.patch[2]+\"px \"+e.patch[3]+\"px\",t.style.borderImage=\"url('\"+art_data(e.art)+\"') \"+e.patch[0]+\" \"+e.patch[1]+\" \"+e.patch[2]+\" \"+e.patch[3]+\" stretch stretch\"):t.style.backgroundSize=e.art_size)}function creation_buttons(){for(a=0;a1)for(var a=0;a\"==a&&story_json.parameters.variables[t]>r){\"tue_go\"!=s?go_to(s):l();break}if(\"<\"==a&&story_json.parameters.variables[t]0?creation_dialog():(del_element(\"tue_art\"),del_element(\"tue_choice\"),del_element(\"tue_html_dialog\"),tue_text_block.style.visibility=\"hidden\",tue_name_block.style.visibility=\"hidden\"),tuesday.dispatchEvent(new Event(Object.keys(arr_dialog)[0]))}}function creation_dialog(next_scene){if(\"hidden\"!=(arr_dialog=story_json[tue_story][scene].dialogs[dialog]).controll&&\"hidden_here\"!=arr_dialog.controll&&(tue_story!=story_json.parameters.launch_story||arr_dialog.text||0!=dialog||0!=scene)){if(\"visible\"==arr_dialog.controll||!0==controll){controll=!0;for(var buttons=document.getElementById(\"tuesday\").getElementsByClassName(\"tue_controll\"),i=0;i0?(video.muted=!1,video.volume=arr_dialog.video.sound/100):video.muted=!0,arr_dialog.video.time_start?video.onloadedmetadata=function(){this.currentTime=arr_dialog.video.time_start,arr_dialog.video.fit&&\"cover\"!=arr_dialog.video.fit||video_size(),arr_dialog.video.stop&&this.pause()}:\"cover\"!=arr_dialog.video.fit&&arr_dialog.video.fit||(video.onloadedmetadata=function(){video_size()}),arr_dialog.video.time_end?arr_dialog.video.loop?video.ontimeupdate=function(){video.currentTime>=arr_dialog.video.time_end&&(video.currentTime=arr_dialog.video.time_start?arr_dialog.video.time_start:0)}:arr_dialog.video.go_to?video.ontimeupdate=function(){video.currentTime>=arr_dialog.video.time_end&&(video.pause(),\"tue_go\"==arr_dialog.video.go_to?go_story(!0):go_to(arr_dialog.video.go_to))}:video.ontimeupdate=function(){video.currentTime>=arr_dialog.video.time_end&&video.pause()}:video.onended=function(){\"tue_go\"==arr_dialog.video.go_to?go_story(!0):go_to(arr_dialog.video.go_to)},arr_dialog.video.stop&&!0==arr_dialog.video.stop||(video.autoplay=!0),tuesday.appendChild(video)}else del_element(\"tue_v\");if(arr_dialog.art){var old=document.getElementById(\"tuesday\").getElementsByClassName(\"tue_art\"),src=!1;if(old.length>0){for(d=0;d0&&(old[o].style=\"user-select:text;\"+arr_dialog.art[i].style,old[o].style.position=\"absolute\"),arr_dialog.art[i].move&&0!=arr_dialog.art[i].move?(old[o].style.transitionDuration=arr_dialog.art[i].move+\"s\",arr_dialog.art[i].speed&&\"\"!=arr_dialog.art[i].speed?old[o].style.transitionTimingFunction=arr_dialog.art[i].speed:old[o].style.transitionTimingFunction=null):(old[o].style.transitionDuration=null,old[o].style.transitionTimingFunction=null),arr_dialog.art[i].opacity?old[o].style.opacity=arr_dialog.art[i].opacity:old[o].style.opacity=null,arr_dialog.art[i].fit&&(old[o].style.objectFit=arr_dialog.art[i].fit),arr_dialog.art[i].size&&(old[o].style.width=arr_dialog.art[i].size[0],old[o].style.height=arr_dialog.art[i].size[1]),arr_dialog.art[i].align?old[o].style.objectPosition=arr_dialog.art[i].align[0]+\" \"+arr_dialog.art[i].align[1]:old[o].style.objectPosition=\"center\",old[o].style.transform=(arr_dialog.art[i].hotspot&&0!=arr_dialog.art[i].hotspot[0]&&0!=arr_dialog.art[i].hotspot[1]?\" translate(\"+arr_dialog.art[i].hotspot[0]+\",\"+arr_dialog.art[i].hotspot[1]+\")\":\"\")+(arr_dialog.art[i].angle?\"rotate(\"+arr_dialog.art[i].angle+\"deg)\":\"\"),0!=arr_dialog.art[i].position[0]&&(old[o].style.left=arr_dialog.art[i].position[0]),0!=arr_dialog.art[i].position[1]&&(old[o].style.left=\"calc(100% - \"+arr_dialog.art[i].position[1]+\" - \"+(\"auto\"==arr_dialog.art[i].size[0]?arr_dialog.art[i].size[1]:arr_dialog.art[i].size[0])+\")\"),0!=arr_dialog.art[i].position[2]&&(old[o].style.top=arr_dialog.art[i].position[2]),0!=arr_dialog.art[i].position[3]&&(old[o].style.top=\"calc(100% - \"+arr_dialog.art[i].position[3]+\" - \"+(\"auto\"==arr_dialog.art[i].size[1]?arr_dialog.art[i].size[0]:arr_dialog.art[i].size[1])+\")\"),src=!0,old[o].style.zIndex=i,old[o].classList.remove(\"img_del\");break}!1==src&&creation_art(i)}del_element(\"img_del\")}else for(i=0;i0&&(choice.style.backgroundImage=\"url('\"+art_data(arr_dialog.choice[i].art)+\"')\"),arr_dialog.choice[i].size&&(0!=arr_dialog.choice[i].size[0]&&(choice.style.width=arr_dialog.choice[i].size[0]),0!=arr_dialog.choice[i].size[1]&&(choice.style.height=arr_dialog.choice[i].size[1])),arr_dialog.choice[i].art_size&&(\"patch\"==arr_dialog.choice[i].art_size&&(choice.style.backgroundImage=\"none\"),\"object\"==typeof arr_dialog.choice[i].art_size?choice.style.backgroundSize=arr_dialog.choice[i].art_size[0]+\" \"+arr_dialog.choice[i].art_size[1]:\"patch\"==arr_dialog.choice[i].art_size?(choice.style.backgroundImage=\"none\",choice.style.backgroundSize=\"none\",choice.style.backgroundClip=\"padding-box\",choice.style.borderStyle=\"solid\",choice.style.borderWidth=arr_dialog.choice[i].patch[0]+\"px \"+arr_dialog.choice[i].patch[1]+\"px \"+arr_dialog.choice[i].patch[2]+\"px \"+arr_dialog.choice[i].patch[3]+\"px\",choice.style.borderImage=\"url('\"+art_data(arr_dialog.choice[i].art)+\"') \"+arr_dialog.choice[i].patch[0]+\" \"+arr_dialog.choice[i].patch[1]+\" \"+arr_dialog.choice[i].patch[2]+\" \"+arr_dialog.choice[i].patch[3]+\" stretch stretch\"):choice.style.backgroundSize=arr_dialog.choice[i].art_size),choice.style.transform=(arr_dialog.choice[i].hotspot&&0!=arr_dialog.choice[i].hotspot[0]&&0!=arr_dialog.choice[i].hotspot[1]?\" translate(\"+arr_dialog.choice[i].hotspot[0]+\",\"+arr_dialog.choice[i].hotspot[1]+\")\":\"\")+(arr_dialog.choice[i].angle?\"rotate(\"+arr_dialog.choice[i].angle+\"deg)\":\"\"),0!=arr_dialog.choice[i].position[0]&&(choice.style.left=arr_dialog.choice[i].position[0]),0!=arr_dialog.choice[i].position[1]&&(choice.style.right=arr_dialog.choice[i].position[1]),0!=arr_dialog.choice[i].position[2]&&(choice.style.top=arr_dialog.choice[i].position[2]),0!=arr_dialog.choice[i].position[3]&&(choice.style.bottom=arr_dialog.choice[i].position[3]),choice.style.color=arr_dialog.choice[i].color_text,choice.style.padding=arr_dialog.choice[i].indent_text,choice.style.fontSize=arr_dialog.choice[i].size_text?arr_dialog.choice[i].size_text:story_json.parameters.font_size,choice.style.fontFamily=arr_dialog.choice[i].font_family?arr_dialog.choice[i].font_family:story_json.parameters.font,choice.style.display=\"flex\",choice.style.justifyContent=arr_dialog.choice[i].align?arr_dialog.choice[i].align[0]:\"center\",choice.style.alignItems=arr_dialog.choice[i].align?arr_dialog.choice[i].align[1]:\"center\",choice.style.zIndex=1001+i,arr_dialog.choice[i].show_if&&show_if(arr_dialog.choice[i].show_if,choice),arr_dialog.choice[i].text&&(\"object\"!=typeof arr_dialog.choice[i].text||arr_dialog.choice[i].text[languare]&&\"object\"!=typeof arr_dialog.choice[i].text[languare])&&(choice.innerHTML=values_button(art_data(arr_dialog.choice[i].text))),\"tue_audio\"==arr_dialog.choice[i].go_to&&show_audio(choice,arr_dialog.choice[i]);var v=\"\";if(arr_dialog.choice[i].variables)for(var g=0;g1)for(var l=0;l/g;ruby_rt=[];let r=t.matchAll(a);r=Array.from(r);for(var s=0;s/g);t=Array.from(t);for(var a=0;a\"+t[0]+\"\"+t[1]+\"\"}function go_story(e){(!(arr_dialog=story_json[tue_story][scene].dialogs[dialog]).choice||e)&&(arr_dialog.go_to?go_to(arr_dialog.go_to):dialog=story_json[tue_story].length?scene=story_json[tue_story].length-1:(dialog=0,creation_scene()),story_json.parameters.autosave&&!story_json[tue_story][scene].dialogs[dialog].no_autosave&&save_stag(\"auto\"))}function back_story(){(arr_dialog=story_json[tue_story][scene].dialogs[dialog],del_element(\"tue_choice\"),del_element(\"tue_html_dialog\"),arr_dialog.back_to)?go_to(arr_dialog.back_to):dialog>0?(dialog-=1,(arr_dialog=story_json[tue_story][scene].dialogs[dialog]).text?\"skip\"==arr_dialog.text[languare]?back_story():creation_dialog():arr_dialog.text_add?\"skip\"==arr_dialog.text_add[languare]?back_story():(dialog_text=arr_dialog.text?dialog_text.replace(arr_dialog.text_add[languare],\"\"):\"\",creation_dialog()):(creation_dialog(),del_element(\"tue_choice\"),del_element(\"tue_html_dialog\"))):((scene-=1)<0?(scene=0,dialog=0):dialog=story_json[tue_story][scene].dialogs.length-1,creation_scene()),story_json.parameters.autosave&&!story_json[tue_story][scene].dialogs[dialog].no_autosave&&save_stag(\"auto\")}function save_stag(e){localStorage.setItem(\"tue_\"+e+\"_scene\",scene),localStorage.setItem(\"tue_\"+e+\"_dialog\",dialog),localStorage.setItem(\"tue_\"+e+\"_story\",tue_story),story_json.parameters.variables&&localStorage.setItem(\"tue_\"+e+\"_data\",JSON.stringify(story_json.parameters.variables)),\"bookmark\"==e&&tuesday.dispatchEvent(new Event(\"save\"))}function load_stag(e){story_json[localStorage.getItem(\"tue_\"+e+\"_story\")]&&(del_element(\"tue_choice\"),del_element(\"tue_html_scene\"),scene=localStorage.getItem(\"tue_\"+e+\"_scene\"),dialog=localStorage.getItem(\"tue_\"+e+\"_dialog\"),tue_story=localStorage.getItem(\"tue_\"+e+\"_story\"),story_json.parameters.variables=JSON.parse(localStorage.getItem(\"tue_\"+e+\"_data\")),creation_scene(),search_music(),tuesday.dispatchEvent(new Event(\"load\")))}function go_to(e){del_element(\"tue_choice\"),del_element(\"tue_html_dialog\"),tue_story=e,dialog=0,scene=0,creation_scene()}function del_element(e){for(var t=document.getElementById(\"tuesday\").getElementsByClassName(e),a=t.length,r=0;r\")}else 0!=dialog_speed&&dialog_letter<=dialog_text.length?dialog_timeout=setTimeout(add_letter,dialog_speed):dialog_letter>=dialog_text.length&&(tue_text_view.innerHTML+=story_json.parameters.text_panel.end_text_cursor&&story_json.parameters.text_panel.end_text_cursor[0]?' ':\"\",tuesday.dispatchEvent(new Event(\"dialog_end\")));story_json.parameters.text_panel.scroll&&(tue_text_view.scrollTop=tue_text_view.scrollHeight)}function add_letter(){for(var e=dialog_text.slice(0,dialog_letter).replace(RegExp(\"\\n\",\"g\"),\"
\"),t=0;t=0;e--)if(story_json[tue_story][e].background_music){tue_bg_music.canPlayType(\"audio/mpeg\")?\"number\"==typeof story_json[tue_story][e].background_music?tue_bg_music.src=story_json.base[story_json[tue_story][e].background_music-1]:story_json[tue_story][e].background_music.includes(\"blob:\")?tue_bg_music.src=story_json[tue_story][e].background_music:story_json[tue_story][e].background_music.includes(\".mp3\")?tue_bg_music.src=story_json[tue_story][e].background_music:tue_bg_music.src=story_json[tue_story][e].background_music+\".mp3\":tue_bg_music.src=story_json[tue_story][e].background_music+\".ogg\",tue_bg_music.loop=!0,0==tue_set_audio&&tue_bg_music.play();break}}function creation_sound(){for(var e=0;Object.keys(story_json.parameters.sounds)[e];){var t=document.createElement(\"audio\");t.preload=\"auto\",t.id=Object.keys(story_json.parameters.sounds)[e],t.canPlayType(\"audio/mpeg\")?story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]].includes(\";base64\")?t.src=story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]]:story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]].includes(\"blob:\")?t.src=story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]]:story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]].includes(\".mp3\")?t.src=story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]]:t.src=story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]]+\".mp3\":t.src=story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]]+\".ogg\",tuesday.appendChild(t),e++}}function get_sound(e){return\"if(tue_set_audio<2){\"+(e[languare]?\"sound_play('\"+e[languare]+\"');\":\"sound_play('\"+e+\"');\")+\"}\"}function get_stop_sound(e){return e[languare]?\"sound_stop('\"+e[languare]+\"');\":\"sound_stop('\"+e+\"');\"}function sound_play(e){var t=document.getElementById(e);t&&(t.currentTime=0,t.volume=1,t.play())}function sound_stop(e){document.getElementById(e).currentTime=0,document.getElementById(e).pause()}function add_style(e){var t=document.createElement(\"link\");t.setAttribute(\"rel\",\"stylesheet\"),t.setAttribute(\"type\",\"text/css\"),t.setAttribute(\"href\",e),document.getElementsByTagName(\"head\").item(0).appendChild(t)}function full_screen(){tue_fullScreen?(tue_fullScreen=!1,document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()):(tue_fullScreen=!0,tuesday.requestFullscreen?tuesday.requestFullscreen():tuesday.mozRequestFullScreen?tuesday.mozRequestFullScreen():tuesday.webkitRequestFullscreen?tuesday.webkitRequestFullscreen():tuesday.msRequestFullscreen&&tuesday.msRequestFullscreen())}function art_data(e){return e[languare]?\"number\"==typeof e[languare]?story_json.base[e[languare]-1]:e[languare]:\"number\"==typeof e?story_json.base[e-1]:e}function video_size(){var e=document.getElementById(\"tue_video\"),t=tuesday.getBoundingClientRect();e.videoWidth/e.videoHeight>t.width/t.height?(e.style.height=\"100%\",e.style.width=\"auto\"):(e.style.height=\"auto\",e.style.width=\"100%\")}function show_if(e,t){show=!0;for(var a=1;a\"==s){if(story_json.parameters.variables[r]<=e[a][2]){show=!1;break}}else if(\"<\"==s&&story_json.parameters.variables[r]>=e[a][2]){show=!1;break}if(!show)break}!show&&e[0]?t.style.visibility=\"hidden\":show&&!e[0]&&(t.style.visibility=\"hidden\")}function fast_rewind(){timers=setTimeout(function(){go_story(!0),dialog1?0:tue_set_audio+1,localStorage.setItem(\"tue_set_audio\",tue_set_audio),0==tue_set_audio?tue_bg_music.play():tue_set_audio>0&&tue_bg_music.pause(),2==tue_set_audio){var a=tuesday.getElementsByTagName(\"audio\");for(let r=0;r0&&(e.innerHTML=values_button(art_data(t[\"text\"+a]))),t[\"art\"+a]&&art_data(t[\"art\"+a]).length>0&&(e.style.backgroundImage=\"url('\"+art_data(t[\"art\"+a])+\"')\")}function autoplaysound(){0==tue_set_audio&&tue_bg_music.play(),tuesday.removeEventListener(\"mousedown\",autoplaysound)}document.oncontextmenu=cmenu,window.onmousedown=window.onselectstart=function(){return!1},document.addEventListener(\"keydown\",function(e){var t=e.code;t==story_json.parameters.key.next&&controll?go_story():t==story_json.parameters.key.back&&controll?back_story():t==story_json.parameters.key.main?go_to(story_json.parameters.launch_story):t==story_json.parameters.key.save?save_stag(\"bookmark\"):t==story_json.parameters.key.load?load_stag(\"bookmark\"):t==story_json.parameters.key.autosave?load_stag(\"auto\"):t==story_json.parameters.key.full_screen?full_screen():t==story_json.parameters.key.fast_rewind&&fast_rewind()}),tuesday.addEventListener(\"mousedown\",autoplaysound);"; +var runtime="let story_json=[];var tue_text_view,tue_text_block,tue_text_element,languare,dialog_text,dialog_timeout,tue_story,tue_bg_music,arr_dialog,timers,tuesday=document.getElementById(\"tuesday\"),tue_name_block=document.createElement(\"div\"),scene=0,dialog=0,dialog_speed=50,dialog_letter=0,tue_set_audio=0,tue_fullScreen=!1,controll=!0,ruby_rt=[];function cmenu(){return!1}function get_lang(){languare=void 0!=navigator.languages?navigator.languages[0].substring(0,2):navigator.languagesubstring(0,2);for(var e,t=0;t0&&alert(\"Json structure error\")}base_creation(),tuesday.dispatchEvent(new Event(\"script_loaded\")),story_json.parameters.sounds&&creation_sound()}},a.open(\"GET\",t,!0),a.send(),a.onerror=function(){0==this.status&&alert(\"Error load json file Cross-Origin Resource Sharing(CORS)\")}}}function name_block_update(){story_json.parameters.name_panel.color&&(tue_name_block.style.backgroundColor=story_json.parameters.name_panel.color),story_json.parameters.name_panel.color_text?tue_name_block.style.color=story_json.parameters.name_panel.color_text:tue_name_block.style.color=story_json.parameters.text_panel.color_text,tue_name_block.style.position=\"absolute\",tue_name_block.id=\"tue_name_block\",tue_name_block.style.padding=story_json.parameters.name_panel.indent_text,tue_name_block.style.fontSize=story_json.parameters.name_panel.size_text?story_json.parameters.name_panel.size_text:story_json.parameters.font_size,tue_name_block.style.fontFamily=story_json.parameters.name_panel.font_family?story_json.parameters.name_panel.font_family:story_json.parameters.font,tue_name_block.style.display=\"flex\",tue_name_block.style.justifyContent=story_json.parameters.name_panel.align?story_json.parameters.name_panel.align[0]:\"center\",tue_name_block.style.alignItems=story_json.parameters.name_panel.align?story_json.parameters.name_panel.align[1]:\"center\",(tue_name_block.style.width=0!=story_json.parameters.name_panel.size[0])&&(tue_name_block.style.width=story_json.parameters.name_panel.size[0]),tue_name_block.style.height=story_json.parameters.name_panel.size[1],tue_name_block.style.left=\"\"==story_json.parameters.name_panel.position[0]||\"0\"==story_json.parameters.name_panel.position[0]?null:story_json.parameters.name_panel.position[0],tue_name_block.style.right=\"\"==story_json.parameters.name_panel.position[1]||\"0\"==story_json.parameters.name_panel.position[1]?null:story_json.parameters.name_panel.position[1],tue_name_block.style.top=\"\"==story_json.parameters.name_panel.position[2]||\"0\"==story_json.parameters.name_panel.position[2]?\"\"==story_json.parameters.name_panel.position[3]||\"0\"==story_json.parameters.name_panel.position[3]?\"0px\":null:story_json.parameters.name_panel.position[2],tue_name_block.style.bottom=\"\"==story_json.parameters.name_panel.position[3]||\"0\"==story_json.parameters.name_panel.position[3]?null:story_json.parameters.name_panel.position[3],tue_name_block.style.zIndex=1001}function base_creation(){if(get_lang(),localStorage.getItem(\"tue_set_audio\")&&(tue_set_audio=JSON.parse(localStorage.getItem(\"tue_set_audio\"))),story_json.parameters.style_file&&add_style(story_json.parameters.style_file),dialog_speed=story_json.parameters.text_panel.dialog_speed,story_json.parameters.title&&(story_json.parameters.title[languare]?document.title=story_json.parameters.title[languare]:document.title=story_json.parameters.title),story_json.parameters.pixelmode&&(tuesday.style.imageRendering=\"pixelated\",tuesday.style.fontSmooth=\"never\"),tuesday.style.backgroundRepeat=\"no-repeat\",tuesday.style.backgroundPosition=\"center\",tuesday.style.position=\"relative\",tuesday.style.overflow=\"hidden\",story_json.parameters.cursors&&story_json.parameters.cursors.main&&(tuesday.style.cursor=\"url(\"+art_data(story_json.parameters.cursors.main[0])+\") \"+story_json.parameters.cursors.main[1]+\" \"+story_json.parameters.cursors.main[2]+\",auto\"),tuesday.innerHTML=\"
\",tue_text_block=document.getElementById(\"tue_text_block\"),(tue_text_element=document.getElementById(\"tue_text_element\")).style.position=\"relative\",story_json.parameters.text_panel.className&&(tue_text_block.className=story_json.parameters.text_panel.className),story_json.parameters.text_panel.style&&(tue_text_block.style=story_json.parameters.text_panel.style),tue_text_block.style.position=\"absolute\",story_json.parameters.text_panel.size&&(tue_text_block.style.width=story_json.parameters.text_panel.size[0],tue_text_block.style.height=story_json.parameters.text_panel.size[1]),story_json.parameters.text_panel.position?(story_json.parameters.text_panel.position[0]&&\"0\"!=story_json.parameters.text_panel.position[0]||story_json.parameters.text_panel.position[1]&&\"0\"!=story_json.parameters.text_panel.position[1]?(tue_text_block.style.left=\"0\"!=story_json.parameters.text_panel.position[0]?story_json.parameters.text_panel.position[0]:null,tue_text_block.style.right=\"0\"!=story_json.parameters.text_panel.position[1]?story_json.parameters.text_panel.position[1]:null,tue_text_block.style.margin=null):(tue_text_block.style.marginLeft=\"auto\",tue_text_block.style.marginRight=\"auto\",tue_text_block.style.left=0,tue_text_block.style.right=0),tue_text_block.style.top=\"0\"!=story_json.parameters.text_panel.position[2]?story_json.parameters.text_panel.position[2]:null):(tue_text_block.style.left=0,tue_text_block.style.right=0),tue_text_block.style.bottom=\"0\"!=story_json.parameters.text_panel.indent_bottom?story_json.parameters.text_panel.indent_bottom:null,tue_text_block.style.zIndex=1e3,tue_text_block.style.borderSpacing=0,(tue_text_view=document.getElementById(\"tue_text_view\")).style.boxSizing=\"border-box\",tue_text_view.style.padding=story_json.parameters.text_panel.indent_text,tue_text_view.style.fontSize=story_json.parameters.text_panel.size_text?story_json.parameters.text_panel.size_text:story_json.parameters.font_size,tue_text_view.style.fontFamily=story_json.parameters.text_panel.font_family?story_json.parameters.text_panel.font_family:story_json.parameters.font,tue_text_view.style.whiteSpace=\"pre-wrap\",tue_text_view.style.height=\"100%\",story_json.parameters.text_panel.scroll&&(tue_text_block.style.paddingTop=story_json.parameters.text_panel.indent_text,tue_text_view.style.height=tue_text_view.offsetHeight,tue_text_view.style.position=\"relative\",tue_text_view.style.overflowY=\"hidden\"),story_json.parameters.name_panel&&(story_json.parameters.name_panel.className&&(tue_name_block.className=story_json.parameters.name_panel.className),story_json.parameters.name_panel.style&&(tue_name_block.style=story_json.parameters.name_panel.style),tue_text_element.appendChild(tue_name_block),name_block_update()),(tue_bg_music=document.createElement(\"AUDIO\")).id=\"tue_bg_music\",tuesday.appendChild(tue_bg_music),story_json.parameters.launch_story)tue_story=story_json.parameters.launch_story;else for(var e=0;e<2;e++)if(\"parameters\"!=Object.getOwnPropertyNames(story_json)[e]){story_json.parameters.launch_story=Object.getOwnPropertyNames(story_json)[1],tue_story=story_json.parameters.launch_story;break}bg_art(story_json.parameters.text_panel,\"tue_text_block\"),tuesday.dispatchEvent(new Event(\"script_executed\")),story_json.parameters.autosave&&localStorage.getItem(\"tue_auto_data\")&&(story_json.parameters.variables=JSON.parse(localStorage.getItem(\"tue_auto_data\"))),creation_buttons(),creation_scene()}function bg_art(e,t,a){if((t=document.getElementById(t)).style.backgroundRepeat=\"no-repeat\",t.style.backgroundPosition=e.art_align?e.art_align[0]+\" \"+e.art_align[1]:\"center\",a=a||e.art){var r=art_data(a);r.length>0&&(t.style.backgroundImage=\"url('\"+r+\"')\")}e.art_size&&(\"patch\"==e.art_size&&(t.style.backgroundImage=\"none\"),\"object\"==typeof e.art_size?t.style.backgroundSize=e.art_size[0]+\" \"+e.art_size[1]:\"patch\"==e.art_size?(t.style.backgroundImage=\"none\",t.style.backgroundSize=\"none\",t.style.backgroundClip=\"padding-box\",t.style.borderStyle=\"solid\",t.style.borderWidth=e.patch[0]+\"px \"+e.patch[1]+\"px \"+e.patch[2]+\"px \"+e.patch[3]+\"px\",t.style.borderImage=\"url('\"+art_data(e.art)+\"') \"+e.patch[0]+\" \"+e.patch[1]+\" \"+e.patch[2]+\" \"+e.patch[3]+\" stretch stretch\"):t.style.backgroundSize=e.art_size)}function creation_buttons(){for(a=0;a1)for(var a=0;a\"==a&&story_json.parameters.variables[t]>r){\"tue_go\"!=s?go_to(s):l();break}if(\"<\"==a&&story_json.parameters.variables[t]0?creation_dialog():(del_element(\"tue_art\"),del_element(\"tue_choice\"),del_element(\"tue_html_dialog\"),tue_text_block.style.visibility=\"hidden\",tue_name_block.style.visibility=\"hidden\"),tuesday.dispatchEvent(new Event(Object.keys(arr_dialog)[0]))}}function creation_dialog(next_scene){if(\"hidden\"!=(arr_dialog=story_json[tue_story][scene].dialogs[dialog]).controll&&\"hidden_here\"!=arr_dialog.controll&&(tue_story!=story_json.parameters.launch_story||arr_dialog.text||0!=dialog||0!=scene)){if(\"visible\"==arr_dialog.controll||!0==controll){controll=!0;for(var buttons=document.getElementById(\"tuesday\").getElementsByClassName(\"tue_controll\"),i=0;i0?(video.muted=!1,video.volume=arr_dialog.video.sound/100):video.muted=!0,arr_dialog.video.time_start?video.onloadedmetadata=function(){this.currentTime=arr_dialog.video.time_start,arr_dialog.video.fit&&\"cover\"!=arr_dialog.video.fit||video_size(),arr_dialog.video.stop&&this.pause()}:\"cover\"!=arr_dialog.video.fit&&arr_dialog.video.fit||(video.onloadedmetadata=function(){video_size()}),arr_dialog.video.time_end?arr_dialog.video.loop?video.ontimeupdate=function(){video.currentTime>=arr_dialog.video.time_end&&(video.currentTime=arr_dialog.video.time_start?arr_dialog.video.time_start:0)}:arr_dialog.video.go_to?video.ontimeupdate=function(){video.currentTime>=arr_dialog.video.time_end&&(video.pause(),\"tue_go\"==arr_dialog.video.go_to?go_story(!0):go_to(arr_dialog.video.go_to))}:video.ontimeupdate=function(){video.currentTime>=arr_dialog.video.time_end&&video.pause()}:video.onended=function(){\"tue_go\"==arr_dialog.video.go_to?go_story(!0):go_to(arr_dialog.video.go_to)},arr_dialog.video.stop&&!0==arr_dialog.video.stop||(video.autoplay=!0),tuesday.appendChild(video)}else del_element(\"tue_v\");if(arr_dialog.art){var old=document.getElementById(\"tuesday\").getElementsByClassName(\"tue_art\"),src=!1;if(old.length>0){for(d=0;d0&&(old[o].style=\"user-select:text;\"+arr_dialog.art[i].style,old[o].style.position=\"absolute\"),arr_dialog.art[i].move&&0!=arr_dialog.art[i].move?(old[o].style.transitionDuration=arr_dialog.art[i].move+\"s\",arr_dialog.art[i].speed&&\"\"!=arr_dialog.art[i].speed?old[o].style.transitionTimingFunction=arr_dialog.art[i].speed:old[o].style.transitionTimingFunction=null):(old[o].style.transitionDuration=null,old[o].style.transitionTimingFunction=null),arr_dialog.art[i].opacity?old[o].style.opacity=arr_dialog.art[i].opacity:old[o].style.opacity=null,arr_dialog.art[i].fit&&(old[o].style.objectFit=arr_dialog.art[i].fit),arr_dialog.art[i].size&&(old[o].style.width=arr_dialog.art[i].size[0],old[o].style.height=arr_dialog.art[i].size[1]),arr_dialog.art[i].align?old[o].style.objectPosition=arr_dialog.art[i].align[0]+\" \"+arr_dialog.art[i].align[1]:old[o].style.objectPosition=\"center\",old[o].style.transform=(arr_dialog.art[i].hotspot&&0!=arr_dialog.art[i].hotspot[0]&&0!=arr_dialog.art[i].hotspot[1]?\" translate(\"+arr_dialog.art[i].hotspot[0]+\",\"+arr_dialog.art[i].hotspot[1]+\")\":\"\")+(arr_dialog.art[i].angle?\"rotate(\"+arr_dialog.art[i].angle+\"deg)\":\"\"),0!=arr_dialog.art[i].position[0]&&(old[o].style.left=arr_dialog.art[i].position[0]),0!=arr_dialog.art[i].position[1]&&(old[o].style.left=\"calc(100% - \"+arr_dialog.art[i].position[1]+\" - \"+(\"auto\"==arr_dialog.art[i].size[0]?arr_dialog.art[i].size[1]:arr_dialog.art[i].size[0])+\")\"),0!=arr_dialog.art[i].position[2]&&(old[o].style.top=arr_dialog.art[i].position[2]),0!=arr_dialog.art[i].position[3]&&(old[o].style.top=\"calc(100% - \"+arr_dialog.art[i].position[3]+\" - \"+(\"auto\"==arr_dialog.art[i].size[1]?arr_dialog.art[i].size[0]:arr_dialog.art[i].size[1])+\")\"),src=!0,old[o].style.zIndex=i,old[o].classList.remove(\"img_del\");break}!1==src&&creation_art(i)}del_element(\"img_del\")}else for(i=0;i0&&(choice.style.backgroundImage=\"url('\"+art_data(arr_dialog.choice[i].art)+\"')\"),arr_dialog.choice[i].size&&(0!=arr_dialog.choice[i].size[0]&&(choice.style.width=arr_dialog.choice[i].size[0]),0!=arr_dialog.choice[i].size[1]&&(choice.style.height=arr_dialog.choice[i].size[1])),arr_dialog.choice[i].art_size&&(\"patch\"==arr_dialog.choice[i].art_size&&(choice.style.backgroundImage=\"none\"),\"object\"==typeof arr_dialog.choice[i].art_size?choice.style.backgroundSize=arr_dialog.choice[i].art_size[0]+\" \"+arr_dialog.choice[i].art_size[1]:\"patch\"==arr_dialog.choice[i].art_size?(choice.style.backgroundImage=\"none\",choice.style.backgroundSize=\"none\",choice.style.backgroundClip=\"padding-box\",choice.style.borderStyle=\"solid\",choice.style.borderWidth=arr_dialog.choice[i].patch[0]+\"px \"+arr_dialog.choice[i].patch[1]+\"px \"+arr_dialog.choice[i].patch[2]+\"px \"+arr_dialog.choice[i].patch[3]+\"px\",choice.style.borderImage=\"url('\"+art_data(arr_dialog.choice[i].art)+\"') \"+arr_dialog.choice[i].patch[0]+\" \"+arr_dialog.choice[i].patch[1]+\" \"+arr_dialog.choice[i].patch[2]+\" \"+arr_dialog.choice[i].patch[3]+\" stretch stretch\"):choice.style.backgroundSize=arr_dialog.choice[i].art_size),choice.style.transform=(arr_dialog.choice[i].hotspot&&0!=arr_dialog.choice[i].hotspot[0]&&0!=arr_dialog.choice[i].hotspot[1]?\" translate(\"+arr_dialog.choice[i].hotspot[0]+\",\"+arr_dialog.choice[i].hotspot[1]+\")\":\"\")+(arr_dialog.choice[i].angle?\"rotate(\"+arr_dialog.choice[i].angle+\"deg)\":\"\"),0!=arr_dialog.choice[i].position[0]&&(choice.style.left=arr_dialog.choice[i].position[0]),0!=arr_dialog.choice[i].position[1]&&(choice.style.right=arr_dialog.choice[i].position[1]),0!=arr_dialog.choice[i].position[2]&&(choice.style.top=arr_dialog.choice[i].position[2]),0!=arr_dialog.choice[i].position[3]&&(choice.style.bottom=arr_dialog.choice[i].position[3]),choice.style.color=arr_dialog.choice[i].color_text,choice.style.padding=arr_dialog.choice[i].indent_text,choice.style.fontSize=arr_dialog.choice[i].size_text?arr_dialog.choice[i].size_text:story_json.parameters.font_size,choice.style.fontFamily=arr_dialog.choice[i].font_family?arr_dialog.choice[i].font_family:story_json.parameters.font,choice.style.display=\"flex\",choice.style.justifyContent=arr_dialog.choice[i].align?arr_dialog.choice[i].align[0]:\"center\",choice.style.alignItems=arr_dialog.choice[i].align?arr_dialog.choice[i].align[1]:\"center\",choice.style.zIndex=1001+i,arr_dialog.choice[i].show_if&&show_if(arr_dialog.choice[i].show_if,choice),arr_dialog.choice[i].text&&(\"object\"!=typeof arr_dialog.choice[i].text||arr_dialog.choice[i].text[languare]&&\"object\"!=typeof arr_dialog.choice[i].text[languare])&&(choice.innerHTML=values_button(art_data(arr_dialog.choice[i].text))),\"tue_audio\"==arr_dialog.choice[i].go_to&&show_audio(choice,arr_dialog.choice[i]);var v=\"\";if(arr_dialog.choice[i].variables)for(var g=0;g1)for(var l=0;l/g;ruby_rt=[];let r=t.matchAll(a);r=Array.from(r);for(var s=0;s/g);t=Array.from(t);for(var a=0;a\"+t[0]+\"\"+t[1]+\"\"}function go_story(e){(!(arr_dialog=story_json[tue_story][scene].dialogs[dialog]).choice||e)&&(arr_dialog.go_to?go_to(arr_dialog.go_to):dialog=story_json[tue_story].length?scene=story_json[tue_story].length-1:(dialog=0,creation_scene()),story_json.parameters.autosave&&!story_json[tue_story][scene].dialogs[dialog].no_autosave&&save_stag(\"auto\"))}function back_story(){(arr_dialog=story_json[tue_story][scene].dialogs[dialog],del_element(\"tue_choice\"),del_element(\"tue_html_dialog\"),arr_dialog.back_to)?go_to(arr_dialog.back_to):dialog>0?(dialog-=1,(arr_dialog=story_json[tue_story][scene].dialogs[dialog]).text?\"skip\"==arr_dialog.text[languare]?back_story():creation_dialog():arr_dialog.text_add?\"skip\"==arr_dialog.text_add[languare]?back_story():(dialog_text=arr_dialog.text?dialog_text.replace(arr_dialog.text_add[languare],\"\"):\"\",creation_dialog()):(creation_dialog(),del_element(\"tue_choice\"),del_element(\"tue_html_dialog\"))):((scene-=1)<0?(scene=0,dialog=0):dialog=story_json[tue_story][scene].dialogs.length-1,creation_scene()),story_json.parameters.autosave&&!story_json[tue_story][scene].dialogs[dialog].no_autosave&&save_stag(\"auto\")}function save_stag(e){localStorage.setItem(\"tue_\"+e+\"_scene\",scene),localStorage.setItem(\"tue_\"+e+\"_dialog\",dialog),localStorage.setItem(\"tue_\"+e+\"_story\",tue_story),story_json.parameters.variables&&localStorage.setItem(\"tue_\"+e+\"_data\",JSON.stringify(story_json.parameters.variables)),\"bookmark\"==e&&tuesday.dispatchEvent(new Event(\"save\"))}function load_stag(e){story_json[localStorage.getItem(\"tue_\"+e+\"_story\")]&&(del_element(\"tue_choice\"),del_element(\"tue_html_scene\"),scene=localStorage.getItem(\"tue_\"+e+\"_scene\"),dialog=localStorage.getItem(\"tue_\"+e+\"_dialog\"),tue_story=localStorage.getItem(\"tue_\"+e+\"_story\"),story_json.parameters.variables=JSON.parse(localStorage.getItem(\"tue_\"+e+\"_data\")),creation_scene(),search_music(),tuesday.dispatchEvent(new Event(\"load\")))}function go_to(e){del_element(\"tue_choice\"),del_element(\"tue_html_dialog\"),tue_story=e,dialog=0,scene=0,creation_scene()}function del_element(e){for(var t=document.getElementById(\"tuesday\").getElementsByClassName(e),a=t.length,r=0;r\")}else 0!=dialog_speed&&dialog_letter<=dialog_text.length?dialog_timeout=setTimeout(add_letter,dialog_speed):dialog_letter>=dialog_text.length&&(tue_text_view.innerHTML+=story_json.parameters.text_panel.end_text_cursor&&story_json.parameters.text_panel.end_text_cursor[0]?' ':\"\",tuesday.dispatchEvent(new Event(\"dialog_end\")));story_json.parameters.text_panel.scroll&&(tue_text_view.scrollTop=tue_text_view.scrollHeight)}function add_letter(){for(var e=dialog_text.slice(0,dialog_letter).replace(RegExp(\"\\n\",\"g\"),\"
\"),t=0;t=0;e--)if(story_json[tue_story][e].background_music){tue_bg_music.canPlayType(\"audio/mpeg\")?\"number\"==typeof story_json[tue_story][e].background_music?tue_bg_music.src=story_json.base[story_json[tue_story][e].background_music-1]:story_json[tue_story][e].background_music.includes(\"blob:\")?tue_bg_music.src=story_json[tue_story][e].background_music:story_json[tue_story][e].background_music.includes(\".mp3\")?tue_bg_music.src=story_json[tue_story][e].background_music:tue_bg_music.src=story_json[tue_story][e].background_music+\".mp3\":tue_bg_music.src=story_json[tue_story][e].background_music+\".ogg\",tue_bg_music.loop=!0,0==tue_set_audio&&tue_bg_music.play();break}}function creation_sound(){for(var e=0;Object.keys(story_json.parameters.sounds)[e];){var t=document.createElement(\"audio\");t.preload=\"auto\",t.id=Object.keys(story_json.parameters.sounds)[e],t.canPlayType(\"audio/mpeg\")?story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]].includes(\";base64\")?t.src=story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]]:story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]].includes(\"blob:\")?t.src=story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]]:story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]].includes(\".mp3\")?t.src=story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]]:t.src=story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]]+\".mp3\":t.src=story_json.parameters.sounds[Object.keys(story_json.parameters.sounds)[e]]+\".ogg\",tuesday.appendChild(t),e++}}function get_sound(e){return\"if(tue_set_audio<2){\"+(e[languare]?\"sound_play('\"+e[languare]+\"');\":\"sound_play('\"+e+\"');\")+\"}\"}function get_stop_sound(e){return e[languare]?\"sound_stop('\"+e[languare]+\"');\":\"sound_stop('\"+e+\"');\"}function sound_play(e){var t=document.getElementById(e);t&&(t.currentTime=0,t.volume=1,t.play())}function sound_stop(e){document.getElementById(e).currentTime=0,document.getElementById(e).pause()}function add_style(e){var t=document.createElement(\"link\");t.setAttribute(\"rel\",\"stylesheet\"),t.setAttribute(\"type\",\"text/css\"),t.setAttribute(\"href\",e),document.getElementsByTagName(\"head\").item(0).appendChild(t)}function full_screen(e,t){tue_fullScreen?(tue_fullScreen=!1,t&&t.text&&art_data(t.text).length>0&&(e.innerHTML=values_button(art_data(t.text))),t&&t.art&&art_data(t.art).length>0&&(e.style.backgroundImage=\"url('\"+art_data(t.art)+\"')\"),document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()):(tue_fullScreen=!0,e&&t&&t.text1&&art_data(t.text1).length>0&&(e.innerHTML=values_button(art_data(t.text1))),e&&t&&t.art1&&art_data(t.art1).length>0&&(e.style.backgroundImage=\"url('\"+art_data(t.art1)+\"')\"),tuesday.requestFullscreen?tuesday.requestFullscreen():tuesday.mozRequestFullScreen?tuesday.mozRequestFullScreen():tuesday.webkitRequestFullscreen?tuesday.webkitRequestFullscreen():tuesday.msRequestFullscreen&&tuesday.msRequestFullscreen())}function art_data(e){return e[languare]?\"number\"==typeof e[languare]?story_json.base[e[languare]-1]:e[languare]:\"number\"==typeof e?story_json.base[e-1]:e}function video_size(){var e=document.getElementById(\"tue_video\"),t=tuesday.getBoundingClientRect();e.videoWidth/e.videoHeight>t.width/t.height?(e.style.height=\"100%\",e.style.width=\"auto\"):(e.style.height=\"auto\",e.style.width=\"100%\")}function show_if(e,t){show=!0;for(var a=1;a\"==s){if(story_json.parameters.variables[r]<=e[a][2]){show=!1;break}}else if(\"<\"==s&&story_json.parameters.variables[r]>=e[a][2]){show=!1;break}if(!show)break}!show&&e[0]?t.style.visibility=\"hidden\":show&&!e[0]&&(t.style.visibility=\"hidden\")}function fast_rewind(){timers=setTimeout(function(){go_story(!0),dialog1?0:tue_set_audio+1,localStorage.setItem(\"tue_set_audio\",tue_set_audio),0==tue_set_audio?tue_bg_music.play():tue_set_audio>0&&tue_bg_music.pause(),2==tue_set_audio){var a=tuesday.getElementsByTagName(\"audio\");for(let r=0;r0&&(e.innerHTML=values_button(art_data(t[\"text\"+a]))),t[\"art\"+a]&&art_data(t[\"art\"+a]).length>0&&(e.style.backgroundImage=\"url('\"+art_data(t[\"art\"+a])+\"')\")}function autoplaysound(){0==tue_set_audio&&tue_bg_music.play(),tuesday.removeEventListener(\"mousedown\",autoplaysound)}document.oncontextmenu=cmenu,window.onmousedown=window.onselectstart=function(){return!1},document.addEventListener(\"keydown\",function(e){var t=e.code;t==story_json.parameters.key.next&&controll?go_story():t==story_json.parameters.key.back&&controll?back_story():t==story_json.parameters.key.main?go_to(story_json.parameters.launch_story):t==story_json.parameters.key.save?save_stag(\"bookmark\"):t==story_json.parameters.key.load?load_stag(\"bookmark\"):t==story_json.parameters.key.autosave?load_stag(\"auto\"):t==story_json.parameters.key.full_screen?full_screen():t==story_json.parameters.key.fast_rewind&&fast_rewind()}),tuesday.addEventListener(\"mousedown\",autoplaysound);"; let arr_l; let arr_n; let color_ui=[ @@ -1150,7 +1150,7 @@ else{n=arr[key][story_script.parameters.languares[i]]} }else{a++} }if(a==story_script.parameters.languares.length){arr[key]=n} - }else if(arr[key].length==0){delete arr[key];if(key=='art'){delete arr.art_size}}} + }else if(arr[key]&&arr[key].length==0){delete arr[key];if(key=='art'){delete arr.art_size}}} function creaton_line(id,go,chapter){ line_controll.push([go,chapter,id]); var newLine=document.createElementNS("http://www.w3.org/2000/svg",'line'); @@ -1491,7 +1491,7 @@ x.classList.add("toast_anim"); } function about(){ - var html="

Tuesday JS visual novel engine


Release: 21

" + var html="

Tuesday JS visual novel engine


Release: 22

" +"" +"" +"" @@ -3384,7 +3384,7 @@ if(!arr_s[b].text[languare]){data_corr(arr_s[b],'text')} if(!arr_s[b].art){arr_s[b].art=''} if(!arr_s[b].art[languare]){data_corr(arr_s[b],'art')} - if(arr_s[b].go_to=='tue_audio'){ + if(arr_s[b].go_to=='tue_audio'||arr_s[b].go_to=='tue_fullScreen'){ if(!arr_s[b].text1){arr_s[b].text1=''} if(!arr_s[b].text1[languare]){data_corr(arr_s[b],'text1')} if(!arr_s[b].text2){arr_s[b].text2=''} @@ -3482,12 +3482,16 @@ +'
E-Mail:tuesdayjsengine@gmail.com
WebSite:kirilllive.github.io/tuesday-js
Tutorial:kirilllive.github.io/tuesday-js/doc_editor
' +'' +'' - +'' + +'' +((arr_s[b].text_from)?'':'') +'' +'' +'' +'' + +((arr_s[b].go_to=='tue_fullScreen')?'' + +'' + +'' + +'':"") +((arr_s[b].go_to=='tue_audio')?'' +'' +'' @@ -3588,6 +3592,11 @@ +'' +'' +'' + +((arr_s[b].go_to=='tue_fullScreen')?'' + +'' + +'' + +'' + +'':"") +((arr_s[b].go_to=='tue_audio')?'' +'' +'' @@ -3676,7 +3685,7 @@ if(!arr_s[b].text[languare]){data_corr(arr_s[b],'text')} if(!arr_s[b].art){arr_s[b].art=''} if(!arr_s[b].art[languare]){data_corr(arr_s[b],'art')} - if(arr_s[b].name=='tue_audio'){ + if(arr_s[b].name=='tue_audio'||arr_s[b].name=='tue_fullScreen'){ if(!arr_s[b].text1){arr_s[b].text1=''} if(!arr_s[b].text1[languare]){data_corr(arr_s[b],'text1')} if(!arr_s[b].text2){arr_s[b].text2=''} @@ -3760,11 +3769,15 @@ +'' +'
Delete
Text
Text fullscreen
Text off music
Art fullscreen
Art off music
'+((arr_s[b].text[languare])?arr_s[b].text[languare]:((arr_s[b].text.length>0)?arr_s[b].text:arr_s[b].name))+'
' +'' - +((arr_s[b].name=='tue_back'||arr_s[b].name=='tue_next')?'':'') + +((arr_s[b].name=='tue_back'||arr_s[b].name=='tue_next')?'':'') +'' +'' +'' +'' + +((arr_s[b].name=='tue_fullScreen')?'' + +'' + +'' + +'':"") +((arr_s[b].name=='tue_audio')?'' +'' +'' @@ -3865,6 +3878,11 @@ +'' +'' +'' + +((arr_s[b].name=='tue_fullScreen')?'' + +'' + +'' + +'' + +'':"") +((arr_s[b].name=='tue_audio')?'' +'' +'' @@ -4019,11 +4037,16 @@ data_only(story_script.parameters.buttons[a],'art'); data_only(story_script.parameters.buttons[a],'text'); data_only(story_script.parameters.buttons[a],'sound'); - if(story_script.parameters.buttons[a].name!='tue_audio'){ + if(story_script.parameters.buttons[a].name!='tue_audio'&&story_script.parameters.buttons[a].name!='tue_fullScreen'){ delete story_script.parameters.buttons[a].text1 delete story_script.parameters.buttons[a].text2 delete story_script.parameters.buttons[a].art1 delete story_script.parameters.buttons[a].art2 + }else{ + data_only(story_script.parameters.buttons[a],'art1'); + data_only(story_script.parameters.buttons[a],'text1'); + data_only(story_script.parameters.buttons[a],'art2'); + data_only(story_script.parameters.buttons[a],'text2'); } } if(arr_s){ @@ -4032,11 +4055,16 @@ data_only(arr_s.choice[a],'art'); data_only(arr_s.choice[a],'text'); data_only(arr_s.choice[a],'sound'); - if(arr_s.choice.go_to!='tue_audio'){ + if(arr_s.choice.go_to!='tue_audio'&&arr_s.choice.go_to!='tue_fullScreen'){ delete arr_s.choice[a].text1 delete arr_s.choice[a].text2 delete arr_s.choice[a].art1 delete arr_s.choice[a].art2 + }else{ + data_only(arr_s.choice[a],'art1'); + data_only(arr_s.choice[a],'text1'); + data_only(arr_s.choice[a],'art2'); + data_only(arr_s.choice[a],'text2'); } }} }
Function
Function
Text
Text fullscreen
Text off music
Art fullscreen
Art off music