Add files via upload
3522
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/animate.css
vendored
Normal file
320
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/doc.js
Normal file
|
@ -0,0 +1,320 @@
|
|||
function object(o) {
|
||||
var f = object.f, i, len, n, prop;
|
||||
f.prototype = o;
|
||||
n = new f;
|
||||
for (i=1, len=arguments.length; i<len; ++i)
|
||||
for (prop in arguments[i])
|
||||
n[prop] = arguments[i][prop];
|
||||
return n;
|
||||
}
|
||||
|
||||
object.f = function(){};
|
||||
|
||||
var tyrano ={};
|
||||
tyrano.plugin ={};
|
||||
tyrano.plugin.kag ={};
|
||||
|
||||
|
||||
(function($){
|
||||
|
||||
$.generateHtml = function() {
|
||||
|
||||
var html="";
|
||||
|
||||
var master_tag ={};
|
||||
var map_doc = {};
|
||||
|
||||
// タグの種類を確定させる
|
||||
for(var order_type in tyrano.plugin.kag.tag){
|
||||
|
||||
master_tag[order_type] = object(tyrano.plugin.kag.tag[order_type]);
|
||||
|
||||
}
|
||||
|
||||
console.log(master_tag);
|
||||
|
||||
//テキストを読み込み。スクリプトから、オブジェクト構造解析
|
||||
//同じディレクトリにある、KAG関連のデータを読み込み
|
||||
|
||||
var array_script = ["kag.tag.js","kag.tag_audio.js","kag.tag_ext.js","kag.tag_system.js","kag.tag_camera.js"];
|
||||
|
||||
var script_num = array_script.length;
|
||||
var loading_num = 0;
|
||||
|
||||
for(var i=0;i<array_script.length;i++){
|
||||
|
||||
$.loadText("./tyrano/plugins/kag/"+array_script[i],function(text_str){
|
||||
|
||||
var flag_tag = ""; //タグ解析中の場合
|
||||
var flag_param =""; //パラメータ名
|
||||
|
||||
var tmp_str ="";
|
||||
|
||||
var array_str = text_str.split("\n");
|
||||
|
||||
for(var i=0; i< array_str.length;i++){
|
||||
|
||||
var line_str = $.trim(array_str[i]);
|
||||
|
||||
//タグ解析中は改行もつかう
|
||||
if (line_str !="" || flag_tag !=""){
|
||||
|
||||
if(line_str ==="#[end]"){
|
||||
|
||||
|
||||
//終了時点で登録すべきデータが残っていた場合は入れておく
|
||||
map_doc[flag_tag][flag_param] = tmp_str;
|
||||
|
||||
flag_tag ="";
|
||||
flag_param ="";
|
||||
|
||||
|
||||
}
|
||||
else if(flag_tag!=""){
|
||||
|
||||
if(line_str.substr(0,1)==":"){
|
||||
|
||||
if(tmp_str!=""){
|
||||
|
||||
if(flag_param!=""){
|
||||
map_doc[flag_tag][flag_param] = tmp_str;
|
||||
}
|
||||
}
|
||||
|
||||
flag_param ="";
|
||||
flag_param = line_str.substr(1,line_str.length);
|
||||
|
||||
//すでに登録済みのデータがあれば、それを格納する
|
||||
map_doc[flag_tag][flag_param] = "";
|
||||
|
||||
tmp_str ="";
|
||||
|
||||
}else {
|
||||
|
||||
if(flag_param != "param" && flag_param != "title"){
|
||||
tmp_str +=line_str+"\n";
|
||||
}else{
|
||||
tmp_str +=line_str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//タグ読み込み開始
|
||||
}else if(line_str.substr(0,2)==="#["){
|
||||
|
||||
var tag_name = line_str.replace("#[","");
|
||||
tag_name = tag_name.replace("]","");
|
||||
tag_name = $.trim(tag_name);
|
||||
|
||||
flag_tag = tag_name;
|
||||
flag_param ="";
|
||||
|
||||
|
||||
map_doc[flag_tag] = {};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
console.log(map_doc);
|
||||
|
||||
//macdoc を 解析して、HTMLを作成
|
||||
|
||||
loading_num++;
|
||||
|
||||
if(loading_num == script_num){
|
||||
$.putHtml(map_doc,master_tag);
|
||||
}
|
||||
|
||||
|
||||
});// ローディング
|
||||
|
||||
}
|
||||
|
||||
return html;
|
||||
|
||||
};
|
||||
|
||||
|
||||
$.putHtml = function (map_doc,master_tag){
|
||||
|
||||
//タグのグルーピングで左部分作成
|
||||
|
||||
var group_map = {};
|
||||
|
||||
var ghtml = "";
|
||||
|
||||
for(key in map_doc){
|
||||
|
||||
var obj = map_doc[key];
|
||||
if(group_map[obj.group]){
|
||||
}else{
|
||||
group_map[obj.group] ={};
|
||||
}
|
||||
group_map[obj.group][key] = obj;
|
||||
|
||||
}
|
||||
|
||||
var num_index = 0;
|
||||
|
||||
//グループをつくる
|
||||
for(key in group_map){
|
||||
|
||||
|
||||
ghtml+='<li class="list-group-item list-toggle">';
|
||||
ghtml +='<a data-toggle="collapse" data-parent="#sidebar-nav-1" href="#nav_'+num_index+'" class="collapsed" aria-expanded="false">'+key+'</a>';
|
||||
|
||||
var tmp = group_map[key];
|
||||
|
||||
ghtml += '<ul id="nav_'+num_index+'" class="collapse" aria-expanded="false" style="height: 0px;">';
|
||||
|
||||
for (key2 in tmp){
|
||||
var obj = tmp[key2];
|
||||
//ghtml +='<div style="padding:2px"><a href="#'+key2+'">['+key2+'] <span style="font-style:italic;color:gray">('+obj.title+')</span></a></div>';
|
||||
ghtml +='<li><a href="#'+key2+'"> ['+key2+'] '+obj.title+'</a></li>';
|
||||
}
|
||||
|
||||
ghtml +="</ul>";
|
||||
ghtml +="</li>";
|
||||
|
||||
num_index++;
|
||||
|
||||
}
|
||||
|
||||
$(".area_group").html(ghtml);
|
||||
|
||||
|
||||
var j_root = $("<div></div>");
|
||||
|
||||
|
||||
for(key in map_doc){
|
||||
|
||||
var obj = map_doc[key];
|
||||
|
||||
console.log(obj.exp.split("\n"));
|
||||
|
||||
var html =''
|
||||
+'<div class="news-v3 bg-color-white margin-bottom-20">'
|
||||
+'<div class="news-v3-in"><a name="'+key+'"></a>'
|
||||
+'<h3 style="color:#a10f2b">['+key+'] '+obj.title+'</h3>'
|
||||
+'<ul class="list-inline posted-info"><li>'+obj.group+'</li></ul>'
|
||||
+'<p>'+$.br($.escapeHTML(obj.exp))+'</p>'
|
||||
+'<table class="table table-bordered">'
|
||||
+'<thead style="background-color:pink"><tr><th>パラメータ</th><th>必須</th><th>解説</th></tr></thead>'
|
||||
+'<tbody>';
|
||||
|
||||
|
||||
//繰り返し
|
||||
|
||||
var param_str = obj.param;
|
||||
|
||||
var array_param = obj.param.split(",");
|
||||
|
||||
console.log("==== array_param =====");
|
||||
console.log(array_param);
|
||||
|
||||
for(var k=0;k<array_param.length;k++){
|
||||
|
||||
if(array_param[k]==""){
|
||||
html+='<tr ><td colspan="3">指定できるパラメータはありません</td></tr>';
|
||||
}else{
|
||||
var tmp_array = array_param[k].split("=");
|
||||
|
||||
var param_name = $.trim(tmp_array[0]);
|
||||
var param_value =$.trim(tmp_array[1]);
|
||||
|
||||
var vital = "×";
|
||||
|
||||
if(master_tag[key]!=null && master_tag[key]["vital"]!=null){
|
||||
|
||||
var array_vital = master_tag[key]["vital"];
|
||||
|
||||
for(var j=0;j<array_vital.length;j++){
|
||||
|
||||
if(master_tag[key].vital[j]==param_name){
|
||||
|
||||
vital ="◯";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
html+=' <tr>'
|
||||
+' <td>'+param_name+'</td>'
|
||||
+' <td>'+vital+'</td>'
|
||||
+' <td>'+param_value+'</td>'
|
||||
|
||||
+' </tr>';
|
||||
|
||||
}
|
||||
|
||||
}//end for loop
|
||||
|
||||
html +='</tbody></table>';
|
||||
|
||||
|
||||
if(obj.sample!=""){
|
||||
|
||||
html+=''
|
||||
+'<ul class="list-inline posted-info"><li>サンプルコード</li></ul>'
|
||||
+'<code><br />'
|
||||
|
||||
+$.br($.escapeHTML(obj.sample))
|
||||
|
||||
+'<br /></code>'
|
||||
+'';
|
||||
|
||||
}
|
||||
|
||||
html +="</div></div>";
|
||||
html +='<div class="clearfix "><hr style="margin:0"></div>';
|
||||
|
||||
//htmlをぶち込みます
|
||||
|
||||
j_root.append($(html));
|
||||
|
||||
}// end map_doc loop
|
||||
|
||||
|
||||
|
||||
$(".area_ref").empty();
|
||||
|
||||
//基本説明部分n
|
||||
|
||||
var basic_exp = ''
|
||||
+' <div class="alert alert-success fade in margin-bottom-20">'
|
||||
+'<h4>基本</h4>'
|
||||
+'<p>'
|
||||
+' [ ] で囲まれた部分がタグになります。 <br/ >'
|
||||
+' @で始まる行も、タグとして認識しますが、1行で記述しなければなりません<br/ >'
|
||||
+' ;(セミコロン)で始まる行はコメントとして扱われます。<br/ >'
|
||||
+' 複数行にわたってコメントにする場合は、/* からはじめて */ で 閉じることでコメントになります。 <br/ >'
|
||||
+' すべてのタグにcond属性があります。JS式を記述して、その結果が真の場合のみタグが実行されます<br/ >'
|
||||
+' _(半角アンダーバー)で始まる行は、文章の前に空白を挿入することができます。<br />'
|
||||
+' '
|
||||
+' </p> '
|
||||
+''
|
||||
+'</div>';
|
||||
$(".area_ref").append(basic_exp);
|
||||
$(".area_ref").append(j_root);
|
||||
$("#src_html").val($(".area_main").html());
|
||||
|
||||
var js_auto_complete = "";
|
||||
for(key in master_tag ){
|
||||
js_auto_complete += '"'+key+'",\n';
|
||||
}
|
||||
|
||||
console.log(master_tag);
|
||||
|
||||
$("#auto_complete_tag").val(js_auto_complete);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
})(jQuery);
|
10
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/font.css
Normal file
|
@ -0,0 +1,10 @@
|
|||
/*ウェブフォントを使用する場合はここに定義を追加して下さい*/
|
||||
|
||||
@font-face {
|
||||
font-family:"mfrules";
|
||||
src:url("../data/others/Mf_Break_The_Rules.eot?") format("eot"),
|
||||
url("../data/others/Mf_Break_The_Rules.woff") format("woff"),
|
||||
url("../data/others/Mf_Break_The_Rules.ttf") format("truetype"),
|
||||
url("../data/others/Mf_Break_The_Rules.svg#MfBreakTheRules") format("svg");
|
||||
font-weight:normal;font-style:normal;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
<div>
|
||||
<div class="display_menu">
|
||||
|
||||
<img class="button_arrow_up button_smart" src="tyrano/images/system/arrow_up.png" style="cursor:pointer;left:670px;top:20px;position:absolute;">
|
||||
<img class="button_arrow_down button_smart" src="tyrano/images/system/arrow_down.png" style="cursor:pointer;left:760px;top:15px;position:absolute;">
|
||||
|
||||
<div class="menu_item" style="float:right">
|
||||
<a href="javascript:void(0)"><img class="menu_close" src="tyrano/images/system/menu_button_close.png"></a>
|
||||
</div>
|
||||
|
||||
<div style="clear:both"></div>
|
||||
|
||||
<div class="log_body" style="width:90%;height:65%;overflow-y:scroll;margin-top:50px;padding:8px;color:#999;border:1px solid #555;font-weight:normal" align="left"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<img class="img_label img_label_backlog" src="tyrano/images/system/label_backlog.png" style="left: 0px; top: 0px; position: absolute;">
|
||||
<img class="img_bg_base" src="tyrano/images/system/bg_base.png" style="z-index:-1;left:0;top:0;width:100%;height:100%;position:absolute;">
|
||||
</div>
|
|
@ -0,0 +1,60 @@
|
|||
<div>
|
||||
|
||||
<div class='menu_item' style='float:right'><img class="menu_close" src='tyrano/images/system/menu_button_close.png' /></div>
|
||||
<div style='clear:both'></div>
|
||||
|
||||
<img class="button_smart button_arrow_up" src='tyrano/images/system/arrow_up.png' style='cursor:pointer;left:670px;top:20px;position:absolute;'>
|
||||
<img class="button_smart button_arrow_down" src='tyrano/images/system/arrow_down.png' style='cursor:pointer;left:760px;top:15px;position:absolute;'>
|
||||
|
||||
|
||||
<div class="area_save_list" style="margin-top:50px;overflow:auto">
|
||||
|
||||
<ul class='save_list'>
|
||||
{{for array_save}}
|
||||
<li class='save_display_area save_list_item' data-num='{{:num}}'>
|
||||
|
||||
<span class='save_list_item_thumb'>
|
||||
{{if img_data != ""}}
|
||||
<img src="{{:img_data}}">
|
||||
{{/if}}
|
||||
</span>
|
||||
|
||||
<span class='save_list_item_area'>
|
||||
<span class='save_list_item_date'>{{:save_date}}</span>
|
||||
<span class='save_list_item_text'>{{:title}}</span>
|
||||
</span>
|
||||
</li>
|
||||
{{/for}}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<img class="img_label img_label_load" src='tyrano/images/system/label_load.png' style='left:0;top:0;position:absolute;'>
|
||||
<img class="img_bg_base" src='tyrano/images/system/bg_base.png' style='z-index:-1;left:0;top:0;width:100%;height:100%;position:absolute;'>
|
||||
|
||||
<script>
|
||||
setTimeout(function(){
|
||||
var save_list_height = parseInt($(".tyrano_base").outerHeight()) - parseInt($(".save_list").get(0).offsetTop) ;
|
||||
$(".area_save_list").css("height",save_list_height);
|
||||
},30);
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
/*両方共通(はみ出したらスクロールさせる)*/
|
||||
.area_save_list::-webkit-scrollbar{
|
||||
width: 15px;
|
||||
}
|
||||
.area_save_list::-webkit-scrollbar-thumb{
|
||||
background: #6495ED;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.area_save_list::-webkit-scrollbar-track-piece:start{
|
||||
background: gray;
|
||||
}
|
||||
.area_save_list::-webkit-scrollbar-track-piece:end{
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
</div>
|
|
@ -0,0 +1,52 @@
|
|||
<div>
|
||||
<div class="display_menu block_menu" align="center">
|
||||
|
||||
<div class="menu_item " style="position:absolute;right:0px">
|
||||
<a href="javascript:void(0)"><img class="menu_close" src="tyrano/images/system/menu_button_close.png" /></a>
|
||||
</div>
|
||||
|
||||
<div style='clear:both'></div>
|
||||
|
||||
<div style="margin-top:100px">
|
||||
<div class="menu_item ">
|
||||
<a href="javascript:void(0)"><img class="menu_save" src="tyrano/images/system/menu_button_save.png" /></a>
|
||||
</div>
|
||||
|
||||
<div class="menu_item">
|
||||
<a href="javascript:void(0)"><img class="menu_load" src="tyrano/images/system/menu_button_load.png" /></a>
|
||||
</div>
|
||||
|
||||
<div class="menu_item">
|
||||
<a href="javascript:void(0)"><img class="menu_window_close" src="tyrano/images/system/menu_message_close.png" /></a>
|
||||
</div>
|
||||
|
||||
<div class="menu_item">
|
||||
<a href="javascript:void(0)"><img class="menu_skip" src="tyrano/images/system/menu_button_skip.png" /></a>
|
||||
</div>
|
||||
|
||||
<div class="menu_item">
|
||||
<a href="javascript:void(0)"><img class="menu_back_title" src="tyrano/images/system/menu_button_title.png" /></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<img class="img_label img_label_menu block_menu" src='tyrano/images/system/label_menu.png' style='left:0;top:0;position:absolute;'>
|
||||
<img class="img_bg_base" src='tyrano/images/system/bg_base.png' style='z-index:-1;left:0;top:0;width:100%;height:100%;position:absolute;'>
|
||||
<script class="block_menu">
|
||||
|
||||
var tmp_src = "";
|
||||
|
||||
$(".menu_item").hover(function(){
|
||||
tmp_src = $(this).find("img").attr("src");
|
||||
var img_src = tmp_src.replace(".gif","2.gif").replace(".png","2.png");
|
||||
$(this).find("img").attr("src",img_src);
|
||||
},
|
||||
function(){
|
||||
|
||||
//もとにもどす
|
||||
$(this).find("img").attr("src",tmp_src);
|
||||
});
|
||||
|
||||
</script>
|
||||
</div>
|
|
@ -0,0 +1,59 @@
|
|||
<div>
|
||||
<div class='menu_item' style='float:right;'><img class="menu_close" src='tyrano/images/system/menu_button_close.png' /></div>
|
||||
|
||||
<div style='clear:both'></div>
|
||||
|
||||
<img class="button_arrow_up button_smart" src='tyrano/images/system/arrow_up.png' style='cursor:pointer;left:670px;top:20px;position:absolute;'>
|
||||
<img class="button_arrow_down button_smart" src='tyrano/images/system/arrow_down.png' style='cursor:pointer;left:760px;top:15px;position:absolute;'>
|
||||
|
||||
<div class="area_save_list" style="margin-top:50px;overflow:auto">
|
||||
|
||||
<ul class='save_list'>
|
||||
{{for array_save}}
|
||||
<li class='save_display_area save_list_item' data-num='{{:num}}'>
|
||||
<span class='save_list_item_thumb'>
|
||||
{{if img_data != ""}}
|
||||
<img style="width:100px" src="{{:img_data}}">
|
||||
{{/if}}
|
||||
</span>
|
||||
|
||||
<span class='save_list_item_area'>
|
||||
<span class='save_list_item_date'>{{:save_date}}</span>
|
||||
<span class='save_list_item_text'>{{:title}}</span>
|
||||
</span>
|
||||
</li>
|
||||
{{/for}}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<img class="img_label img_label_save" src='tyrano/images/system/label_save.png' style='left:0;top:0;position:absolute;'>
|
||||
<img class="img_bg_base" src='tyrano/images/system/bg_base.png' style='z-index:-1;left:0;top:0;width:100%;height:100%;position:absolute;'>
|
||||
|
||||
<script>
|
||||
setTimeout(function(){
|
||||
var save_list_height = parseInt($(".tyrano_base").outerHeight()) - parseInt($(".save_list").get(0).offsetTop) ;
|
||||
$(".area_save_list").css("height",save_list_height);
|
||||
},30);
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
/*両方共通(はみ出したらスクロールさせる)*/
|
||||
.area_save_list::-webkit-scrollbar{
|
||||
width: 15px;
|
||||
}
|
||||
.area_save_list::-webkit-scrollbar-thumb{
|
||||
background: #6495ED;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.area_save_list::-webkit-scrollbar-track-piece:start{
|
||||
background: gray;
|
||||
}
|
||||
.area_save_list::-webkit-scrollbar-track-piece:end{
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
</div>
|
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 486 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 8 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 8.9 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 529 B |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 997 B |
33
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/lang.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
window.tyrano_lang = {
|
||||
|
||||
word : {
|
||||
|
||||
"go_title":"タイトルに戻ります。よろしいですね?",
|
||||
"exit_game":"ウィンドウを閉じて終了します。よろしいですね?",
|
||||
"not_saved":"まだ、保存されているデータがありません",
|
||||
"tag":"タグ",
|
||||
"not_exists":"は存在しません",
|
||||
"error":"エラーが発生しました。スクリプトを確認して下さい",
|
||||
"label":"ラベル",
|
||||
"label_double":"は同一シナリオファイル内に重複しています",
|
||||
"error_occurred":"エラーが発生しました"
|
||||
},
|
||||
|
||||
novel : {
|
||||
"file_menu_button_save":"menu_button_save.gif",
|
||||
"file_menu_button_load":"menu_button_load.gif",
|
||||
"file_menu_button_message_close":"menu_message_close.gif",
|
||||
"file_menu_button_skip":"menu_button_skip.gif",
|
||||
"file_menu_button_title":"menu_button_title.gif",
|
||||
"file_menu_button_close":"menu_button_close.png",
|
||||
"file_menu_bg":"menu_bg.jpg",
|
||||
"file_save_bg":"menu_save_bg.jpg",
|
||||
"file_load_bg":"menu_load_bg.jpg",
|
||||
"file_button_menu":"button_menu.png",
|
||||
"error_occurred":"error occurred"
|
||||
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
1360
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/libs.js
Normal file
|
@ -0,0 +1,137 @@
|
|||
.alertify,
|
||||
.alertify-show,
|
||||
.alertify-log {
|
||||
-webkit-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
|
||||
-moz-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
|
||||
-ms-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
|
||||
-o-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
|
||||
transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275); /* easeOutBack */
|
||||
}
|
||||
.alertify-hide {
|
||||
-webkit-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
|
||||
-moz-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
|
||||
-ms-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
|
||||
-o-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
|
||||
transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045); /* easeInBack */
|
||||
}
|
||||
.alertify-log-hide {
|
||||
-webkit-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
|
||||
-moz-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
|
||||
-ms-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
|
||||
-o-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045);
|
||||
transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045); /* easeInBack */
|
||||
}
|
||||
.alertify-cover {
|
||||
position: fixed; z-index: 99999;
|
||||
top: 0; right: 0; bottom: 0; left: 0;
|
||||
background-color:white;
|
||||
filter:alpha(opacity=0);
|
||||
opacity:0;
|
||||
}
|
||||
.alertify-cover-hidden {
|
||||
display: none;
|
||||
}
|
||||
.alertify {
|
||||
position: fixed; z-index: 99999;
|
||||
top: 50px; left: 50%;
|
||||
width: 550px;
|
||||
margin-left: -275px;
|
||||
opacity: 1;
|
||||
}
|
||||
.alertify-hidden {
|
||||
-webkit-transform: translate(0,-150px);
|
||||
-moz-transform: translate(0,-150px);
|
||||
-ms-transform: translate(0,-150px);
|
||||
-o-transform: translate(0,-150px);
|
||||
transform: translate(0,-150px);
|
||||
opacity: 0;
|
||||
display: none;
|
||||
}
|
||||
/* overwrite display: none; for everything except IE6-8 */
|
||||
:root *> .alertify-hidden {
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
}
|
||||
.alertify-logs {
|
||||
position: fixed;
|
||||
z-index: 5000;
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
width: 300px;
|
||||
}
|
||||
.alertify-logs-hidden {
|
||||
display: none;
|
||||
}
|
||||
.alertify-log {
|
||||
display: block;
|
||||
margin-top: 10px;
|
||||
position: relative;
|
||||
right: -300px;
|
||||
opacity: 0;
|
||||
}
|
||||
.alertify-log-show {
|
||||
right: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
.alertify-log-hide {
|
||||
-webkit-transform: translate(300px, 0);
|
||||
-moz-transform: translate(300px, 0);
|
||||
-ms-transform: translate(300px, 0);
|
||||
-o-transform: translate(300px, 0);
|
||||
transform: translate(300px, 0);
|
||||
opacity: 0;
|
||||
}
|
||||
.alertify-dialog {
|
||||
padding: 25px;
|
||||
}
|
||||
.alertify-resetFocus {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
.alertify-inner {
|
||||
text-align: center;
|
||||
}
|
||||
.alertify-text {
|
||||
margin-bottom: 15px;
|
||||
width: 100%;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
font-size: 100%;
|
||||
}
|
||||
.alertify-buttons {
|
||||
}
|
||||
.alertify-button,
|
||||
.alertify-button:hover,
|
||||
.alertify-button:active,
|
||||
.alertify-button:visited {
|
||||
background: none;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
/* line-height and font-size for input button */
|
||||
line-height: 1.5;
|
||||
font-size: 100%;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 680px) {
|
||||
.alertify,
|
||||
.alertify-logs {
|
||||
width: 90%;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.alertify {
|
||||
left: 5%;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
/**
|
||||
* Default Look and Feel
|
||||
*/
|
||||
.alertify,
|
||||
.alertify-log {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
.alertify {
|
||||
background: #FFF;
|
||||
border: 10px solid #333; /* browsers that don't support rgba */
|
||||
border: 10px solid rgba(0,0,0,.7);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 3px 3px rgba(0,0,0,.3);
|
||||
-webkit-background-clip: padding; /* Safari 4? Chrome 6? */
|
||||
-moz-background-clip: padding; /* Firefox 3.6 */
|
||||
background-clip: padding-box; /* Firefox 4, Safari 5, Opera 10, IE 9 */
|
||||
}
|
||||
.alertify-text {
|
||||
border: 1px solid #CCC;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.alertify-button {
|
||||
border-radius: 4px;
|
||||
color: #FFF;
|
||||
font-weight: bold;
|
||||
padding: 6px 15px;
|
||||
text-decoration: none;
|
||||
text-shadow: 1px 1px 0 rgba(0,0,0,.5);
|
||||
box-shadow: inset 0 1px 0 0 rgba(255,255,255,.5);
|
||||
background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
|
||||
background-image: -moz-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
|
||||
background-image: -ms-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
|
||||
background-image: -o-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
|
||||
background-image: linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0));
|
||||
}
|
||||
.alertify-button:hover,
|
||||
.alertify-button:focus {
|
||||
outline: none;
|
||||
background-image: -webkit-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
||||
background-image: -moz-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
||||
background-image: -ms-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
||||
background-image: -o-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
||||
background-image: linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
||||
}
|
||||
.alertify-button:focus {
|
||||
box-shadow: 0 0 15px #2B72D5;
|
||||
}
|
||||
.alertify-button:active {
|
||||
position: relative;
|
||||
box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
|
||||
}
|
||||
.alertify-button-cancel,
|
||||
.alertify-button-cancel:hover,
|
||||
.alertify-button-cancel:focus {
|
||||
background-color: #FE1A00;
|
||||
border: 1px solid #D83526;
|
||||
}
|
||||
.alertify-button-ok,
|
||||
.alertify-button-ok:hover,
|
||||
.alertify-button-ok:focus {
|
||||
background-color: #5CB811;
|
||||
border: 1px solid #3B7808;
|
||||
}
|
||||
|
||||
.alertify-log {
|
||||
background: #1F1F1F;
|
||||
background: rgba(0,0,0,.9);
|
||||
padding: 15px;
|
||||
border-radius: 4px;
|
||||
color: #FFF;
|
||||
text-shadow: -1px -1px 0 rgba(0,0,0,.5);
|
||||
}
|
||||
.alertify-log-error {
|
||||
background: #FE1A00;
|
||||
background: rgba(254,26,0,.9);
|
||||
}
|
||||
.alertify-log-success {
|
||||
background: #5CB811;
|
||||
background: rgba(92,184,17,.9);
|
||||
}
|
2
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/libs/alertify/alertify.min.js
vendored
Normal file
3167
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/libs/howler.js
Normal file
3376
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/libs/html2canvas.js
Normal file
2
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/libs/jquery-3.4.1.min.js
vendored
Normal file
1186
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/libs/jquery-ui.css
vendored
Normal file
12
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/libs/jquery-ui.min.js
vendored
Normal file
|
@ -0,0 +1,495 @@
|
|||
/**
|
||||
*
|
||||
* jQuery A3D v1.0 To use CSS3 Keyframe Animation from JavaScript
|
||||
* http://
|
||||
* Copyright 2012, ShikemokuMK
|
||||
|
||||
*Free to use and abuse under the MIT license.
|
||||
*https://twitter.com/shikemokumk
|
||||
*
|
||||
*/
|
||||
|
||||
(function($){
|
||||
var vendor = (/webkit/i).test(navigator.appVersion) ? 'webkit' : (/firefox/i).test(navigator.userAgent) ? 'Moz' : (/Trident/i).test(navigator.userAgent) ? 'ms' : 'opera' in window ? 'O' : '';
|
||||
$.fn.a3d=function(arg){
|
||||
|
||||
var base_point = null;
|
||||
|
||||
return this.each(function(i){
|
||||
|
||||
var that = this;
|
||||
|
||||
var keyframe = arg.frames;
|
||||
var config = arg.config;
|
||||
var cb_complete = arg.complete;
|
||||
var cb_start = arg.start;
|
||||
var cb_iteration = arg.iteration;
|
||||
|
||||
var point = {x:0, y:0, z:0};
|
||||
|
||||
|
||||
var anim_id = "id_"+Math.floor( Math.random() * 1000000000 );
|
||||
|
||||
var trans = {};
|
||||
var master_text ="";
|
||||
|
||||
var defaults={
|
||||
duration:"4s",
|
||||
state:"running",
|
||||
easing:"0.0,0.0,1.0,1.0",
|
||||
count:"1",
|
||||
delay:"0",
|
||||
direction:"",
|
||||
mode:"forwards",
|
||||
maintain:"true"
|
||||
|
||||
}
|
||||
|
||||
var options=$.extend(defaults, trimAll(config));
|
||||
|
||||
var last_frame_text = "";
|
||||
var last_style_text = "";
|
||||
|
||||
var mod_frames ={};
|
||||
var mod_styles ={};
|
||||
|
||||
var ext_array = [];
|
||||
|
||||
|
||||
base_point = $.data(this,"base_point") || null;
|
||||
|
||||
|
||||
if(base_point != null){
|
||||
|
||||
}else{
|
||||
|
||||
base_point = $.extend({x:0,y:0,z:0},{x:parseInt($(this).offset().left),y:parseInt($(this).offset().top)});
|
||||
$.data(this,"base_point",base_point);
|
||||
|
||||
}
|
||||
|
||||
if(keyframe["0%"]){
|
||||
//0%が存在する場合,そのまま適応
|
||||
|
||||
}else{
|
||||
|
||||
var last_frame_text = $.data(this,"last_frame_text") || "";
|
||||
var last_style_text = $.data(this,"last_style_text") || "";
|
||||
|
||||
var last_mod_frames = $.data(this,"last_mod_frames") || {};
|
||||
var last_mod_styles = $.data(this,"last_mod_styles") || {};
|
||||
|
||||
point = $.data(this,"point") || {x:0,y:0,z:0}
|
||||
|
||||
var state_text = last_frame_text + "; " + last_style_text;
|
||||
|
||||
var maintain_state = " 0%{ -"+vendor+"-transform:";
|
||||
maintain_state += state_text+" } ";
|
||||
|
||||
master_text = maintain_state;
|
||||
|
||||
mod_frames = last_mod_frames;
|
||||
mod_styles = last_mod_styles;
|
||||
|
||||
|
||||
}
|
||||
|
||||
var mstime = parseInt(options.duration);
|
||||
//options.duration.substring(options.duration.substring.length-1,options.duration.substring.length)!="s"){
|
||||
if(options.duration.indexOf("ms")!=-1){
|
||||
}else if(options.duration.indexOf("s")!=-1){
|
||||
mstime = mstime * 1000
|
||||
}
|
||||
|
||||
//キーフレーム登録
|
||||
for(percentage in keyframe){
|
||||
|
||||
var frames = [];
|
||||
var styles = [];
|
||||
|
||||
keyframe[percentage].trans = keyframe[percentage].trans || {};
|
||||
keyframe[percentage].styles = keyframe[percentage].styles || {};
|
||||
|
||||
frames = convertTrans(trimAll(keyframe[percentage].trans),point,base_point);
|
||||
styles = trimAll(keyframe[percentage].styles);
|
||||
|
||||
var head_text = " "+percentage+"{ -"+vendor+"-transform:";
|
||||
|
||||
var frame_text = "";
|
||||
var style_text = "";
|
||||
|
||||
mod_styles = $.extend(mod_styles,styles);
|
||||
mod_frames = $.extend(mod_frames,frames);
|
||||
|
||||
|
||||
//スタイルの状態を引き継ぐ
|
||||
if(options.maintain == "true"){
|
||||
|
||||
for(key in mod_styles){
|
||||
style_text+=" "+key+":"+mod_styles[key]+";";
|
||||
}
|
||||
|
||||
for(var key in mod_frames){
|
||||
frame_text+=key+"("+mod_frames[key]+") ";
|
||||
}
|
||||
|
||||
}else{
|
||||
for(key in styles){
|
||||
style_text+=" "+key+":"+styles[key]+";";
|
||||
}
|
||||
|
||||
for(var key in frames){
|
||||
frame_text+=key+"("+frames[key]+") ";
|
||||
}
|
||||
}
|
||||
|
||||
master_text += head_text + frame_text+ "; "+style_text+" } ";
|
||||
|
||||
last_frame_text = frame_text;
|
||||
|
||||
//関数登録
|
||||
if (typeof keyframe[percentage].ext == "function"){
|
||||
|
||||
|
||||
(function(){
|
||||
var _fnc = keyframe[percentage].ext;
|
||||
var _mstime = mstime*(parseInt(percentage));
|
||||
var tfnc = function(){
|
||||
setTimeout(function(){_fnc.call(that);},_mstime*0.01);
|
||||
};
|
||||
|
||||
ext_array.push(tfnc);
|
||||
|
||||
})();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(ext_array.length>0){
|
||||
|
||||
if(typeof cb_start !== "function"){
|
||||
cb_start = function(){};
|
||||
}
|
||||
if(typeof cb_iteration !== "function"){
|
||||
cb_iteration = function(){};
|
||||
}
|
||||
}
|
||||
|
||||
$.data(this,"ext_array",ext_array);
|
||||
|
||||
|
||||
for(key in mod_styles){
|
||||
last_style_text += " "+key+":"+mod_styles[key]+";"
|
||||
}
|
||||
|
||||
|
||||
var last_text = last_frame_text + "; " + last_style_text;
|
||||
|
||||
var lastSheet = document.styleSheets[document.styleSheets.length - 1];
|
||||
lastSheet.insertRule("@-"+vendor+"-keyframes " + anim_id + " {"+master_text+"} ", lastSheet.cssRules.length);
|
||||
|
||||
|
||||
var obj = $(this);
|
||||
|
||||
obj.a3d_name = anim_id;
|
||||
|
||||
var original_css_param={
|
||||
|
||||
"-animation-name":obj.a3d_name,
|
||||
"-animation-duration":defaults.duration,
|
||||
"-animation-play-state":defaults.state,
|
||||
"-animation-delay":defaults.delay,
|
||||
"-animation-iteration-count":defaults.count,
|
||||
"-animation-direction": defaults.direction,
|
||||
"-animation-fill-mode": defaults.mode,
|
||||
"-animation-timing-function":defaults.easing
|
||||
|
||||
};
|
||||
|
||||
var css_param = {};
|
||||
|
||||
for(prefix in original_css_param){
|
||||
|
||||
css_param["-"+vendor+prefix] = original_css_param[prefix];
|
||||
|
||||
}
|
||||
|
||||
obj.css(css_param);
|
||||
|
||||
$.data(this,"last_frame_text",last_frame_text);
|
||||
$.data(this,"last_style_text",last_style_text);
|
||||
|
||||
$.data(this,"last_mod_frames",mod_frames);
|
||||
$.data(this,"last_mod_styles",mod_styles);
|
||||
|
||||
$.data(this,"point",point);
|
||||
|
||||
if(vendor == "Moz"){
|
||||
|
||||
obj.css(css_param).one('animationend',function(){
|
||||
|
||||
if(typeof cb_complete === "function"){
|
||||
|
||||
obj.css("transform", obj.css("transform"));
|
||||
for (var key in mod_styles) {
|
||||
obj.css(key, obj.css(key));
|
||||
}
|
||||
obj.css("animation-name","");
|
||||
|
||||
cb_complete.call(that);
|
||||
}
|
||||
|
||||
});
|
||||
obj.css(css_param).bind('animationiteration',function(){
|
||||
|
||||
if(typeof cb_iteration === "function"){
|
||||
cb_iteration.call(that);
|
||||
}
|
||||
|
||||
//タイムアウト呼び起こし
|
||||
var tanim = $.data(that,"ext_array");
|
||||
|
||||
if(tanim.length>0){
|
||||
for(var i=0;i<tanim.length;i++){
|
||||
|
||||
tanim[i]();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
obj.css(css_param).one('animationstart',function(){
|
||||
|
||||
|
||||
if(typeof cb_start === "function"){
|
||||
cb_start.call(that);
|
||||
|
||||
}
|
||||
//タイムアウト呼び起こし
|
||||
var tanim = $.data(that,"ext_array");
|
||||
|
||||
if(tanim.length>0){
|
||||
for(var i=0;i<tanim.length;i++){
|
||||
|
||||
tanim[i]();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}else{
|
||||
|
||||
//if(vendor =="ms") vendor="";
|
||||
//alert(vendor);
|
||||
//var hasAnimationEvt = 'AnimationEvent' in window;
|
||||
//alert(hasAnimationEvt);
|
||||
|
||||
obj.css(css_param).one(''+vendor+'AnimationEnd animationend',function(){
|
||||
|
||||
if(typeof cb_complete === "function"){
|
||||
obj.css("transform",obj.css("transform"));
|
||||
|
||||
for (var key in mod_styles) {
|
||||
obj.css(key, obj.css(key));
|
||||
}
|
||||
|
||||
obj.css("-"+vendor+"-animation-name","");
|
||||
cb_complete.call(that);
|
||||
}
|
||||
|
||||
});
|
||||
obj.css(css_param).bind(''+vendor+'AnimationIteration animationiteration',function(){
|
||||
|
||||
if(typeof cb_iteration === "function"){
|
||||
cb_iteration.call(that);
|
||||
}
|
||||
|
||||
//タイムアウト呼び起こし
|
||||
var tanim = $.data(that,"ext_array");
|
||||
|
||||
if(tanim.length>0){
|
||||
for(var i=0;i<tanim.length;i++){
|
||||
|
||||
tanim[i]();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
obj.css(css_param).one(''+vendor+'AnimationStart animationstart',function(){
|
||||
if(typeof cb_start === "function"){
|
||||
cb_start.call(that);
|
||||
}
|
||||
|
||||
//タイムアウト呼び起こし
|
||||
var tanim = $.data(that,"ext_array");
|
||||
|
||||
if(tanim.length>0){
|
||||
for(var i=0;i<tanim.length;i++){
|
||||
|
||||
tanim[i]();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
//アニメーション開始
|
||||
$.fn.a3dstate=function(str_stat){
|
||||
|
||||
return this.each(function(i){
|
||||
|
||||
$(this).css("-"+vendor+"-animation-play-state",str_stat);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
//アニメーション開始
|
||||
$.fn.a3dInfo=function(){
|
||||
|
||||
var result_array = [];
|
||||
|
||||
this.each(function(i){
|
||||
|
||||
var last_frame_text = $.data(this,"last_frame_text") || "";
|
||||
var last_style_text = $.data(this,"last_style_text") || "";
|
||||
|
||||
var last_mod_frames = $.data(this,"last_mod_frames") || {};
|
||||
var last_mod_styles = $.data(this,"last_mod_styles") || {};
|
||||
|
||||
var point = $.data(this,"point") || {x:0,y:0,z:0}
|
||||
|
||||
var result = {
|
||||
point : point,
|
||||
frame_text :last_frame_text,
|
||||
style_text :last_style_text,
|
||||
frames:last_mod_frames,
|
||||
styles:last_mod_styles
|
||||
}
|
||||
|
||||
result_array.push(result);
|
||||
|
||||
});
|
||||
|
||||
return result_array;
|
||||
|
||||
|
||||
};
|
||||
|
||||
//アニメーションをつなげる
|
||||
$.fn.a3dChain=function(a3ds,cb){
|
||||
|
||||
var chain_num = a3ds.length;
|
||||
var index = 0;
|
||||
|
||||
var array_a3d = [];
|
||||
|
||||
var target = $(this);
|
||||
|
||||
for(var i=0;i<a3ds.length;i++){
|
||||
|
||||
var a3d = a3ds[i];
|
||||
|
||||
a3d.complete = function(){
|
||||
|
||||
index++;
|
||||
if(array_a3d.length > index){
|
||||
|
||||
target.a3d(array_a3d[index]);
|
||||
target.a3dstate("running")
|
||||
|
||||
}else{
|
||||
|
||||
if(typeof cb =="function"){
|
||||
cb();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//初期状態は強制的に停止状態
|
||||
a3d.config["state"] = "pause";
|
||||
|
||||
array_a3d.push(a3d);
|
||||
|
||||
}
|
||||
|
||||
target.a3d(array_a3d[0]);
|
||||
target.a3dstate("running");
|
||||
|
||||
};
|
||||
|
||||
function trimAll(array_obj) {
|
||||
|
||||
var result = {};
|
||||
|
||||
for(key in array_obj){
|
||||
array_obj[key] = ""+array_obj[key] ;
|
||||
result[key.replace(/^\s+|\s+$/g, "")] = array_obj[key].replace(/^\s+|\s+$/g, "");
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
function convertTrans(array_obj,point,base_point){
|
||||
|
||||
var result = {};
|
||||
|
||||
for(key in array_obj){
|
||||
|
||||
if(key == "x" || key == "y" || key == "z"){
|
||||
|
||||
var tmp = array_obj[key];
|
||||
|
||||
//相対位置指定
|
||||
if(tmp.substring(0,1)=="="){
|
||||
|
||||
var tmp_i = parseInt(tmp.replace("=",""));
|
||||
point[key] = point[key] + tmp_i ;
|
||||
|
||||
}else if(tmp.substring(0,1)=="*"){
|
||||
|
||||
var tmp_i = parseInt(tmp.replace("*",""));
|
||||
point[key] = tmp_i - base_point[key];
|
||||
|
||||
|
||||
}else{
|
||||
//絶対位置指定
|
||||
point[key] = parseInt(tmp) ;
|
||||
}
|
||||
|
||||
delete array_obj[key];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//array_obj["translate3d"] = point["x"]+"px,"+point["y"]+"px,"+point["z"]+"px";
|
||||
array_obj["translate"] = point["x"]+"px,"+point["y"]+"px";
|
||||
|
||||
return array_obj;
|
||||
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
280
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/libs/jquery.a3d.min.js
vendored
Normal file
|
@ -0,0 +1,280 @@
|
|||
/**
|
||||
*
|
||||
* jQuery A3D v1.0 To use CSS3 Keyframe Animation from JavaScript
|
||||
* http://
|
||||
* Copyright 2012, ShikemokuMK
|
||||
|
||||
*Free to use and abuse under the MIT license.
|
||||
*https://twitter.com/shikemokumk
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
var vendor = (/webkit/i).test(navigator.appVersion) ? 'webkit' : (/firefox/i).test(navigator.userAgent) ? 'Moz' : 'opera' in window ? 'O' : '';
|
||||
$.fn.a3d=function(arg){
|
||||
var base_point = null;
|
||||
return this.each(function(i){
|
||||
var that = this;
|
||||
var keyframe = arg.frames;
|
||||
var config = arg.config;
|
||||
var cb_complete = arg.complete;
|
||||
var cb_start = arg.start;
|
||||
var cb_iteration = arg.iteration;
|
||||
var point = {x:0, y:0, z:0};
|
||||
var anim_id = "id_"+Math.floor( Math.random() * 1000000000 );
|
||||
var trans = {};
|
||||
var master_text ="";
|
||||
var defaults={
|
||||
duration:"4s",
|
||||
state:"running",
|
||||
easing:"0.0,0.0,1.0,1.0",
|
||||
count:"1",
|
||||
delay:"0",
|
||||
direction:"",
|
||||
mode:"forwards",
|
||||
maintain:"true"
|
||||
}
|
||||
var options=$.extend(defaults, trimAll(config));
|
||||
var last_frame_text = "";
|
||||
var last_style_text = "";
|
||||
var mod_frames ={};
|
||||
var mod_styles ={};
|
||||
var ext_array = [];
|
||||
base_point = $.data(this,"base_point") || null;
|
||||
if(base_point != null){
|
||||
}else{
|
||||
base_point = $.extend({x:0,y:0,z:0},{x:parseInt($(this).offset().left),y:parseInt($(this).offset().top)});
|
||||
$.data(this,"base_point",base_point);
|
||||
}
|
||||
if(keyframe["0%"]){
|
||||
}else{
|
||||
var last_frame_text = $.data(this,"last_frame_text") || "";
|
||||
var last_style_text = $.data(this,"last_style_text") || "";
|
||||
var last_mod_frames = $.data(this,"last_mod_frames") || {};
|
||||
var last_mod_styles = $.data(this,"last_mod_styles") || {};
|
||||
point = $.data(this,"point") || {x:0,y:0,z:0}
|
||||
var state_text = last_frame_text + "; " + last_style_text;
|
||||
var maintain_state = " 0%{ -"+vendor+"-transform:";
|
||||
maintain_state += state_text+" } ";
|
||||
master_text = maintain_state;
|
||||
mod_frames = last_mod_frames;
|
||||
mod_styles = last_mod_styles;
|
||||
}
|
||||
var mstime = parseInt(options.duration);
|
||||
if(options.duration.indexOf("ms")!=-1){
|
||||
}else if(options.duration.indexOf("s")!=-1){
|
||||
mstime = mstime * 1000
|
||||
}
|
||||
for(percentage in keyframe){
|
||||
var frames = [];
|
||||
var styles = [];
|
||||
keyframe[percentage].trans = keyframe[percentage].trans || {};
|
||||
keyframe[percentage].styles = keyframe[percentage].styles || {};
|
||||
frames = convertTrans(trimAll(keyframe[percentage].trans),point,base_point);
|
||||
styles = trimAll(keyframe[percentage].styles);
|
||||
var head_text = " "+percentage+"{ -"+vendor+"-transform:";
|
||||
var frame_text = "";
|
||||
var style_text = "";
|
||||
mod_styles = $.extend(mod_styles,styles);
|
||||
mod_frames = $.extend(mod_frames,frames);
|
||||
if(options.maintain == "true"){
|
||||
for(key in mod_styles){
|
||||
style_text+=" "+key+":"+mod_styles[key]+";";
|
||||
}
|
||||
for(var key in mod_frames){
|
||||
frame_text+=key+"("+mod_frames[key]+") ";
|
||||
}
|
||||
}else{
|
||||
for(key in styles){
|
||||
style_text+=" "+key+":"+styles[key]+";";
|
||||
}
|
||||
for(var key in frames){
|
||||
frame_text+=key+"("+frames[key]+") ";
|
||||
}
|
||||
}
|
||||
master_text += head_text + frame_text+ "; "+style_text+" } ";
|
||||
last_frame_text = frame_text;
|
||||
if (typeof keyframe[percentage].ext == "function"){
|
||||
(function(){
|
||||
var _fnc = keyframe[percentage].ext;
|
||||
var _mstime = mstime*(parseInt(percentage));
|
||||
var tfnc = function(){
|
||||
setTimeout(function(){_fnc.call(that);},_mstime*0.01);
|
||||
};
|
||||
ext_array.push(tfnc);
|
||||
})();
|
||||
}
|
||||
}
|
||||
if(ext_array.length>0){
|
||||
if(typeof cb_start !== "function"){
|
||||
cb_start = function(){};
|
||||
}
|
||||
if(typeof cb_iteration !== "function"){
|
||||
cb_iteration = function(){};
|
||||
}
|
||||
}
|
||||
$.data(this,"ext_array",ext_array);
|
||||
for(key in mod_styles){
|
||||
last_style_text += " "+key+":"+mod_styles[key]+";"
|
||||
}
|
||||
var last_text = last_frame_text + "; " + last_style_text;
|
||||
var lastSheet = document.styleSheets[document.styleSheets.length - 1];
|
||||
lastSheet.insertRule("@-"+vendor+"-keyframes " + anim_id + " {"+master_text+"} ", lastSheet.cssRules.length);
|
||||
var obj = $(this);
|
||||
obj.a3d_name = anim_id;
|
||||
var original_css_param={
|
||||
"-animation-name":obj.a3d_name,
|
||||
"-animation-duration":defaults.duration,
|
||||
"-animation-play-state":defaults.state,
|
||||
"-animation-delay":defaults.delay,
|
||||
"-animation-iteration-count":defaults.count,
|
||||
"-animation-direction": defaults.direction,
|
||||
"-animation-fill-mode": defaults.mode,
|
||||
"-animation-timing-function":defaults.easing
|
||||
};
|
||||
var css_param = {};
|
||||
for(prefix in original_css_param){
|
||||
css_param["-"+vendor+prefix] = original_css_param[prefix];
|
||||
}
|
||||
obj.css(css_param);
|
||||
$.data(this,"last_frame_text",last_frame_text);
|
||||
$.data(this,"last_style_text",last_style_text);
|
||||
$.data(this,"last_mod_frames",mod_frames);
|
||||
$.data(this,"last_mod_styles",mod_styles);
|
||||
$.data(this,"point",point);
|
||||
if(vendor == "Moz"){
|
||||
obj.css(css_param).one('animationend',function(){
|
||||
if(typeof cb_complete === "function"){
|
||||
cb_complete.call(that);
|
||||
}
|
||||
});
|
||||
obj.css(css_param).bind('animationiteration',function(){
|
||||
if(typeof cb_iteration === "function"){
|
||||
cb_iteration.call(that);
|
||||
}
|
||||
var tanim = $.data(that,"ext_array");
|
||||
if(tanim.length>0){
|
||||
for(var i=0;i<tanim.length;i++){
|
||||
tanim[i]();
|
||||
}
|
||||
}
|
||||
});
|
||||
obj.css(css_param).one('animationstart',function(){
|
||||
if(typeof cb_start === "function"){
|
||||
cb_start.call(that);
|
||||
}
|
||||
var tanim = $.data(that,"ext_array");
|
||||
if(tanim.length>0){
|
||||
for(var i=0;i<tanim.length;i++){
|
||||
tanim[i]();
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
obj.css(css_param).one(''+vendor+'AnimationEnd',function(){
|
||||
if(typeof cb_complete === "function"){
|
||||
cb_complete.call(that);
|
||||
}
|
||||
});
|
||||
obj.css(css_param).bind(''+vendor+'AnimationIteration',function(){
|
||||
if(typeof cb_iteration === "function"){
|
||||
cb_iteration.call(that);
|
||||
}
|
||||
var tanim = $.data(that,"ext_array");
|
||||
if(tanim.length>0){
|
||||
for(var i=0;i<tanim.length;i++){
|
||||
tanim[i]();
|
||||
}
|
||||
}
|
||||
});
|
||||
obj.css(css_param).one(''+vendor+'AnimationStart',function(){
|
||||
if(typeof cb_start === "function"){
|
||||
cb_start.call(that);
|
||||
}
|
||||
var tanim = $.data(that,"ext_array");
|
||||
if(tanim.length>0){
|
||||
for(var i=0;i<tanim.length;i++){
|
||||
tanim[i]();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
$.fn.a3dstate=function(str_stat){
|
||||
return this.each(function(i){
|
||||
$(this).css("-"+vendor+"-animation-play-state",str_stat);
|
||||
});
|
||||
};
|
||||
$.fn.a3dInfo=function(){
|
||||
var result_array = [];
|
||||
this.each(function(i){
|
||||
var last_frame_text = $.data(this,"last_frame_text") || "";
|
||||
var last_style_text = $.data(this,"last_style_text") || "";
|
||||
var last_mod_frames = $.data(this,"last_mod_frames") || {};
|
||||
var last_mod_styles = $.data(this,"last_mod_styles") || {};
|
||||
var point = $.data(this,"point") || {x:0,y:0,z:0}
|
||||
var result = {
|
||||
point : point,
|
||||
frame_text :last_frame_text,
|
||||
style_text :last_style_text,
|
||||
frames:last_mod_frames,
|
||||
styles:last_mod_styles
|
||||
}
|
||||
result_array.push(result);
|
||||
});
|
||||
return result_array;
|
||||
};
|
||||
$.fn.a3dChain=function(a3ds,cb){
|
||||
var chain_num = a3ds.length;
|
||||
var index = 0;
|
||||
var array_a3d = [];
|
||||
var target = $(this);
|
||||
for(var i=0;i<a3ds.length;i++){
|
||||
var a3d = a3ds[i];
|
||||
a3d.complete = function(){
|
||||
index++;
|
||||
if(array_a3d.length > index){
|
||||
target.a3d(array_a3d[index]);
|
||||
target.a3dstate("running")
|
||||
}else{
|
||||
if(typeof cb =="function"){
|
||||
cb();
|
||||
}
|
||||
}
|
||||
};
|
||||
a3d.config["state"] = "pause";
|
||||
array_a3d.push(a3d);
|
||||
}
|
||||
target.a3d(array_a3d[0]);
|
||||
target.a3dstate("running");
|
||||
};
|
||||
function trimAll(array_obj) {
|
||||
var result = {};
|
||||
for(key in array_obj){
|
||||
array_obj[key] = ""+array_obj[key] ;
|
||||
result[key.replace(/^\s+|\s+$/g, "")] = array_obj[key].replace(/^\s+|\s+$/g, "");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function convertTrans(array_obj,point,base_point){
|
||||
var result = {};
|
||||
for(key in array_obj){
|
||||
if(key == "x" || key == "y" || key == "z"){
|
||||
var tmp = array_obj[key];
|
||||
if(tmp.substring(0,1)=="="){
|
||||
var tmp_i = parseInt(tmp.replace("=",""));
|
||||
point[key] = point[key] + tmp_i ;
|
||||
}else if(tmp.substring(0,1)=="*"){
|
||||
var tmp_i = parseInt(tmp.replace("*",""));
|
||||
point[key] = tmp_i - base_point[key];
|
||||
}else{
|
||||
var tmp_i = parseInt(tmp);
|
||||
point[key] = point[key] + tmp_i ;
|
||||
}
|
||||
delete array_obj[key];
|
||||
}
|
||||
}
|
||||
array_obj["translate3d"] = point["x"]+"px,"+point["y"]+"px,"+point["z"]+"px";
|
||||
return array_obj;
|
||||
}
|
||||
})(jQuery);
|
14
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/libs/jquery.touchSwipe.min.js
vendored
Normal file
3
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/libs/jsrender.min.js
vendored
Normal file
1
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/libs/lz-string.min.js
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
var LZString=function(){function o(o,r){if(!t[o]){t[o]={};for(var n=0;n<o.length;n++)t[o][o.charAt(n)]=n}return t[o][r]}var r=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",t={},i={compressToBase64:function(o){if(null==o)return"";var r=i._compress(o,6,function(o){return n.charAt(o)});switch(r.length%4){default:case 0:return r;case 1:return r+"===";case 2:return r+"==";case 3:return r+"="}},decompressFromBase64:function(r){return null==r?"":""==r?null:i._decompress(r.length,32,function(e){return o(n,r.charAt(e))})},compressToUTF16:function(o){return null==o?"":i._compress(o,15,function(o){return r(o+32)})+" "},decompressFromUTF16:function(o){return null==o?"":""==o?null:i._decompress(o.length,16384,function(r){return o.charCodeAt(r)-32})},compressToUint8Array:function(o){for(var r=i.compress(o),n=new Uint8Array(2*r.length),e=0,t=r.length;t>e;e++){var s=r.charCodeAt(e);n[2*e]=s>>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null===o||void 0===o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;t>e;e++)n[e]=256*o[2*e]+o[2*e+1];var s=[];return n.forEach(function(o){s.push(r(o))}),i.decompress(s.join(""))},compressToEncodedURIComponent:function(o){return null==o?"":i._compress(o,6,function(o){return e.charAt(o)})},decompressFromEncodedURIComponent:function(r){return null==r?"":""==r?null:(r=r.replace(/ /g,"+"),i._decompress(r.length,32,function(n){return o(e,r.charAt(n))}))},compress:function(o){return i._compress(o,16,function(o){return r(o)})},_compress:function(o,r,n){if(null==o)return"";var e,t,i,s={},p={},u="",c="",a="",l=2,f=3,h=2,d=[],m=0,v=0;for(i=0;i<o.length;i+=1)if(u=o.charAt(i),Object.prototype.hasOwnProperty.call(s,u)||(s[u]=f++,p[u]=!0),c=a+u,Object.prototype.hasOwnProperty.call(s,c))a=c;else{if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++),s[c]=f++,a=String(u)}if(""!==a){if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==r-1){d.push(n(m));break}v++}return d.join("")},decompress:function(o){return null==o?"":""==o?null:i._decompress(o.length,32768,function(r){return o.charCodeAt(r)})},_decompress:function(o,n,e){var t,i,s,p,u,c,a,l,f=[],h=4,d=4,m=3,v="",w=[],A={val:e(0),position:n,index:1};for(i=0;3>i;i+=1)f[i]=i;for(p=0,c=Math.pow(2,2),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(t=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 2:return""}for(f[3]=l,s=l,w.push(l);;){if(A.index>o)return"";for(p=0,c=Math.pow(2,m),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(l=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 2:return w.join("")}if(0==h&&(h=Math.pow(2,m),m++),f[l])v=f[l];else{if(l!==d)return null;v=s+s.charAt(0)}w.push(v),f[d++]=s+v.charAt(0),h--,s=v,0==h&&(h=Math.pow(2,m),m++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module&&(module.exports=LZString);
|
|
@ -0,0 +1,323 @@
|
|||
/*
|
||||
* Remodal - v1.1.1
|
||||
* Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
|
||||
* http://vodkabears.github.io/remodal/
|
||||
*
|
||||
* Made by Ilya Makarov
|
||||
* Under MIT License
|
||||
*/
|
||||
|
||||
/* ==========================================================================
|
||||
Remodal's default mobile first theme
|
||||
========================================================================== */
|
||||
|
||||
/* Default theme styles for the background */
|
||||
|
||||
.remodal-bg.remodal-is-opening,
|
||||
.remodal-bg.remodal-is-opened {
|
||||
-webkit-filter: blur(3px);
|
||||
filter: blur(3px);
|
||||
}
|
||||
|
||||
/* Default theme styles of the overlay */
|
||||
|
||||
.remodal-overlay {
|
||||
background: rgba(43, 46, 56, 0.9);
|
||||
}
|
||||
|
||||
.remodal-overlay.remodal-is-opening,
|
||||
.remodal-overlay.remodal-is-closing {
|
||||
-webkit-animation-duration: 0.3s;
|
||||
animation-duration: 0.3s;
|
||||
-webkit-animation-fill-mode: forwards;
|
||||
animation-fill-mode: forwards;
|
||||
}
|
||||
|
||||
.remodal-overlay.remodal-is-opening {
|
||||
-webkit-animation-name: remodal-overlay-opening-keyframes;
|
||||
animation-name: remodal-overlay-opening-keyframes;
|
||||
}
|
||||
|
||||
.remodal-overlay.remodal-is-closing {
|
||||
-webkit-animation-name: remodal-overlay-closing-keyframes;
|
||||
animation-name: remodal-overlay-closing-keyframes;
|
||||
}
|
||||
|
||||
/* Default theme styles of the wrapper */
|
||||
|
||||
.remodal-wrapper {
|
||||
padding: 10px 10px 0;
|
||||
}
|
||||
|
||||
/* Default theme styles of the modal dialog */
|
||||
|
||||
.remodal {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
padding: 35px;
|
||||
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
transform: translate3d(0, 0, 0);
|
||||
|
||||
color: #2b2e38;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.remodal.remodal-is-opening,
|
||||
.remodal.remodal-is-closing {
|
||||
-webkit-animation-duration: 0.3s;
|
||||
animation-duration: 0.3s;
|
||||
-webkit-animation-fill-mode: forwards;
|
||||
animation-fill-mode: forwards;
|
||||
}
|
||||
|
||||
.remodal.remodal-is-opening {
|
||||
-webkit-animation-name: remodal-opening-keyframes;
|
||||
animation-name: remodal-opening-keyframes;
|
||||
}
|
||||
|
||||
.remodal.remodal-is-closing {
|
||||
-webkit-animation-name: remodal-closing-keyframes;
|
||||
animation-name: remodal-closing-keyframes;
|
||||
}
|
||||
|
||||
/* Vertical align of the modal dialog */
|
||||
|
||||
.remodal,
|
||||
.remodal-wrapper:after {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Close button */
|
||||
|
||||
.remodal-close {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
display: block;
|
||||
overflow: visible;
|
||||
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
cursor: pointer;
|
||||
-webkit-transition: color 0.2s;
|
||||
transition: color 0.2s;
|
||||
text-decoration: none;
|
||||
|
||||
color: #95979c;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.remodal-close:hover,
|
||||
.remodal-close:focus {
|
||||
color: #2b2e38;
|
||||
}
|
||||
|
||||
.remodal-close:before {
|
||||
font-family: Arial, "Helvetica CY", "Nimbus Sans L", sans-serif !important;
|
||||
font-size: 25px;
|
||||
line-height: 35px;
|
||||
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
display: block;
|
||||
|
||||
width: 35px;
|
||||
|
||||
content: "\00d7";
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Dialog buttons */
|
||||
|
||||
.remodal-confirm,
|
||||
.remodal-cancel {
|
||||
font: inherit;
|
||||
|
||||
display: inline-block;
|
||||
overflow: visible;
|
||||
|
||||
min-width: 110px;
|
||||
margin: 0;
|
||||
padding: 12px 0;
|
||||
|
||||
cursor: pointer;
|
||||
-webkit-transition: background 0.2s;
|
||||
transition: background 0.2s;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
text-decoration: none;
|
||||
|
||||
border: 0;
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.remodal-confirm {
|
||||
color: #fff;
|
||||
background: #81c784;
|
||||
}
|
||||
|
||||
.remodal-confirm:hover,
|
||||
.remodal-confirm:focus {
|
||||
background: #66bb6a;
|
||||
}
|
||||
|
||||
.remodal-cancel {
|
||||
color: #fff;
|
||||
background: #e57373;
|
||||
}
|
||||
|
||||
.remodal-cancel:hover,
|
||||
.remodal-cancel:focus {
|
||||
background: #ef5350;
|
||||
}
|
||||
|
||||
/* Remove inner padding and border in Firefox 4+ for the button tag. */
|
||||
|
||||
.remodal-confirm::-moz-focus-inner,
|
||||
.remodal-cancel::-moz-focus-inner,
|
||||
.remodal-close::-moz-focus-inner {
|
||||
padding: 0;
|
||||
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* Keyframes
|
||||
========================================================================== */
|
||||
|
||||
@-webkit-keyframes remodal-opening-keyframes {
|
||||
from {
|
||||
-webkit-transform: scale(1.05);
|
||||
transform: scale(1.05);
|
||||
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
-webkit-transform: none;
|
||||
transform: none;
|
||||
|
||||
opacity: 1;
|
||||
|
||||
-webkit-filter: blur(0);
|
||||
filter: blur(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes remodal-opening-keyframes {
|
||||
from {
|
||||
-webkit-transform: scale(1.05);
|
||||
transform: scale(1.05);
|
||||
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
-webkit-transform: none;
|
||||
transform: none;
|
||||
|
||||
opacity: 1;
|
||||
|
||||
-webkit-filter: blur(0);
|
||||
filter: blur(0);
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes remodal-closing-keyframes {
|
||||
from {
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1);
|
||||
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
-webkit-transform: scale(0.95);
|
||||
transform: scale(0.95);
|
||||
|
||||
opacity: 0;
|
||||
|
||||
-webkit-filter: blur(0);
|
||||
filter: blur(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes remodal-closing-keyframes {
|
||||
from {
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1);
|
||||
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
-webkit-transform: scale(0.95);
|
||||
transform: scale(0.95);
|
||||
|
||||
opacity: 0;
|
||||
|
||||
-webkit-filter: blur(0);
|
||||
filter: blur(0);
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes remodal-overlay-opening-keyframes {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes remodal-overlay-opening-keyframes {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes remodal-overlay-closing-keyframes {
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes remodal-overlay-closing-keyframes {
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Media queries
|
||||
========================================================================== */
|
||||
|
||||
@media only screen and (min-width: 641px) {
|
||||
.remodal {
|
||||
max-width: 700px;
|
||||
}
|
||||
}
|
||||
|
||||
/* IE8
|
||||
========================================================================== */
|
||||
|
||||
.lt-ie9 .remodal-overlay {
|
||||
background: #2b2e38;
|
||||
}
|
||||
|
||||
.lt-ie9 .remodal {
|
||||
width: 700px;
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
/*
|
||||
* Remodal - v1.1.1
|
||||
* Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
|
||||
* http://vodkabears.github.io/remodal/
|
||||
*
|
||||
* Made by Ilya Makarov
|
||||
* Under MIT License
|
||||
*/
|
||||
|
||||
/* ==========================================================================
|
||||
Remodal's necessary styles
|
||||
========================================================================== */
|
||||
|
||||
/* Hide scroll bar */
|
||||
|
||||
html.remodal-is-locked {
|
||||
overflow: hidden;
|
||||
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
/* Anti FOUC */
|
||||
|
||||
.remodal,
|
||||
[data-remodal-id] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Necessary styles of the overlay */
|
||||
|
||||
.remodal-overlay {
|
||||
position: fixed;
|
||||
z-index: 9999999;
|
||||
top: -5000px;
|
||||
right: -5000px;
|
||||
bottom: -5000px;
|
||||
left: -5000px;
|
||||
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Necessary styles of the wrapper */
|
||||
|
||||
.remodal-wrapper {
|
||||
position: fixed;
|
||||
z-index: 100000000;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
||||
display: none;
|
||||
overflow: auto;
|
||||
|
||||
text-align: center;
|
||||
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.remodal-wrapper:after {
|
||||
display: inline-block;
|
||||
|
||||
height: 100%;
|
||||
margin-left: -0.05em;
|
||||
|
||||
content: "";
|
||||
}
|
||||
|
||||
/* Fix iPad, iPhone glitches */
|
||||
|
||||
.remodal-overlay,
|
||||
.remodal-wrapper {
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
}
|
||||
|
||||
/* Necessary styles of the modal dialog */
|
||||
|
||||
.remodal {
|
||||
position: relative;
|
||||
|
||||
outline: none;
|
||||
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-ms-text-size-adjust: 100%;
|
||||
text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
.remodal-is-initialized {
|
||||
/* Disable Anti-FOUC */
|
||||
display: inline-block;
|
||||
}
|
|
@ -0,0 +1,785 @@
|
|||
/*
|
||||
* Remodal - v1.1.1
|
||||
* Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
|
||||
* http://vodkabears.github.io/remodal/
|
||||
*
|
||||
* Made by Ilya Makarov
|
||||
* Under MIT License
|
||||
*/
|
||||
|
||||
!(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery'], function($) {
|
||||
return factory(root, $);
|
||||
});
|
||||
} else if (typeof exports === 'object') {
|
||||
factory(root, require('jquery'));
|
||||
} else {
|
||||
factory(root, root.jQuery || root.Zepto);
|
||||
}
|
||||
})(this, function(global, $) {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Name of the plugin
|
||||
* @private
|
||||
* @const
|
||||
* @type {String}
|
||||
*/
|
||||
var PLUGIN_NAME = 'remodal';
|
||||
|
||||
/**
|
||||
* Namespace for CSS and events
|
||||
* @private
|
||||
* @const
|
||||
* @type {String}
|
||||
*/
|
||||
var NAMESPACE = global.REMODAL_GLOBALS && global.REMODAL_GLOBALS.NAMESPACE || PLUGIN_NAME;
|
||||
|
||||
/**
|
||||
* Animationstart event with vendor prefixes
|
||||
* @private
|
||||
* @const
|
||||
* @type {String}
|
||||
*/
|
||||
var ANIMATIONSTART_EVENTS = $.map(
|
||||
['animationstart', 'webkitAnimationStart', 'MSAnimationStart', 'oAnimationStart'],
|
||||
|
||||
function(eventName) {
|
||||
return eventName + '.' + NAMESPACE;
|
||||
}
|
||||
|
||||
).join(' ');
|
||||
|
||||
/**
|
||||
* Animationend event with vendor prefixes
|
||||
* @private
|
||||
* @const
|
||||
* @type {String}
|
||||
*/
|
||||
var ANIMATIONEND_EVENTS = $.map(
|
||||
['animationend', 'webkitAnimationEnd', 'MSAnimationEnd', 'oAnimationEnd'],
|
||||
|
||||
function(eventName) {
|
||||
return eventName + '.' + NAMESPACE;
|
||||
}
|
||||
|
||||
).join(' ');
|
||||
|
||||
/**
|
||||
* Default settings
|
||||
* @private
|
||||
* @const
|
||||
* @type {Object}
|
||||
*/
|
||||
var DEFAULTS = $.extend({
|
||||
hashTracking: true,
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true,
|
||||
closeOnEscape: true,
|
||||
closeOnOutsideClick: true,
|
||||
modifier: '',
|
||||
appendTo: null
|
||||
}, global.REMODAL_GLOBALS && global.REMODAL_GLOBALS.DEFAULTS);
|
||||
|
||||
/**
|
||||
* States of the Remodal
|
||||
* @private
|
||||
* @const
|
||||
* @enum {String}
|
||||
*/
|
||||
var STATES = {
|
||||
CLOSING: 'closing',
|
||||
CLOSED: 'closed',
|
||||
OPENING: 'opening',
|
||||
OPENED: 'opened'
|
||||
};
|
||||
|
||||
/**
|
||||
* Reasons of the state change.
|
||||
* @private
|
||||
* @const
|
||||
* @enum {String}
|
||||
*/
|
||||
var STATE_CHANGE_REASONS = {
|
||||
CONFIRMATION: 'confirmation',
|
||||
CANCELLATION: 'cancellation'
|
||||
};
|
||||
|
||||
/**
|
||||
* Is animation supported?
|
||||
* @private
|
||||
* @const
|
||||
* @type {Boolean}
|
||||
*/
|
||||
var IS_ANIMATION = (function() {
|
||||
var style = document.createElement('div').style;
|
||||
|
||||
return style.animationName !== undefined ||
|
||||
style.WebkitAnimationName !== undefined ||
|
||||
style.MozAnimationName !== undefined ||
|
||||
style.msAnimationName !== undefined ||
|
||||
style.OAnimationName !== undefined;
|
||||
})();
|
||||
|
||||
/**
|
||||
* Is iOS?
|
||||
* @private
|
||||
* @const
|
||||
* @type {Boolean}
|
||||
*/
|
||||
var IS_IOS = /iPad|iPhone|iPod/.test(navigator.platform);
|
||||
|
||||
/**
|
||||
* Current modal
|
||||
* @private
|
||||
* @type {Remodal}
|
||||
*/
|
||||
var current;
|
||||
|
||||
/**
|
||||
* Scrollbar position
|
||||
* @private
|
||||
* @type {Number}
|
||||
*/
|
||||
var scrollTop;
|
||||
|
||||
/**
|
||||
* Returns an animation duration
|
||||
* @private
|
||||
* @param {jQuery} $elem
|
||||
* @returns {Number}
|
||||
*/
|
||||
function getAnimationDuration($elem) {
|
||||
if (
|
||||
IS_ANIMATION &&
|
||||
$elem.css('animation-name') === 'none' &&
|
||||
$elem.css('-webkit-animation-name') === 'none' &&
|
||||
$elem.css('-moz-animation-name') === 'none' &&
|
||||
$elem.css('-o-animation-name') === 'none' &&
|
||||
$elem.css('-ms-animation-name') === 'none'
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var duration = $elem.css('animation-duration') ||
|
||||
$elem.css('-webkit-animation-duration') ||
|
||||
$elem.css('-moz-animation-duration') ||
|
||||
$elem.css('-o-animation-duration') ||
|
||||
$elem.css('-ms-animation-duration') ||
|
||||
'0s';
|
||||
|
||||
var delay = $elem.css('animation-delay') ||
|
||||
$elem.css('-webkit-animation-delay') ||
|
||||
$elem.css('-moz-animation-delay') ||
|
||||
$elem.css('-o-animation-delay') ||
|
||||
$elem.css('-ms-animation-delay') ||
|
||||
'0s';
|
||||
|
||||
var iterationCount = $elem.css('animation-iteration-count') ||
|
||||
$elem.css('-webkit-animation-iteration-count') ||
|
||||
$elem.css('-moz-animation-iteration-count') ||
|
||||
$elem.css('-o-animation-iteration-count') ||
|
||||
$elem.css('-ms-animation-iteration-count') ||
|
||||
'1';
|
||||
|
||||
var max;
|
||||
var len;
|
||||
var num;
|
||||
var i;
|
||||
|
||||
duration = duration.split(', ');
|
||||
delay = delay.split(', ');
|
||||
iterationCount = iterationCount.split(', ');
|
||||
|
||||
// The 'duration' size is the same as the 'delay' size
|
||||
for (i = 0, len = duration.length, max = Number.NEGATIVE_INFINITY; i < len; i++) {
|
||||
num = parseFloat(duration[i]) * parseInt(iterationCount[i], 10) + parseFloat(delay[i]);
|
||||
|
||||
if (num > max) {
|
||||
max = num;
|
||||
}
|
||||
}
|
||||
|
||||
return max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a scrollbar width
|
||||
* @private
|
||||
* @returns {Number}
|
||||
*/
|
||||
function getScrollbarWidth() {
|
||||
if ($(document).height() <= $(window).height()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var outer = document.createElement('div');
|
||||
var inner = document.createElement('div');
|
||||
var widthNoScroll;
|
||||
var widthWithScroll;
|
||||
|
||||
outer.style.visibility = 'hidden';
|
||||
outer.style.width = '100px';
|
||||
document.body.appendChild(outer);
|
||||
|
||||
widthNoScroll = outer.offsetWidth;
|
||||
|
||||
// Force scrollbars
|
||||
outer.style.overflow = 'scroll';
|
||||
|
||||
// Add inner div
|
||||
inner.style.width = '100%';
|
||||
outer.appendChild(inner);
|
||||
|
||||
widthWithScroll = inner.offsetWidth;
|
||||
|
||||
// Remove divs
|
||||
outer.parentNode.removeChild(outer);
|
||||
|
||||
return widthNoScroll - widthWithScroll;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locks the screen
|
||||
* @private
|
||||
*/
|
||||
function lockScreen() {
|
||||
if (IS_IOS) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $html = $('html');
|
||||
var lockedClass = namespacify('is-locked');
|
||||
var paddingRight;
|
||||
var $body;
|
||||
|
||||
if (!$html.hasClass(lockedClass)) {
|
||||
$body = $(document.body);
|
||||
|
||||
// Zepto does not support '-=', '+=' in the `css` method
|
||||
paddingRight = parseInt($body.css('padding-right'), 10) + getScrollbarWidth();
|
||||
|
||||
$body.css('padding-right', paddingRight + 'px');
|
||||
$html.addClass(lockedClass);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlocks the screen
|
||||
* @private
|
||||
*/
|
||||
function unlockScreen() {
|
||||
if (IS_IOS) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $html = $('html');
|
||||
var lockedClass = namespacify('is-locked');
|
||||
var paddingRight;
|
||||
var $body;
|
||||
|
||||
if ($html.hasClass(lockedClass)) {
|
||||
$body = $(document.body);
|
||||
|
||||
// Zepto does not support '-=', '+=' in the `css` method
|
||||
paddingRight = parseInt($body.css('padding-right'), 10) - getScrollbarWidth();
|
||||
|
||||
$body.css('padding-right', paddingRight + 'px');
|
||||
$html.removeClass(lockedClass);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a state for an instance
|
||||
* @private
|
||||
* @param {Remodal} instance
|
||||
* @param {STATES} state
|
||||
* @param {Boolean} isSilent If true, Remodal does not trigger events
|
||||
* @param {String} Reason of a state change.
|
||||
*/
|
||||
function setState(instance, state, isSilent, reason) {
|
||||
|
||||
var newState = namespacify('is', state);
|
||||
var allStates = [namespacify('is', STATES.CLOSING),
|
||||
namespacify('is', STATES.OPENING),
|
||||
namespacify('is', STATES.CLOSED),
|
||||
namespacify('is', STATES.OPENED)].join(' ');
|
||||
|
||||
instance.$bg
|
||||
.removeClass(allStates)
|
||||
.addClass(newState);
|
||||
|
||||
instance.$overlay
|
||||
.removeClass(allStates)
|
||||
.addClass(newState);
|
||||
|
||||
instance.$wrapper
|
||||
.removeClass(allStates)
|
||||
.addClass(newState);
|
||||
|
||||
instance.$modal
|
||||
.removeClass(allStates)
|
||||
.addClass(newState);
|
||||
|
||||
instance.state = state;
|
||||
!isSilent && instance.$modal.trigger({
|
||||
type: state,
|
||||
reason: reason
|
||||
}, [{ reason: reason }]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronizes with the animation
|
||||
* @param {Function} doBeforeAnimation
|
||||
* @param {Function} doAfterAnimation
|
||||
* @param {Remodal} instance
|
||||
*/
|
||||
function syncWithAnimation(doBeforeAnimation, doAfterAnimation, instance) {
|
||||
var runningAnimationsCount = 0;
|
||||
|
||||
var handleAnimationStart = function(e) {
|
||||
if (e.target !== this) {
|
||||
return;
|
||||
}
|
||||
|
||||
runningAnimationsCount++;
|
||||
};
|
||||
|
||||
var handleAnimationEnd = function(e) {
|
||||
if (e.target !== this) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (--runningAnimationsCount === 0) {
|
||||
|
||||
// Remove event listeners
|
||||
$.each(['$bg', '$overlay', '$wrapper', '$modal'], function(index, elemName) {
|
||||
instance[elemName].off(ANIMATIONSTART_EVENTS + ' ' + ANIMATIONEND_EVENTS);
|
||||
});
|
||||
|
||||
doAfterAnimation();
|
||||
}
|
||||
};
|
||||
|
||||
$.each(['$bg', '$overlay', '$wrapper', '$modal'], function(index, elemName) {
|
||||
instance[elemName]
|
||||
.on(ANIMATIONSTART_EVENTS, handleAnimationStart)
|
||||
.on(ANIMATIONEND_EVENTS, handleAnimationEnd);
|
||||
});
|
||||
|
||||
doBeforeAnimation();
|
||||
|
||||
// If the animation is not supported by a browser or its duration is 0
|
||||
if (
|
||||
getAnimationDuration(instance.$bg) === 0 &&
|
||||
getAnimationDuration(instance.$overlay) === 0 &&
|
||||
getAnimationDuration(instance.$wrapper) === 0 &&
|
||||
getAnimationDuration(instance.$modal) === 0
|
||||
) {
|
||||
|
||||
// Remove event listeners
|
||||
$.each(['$bg', '$overlay', '$wrapper', '$modal'], function(index, elemName) {
|
||||
instance[elemName].off(ANIMATIONSTART_EVENTS + ' ' + ANIMATIONEND_EVENTS);
|
||||
});
|
||||
|
||||
doAfterAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes immediately
|
||||
* @private
|
||||
* @param {Remodal} instance
|
||||
*/
|
||||
function halt(instance) {
|
||||
if (instance.state === STATES.CLOSED) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.each(['$bg', '$overlay', '$wrapper', '$modal'], function(index, elemName) {
|
||||
instance[elemName].off(ANIMATIONSTART_EVENTS + ' ' + ANIMATIONEND_EVENTS);
|
||||
});
|
||||
|
||||
instance.$bg.removeClass(instance.settings.modifier);
|
||||
instance.$overlay.removeClass(instance.settings.modifier).hide();
|
||||
instance.$wrapper.hide();
|
||||
unlockScreen();
|
||||
setState(instance, STATES.CLOSED, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a string with options
|
||||
* @private
|
||||
* @param str
|
||||
* @returns {Object}
|
||||
*/
|
||||
function parseOptions(str) {
|
||||
var obj = {};
|
||||
var arr;
|
||||
var len;
|
||||
var val;
|
||||
var i;
|
||||
|
||||
// Remove spaces before and after delimiters
|
||||
str = str.replace(/\s*:\s*/g, ':').replace(/\s*,\s*/g, ',');
|
||||
|
||||
// Parse a string
|
||||
arr = str.split(',');
|
||||
for (i = 0, len = arr.length; i < len; i++) {
|
||||
arr[i] = arr[i].split(':');
|
||||
val = arr[i][1];
|
||||
|
||||
// Convert a string value if it is like a boolean
|
||||
if (typeof val === 'string' || val instanceof String) {
|
||||
val = val === 'true' || (val === 'false' ? false : val);
|
||||
}
|
||||
|
||||
// Convert a string value if it is like a number
|
||||
if (typeof val === 'string' || val instanceof String) {
|
||||
val = !isNaN(val) ? +val : val;
|
||||
}
|
||||
|
||||
obj[arr[i][0]] = val;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a string separated by dashes and prefixed with NAMESPACE
|
||||
* @private
|
||||
* @param {...String}
|
||||
* @returns {String}
|
||||
*/
|
||||
function namespacify() {
|
||||
var result = NAMESPACE;
|
||||
|
||||
for (var i = 0; i < arguments.length; ++i) {
|
||||
result += '-' + arguments[i];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the hashchange event
|
||||
* @private
|
||||
* @listens hashchange
|
||||
*/
|
||||
function handleHashChangeEvent() {
|
||||
var id = location.hash.replace('#', '');
|
||||
var instance;
|
||||
var $elem;
|
||||
|
||||
if (!id) {
|
||||
|
||||
// Check if we have currently opened modal and animation was completed
|
||||
if (current && current.state === STATES.OPENED && current.settings.hashTracking) {
|
||||
current.close();
|
||||
}
|
||||
} else {
|
||||
|
||||
// Catch syntax error if your hash is bad
|
||||
try {
|
||||
$elem = $(
|
||||
'[data-' + PLUGIN_NAME + '-id="' + id + '"]'
|
||||
);
|
||||
} catch (err) {}
|
||||
|
||||
if ($elem && $elem.length) {
|
||||
instance = $[PLUGIN_NAME].lookup[$elem.data(PLUGIN_NAME)];
|
||||
|
||||
if (instance && instance.settings.hashTracking) {
|
||||
instance.open();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remodal constructor
|
||||
* @constructor
|
||||
* @param {jQuery} $modal
|
||||
* @param {Object} options
|
||||
*/
|
||||
function Remodal($modal, options) {
|
||||
var $body = $(document.body);
|
||||
var $appendTo = $body;
|
||||
var remodal = this;
|
||||
|
||||
remodal.settings = $.extend({}, DEFAULTS, options);
|
||||
remodal.index = $[PLUGIN_NAME].lookup.push(remodal) - 1;
|
||||
remodal.state = STATES.CLOSED;
|
||||
|
||||
remodal.$overlay = $('.' + namespacify('overlay'));
|
||||
|
||||
if (remodal.settings.appendTo !== null && remodal.settings.appendTo.length) {
|
||||
$appendTo = $(remodal.settings.appendTo);
|
||||
}
|
||||
|
||||
if (!remodal.$overlay.length) {
|
||||
remodal.$overlay = $('<div>').addClass(namespacify('overlay') + ' ' + namespacify('is', STATES.CLOSED)).hide();
|
||||
$appendTo.append(remodal.$overlay);
|
||||
}
|
||||
|
||||
remodal.$bg = $('.' + namespacify('bg')).addClass(namespacify('is', STATES.CLOSED));
|
||||
|
||||
remodal.$modal = $modal
|
||||
.addClass(
|
||||
NAMESPACE + ' ' +
|
||||
namespacify('is-initialized') + ' ' +
|
||||
remodal.settings.modifier + ' ' +
|
||||
namespacify('is', STATES.CLOSED))
|
||||
.attr('tabindex', '-1');
|
||||
|
||||
remodal.$wrapper = $('<div>')
|
||||
.addClass(
|
||||
namespacify('wrapper') + ' ' +
|
||||
remodal.settings.modifier + ' ' +
|
||||
namespacify('is', STATES.CLOSED))
|
||||
.hide()
|
||||
.append(remodal.$modal);
|
||||
$appendTo.append(remodal.$wrapper);
|
||||
|
||||
// Add the event listener for the close button
|
||||
remodal.$wrapper.on('touchstart click.' + NAMESPACE, '[data-' + PLUGIN_NAME + '-action="close"]', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
remodal.close();
|
||||
});
|
||||
|
||||
// Add the event listener for the cancel button
|
||||
remodal.$wrapper.on('touchstart click.' + NAMESPACE, '[data-' + PLUGIN_NAME + '-action="cancel"]', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
remodal.$modal.trigger(STATE_CHANGE_REASONS.CANCELLATION);
|
||||
|
||||
if (remodal.settings.closeOnCancel) {
|
||||
remodal.close(STATE_CHANGE_REASONS.CANCELLATION);
|
||||
}
|
||||
});
|
||||
|
||||
// Add the event listener for the confirm button
|
||||
remodal.$wrapper.on('touchstart click.' + NAMESPACE, '[data-' + PLUGIN_NAME + '-action="confirm"]', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
remodal.$modal.trigger(STATE_CHANGE_REASONS.CONFIRMATION);
|
||||
|
||||
if (remodal.settings.closeOnConfirm) {
|
||||
remodal.close(STATE_CHANGE_REASONS.CONFIRMATION);
|
||||
}
|
||||
});
|
||||
|
||||
// Add the event listener for the overlay
|
||||
remodal.$wrapper.on('touchstart click.' + NAMESPACE, function(e) {
|
||||
var $target = $(e.target);
|
||||
|
||||
if (!$target.hasClass(namespacify('wrapper'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (remodal.settings.closeOnOutsideClick) {
|
||||
remodal.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a modal window
|
||||
* @public
|
||||
*/
|
||||
Remodal.prototype.open = function() {
|
||||
var remodal = this;
|
||||
var id;
|
||||
|
||||
// Check if the animation was completed
|
||||
if (remodal.state === STATES.OPENING || remodal.state === STATES.CLOSING) {
|
||||
return;
|
||||
}
|
||||
|
||||
id = remodal.$modal.attr('data-' + PLUGIN_NAME + '-id');
|
||||
|
||||
if (id && remodal.settings.hashTracking) {
|
||||
scrollTop = $(window).scrollTop();
|
||||
location.hash = id;
|
||||
}
|
||||
|
||||
if (current && current !== remodal) {
|
||||
halt(current);
|
||||
}
|
||||
|
||||
current = remodal;
|
||||
lockScreen();
|
||||
remodal.$bg.addClass(remodal.settings.modifier);
|
||||
remodal.$overlay.addClass(remodal.settings.modifier).show();
|
||||
remodal.$wrapper.show().scrollTop(0);
|
||||
remodal.$modal.focus();
|
||||
|
||||
syncWithAnimation(
|
||||
function() {
|
||||
setState(remodal, STATES.OPENING);
|
||||
},
|
||||
|
||||
function() {
|
||||
setState(remodal, STATES.OPENED);
|
||||
},
|
||||
|
||||
remodal);
|
||||
};
|
||||
|
||||
/**
|
||||
* Closes a modal window
|
||||
* @public
|
||||
* @param {String} reason
|
||||
*/
|
||||
Remodal.prototype.close = function(reason) {
|
||||
var remodal = this;
|
||||
|
||||
// Check if the animation was completed
|
||||
if (remodal.state === STATES.OPENING || remodal.state === STATES.CLOSING || remodal.state === STATES.CLOSED) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
remodal.settings.hashTracking &&
|
||||
remodal.$modal.attr('data-' + PLUGIN_NAME + '-id') === location.hash.substr(1)
|
||||
) {
|
||||
location.hash = '';
|
||||
$(window).scrollTop(scrollTop);
|
||||
}
|
||||
|
||||
syncWithAnimation(
|
||||
function() {
|
||||
setState(remodal, STATES.CLOSING, false, reason);
|
||||
},
|
||||
|
||||
function() {
|
||||
remodal.$bg.removeClass(remodal.settings.modifier);
|
||||
remodal.$overlay.removeClass(remodal.settings.modifier).hide();
|
||||
remodal.$wrapper.hide();
|
||||
unlockScreen();
|
||||
|
||||
setState(remodal, STATES.CLOSED, false, reason);
|
||||
},
|
||||
|
||||
remodal);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a current state of a modal
|
||||
* @public
|
||||
* @returns {STATES}
|
||||
*/
|
||||
Remodal.prototype.getState = function() {
|
||||
return this.state;
|
||||
};
|
||||
|
||||
/**
|
||||
* Destroys a modal
|
||||
* @public
|
||||
*/
|
||||
Remodal.prototype.destroy = function() {
|
||||
var lookup = $[PLUGIN_NAME].lookup;
|
||||
var instanceCount;
|
||||
|
||||
halt(this);
|
||||
this.$wrapper.remove();
|
||||
|
||||
delete lookup[this.index];
|
||||
instanceCount = $.grep(lookup, function(instance) {
|
||||
return !!instance;
|
||||
}).length;
|
||||
|
||||
if (instanceCount === 0) {
|
||||
this.$overlay.remove();
|
||||
this.$bg.removeClass(
|
||||
namespacify('is', STATES.CLOSING) + ' ' +
|
||||
namespacify('is', STATES.OPENING) + ' ' +
|
||||
namespacify('is', STATES.CLOSED) + ' ' +
|
||||
namespacify('is', STATES.OPENED));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Special plugin object for instances
|
||||
* @public
|
||||
* @type {Object}
|
||||
*/
|
||||
$[PLUGIN_NAME] = {
|
||||
lookup: []
|
||||
};
|
||||
|
||||
/**
|
||||
* Plugin constructor
|
||||
* @constructor
|
||||
* @param {Object} options
|
||||
* @returns {JQuery}
|
||||
*/
|
||||
$.fn[PLUGIN_NAME] = function(opts) {
|
||||
var instance;
|
||||
var $elem;
|
||||
|
||||
this.each(function(index, elem) {
|
||||
$elem = $(elem);
|
||||
|
||||
if ($elem.data(PLUGIN_NAME) == null) {
|
||||
instance = new Remodal($elem, opts);
|
||||
$elem.data(PLUGIN_NAME, instance.index);
|
||||
|
||||
if (
|
||||
instance.settings.hashTracking &&
|
||||
$elem.attr('data-' + PLUGIN_NAME + '-id') === location.hash.substr(1)
|
||||
) {
|
||||
instance.open();
|
||||
}
|
||||
} else {
|
||||
instance = $[PLUGIN_NAME].lookup[$elem.data(PLUGIN_NAME)];
|
||||
}
|
||||
});
|
||||
|
||||
return instance;
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
// data-remodal-target opens a modal window with the special Id
|
||||
$(document).on('touchstart click', '[data-' + PLUGIN_NAME + '-target]', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var elem = e.currentTarget;
|
||||
var id = elem.getAttribute('data-' + PLUGIN_NAME + '-target');
|
||||
var $target = $('[data-' + PLUGIN_NAME + '-id="' + id + '"]');
|
||||
|
||||
$[PLUGIN_NAME].lookup[$target.data(PLUGIN_NAME)].open();
|
||||
});
|
||||
|
||||
// Auto initialization of modal windows
|
||||
// They should have the 'remodal' class attribute
|
||||
// Also you can write the `data-remodal-options` attribute to pass params into the modal
|
||||
$(document).find('.' + NAMESPACE).each(function(i, container) {
|
||||
var $container = $(container);
|
||||
var options = $container.data(PLUGIN_NAME + '-options');
|
||||
|
||||
if (!options) {
|
||||
options = {};
|
||||
} else if (typeof options === 'string' || options instanceof String) {
|
||||
options = parseOptions(options);
|
||||
}
|
||||
|
||||
$container[PLUGIN_NAME](options);
|
||||
});
|
||||
|
||||
// Handles the keydown event
|
||||
$(document).on('keydown.' + NAMESPACE, function(e) {
|
||||
if (current && current.settings.closeOnEscape && current.state === STATES.OPENED && e.keyCode === 27) {
|
||||
current.close();
|
||||
}
|
||||
});
|
||||
|
||||
// Handles the hashchange event
|
||||
$(window).on('hashchange.' + NAMESPACE, handleHashChangeEvent);
|
||||
});
|
||||
});
|
3263
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/libs/textillate/assets/animate.css
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*global jQuery */
|
||||
/*!
|
||||
* FitText.js 1.1
|
||||
*
|
||||
* Copyright 2011, Dave Rupert http://daverupert.com
|
||||
* Released under the WTFPL license
|
||||
* http://sam.zoy.org/wtfpl/
|
||||
*
|
||||
* Date: Thu May 05 14:23:00 2011 -0600
|
||||
*/
|
||||
|
||||
(function( $ ){
|
||||
|
||||
$.fn.fitText = function( kompressor, options ) {
|
||||
|
||||
// Setup options
|
||||
var compressor = kompressor || 1,
|
||||
settings = $.extend({
|
||||
'minFontSize' : Number.NEGATIVE_INFINITY,
|
||||
'maxFontSize' : Number.POSITIVE_INFINITY
|
||||
}, options);
|
||||
|
||||
return this.each(function(){
|
||||
|
||||
// Store the object
|
||||
var $this = $(this);
|
||||
|
||||
// Resizer() resizes items based on the object width divided by the compressor * 10
|
||||
var resizer = function () {
|
||||
$this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize)));
|
||||
};
|
||||
|
||||
// Call once to set.
|
||||
resizer();
|
||||
|
||||
// Call on resize. Opera debounces their resize by default.
|
||||
$(window).on('resize', resizer);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
})( jQuery );
|
|
@ -0,0 +1,66 @@
|
|||
/*global jQuery */
|
||||
/*!
|
||||
* Lettering.JS 0.6.1
|
||||
*
|
||||
* Copyright 2010, Dave Rupert http://daverupert.com
|
||||
* Released under the WTFPL license
|
||||
* http://sam.zoy.org/wtfpl/
|
||||
*
|
||||
* Thanks to Paul Irish - http://paulirish.com - for the feedback.
|
||||
*
|
||||
* Date: Mon Sep 20 17:14:00 2010 -0600
|
||||
*/
|
||||
(function($){
|
||||
function injector(t, splitter, klass, after) {
|
||||
var a = t.text().split(splitter), inject = '';
|
||||
if (a.length) {
|
||||
$(a).each(function(i, item) {
|
||||
inject += '<span class="'+klass+(i+1)+'">'+item+'</span>'+after;
|
||||
});
|
||||
t.empty().append(inject);
|
||||
}
|
||||
}
|
||||
|
||||
var methods = {
|
||||
init : function() {
|
||||
|
||||
return this.each(function() {
|
||||
injector($(this), '', 'char', '');
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
words : function() {
|
||||
|
||||
return this.each(function() {
|
||||
injector($(this), ' ', 'word', ' ');
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
lines : function() {
|
||||
|
||||
return this.each(function() {
|
||||
var r = "eefec303079ad17405c889e092e105b0";
|
||||
// Because it's hard to split a <br/> tag consistently across browsers,
|
||||
// (*ahem* IE *ahem*), we replaces all <br/> instances with an md5 hash
|
||||
// (of the word "split"). If you're trying to use this plugin on that
|
||||
// md5 hash string, it will fail because you're being ridiculous.
|
||||
injector($(this).children("br").replaceWith(r).end(), r, 'line', '');
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.lettering = function( method ) {
|
||||
// Method calling logic
|
||||
if ( method && methods[method] ) {
|
||||
return methods[ method ].apply( this, [].slice.call( arguments, 1 ));
|
||||
} else if ( method === 'letters' || ! method ) {
|
||||
return methods.init.apply( this, [].slice.call( arguments, 0 ) ); // always pass an array
|
||||
}
|
||||
$.error( 'Method ' + method + ' does not exist on jQuery.lettering' );
|
||||
return this;
|
||||
};
|
||||
|
||||
})(jQuery);
|
|
@ -0,0 +1,398 @@
|
|||
* {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: #282828;
|
||||
color: #eee;
|
||||
font-family: 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin: 10px 0;
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.8em;
|
||||
font-weight: 200;
|
||||
color: #888;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
section {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #00aaee;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #0077a2;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.decal {
|
||||
height: 2px;
|
||||
background-color: #000;
|
||||
border-bottom: 1px solid #333;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 940px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
/* EFFECTS
|
||||
***************/
|
||||
|
||||
.glow {
|
||||
text-shadow: 0 0 0 rgba(0, 0, 0, 0);
|
||||
-webkit-transition: text-shadow 1s linear;
|
||||
-moz-transition: text-shadow 1s linear;
|
||||
-o-transition: text-shadow 1s linear;
|
||||
transition: text-shadow 1s linear;
|
||||
}
|
||||
|
||||
.glow.in {
|
||||
text-shadow:
|
||||
0.025em 0.025em 0.025em rgba(0, 0, 0, 0.8),
|
||||
0 0 0.5em rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.fade {
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 1s linear;
|
||||
-moz-transition: opacity 1s linear;
|
||||
-o-transition: opacity 1s linear;
|
||||
transition: opacity 1s linear;
|
||||
}
|
||||
|
||||
.fade.in {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* BUTTONS
|
||||
***************/
|
||||
|
||||
.btn {
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
font-weight: 200;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
border-radius: 0.5em;
|
||||
padding: 0.8em 1.2em;
|
||||
background-color: #ED303C;
|
||||
background-image: -moz-linear-gradient(top, #ED303C, #8D121A);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ED303C), to(#8D121A));
|
||||
background-image: -webkit-linear-gradient(top, #ED303C, #8D121A);
|
||||
background-image: -o-linear-gradient(top, #ED303C, #8D121A);
|
||||
background-image: linear-gradient(to bottom, #ED303C, #8D121A);
|
||||
background-repeat: repeat-x;
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25);
|
||||
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25);
|
||||
box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25);
|
||||
}
|
||||
|
||||
.btn:hover,
|
||||
.btn-primary:active,
|
||||
.btn-primary.active,
|
||||
.btn-primary.disabled,
|
||||
.btn-primary[disabled] {
|
||||
text-decoration: none;
|
||||
color: #ddd;
|
||||
background-color: #8D121A;
|
||||
background-position: 0 -15px;
|
||||
-webkit-transition: background-position 0.1s linear;
|
||||
-moz-transition: background-position 0.1s linear;
|
||||
-o-transition: background-position 0.1s linear;
|
||||
transition: background-position 0.1s linear;
|
||||
}
|
||||
|
||||
.btn.active,
|
||||
.btn:active {
|
||||
background-image: none;
|
||||
outline: 0;
|
||||
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
/* MARKETING
|
||||
***************/
|
||||
|
||||
.jumbotron {
|
||||
position: relative;
|
||||
padding: 3em 0;
|
||||
text-align: center;
|
||||
background: #242424;
|
||||
}
|
||||
|
||||
.jumbotron h1 {
|
||||
color: #fff;
|
||||
font-family: Rokkitt;
|
||||
font-size: 13em;
|
||||
font-weight: 200;
|
||||
text-shadow: 0.025em 0.025em 0.025em rgba(0, 0, 0, 0.8);
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.jumbotron h1 .char11 {
|
||||
color: #ED303C;
|
||||
}
|
||||
|
||||
.jumbotron p {
|
||||
margin-top: -1em;
|
||||
letter-spacing: 0.15em;
|
||||
color: #ccc;
|
||||
font-size: 1.25em;
|
||||
font-weight: 200;
|
||||
text-shadow: 0.1em 0.1em 0.1em rgba(0, 0, 0, 0.8);
|
||||
visibility: hidden;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.jumbotron .btn {
|
||||
margin-top: 2em;
|
||||
margin-bottom: 2em;
|
||||
font-size: 1.6em;
|
||||
}
|
||||
|
||||
.about {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.about p {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.playground {
|
||||
background: #242424;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #333;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.playground .controls {
|
||||
margin-bottom: 0;
|
||||
background: #282828;
|
||||
border-radius: 0 0 4px 4px;
|
||||
border: 1px solid #0c0c0c;
|
||||
border-top: 1px solid #333;
|
||||
}
|
||||
|
||||
.playground .controls form {
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
.playground .controls select {
|
||||
width: 48%;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.playground .controls select {
|
||||
width: 100%;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.playground .viewport {
|
||||
display: table;
|
||||
min-height: 10em;
|
||||
padding: 20px;
|
||||
border-radius: 4px 4px 0 0;
|
||||
border: 1px solid #0c0c0c;
|
||||
overflow: hidden;
|
||||
-webkit-box-shadow: inset 0px 0px 2px rgba(0, 0, 0, 0.5);
|
||||
-moz-box-shadow: inset 0px 0px 2px rgba(0, 0, 0, 0.5);
|
||||
box-shadow: inset 0px 0px 2px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.playground .viewport .tlt {
|
||||
color: #fff;
|
||||
font-size: 1.5em;
|
||||
font-weight: 200;
|
||||
letter-spacing: 1px;
|
||||
padding: 20px 0;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
display: table-cell;
|
||||
text-align: center;
|
||||
/*visibility: hidden;*/
|
||||
}
|
||||
|
||||
.deps {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.deps ul {
|
||||
list-style-type: square;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.deps ul li {
|
||||
line-height: 1.5em
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
/* GRID
|
||||
***************/
|
||||
|
||||
.grid:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
[class*='col-'] {
|
||||
float: left;
|
||||
padding-right: 20px;
|
||||
}
|
||||
.grid [class*='col-']:last-of-type {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.col-1-1 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.col-2-3 {
|
||||
width: 66.66%;
|
||||
}
|
||||
|
||||
.col-1-3 {
|
||||
width: 33.33%;
|
||||
}
|
||||
|
||||
.col-1-2 {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.col-1-4 {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.col-3-4 {
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
.col-4-5 {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.col-1-6 {
|
||||
width: 16.66%;
|
||||
}
|
||||
|
||||
.col-1-8 {
|
||||
width: 12.5%;
|
||||
}
|
||||
|
||||
.grid-pad {
|
||||
padding-left: 20px
|
||||
}
|
||||
|
||||
.grid-pad [class*='col-'] {
|
||||
padding-top: 20px;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.grid-pad [class*='col-']:last-of-type {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
[class*='col-'] {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* FORM
|
||||
*********/
|
||||
|
||||
form .control {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
select,
|
||||
input[type="text"] {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
height: 30px;
|
||||
padding: 4px 6px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
color: #555555;
|
||||
vertical-align: middle;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
background-color: #ddd;
|
||||
border: 1px solid #ccc;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
|
||||
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
|
||||
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
|
||||
transition: border linear 0.2s, box-shadow linear 0.2s;
|
||||
}
|
||||
|
||||
input[type="text"]:focus {
|
||||
background-color: #fff;
|
||||
border-color: #8D121A;
|
||||
outline: 0;
|
||||
-webkit-box-shadow: inset 0 1px 1px #8D121A, 0 0 8px #ED303C;
|
||||
-moz-box-shadow: inset 0 1px 1px #8D121A, 0 0 8px #ED303C;
|
||||
box-shadow: inset 0 1px 1px #8D121A, 0 0 8px #ED303C;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
label.inline {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
label.checkbox {
|
||||
padding: 4px 0;
|
||||
margin-right: 10px;
|
||||
white-space: nowrap;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* CODE
|
||||
**************/
|
||||
|
||||
pre code {
|
||||
background: transparent;
|
||||
}
|
|
@ -0,0 +1,287 @@
|
|||
/*
|
||||
* textillate.js
|
||||
* http://jschr.github.com/textillate
|
||||
* MIT licensed
|
||||
*
|
||||
* Copyright (C) 2012-2013 Jordan Schroter
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
function isInEffect (effect) {
|
||||
return /In/.test(effect) || $.inArray(effect, $.fn.textillate.defaults.inEffects) >= 0;
|
||||
};
|
||||
|
||||
function isOutEffect (effect) {
|
||||
return /Out/.test(effect) || $.inArray(effect, $.fn.textillate.defaults.outEffects) >= 0;
|
||||
};
|
||||
|
||||
|
||||
function stringToBoolean(str) {
|
||||
if (str !== "true" && str !== "false") return str;
|
||||
return (str === "true");
|
||||
};
|
||||
|
||||
// custom get data api method
|
||||
function getData (node) {
|
||||
var attrs = node.attributes || []
|
||||
, data = {};
|
||||
|
||||
if (!attrs.length) return data;
|
||||
|
||||
$.each(attrs, function (i, attr) {
|
||||
var nodeName = attr.nodeName.replace(/delayscale/, 'delayScale');
|
||||
if (/^data-in-*/.test(nodeName)) {
|
||||
data.in = data.in || {};
|
||||
data.in[nodeName.replace(/data-in-/, '')] = stringToBoolean(attr.nodeValue);
|
||||
} else if (/^data-out-*/.test(nodeName)) {
|
||||
data.out = data.out || {};
|
||||
data.out[nodeName.replace(/data-out-/, '')] =stringToBoolean(attr.nodeValue);
|
||||
} else if (/^data-*/.test(nodeName)) {
|
||||
data[nodeName.replace(/data-/, '')] = stringToBoolean(attr.nodeValue);
|
||||
}
|
||||
})
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function shuffle (o) {
|
||||
for (var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
|
||||
return o;
|
||||
}
|
||||
|
||||
function animate ($t, effect, cb) {
|
||||
$t.addClass('animated ' + effect)
|
||||
.css('visibility', 'visible')
|
||||
.show();
|
||||
|
||||
$t.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
|
||||
$t.removeClass('animated ' + effect);
|
||||
cb && cb();
|
||||
});
|
||||
}
|
||||
|
||||
function animateTokens ($tokens, options, cb) {
|
||||
var that = this
|
||||
, count = $tokens.length;
|
||||
|
||||
if (!count) {
|
||||
cb && cb();
|
||||
return;
|
||||
}
|
||||
|
||||
if (options.shuffle) $tokens = shuffle($tokens);
|
||||
if (options.reverse) $tokens = $tokens.toArray().reverse();
|
||||
|
||||
$.each($tokens, function (i, t) {
|
||||
var $token = $(t);
|
||||
|
||||
function complete () {
|
||||
if (isInEffect(options.effect)) {
|
||||
$token.css('visibility', 'visible');
|
||||
} else if (isOutEffect(options.effect)) {
|
||||
$token.css('visibility', 'hidden');
|
||||
}
|
||||
count -= 1;
|
||||
if (!count && cb) cb();
|
||||
}
|
||||
|
||||
var delay = options.sync ? options.delay : options.delay * i * options.delayScale;
|
||||
|
||||
$token.text() ?
|
||||
setTimeout(function () { animate($token, options.effect, complete) }, delay) :
|
||||
complete();
|
||||
});
|
||||
};
|
||||
|
||||
var Textillate = function (element, options) {
|
||||
var base = this
|
||||
, $element = $(element);
|
||||
|
||||
base.init = function () {
|
||||
base.$texts = $element.find(options.selector);
|
||||
|
||||
if (!base.$texts.length) {
|
||||
base.$texts = $('<ul class="texts"><li>' + $element.html() + '</li></ul>');
|
||||
$element.html(base.$texts);
|
||||
}
|
||||
|
||||
base.$texts.hide();
|
||||
|
||||
base.$current = $('<span>')
|
||||
.html(base.$texts.find(':first-child').html())
|
||||
.prependTo($element);
|
||||
|
||||
if (isInEffect(options.in.effect)) {
|
||||
base.$current.css('visibility', 'hidden');
|
||||
} else if (isOutEffect(options.out.effect)) {
|
||||
base.$current.css('visibility', 'visible');
|
||||
}
|
||||
|
||||
base.setOptions(options);
|
||||
|
||||
base.timeoutRun = null;
|
||||
|
||||
setTimeout(function () {
|
||||
base.options.autoStart && base.start();
|
||||
}, base.options.initialDelay)
|
||||
};
|
||||
|
||||
base.setOptions = function (options) {
|
||||
base.options = options;
|
||||
};
|
||||
|
||||
base.triggerEvent = function (name) {
|
||||
var e = $.Event(name + '.tlt');
|
||||
$element.trigger(e, base);
|
||||
return e;
|
||||
};
|
||||
|
||||
base.in = function (index, cb) {
|
||||
index = index || 0;
|
||||
|
||||
var $elem = base.$texts.find(':nth-child(' + ((index||0) + 1) + ')')
|
||||
, options = $.extend(true, {}, base.options, $elem.length ? getData($elem[0]) : {})
|
||||
, $tokens;
|
||||
|
||||
$elem.addClass('current');
|
||||
|
||||
base.triggerEvent('inAnimationBegin');
|
||||
|
||||
base.$current
|
||||
.html($elem.html())
|
||||
.lettering('words');
|
||||
|
||||
// split words to individual characters if token type is set to 'char'
|
||||
if (base.options.type == "char") {
|
||||
base.$current.find('[class^="word"]')
|
||||
.css({
|
||||
'display': 'inline-block',
|
||||
// fix for poor ios performance
|
||||
'-webkit-transform': 'translate3d(0,0,0)',
|
||||
'-moz-transform': 'translate3d(0,0,0)',
|
||||
'-o-transform': 'translate3d(0,0,0)',
|
||||
'transform': 'translate3d(0,0,0)'
|
||||
})
|
||||
.each(function () { $(this).lettering() });
|
||||
}
|
||||
|
||||
$tokens = base.$current
|
||||
.find('[class^="' + base.options.type + '"]')
|
||||
.css('display', 'inline-block');
|
||||
|
||||
if (isInEffect(options.in.effect)) {
|
||||
$tokens.css('visibility', 'hidden');
|
||||
} else if (isOutEffect(options.in.effect)) {
|
||||
$tokens.css('visibility', 'visible');
|
||||
}
|
||||
|
||||
base.currentIndex = index;
|
||||
|
||||
animateTokens($tokens, options.in, function () {
|
||||
base.triggerEvent('inAnimationEnd');
|
||||
if (options.in.callback) options.in.callback();
|
||||
if (cb) cb(base);
|
||||
});
|
||||
};
|
||||
|
||||
base.out = function (cb) {
|
||||
var $elem = base.$texts.find(':nth-child(' + ((base.currentIndex||0) + 1) + ')')
|
||||
, $tokens = base.$current.find('[class^="' + base.options.type + '"]')
|
||||
, options = $.extend(true, {}, base.options, $elem.length ? getData($elem[0]) : {})
|
||||
|
||||
base.triggerEvent('outAnimationBegin');
|
||||
|
||||
animateTokens($tokens, options.out, function () {
|
||||
$elem.removeClass('current');
|
||||
base.triggerEvent('outAnimationEnd');
|
||||
if (options.out.callback) options.out.callback();
|
||||
if (cb) cb(base);
|
||||
});
|
||||
};
|
||||
|
||||
base.start = function (index) {
|
||||
setTimeout(function () {
|
||||
base.triggerEvent('start');
|
||||
|
||||
(function run (index) {
|
||||
base.in(index, function () {
|
||||
var length = base.$texts.children().length;
|
||||
|
||||
index += 1;
|
||||
|
||||
if (!base.options.loop && index >= length) {
|
||||
if (base.options.callback) base.options.callback();
|
||||
base.triggerEvent('end');
|
||||
} else {
|
||||
index = index % length;
|
||||
|
||||
base.timeoutRun = setTimeout(function () {
|
||||
base.out(function () {
|
||||
run(index)
|
||||
});
|
||||
}, base.options.minDisplayTime);
|
||||
}
|
||||
});
|
||||
}(index || 0));
|
||||
}, base.options.initialDelay);
|
||||
};
|
||||
|
||||
base.stop = function () {
|
||||
if (base.timeoutRun) {
|
||||
clearInterval(base.timeoutRun);
|
||||
base.timeoutRun = null;
|
||||
}
|
||||
};
|
||||
|
||||
base.init();
|
||||
}
|
||||
|
||||
$.fn.textillate = function (settings, args) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('textillate')
|
||||
, options = $.extend(true, {}, $.fn.textillate.defaults, getData(this), typeof settings == 'object' && settings);
|
||||
|
||||
if (!data) {
|
||||
$this.data('textillate', (data = new Textillate(this, options)));
|
||||
} else if (typeof settings == 'string') {
|
||||
data[settings].apply(data, [].concat(args));
|
||||
} else {
|
||||
data.setOptions.call(data, options);
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
$.fn.textillate.defaults = {
|
||||
selector: '.texts',
|
||||
loop: false,
|
||||
minDisplayTime: 2000,
|
||||
initialDelay: 0,
|
||||
in: {
|
||||
effect: 'fadeInLeftBig',
|
||||
delayScale: 1.5,
|
||||
delay: 50,
|
||||
sync: false,
|
||||
reverse: false,
|
||||
shuffle: false,
|
||||
callback: function () {}
|
||||
},
|
||||
out: {
|
||||
effect: 'hinge',
|
||||
delayScale: 1.5,
|
||||
delay: 50,
|
||||
sync: false,
|
||||
reverse: false,
|
||||
shuffle: false,
|
||||
callback: function () {}
|
||||
},
|
||||
autoStart: true,
|
||||
inEffects: [],
|
||||
outEffects: [ 'hinge' ],
|
||||
callback: function () {},
|
||||
type: 'char'
|
||||
};
|
||||
|
||||
}(jQuery));
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
//イベント管理用のクラス
|
||||
tyrano.plugin.kag.event ={
|
||||
|
||||
tyrano:null,
|
||||
|
||||
init:function(){
|
||||
|
||||
//alert("kag.order 初期化");
|
||||
//this.tyrano.test();
|
||||
|
||||
//同じディレクトリにある、KAG関連のデータを読み込み
|
||||
|
||||
},
|
||||
|
||||
//イベント用のエレメントを設定する
|
||||
addEventElement:function(obj){
|
||||
|
||||
var j_obj = obj.j_target;
|
||||
|
||||
j_obj.addClass("event-setting-element");
|
||||
j_obj.attr("data-event-target",obj.target);
|
||||
j_obj.attr("data-event-storage",obj.storage);
|
||||
j_obj.attr("data-event-tag",obj.tag);
|
||||
|
||||
//パラメータを格納してみてはどうか?
|
||||
j_obj.attr("data-event-pm",JSON.stringify(obj.pm));
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
1247
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/plugins/kag/kag.js
Normal file
|
@ -0,0 +1,539 @@
|
|||
/*
|
||||
* キーボードとマウス操作を支援するプラグインです.
|
||||
* キーボード:
|
||||
* [ENTER]や[SPACE]で、次のメッセージへ.
|
||||
* [ESC]でメッセージウィンドウを消す.
|
||||
* マウス:
|
||||
* マウスの右クリックでメニューを表示.
|
||||
* ※メニューが非表示の場合、メッセージウィンドウを消します.
|
||||
*
|
||||
* This is a plugin to support the operation of keyboard and mouse.
|
||||
* Keyboard:
|
||||
* Press [Enter] or the space key to go to the next message.
|
||||
* Press [Ecs] to hide the message window.
|
||||
* Mouse:
|
||||
* Right-clicking displays the menu.
|
||||
* Note: When the menu is not displayed, hide the message window.
|
||||
*
|
||||
* Special Thanks for Keito
|
||||
*
|
||||
*/
|
||||
tyrano.plugin.kag.key_mouse = {
|
||||
kag : null,
|
||||
|
||||
//キーコンフィグ。デフォルトは用意しておく
|
||||
keyconfig : {
|
||||
key : {}
|
||||
},
|
||||
|
||||
map_key : {},
|
||||
map_mouse:{},
|
||||
map_ges:{},
|
||||
|
||||
//状況に応じて変化する
|
||||
is_swipe: false,
|
||||
timeoutId:0,
|
||||
|
||||
is_keydown:false, //キーの連続押し込み反応を防ぐ
|
||||
|
||||
//指が動いた状態を管理するための値
|
||||
start_point:{x:0,y:0},
|
||||
end_point:{x:0,y:0},
|
||||
|
||||
|
||||
init : function() {
|
||||
var that = this;
|
||||
|
||||
this.keyconfig = __tyrano_key_config;
|
||||
|
||||
this.map_key = this.keyconfig["key"];
|
||||
this.map_mouse = this.keyconfig["mouse"];
|
||||
this.map_ges = this.keyconfig["gesture"];
|
||||
|
||||
$(document).keydown(function(e) {
|
||||
|
||||
if(that.is_keydown==true){
|
||||
return false;
|
||||
}
|
||||
|
||||
//メニュー系が表示されている時。
|
||||
|
||||
that.is_keydown = true;
|
||||
|
||||
var keycode = e.keyCode;
|
||||
|
||||
//イベント登録済みなら
|
||||
if (that.map_key[keycode]) {
|
||||
|
||||
if ( typeof that.map_key[keycode] == "function") {
|
||||
//関数の場合
|
||||
that.map_key[keycode]();
|
||||
} else {
|
||||
if (that[that.map_key[keycode]]) {
|
||||
that[that.map_key[keycode]]();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//keyup はコントローラーのときや押しっぱなし対応
|
||||
$(document).keyup(function(e) {
|
||||
|
||||
that.is_keydown = false;
|
||||
|
||||
var keycode = e.keyCode;
|
||||
|
||||
//スキップ用ホールド解除 mac と windowsでコードが違うctrl 決め打ち
|
||||
if (keycode==91 || keycode ==17) {
|
||||
that.kag.stat.is_skip = false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(document).on("mousedown", function(e) {
|
||||
|
||||
//スキップ中にクリックされたら元に戻す
|
||||
if(that.kag.stat.is_skip == true && that.kag.stat.is_strong_stop == false){
|
||||
that.kag.stat.is_skip = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
var target = null;
|
||||
|
||||
//中央クリック
|
||||
if (e.which == 2) {
|
||||
|
||||
target = that.map_mouse["center"];
|
||||
|
||||
}else if(e.which == 3){
|
||||
//右クリック
|
||||
target = that.map_mouse["right"];
|
||||
|
||||
}
|
||||
|
||||
if(typeof target=="function"){
|
||||
target();
|
||||
}else{
|
||||
if(that[target]){
|
||||
that[target]();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var mousewheelevent = 'onwheel' in document ? 'wheel' : 'onmousewheel' in document ? 'mousewheel' : 'DOMMouseScroll';
|
||||
$(document).on(mousewheelevent,function(e){
|
||||
|
||||
//メニュー表示中は進めない。
|
||||
if(!that.canShowMenu()){
|
||||
return ;
|
||||
}
|
||||
|
||||
//メニュー表示中は無効にする
|
||||
if ($(".menu_close").length > 0 && $(".layer_menu").css("display") != "none") {
|
||||
return ;
|
||||
}
|
||||
|
||||
var delta = e.originalEvent.deltaY ? -(e.originalEvent.deltaY) : e.originalEvent.wheelDelta ? e.originalEvent.wheelDelta : -(e.originalEvent.detail);
|
||||
|
||||
var target = null;
|
||||
|
||||
if (delta < 0){
|
||||
// マウスホイールを下にスクロールしたときの処理を記載
|
||||
target = that.map_mouse["wheel_down"];
|
||||
|
||||
} else {
|
||||
// マウスホイールを上にスクロールしたときの処理を記載
|
||||
target = that.map_mouse["wheel_up"];
|
||||
}
|
||||
|
||||
if(typeof target=="function"){
|
||||
target();
|
||||
}else{
|
||||
if(that[target]){
|
||||
that[target]();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
var layer_obj_click = $(".layer_event_click");
|
||||
|
||||
//スマートフォンイベント
|
||||
if($.userenv() != "pc"){
|
||||
layer_obj_click.swipe(
|
||||
{
|
||||
swipe:function(event, direction, distance, duration, fingerCount, fingerData){
|
||||
that.is_swipe = true;
|
||||
//console.log("wwwwwwwwwwwwwww");
|
||||
//console.log(direction+":"+distance+":"+duration+":"+fingerCount+":"+fingerData);
|
||||
//$(this).text("You swiped " + direction );
|
||||
|
||||
var swipe_str = "swipe_"+direction+"_"+fingerCount;
|
||||
|
||||
|
||||
if(that.map_ges[swipe_str]){
|
||||
if(that[that.map_ges[swipe_str]["action"]]){
|
||||
that[that.map_ges[swipe_str]["action"]]();
|
||||
}
|
||||
}
|
||||
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
},
|
||||
|
||||
fingers:"all"
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
layer_obj_click.on("touchstart", function() {
|
||||
|
||||
if(that.kag.stat.is_skip == true){
|
||||
that.kag.stat.is_skip = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
that.timeoutId = setTimeout(function(){
|
||||
if(that[that.map_ges["hold"]["action"]]){
|
||||
that.is_swipe = true;
|
||||
that[that.map_ges["hold"]["action"]]();
|
||||
}
|
||||
|
||||
}, 2000);
|
||||
}).on('touchend', function() {
|
||||
clearTimeout(that.timeoutId);
|
||||
that.timeoutId = null;
|
||||
});
|
||||
|
||||
//スマホでのダブルタップ抑制
|
||||
var t = 0;
|
||||
$(".tyrano_base").on('touchend', function (e) {
|
||||
var now = new Date().getTime();
|
||||
if ((now - t) < 350){
|
||||
e.preventDefault();
|
||||
}
|
||||
t = now;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
layer_obj_click.click(function(e){
|
||||
// POSSIBLE IMPROVE
|
||||
// make "isReturn" variable
|
||||
// and do all if statements
|
||||
// then do "if (isReturn) return;"
|
||||
|
||||
if(that.kag.tmp.ready_audio==false){
|
||||
|
||||
if($.isNeedClickAudio()){
|
||||
|
||||
that.kag.readyAudio();
|
||||
that.kag.tmp.ready_audio = true;
|
||||
|
||||
if(that.kag.stat.is_adding_text == true){
|
||||
that.kag.stat.is_click_text = true;
|
||||
return false;
|
||||
}
|
||||
that.kag.ftag.nextOrder();
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(that.is_swipe){
|
||||
that.is_swipe = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(that.kag.stat.is_hide_message == true){
|
||||
that.kag.layer.showMessageLayers();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//テキスト再生中にクリックされた場合、文字列を進めて終了にする
|
||||
if(that.kag.stat.is_adding_text == true){
|
||||
that.kag.stat.is_click_text = true;
|
||||
return false;;
|
||||
}
|
||||
|
||||
//テキストマッハ表示時もリターン。
|
||||
if(that.kag.stat.is_click_text == true){
|
||||
return false;
|
||||
}
|
||||
|
||||
if(that.kag.stat.is_stop == true){
|
||||
return false;
|
||||
}
|
||||
|
||||
that.kag.ftag.nextOrder();
|
||||
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
next : function() {
|
||||
//指定された動作を発火させる
|
||||
if (this.kag.key_mouse.canClick()) {
|
||||
$(".layer_event_click").click();
|
||||
}
|
||||
},
|
||||
|
||||
showmenu : function() {
|
||||
if (this.canShowMenu()) {
|
||||
if ($(".menu_close").length > 0 && $(".layer_menu").css("display") != "none") {
|
||||
$(".menu_close").click();
|
||||
} else {
|
||||
$(".button_menu").click();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
hidemessage : function() {
|
||||
if (this.canShowMenu()) {
|
||||
if ($(".menu_close").length > 0 && $(".layer_menu").css("display") != "none") {
|
||||
$(".menu_close").click();
|
||||
} else {
|
||||
if (!this.kag.stat.is_strong_stop) {
|
||||
if (this.kag.stat.is_hide_message) {
|
||||
this.kag.layer.showMessageLayers();
|
||||
} else {
|
||||
this.kag.ftag.startTag("hidemessage");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
save:function(){
|
||||
this._role("save");
|
||||
},
|
||||
load:function(){
|
||||
this._role("load");
|
||||
},
|
||||
menu:function(){
|
||||
this._role("menu");
|
||||
},
|
||||
title:function(){
|
||||
this._role("title");
|
||||
},
|
||||
skip:function(){
|
||||
if(this.canClick()){
|
||||
this._role("skip");
|
||||
}
|
||||
},
|
||||
backlog:function(){
|
||||
this._role("backlog");
|
||||
},
|
||||
fullscreen:function(){
|
||||
this._role("fullscreen");
|
||||
},
|
||||
qsave:function(){
|
||||
this._role("quicksave");
|
||||
},
|
||||
qload:function(){
|
||||
this._role("quickload");
|
||||
},
|
||||
auto:function(){
|
||||
this._role("auto");
|
||||
},
|
||||
|
||||
//役割系のロジック
|
||||
_role : function(role) {
|
||||
|
||||
var that = this;
|
||||
|
||||
//roleがクリックされたら、skip停止。スキップ繰り返しでやったりやめたり
|
||||
if(that.kag.stat.is_skip==true && role=="skip"){
|
||||
that.kag.stat.is_skip = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
//画面効果中は実行できないようにする
|
||||
if(that.kag.layer.layer_event.css("display") =="none" && that.kag.stat.is_strong_stop != true){
|
||||
return false;
|
||||
}
|
||||
|
||||
//キーコンフィグが有効化否か
|
||||
if(that.kag.stat.enable_keyconfig==false){
|
||||
return false;
|
||||
}
|
||||
|
||||
that.kag.stat.is_skip = false;
|
||||
|
||||
//オートは停止
|
||||
if (role != "auto") {
|
||||
that.kag.ftag.startTag("autostop", {next:"false"});
|
||||
}
|
||||
|
||||
//文字が流れているときは、セーブ出来ないようにする。
|
||||
if (role == "save" || role == "menu" || role == "quicksave" || role == "sleepgame") {
|
||||
|
||||
//テキストが流れているときとwait中は実行しない
|
||||
if (that.kag.stat.is_adding_text == true || that.kag.stat.is_wait == true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
switch(role) {
|
||||
|
||||
case "save":
|
||||
//すでにメニュー画面が見えてる場合は無効にする
|
||||
if($(".layer_menu").css("display")=="none"){
|
||||
that.kag.menu.displaySave();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "load":
|
||||
if($(".layer_menu").css("display")=="none"){
|
||||
that.kag.menu.displayLoad();
|
||||
}
|
||||
break;
|
||||
|
||||
case "window":
|
||||
that.kag.layer.hideMessageLayers();
|
||||
break;
|
||||
case "title":
|
||||
|
||||
$.confirm($.lang("go_title"), function() {
|
||||
location.reload();
|
||||
}, function() {
|
||||
return false;
|
||||
});
|
||||
break;
|
||||
|
||||
case "menu":
|
||||
that.kag.menu.showMenu();
|
||||
break;
|
||||
case "skip":
|
||||
that.kag.ftag.startTag("skipstart", {});
|
||||
break;
|
||||
case "backlog":
|
||||
that.kag.menu.displayLog();
|
||||
break;
|
||||
case "fullscreen":
|
||||
that.kag.menu.screenFull();
|
||||
break;
|
||||
case "quicksave":
|
||||
that.kag.menu.setQuickSave();
|
||||
break;
|
||||
case "quickload":
|
||||
that.kag.menu.loadQuickSave();
|
||||
break;
|
||||
case "auto":
|
||||
if (that.kag.stat.is_auto == true) {
|
||||
that.kag.ftag.startTag("autostop", {next:"false"});
|
||||
} else {
|
||||
that.kag.ftag.startTag("autostart", {});
|
||||
}
|
||||
break;
|
||||
|
||||
case "sleepgame":
|
||||
|
||||
if (that.kag.tmp.sleep_game != null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//ready
|
||||
that.kag.tmp.sleep_game = {};
|
||||
|
||||
that.kag.ftag.startTag("sleepgame", _pm);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
canClick : function() {
|
||||
|
||||
if ($(".layer_event_click").css("display") != "none" && $(".layer_menu").css("display") == "none") {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
canShowMenu : function() {
|
||||
|
||||
|
||||
if (this.kag.layer.layer_event.css("display") == "none" && this.kag.stat.is_strong_stop != true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//wait中の時
|
||||
if(this.kag.stat.is_wait == true){
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
/*
|
||||
if ($(".layer_free").css("display") == "none") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
*/
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
///マウス周り
|
||||
//スライドイベント
|
||||
layer_obj_click.bind('touchstart', function(e) {
|
||||
e.preventDefault(); // ページが動くのを止める
|
||||
var pageX = event.changedTouches[0].pageX; // X 座標の位置
|
||||
var pageY = event.changedTouches[0].pageY; // Y 座標の位置
|
||||
that.start_point.x = pageX;
|
||||
that.start_point.y = pageY;
|
||||
|
||||
//console.log("start -------");
|
||||
//console.log(pageY);
|
||||
|
||||
});
|
||||
|
||||
//スライドイベント
|
||||
layer_obj_click.bind('touchend', function(e) {
|
||||
|
||||
if(that.kag.stat.visible_menu_button==false){
|
||||
return false;
|
||||
}
|
||||
|
||||
e.preventDefault(); // ページが動くのを止める
|
||||
var pageX = event.changedTouches[0].pageX; // X 座標の位置
|
||||
var pageY = event.changedTouches[0].pageY; // Y 座標の位置
|
||||
|
||||
that.end_point.x = pageX;
|
||||
that.end_point.y = pageY;
|
||||
|
||||
var move_x = that.end_point.x - that.start_point.x;
|
||||
var move_y = that.end_point.y - that.start_point.y;
|
||||
|
||||
////
|
||||
if(move_x > 250){
|
||||
//右スライド
|
||||
console.log("右スライド");
|
||||
}else if(move_y > 50){
|
||||
//縦スライド
|
||||
that.kag.ftag.startTag("showmenu", {});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
* */
|
||||
|
|
@ -0,0 +1,493 @@
|
|||
|
||||
tyrano.plugin.kag.layer ={
|
||||
|
||||
tyrano:null,
|
||||
kag:null,
|
||||
|
||||
layer_event:{},
|
||||
|
||||
layer_menu:{}, //メニュー用の画面。イベントレイヤーよりも更に上
|
||||
|
||||
layer_free:{},// フリーレイヤー 用 画像の配置などはここで設定する
|
||||
|
||||
map_layer_fore:{},
|
||||
map_layer_back:{},
|
||||
|
||||
//状況に応じて変化する
|
||||
is_swipe: false,
|
||||
timeoutId:0,
|
||||
|
||||
//指が動いた状態を管理するための値
|
||||
start_point:{x:0,y:0},
|
||||
end_point:{x:0,y:0},
|
||||
|
||||
init:function(){
|
||||
|
||||
var that = this;
|
||||
//同じディレクトリにある、KAG関連のデータを読み込み
|
||||
|
||||
//分割用のレイヤ
|
||||
$("#tyrano_base").append('<div id="root_layer_game" class="root_layer_game"></div>');
|
||||
$("#tyrano_base").append('<div id="root_layer_system" class="root_layer_system"></div>');
|
||||
|
||||
//隠しレイヤの登録
|
||||
//画面クリックのレイヤ
|
||||
var layer_obj_click = $("<div class='layer layer_event_click' style='z-index:9999;display:none'></div>");
|
||||
layer_obj_click.css("width",this.kag.config.scWidth).css("height",this.kag.config.scHeight).css("position","absolute");
|
||||
|
||||
|
||||
//スキップやオートキャンセルの停止、画面がクリックされた時。
|
||||
$("body").click(function(){
|
||||
|
||||
//スキップ中にクリックされたら元に戻す
|
||||
if(that.kag.stat.is_skip == true){
|
||||
that.kag.stat.is_skip = false;
|
||||
}
|
||||
|
||||
//オート中でクリックされた場合。オート停止
|
||||
if(that.kag.stat.is_auto == true){
|
||||
if(that.kag.config.autoClickStop == "true"){
|
||||
that.kag.ftag.startTag("autostop", {next:"false"});
|
||||
}
|
||||
}
|
||||
|
||||
//オート待ち状態なら、、解除する
|
||||
if(that.kag.stat.is_wait_auto = true){
|
||||
that.kag.stat.is_wait_auto = false;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
this.layer_event = layer_obj_click ;
|
||||
this.appendLayer(this.layer_event,"root_layer_system");
|
||||
|
||||
|
||||
//メニュー画面用のレイヤ
|
||||
var layer_menu = $("<div class='layer layer_menu' style='z-index:1000000000;display:none' align='center'></div>");
|
||||
layer_menu.css("width",this.kag.config.scWidth).css("height",this.kag.config.scHeight).css("position","absolute");
|
||||
this.layer_menu = layer_menu;
|
||||
this.appendLayer(this.layer_menu,"root_layer_system");
|
||||
|
||||
//フリーレイヤ
|
||||
var layer_free = $("<div class='layer layer_free' style='z-index:9998;display:none' ></div>");
|
||||
layer_free.css("width",this.kag.config.scWidth).css("height",this.kag.config.scHeight).css("position","absolute");
|
||||
this.layer_free = layer_free;
|
||||
this.appendLayer(this.layer_free,"root_layer_system");
|
||||
|
||||
|
||||
},
|
||||
|
||||
//メニューレイヤーを返す
|
||||
getMenuLayer:function(){
|
||||
return this.layer_menu;
|
||||
},
|
||||
|
||||
//フリーレイヤを返却します
|
||||
getFreeLayer:function(){
|
||||
return this.layer_free;
|
||||
},
|
||||
|
||||
addLayer:function(layer_name){
|
||||
|
||||
var system_layer = "";
|
||||
|
||||
var layer_obj_fore = $("<div class='layer "+layer_name+"_fore layer_fore'></div>");
|
||||
var layer_obj_back = $("<div class='layer "+layer_name+"_back layer_back' style='display:none'></div>");
|
||||
|
||||
if(layer_name.indexOf("message")==-1){
|
||||
layer_obj_fore.addClass("layer_camera");
|
||||
layer_obj_back.addClass("layer_camera");
|
||||
}else{
|
||||
system_layer = "root_layer_system";
|
||||
}
|
||||
|
||||
layer_obj_fore.css("width",this.kag.config.scWidth).css("height",this.kag.config.scHeight).css("position","absolute");
|
||||
layer_obj_back.css("width",this.kag.config.scWidth).css("height",this.kag.config.scHeight).css("position","absolute");
|
||||
|
||||
this.map_layer_fore[layer_name] = layer_obj_fore;
|
||||
this.map_layer_back[layer_name] = layer_obj_back;
|
||||
|
||||
//表示ステータス
|
||||
this.map_layer_fore[layer_name].attr("l_visible","true");
|
||||
this.map_layer_back[layer_name].attr("l_visible","true");
|
||||
|
||||
|
||||
this.appendLayer(this.map_layer_fore[layer_name],system_layer);
|
||||
this.appendLayer(this.map_layer_back[layer_name],system_layer);
|
||||
|
||||
},
|
||||
|
||||
//メッセージレイヤ追加用
|
||||
appendLayer:function(layer_obj,system){
|
||||
|
||||
system = system || "root_layer_game";
|
||||
|
||||
if(system!=""){
|
||||
$("."+this.kag.define.BASE_DIV_NAME).find("#"+system).append(layer_obj);
|
||||
}else{
|
||||
$("."+this.kag.define.BASE_DIV_NAME).append(layer_obj);
|
||||
}
|
||||
},
|
||||
|
||||
//全景レイヤにオブジェクトを追加する
|
||||
appendImage:function(image_obj){
|
||||
|
||||
$("."+this.kag.define.BASE_DIV_NAME).append(layer_obj);
|
||||
|
||||
},
|
||||
|
||||
getLayer:function(layer_name,page){
|
||||
|
||||
if(layer_name =="fix"){
|
||||
return $("#tyrano_base");
|
||||
}
|
||||
|
||||
page = page || 'fore';
|
||||
|
||||
if(page=="fore"){
|
||||
return this.map_layer_fore[layer_name];
|
||||
}else{
|
||||
return this.map_layer_back[layer_name];
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
updateLayer:function(layer_name,page,layer_obj){
|
||||
|
||||
page = page || 'fore';
|
||||
|
||||
if(page=="fore"){
|
||||
this.map_layer_fore[layer_name] = layer_obj;
|
||||
}else{
|
||||
this.map_layer_back[layer_name] = layer_obj;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
//メッセージレイヤの消去
|
||||
hideMessageLayers:function(){
|
||||
|
||||
this.kag.stat.is_hide_message = true ;
|
||||
|
||||
var num_message_layer = parseInt(this.kag.config.numMessageLayers);
|
||||
|
||||
for(var i=0; i < num_message_layer ;i++){
|
||||
this.getLayer("message"+i).hide();
|
||||
}
|
||||
|
||||
//fixレイヤも隠します
|
||||
this.hideFixLayer();
|
||||
},
|
||||
|
||||
//メッセージレイヤの表示
|
||||
showMessageLayers:function(){
|
||||
|
||||
this.kag.stat.is_hide_message = false ;
|
||||
|
||||
var num_message_layer = parseInt(this.kag.config.numMessageLayers);
|
||||
|
||||
//表示するときに、もともと表示状態のもののみ、表示する必要がある
|
||||
for(var i=0; i < num_message_layer ;i++){
|
||||
|
||||
var j_layer = this.getLayer("message"+i);
|
||||
|
||||
//もともと、表示状態の場合のみ、再表示する
|
||||
if(j_layer.attr("l_visible") == "true"){
|
||||
j_layer.show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//fixレイヤも
|
||||
this.showFixLayer();
|
||||
|
||||
},
|
||||
|
||||
showFixLayer:function(){
|
||||
$(".fixlayer").show();
|
||||
},
|
||||
|
||||
hideFixLayer:function(){
|
||||
$(".fixlayer").hide();
|
||||
},
|
||||
|
||||
|
||||
appendObj:function(layer_name,page,obj){
|
||||
|
||||
obj.css("position","absolute");
|
||||
this.getLayer(layer_name,page).append(obj);
|
||||
|
||||
},
|
||||
|
||||
|
||||
//メッセージレイヤのインナーを最適化する
|
||||
refMessageLayer:function(target_layer){
|
||||
|
||||
var num = 0;
|
||||
|
||||
if(!target_layer){
|
||||
|
||||
while(true){
|
||||
|
||||
if(this.map_layer_fore["message"+num]){
|
||||
|
||||
var j_message_outer = this.map_layer_fore["message"+num].find(".message_outer");
|
||||
var j_message_inner = this.map_layer_fore["message"+num].find(".message_inner");
|
||||
|
||||
j_message_inner
|
||||
.css("left",parseInt(j_message_outer.css("left"))+10)
|
||||
.css("top",parseInt(j_message_outer.css("top"))+10)
|
||||
.css("width",parseInt(j_message_outer.css("width"))-10)
|
||||
.css("height",parseInt(j_message_outer.css("height"))-10);
|
||||
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
|
||||
num++;
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
if(this.map_layer_fore[target_layer]){
|
||||
|
||||
var j_message_outer = this.map_layer_fore[target_layer].find(".message_outer");
|
||||
var j_message_inner = this.map_layer_fore[target_layer].find(".message_inner");
|
||||
|
||||
j_message_inner
|
||||
.css("left",parseInt(j_message_outer.css("left"))+10)
|
||||
.css("top",parseInt(j_message_outer.css("top"))+10)
|
||||
.css("width",parseInt(j_message_outer.css("width"))-10)
|
||||
.css("height",parseInt(j_message_outer.css("height"))-10);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
//レイヤに関連するHTMLファイルを文字列でぶっこ抜きます
|
||||
getLayeyHtml:function(){
|
||||
|
||||
var layer_info ={
|
||||
|
||||
map_layer_fore:{},
|
||||
map_layer_back:{},
|
||||
layer_free:{},
|
||||
layer_fix:{},
|
||||
layer_blend:{}
|
||||
|
||||
};
|
||||
|
||||
for( key in this.map_layer_fore ){
|
||||
layer_info["map_layer_fore"][key] = $.playerHtmlPath(this.map_layer_fore[key].outerHTML());
|
||||
}
|
||||
for( key in this.map_layer_back ){
|
||||
layer_info["map_layer_back"][key] = $.playerHtmlPath(this.map_layer_back[key].outerHTML());
|
||||
}
|
||||
|
||||
/*
|
||||
for( key in this.map_layer_fix ){
|
||||
layer_info["map_layer_fix"][key] = this.map_layer_fix[key].outerHTML();
|
||||
}
|
||||
*/
|
||||
|
||||
layer_info["layer_free"] = $.playerHtmlPath(this.layer_free.outerHTML());
|
||||
|
||||
var n = 0;
|
||||
$(".fixlayer").each(function(){
|
||||
|
||||
layer_info["layer_fix"][n] = $.playerHtmlPath($(this).outerHTML());
|
||||
n++;
|
||||
|
||||
});
|
||||
|
||||
var m = 0;
|
||||
$(".blendlayer").each(function(){
|
||||
layer_info["layer_blend"][m] = $.playerHtmlPath($(this).outerHTML());
|
||||
m++;
|
||||
|
||||
});
|
||||
|
||||
return layer_info;
|
||||
|
||||
|
||||
},
|
||||
|
||||
setLayerHtml:function(layer){
|
||||
|
||||
var that = this;
|
||||
|
||||
for(key in layer.map_layer_fore){
|
||||
this["map_layer_fore"][key].remove();
|
||||
delete this["map_layer_fore"][key];
|
||||
this["map_layer_fore"][key] = $(layer["map_layer_fore"][key]);
|
||||
this.appendLayer(this["map_layer_fore"][key]);
|
||||
}
|
||||
|
||||
for(key in layer.map_layer_back){
|
||||
this["map_layer_back"][key].remove();
|
||||
delete this["map_layer_back"][key];
|
||||
this["map_layer_back"][key] = $(layer["map_layer_back"][key]);
|
||||
this.appendLayer(this["map_layer_back"][key]);
|
||||
}
|
||||
|
||||
//fixlayerの削除
|
||||
$(".fixlayer").each(function(){
|
||||
$(this).remove();
|
||||
});
|
||||
|
||||
//fixlayer は復元しない
|
||||
|
||||
for(key in layer.layer_fix){
|
||||
$("#tyrano_base").append($(layer.layer_fix[key]));
|
||||
}
|
||||
|
||||
//ブレンド演出の復元
|
||||
$(".blendlayer").remove();
|
||||
for(key in layer.layer_blend){
|
||||
|
||||
var obj = $(layer.layer_blend[key]);
|
||||
if(obj.hasClass("blendvideo")){
|
||||
//ビデオの再現
|
||||
//console.log(obj.attr("data-video-pm"));
|
||||
var video_pm = JSON.parse(obj.attr("data-video-pm"));
|
||||
|
||||
video_pm.stop = "true";
|
||||
video_pm.time = 10;
|
||||
//ビデオレイヤ追加だお。
|
||||
(function(){
|
||||
var _video_pm = video_pm;
|
||||
setTimeout(function(){
|
||||
that.kag.ftag.startTag("layermode_movie", _video_pm );
|
||||
},10);
|
||||
})();
|
||||
|
||||
}else{
|
||||
//画像のブレンド
|
||||
$("#tyrano_base").append(obj);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.layer_free.remove();
|
||||
delete this.layer_free ;
|
||||
this.layer_free = $(layer.layer_free);
|
||||
this.appendLayer(this.layer_free);
|
||||
|
||||
|
||||
},
|
||||
|
||||
//すべてのメッセージインナーレイヤ削除
|
||||
clearMessageInnerLayerAll:function(){
|
||||
|
||||
for( key in this.map_layer_fore ){
|
||||
|
||||
if(key.indexOf("message")!=-1){
|
||||
//メッセージインナーの削除
|
||||
this.map_layer_fore[key].find(".message_inner").html("");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
//前景レイヤを背景レイヤにコピーする
|
||||
backlay:function(layer){
|
||||
|
||||
//レイヤが指定されている場合は、そのレイヤのみコピーする
|
||||
layer = layer || "";
|
||||
|
||||
for( key in this.map_layer_fore ){
|
||||
|
||||
if(layer == "" || layer == key){
|
||||
|
||||
var fore_class_name = this.map_layer_fore[key].attr("class");
|
||||
var back_class_name = this.map_layer_back[key].attr("class");
|
||||
|
||||
this.map_layer_back[key] = this.map_layer_fore[key].clone();
|
||||
|
||||
this.map_layer_back[key].removeClass(fore_class_name);
|
||||
this.map_layer_back[key].addClass(back_class_name);
|
||||
|
||||
back_class_name = $.replaceAll(back_class_name," ",".");
|
||||
|
||||
//削除
|
||||
$("."+back_class_name).remove();
|
||||
//$("." + back_class_name.replace(/ +/g, '.')).remove();
|
||||
|
||||
//追加
|
||||
this.map_layer_back[key].hide();
|
||||
this.appendLayer(this.map_layer_back[key]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
//全面のイベントレイヤを削除する
|
||||
showEventLayer:function(){
|
||||
this.kag.stat.is_stop = false;
|
||||
this.layer_event.show();
|
||||
},
|
||||
|
||||
hideEventLayer:function(){
|
||||
this.kag.stat.is_stop = true;
|
||||
this.layer_event.hide();
|
||||
},
|
||||
|
||||
//backlayの逆 トランスの後に実施する
|
||||
forelay:function(layer){
|
||||
|
||||
//レイヤが指定されている場合は、そのレイヤのみコピーする
|
||||
layer = layer || "";
|
||||
|
||||
for( key in this.map_layer_back ){
|
||||
|
||||
if(layer == "" || layer == key){
|
||||
|
||||
var fore_class_name = this.map_layer_fore[key].attr("class");
|
||||
var back_class_name = this.map_layer_back[key].attr("class");
|
||||
|
||||
this.map_layer_fore[key] = this.map_layer_back[key].clone(true);
|
||||
|
||||
this.map_layer_fore[key].removeClass(back_class_name);
|
||||
this.map_layer_fore[key].addClass(fore_class_name);
|
||||
|
||||
fore_class_name = $.replaceAll(fore_class_name," ",".");
|
||||
|
||||
//削除
|
||||
$("."+fore_class_name).remove();
|
||||
//$("." + back_class_name.replace(/ +/g, '.')).remove();
|
||||
|
||||
//追加
|
||||
//this.appendLayer(this.map_layer_fore[key]);
|
||||
this.map_layer_back[key].before(this.map_layer_fore[key]);
|
||||
|
||||
|
||||
//バックレイヤは隠す
|
||||
this.map_layer_back[key].css("display","none");
|
||||
|
||||
//this.map_layer_fore[key].css("display","block");
|
||||
|
||||
if(key.indexOf("message")!=-1){
|
||||
this.map_layer_fore[key].css("opacity","");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
test:function(){
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,457 @@
|
|||
|
||||
tyrano.plugin.kag.parser ={
|
||||
|
||||
tyrano:null,
|
||||
kag:null,
|
||||
|
||||
flag_script:false , //スクリプト解析中なら
|
||||
deep_if: 0,
|
||||
|
||||
init:function(){
|
||||
|
||||
//alert("kag.parser 初期化");
|
||||
//this.tyrano.test();
|
||||
|
||||
|
||||
},
|
||||
|
||||
loadConfig:function(call_back){
|
||||
|
||||
var that = this;
|
||||
|
||||
//同じディレクトリにある、KAG関連のデータを読み込み
|
||||
$.loadText("./data/system/Config.tjs",function(text_str){
|
||||
|
||||
var map_config = that.compileConfig(text_str);
|
||||
|
||||
if(call_back){
|
||||
call_back(map_config);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
//コンフィグファイルをデータ構造に格納
|
||||
compileConfig:function(text_str){
|
||||
|
||||
var error_str ="";
|
||||
var map_config = {};
|
||||
|
||||
var array_config = text_str.split("\n");
|
||||
|
||||
for(var i=0; i< array_config.length;i++){
|
||||
|
||||
try{
|
||||
|
||||
var line_str = $.trim(array_config[i]);
|
||||
if(line_str !="" && line_str.substr(0,1)===";"){
|
||||
|
||||
var tmp_comment = line_str.split("//");
|
||||
if(tmp_comment.length>1){
|
||||
line_str = $.trim(tmp_comment[0]);
|
||||
}
|
||||
|
||||
line_str = $.replaceAll(line_str,";","");
|
||||
line_str = $.replaceAll(line_str,"\"","");
|
||||
|
||||
var tmp = line_str.split("=");
|
||||
|
||||
var key = $.trim(tmp[0]);
|
||||
var val = $.trim(tmp[1]);
|
||||
map_config[key] = val;
|
||||
}
|
||||
|
||||
}catch(e){
|
||||
|
||||
error_str +="Error:Config.tjsに誤りがあります/行:"+i+"";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(error_str !=""){
|
||||
alert(error_str);
|
||||
}
|
||||
|
||||
return map_config;
|
||||
|
||||
},
|
||||
|
||||
//シナリオをオブジェクト化する
|
||||
parseScenario:function(text_str){
|
||||
|
||||
var array_s = [];
|
||||
|
||||
var map_label = {}; //ラベル一覧
|
||||
|
||||
var array_row = text_str.split("\n");
|
||||
|
||||
var flag_comment = false; //コメント中なら
|
||||
|
||||
for(var i=0;i<array_row.length;i++){
|
||||
|
||||
var line_str = $.trim(array_row[i]);
|
||||
var first_char = line_str.substr(0,1);
|
||||
|
||||
if(line_str.indexOf("endscript") !=-1){
|
||||
this.flag_script = false;
|
||||
}
|
||||
|
||||
//コメントの場合は無視する
|
||||
if(flag_comment === true && line_str ==="*/"){
|
||||
flag_comment = false;
|
||||
}else if(line_str==="/*"){
|
||||
flag_comment = true;
|
||||
}else if(flag_comment == true||first_char ===";"){
|
||||
|
||||
}else if(first_char ==="#"){
|
||||
|
||||
var tmp_line = $.trim(line_str.replace("#",""));
|
||||
var chara_name = "";
|
||||
var chara_face = "";
|
||||
if(tmp_line.split(":").length > 1){
|
||||
var array_line = tmp_line.split(":");
|
||||
chara_name = array_line[0];
|
||||
chara_face = array_line[1];
|
||||
}else{
|
||||
chara_name = tmp_line;
|
||||
}
|
||||
//キャラクターボックスへの名前表示
|
||||
var text_obj = {
|
||||
line:i,
|
||||
name:"chara_ptext",
|
||||
pm:{"name":chara_name,"face":chara_face},
|
||||
val:text
|
||||
};
|
||||
|
||||
array_s.push(text_obj);
|
||||
|
||||
|
||||
}else if(first_char ==="*"){
|
||||
//ラベル
|
||||
|
||||
var label_tmp = line_str.substr(1,line_str.length).split("|");
|
||||
|
||||
var label_key = "";
|
||||
var label_val = "";
|
||||
|
||||
label_key = $.trim(label_tmp[0]);
|
||||
|
||||
if(label_tmp.length >1){
|
||||
label_val = $.trim(label_tmp[1]);
|
||||
}
|
||||
|
||||
var label_obj = {
|
||||
name:"label",
|
||||
pm:{
|
||||
"line":i,
|
||||
"index":array_s.length,
|
||||
"label_name":label_key,
|
||||
"val":label_val
|
||||
},
|
||||
val:label_val
|
||||
};
|
||||
|
||||
//ラベル
|
||||
array_s.push(label_obj);
|
||||
|
||||
if(map_label[label_obj.pm.label_name]){
|
||||
//this.kag.warning("警告:"+i+"行目:"+"ラベル名「"+label_obj.pm.label_name+"」は同一シナリオファイル内に重複しています");
|
||||
this.kag.warning("Warning line:"+i+" "+ $.lang("label") +"'"+ label_obj.pm.label_name+"'"+ $.lang("label_double"));
|
||||
|
||||
}else{
|
||||
map_label[label_obj.pm.label_name] = label_obj.pm;
|
||||
}
|
||||
|
||||
}else if(first_char ==="@"){
|
||||
//コマンド行確定なので、その残りの部分を、ごそっと回す
|
||||
var tag_str =line_str.substr(1,line_str.length); // "image split=2 samba = 5"
|
||||
var tmpobj = this.makeTag(tag_str,i);
|
||||
array_s.push(tmpobj);
|
||||
}else{
|
||||
|
||||
//半角アンダーバーで始まっている場合は空白ではじめる
|
||||
if(first_char === "_") {
|
||||
line_str = line_str.substring(1,line_str.length);
|
||||
}
|
||||
|
||||
var array_char = line_str.split("");
|
||||
|
||||
var text = "";//命令じゃない部分はここに配置していく
|
||||
|
||||
var tag_str ="";
|
||||
|
||||
//1文字づつ解析していく
|
||||
var flag_tag = false; //タグ解析中
|
||||
|
||||
var num_kakko = 0; //embタグの中の配列[]扱うために
|
||||
|
||||
for(var j=0;j<array_char.length;j++){
|
||||
var c = array_char[j];
|
||||
|
||||
if(flag_tag ===true){
|
||||
|
||||
if(c==="]" && this.flag_script ==false){
|
||||
|
||||
num_kakko--;
|
||||
|
||||
if(num_kakko == 0){
|
||||
|
||||
flag_tag = false;
|
||||
array_s.push(this.makeTag(tag_str,i));
|
||||
//tag_str をビルドして、命令配列に格納
|
||||
tag_str ="";
|
||||
|
||||
}else{
|
||||
tag_str +=c;
|
||||
}
|
||||
}else if(c ==="[" && this.flag_script == false ){
|
||||
|
||||
num_kakko++;
|
||||
tag_str +=c;
|
||||
|
||||
} else{
|
||||
tag_str +=c;
|
||||
}
|
||||
|
||||
}
|
||||
else if(flag_tag === false && c==="[" && this.flag_script == false){
|
||||
|
||||
num_kakko++;
|
||||
|
||||
//テキストファイルを命令に格納
|
||||
if(text!=""){
|
||||
|
||||
var text_obj = {
|
||||
line:i,
|
||||
name:"text",
|
||||
pm:{"val":text},
|
||||
val:text
|
||||
};
|
||||
|
||||
array_s.push(text_obj);
|
||||
|
||||
text ="";
|
||||
}
|
||||
|
||||
flag_tag = true;
|
||||
|
||||
}else{
|
||||
|
||||
text +=c;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(text !=""){
|
||||
var text_obj = {
|
||||
line:i,
|
||||
name:"text",
|
||||
pm:{"val":text},
|
||||
val:text
|
||||
};
|
||||
|
||||
array_s.push(text_obj);
|
||||
}
|
||||
|
||||
//console.log(array_char);
|
||||
|
||||
}
|
||||
//1行づつ解析解析していく
|
||||
|
||||
}
|
||||
|
||||
var result_obj = {
|
||||
|
||||
array_s:array_s,
|
||||
map_label:map_label
|
||||
|
||||
};
|
||||
|
||||
if (this.deep_if != 0) {
|
||||
alert("[if]と[endif]の数が一致しません。シナリオを見直してみませんか?");
|
||||
this.deep_if = 0;
|
||||
}
|
||||
|
||||
return result_obj;
|
||||
|
||||
|
||||
},
|
||||
|
||||
//タグ情報から、オブジェクトを作成して返却する
|
||||
makeTag:function(str,line){
|
||||
|
||||
var obj ={
|
||||
line:line,
|
||||
name:"",
|
||||
pm:{},
|
||||
val:""
|
||||
};
|
||||
|
||||
|
||||
var array_c = str.split("");
|
||||
|
||||
var flag_quot_c = "";
|
||||
|
||||
var tmp_str = "";
|
||||
|
||||
var cnt_quot_c = 0;
|
||||
|
||||
for (var j=0;j<array_c.length;j++){
|
||||
|
||||
var c = array_c[j];
|
||||
|
||||
if(flag_quot_c =="" && (c ==="\"" || c ==="'" )){
|
||||
flag_quot_c = c;
|
||||
cnt_quot_c = 0;
|
||||
}else{
|
||||
|
||||
//特殊自体発生中
|
||||
if(flag_quot_c !=""){
|
||||
|
||||
//特殊状態解除
|
||||
if(c === flag_quot_c){
|
||||
|
||||
flag_quot_c ="";
|
||||
|
||||
//""のように直後に"が出てきた場合undefinedを代入
|
||||
if(cnt_quot_c==0){
|
||||
tmp_str+="undefined";
|
||||
}
|
||||
|
||||
cnt_quot_c=0;
|
||||
|
||||
}else{
|
||||
|
||||
if(c =="="){
|
||||
c = "#";
|
||||
}
|
||||
|
||||
//空白削除。カンマの中の場合
|
||||
if(c ==" "){
|
||||
//個々消さないとダメ
|
||||
c ="";
|
||||
}
|
||||
|
||||
tmp_str +=c;
|
||||
cnt_quot_c++;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
tmp_str +=c;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
str = tmp_str ;
|
||||
|
||||
//str = $.replaceAll(str,'"','');
|
||||
//str = $.replaceAll(str,"'",'');
|
||||
|
||||
var array = str.split(" ");
|
||||
|
||||
//タグの名前 [xxx
|
||||
obj.name = $.trim(array[0]);
|
||||
|
||||
//=のみが出てきた場合は前後のをくっつけて、ひとつの変数にしてしまって良い
|
||||
for(var k=1;k<array.length;k++){
|
||||
|
||||
if(array[k] ==""){
|
||||
|
||||
array.splice(k,1);
|
||||
k--;
|
||||
}
|
||||
|
||||
else if(array[k] ==="="){
|
||||
if(array[k-1]){
|
||||
if(array[k+1]){
|
||||
array[k-1] = array[k-1]+"="+array[k+1];
|
||||
array.splice(k,2);
|
||||
k--;
|
||||
|
||||
}
|
||||
}
|
||||
}else if(array[k].substr(0,1)==="="){
|
||||
if(array[k-1]){
|
||||
if(array[k]){
|
||||
array[k-1] = array[k-1]+array[k];
|
||||
array.splice(k,1);
|
||||
//k--;
|
||||
|
||||
}
|
||||
}
|
||||
}else if(array[k].substr(array[k].length-1,array[k].length)==="="){
|
||||
if(array[k+1]){
|
||||
if(array[k]){
|
||||
array[k] = array[k]+array[k+1];
|
||||
array.splice(k+1,1);
|
||||
//k--;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
for(var i=1;i<array.length;i++){
|
||||
|
||||
var tmp = $.trim(array[i]).split("=");
|
||||
|
||||
var pm_key = $.trim(tmp[0]);
|
||||
var pm_val = $.trim(tmp[1]);
|
||||
|
||||
//全引き継ぎ対応
|
||||
if(pm_key=="*"){
|
||||
obj.pm["*"]="";
|
||||
}
|
||||
//特殊変換された値はそのまま代入できない
|
||||
if(pm_val!=""){
|
||||
obj.pm[pm_key] = $.replaceAll(pm_val,"#","=");
|
||||
}
|
||||
|
||||
if(pm_val=="undefined"){
|
||||
obj.pm[pm_key]="";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(obj.name == "iscript"){
|
||||
this.flag_script = true;
|
||||
}
|
||||
if(obj.name == "endscript"){
|
||||
this.flag_script = false;
|
||||
}
|
||||
|
||||
|
||||
switch (obj.name) {
|
||||
case "if":
|
||||
this.deep_if++;
|
||||
case "elsif":
|
||||
case "else":
|
||||
obj.pm.deep_if = this.deep_if;
|
||||
break;
|
||||
case "endif":
|
||||
obj.pm.deep_if = this.deep_if;
|
||||
this.deep_if--;
|
||||
break;
|
||||
};
|
||||
|
||||
return obj;
|
||||
|
||||
},
|
||||
|
||||
test:function(){
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
//ティラノライダー用のクラス
|
||||
//デバッグツール向けの処理が集中します。
|
||||
|
||||
tyrano.plugin.kag.rider = {
|
||||
|
||||
app : {}, //ライダー側のルート
|
||||
tyrano : null,
|
||||
rider_view : {},
|
||||
|
||||
init : function() {
|
||||
//alert("init rider");
|
||||
},
|
||||
|
||||
complete : function(TG) {
|
||||
//ゲームがスタートした時にライダー側に通知する
|
||||
//alert("complete!");
|
||||
//riderからの起動かどうかを判定する必要あり
|
||||
if (window.opener && window.opener.app) {
|
||||
if(window.opener.app.config.user_config.check_debug==true){
|
||||
TYRANO.kag.is_rider = true;
|
||||
this.app = window.opener.app;
|
||||
this.app.completeRider(TG);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
cutTyranoTag : function(tag, pm) {
|
||||
|
||||
TYRANO.kag.ftag.startTag(tag, pm);
|
||||
|
||||
},
|
||||
|
||||
cutTyranoScript : function(str) {
|
||||
|
||||
var result = TYRANO.kag.parser.parseScenario(str);
|
||||
|
||||
var array_s = result.array_s;
|
||||
for (var i = 0; i < array_s.length; i++) {
|
||||
var tag = array_s[i];
|
||||
this.app.rider_view.pushConsoleGrid("tag", tag);
|
||||
this.cutTyranoTag(tag.name, tag.pm);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
insertElement : function(category, file) {
|
||||
|
||||
var path = "./data/" + category + "/" + file;
|
||||
|
||||
if(category=="fgimage" || category =="image"){
|
||||
var j_img = $("<div style='position:absolute;z-index:9999999;'><div class='area_pos' style='position:absolute;width:100px;opacity:0.5;background-color:black;color:white'></div><div class='button_delete' style='position:absolute;right:0px;border:solid 1px gray;background-color:white;width:20px;height:20px;cursor:pointer' >×</div><img style='border:solid 1px green;' src='"+path+"' /></div>");
|
||||
|
||||
(function(){
|
||||
|
||||
var _j_img = j_img;
|
||||
var _category = category;
|
||||
var _file = file;
|
||||
|
||||
|
||||
j_img.draggable({
|
||||
|
||||
scroll : false,
|
||||
//containment:".tyrano_base",
|
||||
stop : function(e, ui) {
|
||||
|
||||
//j_x.html(ui.position.left);
|
||||
//j_y.html(ui.position.top);
|
||||
_j_img.find(".area_pos").html("x:"+ui.position.left+" y:"+ui.position.top);
|
||||
|
||||
//タグのプレビューがここに表示される
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
_j_img.find(".button_delete").click(function(){
|
||||
_j_img.remove();
|
||||
});
|
||||
|
||||
//ドラッグを出来るように
|
||||
$(".tyrano_base").attr("ondragstart","");
|
||||
$(".tyrano_base").append(_j_img);
|
||||
|
||||
})();
|
||||
|
||||
}else if(category =="bgimage"){
|
||||
//背景画像変更
|
||||
var j_new_bg = TYRANO.kag.layer.getLayer("base", "fore");
|
||||
j_new_bg.css("background-image","url("+path+")");
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
//シナリオのラベル一覧を取得する
|
||||
getScenario : function(scenario_name, call_back) {
|
||||
|
||||
var that = this;
|
||||
|
||||
var file_url = "./data/scenario/" + scenario_name;
|
||||
|
||||
$.loadText(file_url, function(text_str) {
|
||||
|
||||
var result_obj = TYRANO.kag.parser.parseScenario(text_str);
|
||||
|
||||
if (call_back) {
|
||||
call_back(result_obj);
|
||||
}
|
||||
|
||||
});
|
||||
//ラベルの一覧を取得
|
||||
|
||||
//呼び出し元(riderの関数呼び出し方法)
|
||||
//window.opener.myFunc();
|
||||
|
||||
},
|
||||
|
||||
//キャラクター情報を返却する
|
||||
getCharaInfo:function(){
|
||||
|
||||
return TYRANO.kag.stat.charas;
|
||||
|
||||
},
|
||||
|
||||
//変数を取得する
|
||||
getVariables : function() {
|
||||
var map_variable = TYRANO.kag.variable;
|
||||
|
||||
var f = TYRANO.kag.stat.f;
|
||||
var mp = TYRANO.kag.stat.mp;
|
||||
|
||||
map_variable.f = f;
|
||||
map_variable.mp = mp;
|
||||
|
||||
return map_variable;
|
||||
},
|
||||
|
||||
//ライダー側で変数が編集された
|
||||
evalScript : function(str) {
|
||||
TYRANO.kag.evalScript(str);
|
||||
},
|
||||
|
||||
//変数値を更新します
|
||||
pushVariableGrid : function() {
|
||||
//更新が合ったことを通知するだけ
|
||||
this.app.rider_view.updateVariable();
|
||||
},
|
||||
|
||||
initSave:function(){
|
||||
localStorage.clear();
|
||||
},
|
||||
|
||||
//命令が実行されて、デバッグツール側にコンソールを発信する
|
||||
pushConsoleLog : function(tag) {
|
||||
//タグをアプリ側にプッシュします
|
||||
this.app.rider_view.pushConsoleGrid("tag", tag);
|
||||
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
//ティラノスタジオ用のクラス
|
||||
//デバッグツール向けの処理が集中します。
|
||||
|
||||
tyrano.plugin.kag.studio = {
|
||||
|
||||
app : {}, //ライダー側のルート
|
||||
tyrano : null,
|
||||
rider_view : {},
|
||||
ipc:{},
|
||||
init : function() {
|
||||
//alert("init rider");
|
||||
|
||||
if(window.navigator.userAgent.indexOf("TyranoStudio") !=-1){
|
||||
|
||||
TYRANO.kag.is_studio = true;
|
||||
|
||||
this.ipc = require('electron');
|
||||
|
||||
this.ipc.ipcRenderer.on('ping', (event, arg) => {
|
||||
console.log("wwwwwwwwwwwwwww");
|
||||
console.log(arg);
|
||||
ipc.ipcRenderer.send('asynchronous-reply', JSON.stringify(arg));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//ユーザーエージェントに TyranoStudio があるかどうかで判定する
|
||||
/*
|
||||
ipcRenderer.on('ping', (event, arg) => {
|
||||
console.log(arg) // pong
|
||||
})
|
||||
*/
|
||||
|
||||
|
||||
},
|
||||
|
||||
send:function(key,json_obj){
|
||||
|
||||
this.ipc.ipcRenderer.send(key, JSON.stringify(json_obj));
|
||||
|
||||
},
|
||||
|
||||
pushConsole:function(obj){
|
||||
|
||||
this.send("replay-console",obj);
|
||||
|
||||
},
|
||||
|
||||
complete : function(TG) {
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
|
@ -0,0 +1,574 @@
|
|||
|
||||
/*
|
||||
#[camera]
|
||||
:group
|
||||
カメラ操作
|
||||
:title
|
||||
カメラを移動する
|
||||
:exp
|
||||
カメラをズームやパンさせる演出を追加できます。
|
||||
この機能を使うと、立ち絵のキャラクター表情にフォーカスをあてたり
|
||||
一枚絵であっても多彩な演出が可能になります。
|
||||
|
||||
カメラ機能を使用するにはConfig.tjs の useCameraをtrueにする必要があります。
|
||||
また、カメラ機能を有効にした場合、画面の中央寄せ(ScreenCentering)が無効になります。
|
||||
|
||||
カメラの座標は画面中央が(x:0,y:0)です。
|
||||
例えば、画面右上は x:200 y:200 画面左下は x:-200 y:-200 という座標指定になります。
|
||||
|
||||
カメラを元の位置に戻すためには[reset_camera]タグを使用します。
|
||||
カメラの演出完了を待ちたい場合は[wait_camera]タグを使用します。
|
||||
|
||||
【重要】
|
||||
カメラ演出が終わったら、必ず[reset_camera]でカメラの位置を初期値に戻して下さい。
|
||||
カメラを戻さないと、背景の変更 [bg]タグ等は使用できません。
|
||||
|
||||
:sample
|
||||
|
||||
@camera zoom=2 x=180 y=100 time=1000
|
||||
@camera x=-180 y=100 time=2000
|
||||
@camera zoom=2 from_zoom=3 x=180 y=100 time=1000
|
||||
|
||||
;カメラの位置を元に戻す
|
||||
@reset_camera
|
||||
|
||||
:param
|
||||
time=カメラが座標へ移動する時間を指定できます。ミリ秒で指定して下さい。デフォルトは1000,
|
||||
x=カメラの移動するX座標を指定して下さい,
|
||||
y=カメラの移動するY座標を指定して下さい,
|
||||
zoom=カメラの拡大率を指定して下さい。例えば2と指定すると2倍ズームします,
|
||||
rotate=カメラの傾きを指定します。例えば20 だとカメラが20度傾きます。,
|
||||
from_x=カメラの移動開始時のX座標を指定できます,
|
||||
from_y=カメラの移動開始時のY座標を指定できます,
|
||||
from_zoom=カメラの移動開始時の倍率を指定できます,
|
||||
from_rotate=カメラの移動開始時の傾きを指定できます,
|
||||
wait=カメラ移動の完了を待つかどうかを指定します。falseを指定するとカメラ移動中もゲームを進行することができます。デフォルトはtrue,
|
||||
layer=レイヤを指定します。背景ならbase 前景レイヤならう 0以上の数字。カメラの効果を特定レイヤだけに適応できます。,
|
||||
ease_type=カメラの移動演出を指定できます。
|
||||
ease(開始時点と終了時点を滑らかに再生する)
|
||||
linear(一定の間隔で再生する)
|
||||
ease-in(開始時点をゆっくり再生する)
|
||||
ease-out(終了時点をゆっくり再生する)
|
||||
ease-in-out(開始時点と終了時点をゆっくり再生する)
|
||||
デフォルトはeaseです。
|
||||
#[end]
|
||||
*/
|
||||
|
||||
|
||||
tyrano.plugin.kag.tag.camera = {
|
||||
|
||||
vital : [],
|
||||
|
||||
pm : {
|
||||
|
||||
time : 1000,
|
||||
|
||||
from_x : "0",
|
||||
from_y : "0",
|
||||
from_zoom : "1",
|
||||
from_rotate:"0",
|
||||
|
||||
x : "",
|
||||
y : "",
|
||||
zoom : "",
|
||||
rotate:"",
|
||||
layer:"layer_camera",
|
||||
|
||||
wait:"true",
|
||||
ease_type : "ease"
|
||||
|
||||
|
||||
},
|
||||
|
||||
start : function(pm) {
|
||||
var that = this;
|
||||
|
||||
/*
|
||||
if(this.kag.config.useCamera == "false"){
|
||||
$.alert("[camera]タグエラー。カメラの使用を許可して下さい。Config.tjsのuseCameraをtrueにする必要があります");
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
//duration を確認する
|
||||
var duration = pm.time + "ms";
|
||||
|
||||
if(typeof this.kag.stat.current_camera[pm.layer] == "undefined"){
|
||||
this.kag.stat.current_camera[pm.layer] = {
|
||||
x : "0",
|
||||
y : "0",
|
||||
scale : "1",
|
||||
rotate:"0"
|
||||
};
|
||||
}
|
||||
|
||||
var to_camera = $.extend(true, {}, this.kag.stat.current_camera[pm.layer]);
|
||||
|
||||
//指定されて項目があるなら、上書きする
|
||||
if(pm.x!="") to_camera.x = parseInt(pm.x)*-1 +"px";
|
||||
if(pm.y!="") to_camera.y = parseInt(pm.y)*1 +"px";
|
||||
if(pm.zoom!="") to_camera.scale = pm.zoom;
|
||||
if(pm.rotate!="") to_camera.rotate = pm.rotate+"deg";
|
||||
|
||||
|
||||
if(pm.from_x != "0" || pm.from_y!="0" || pm.from_zoom!="1" || pm.from_rotate!="0" ){
|
||||
|
||||
this.kag.stat.current_camera[pm.layer] = {
|
||||
x : parseInt(pm.from_x)*-1 +"px",
|
||||
y : parseInt(pm.from_y)*1+"px",
|
||||
scale : pm.from_zoom,
|
||||
rotate:pm.from_rotate+"deg"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
var flag_complete = false;
|
||||
that.kag.stat.is_move_camera = true;
|
||||
|
||||
var a3d_define = {
|
||||
frames : {
|
||||
|
||||
"0%" : {
|
||||
trans : this.kag.stat.current_camera[pm.layer]
|
||||
},
|
||||
"100%" : {
|
||||
trans : to_camera
|
||||
}
|
||||
},
|
||||
|
||||
config : {
|
||||
duration : duration,
|
||||
state : "running",
|
||||
easing : pm.ease_type
|
||||
},
|
||||
|
||||
complete:function(){
|
||||
//アニメーションが完了しないと次へはいかない
|
||||
if(pm.wait =="true" && flag_complete ==false){
|
||||
flag_complete=true; //最初の一回だけwait有効
|
||||
|
||||
setTimeout(function(){
|
||||
that.kag.ftag.nextOrder();
|
||||
},300);
|
||||
|
||||
}else{
|
||||
|
||||
//カメラを待ってる状態なら
|
||||
if(that.kag.stat.is_wait_camera == true){
|
||||
that.kag.stat.is_wait_camera = false;
|
||||
that.kag.ftag.nextOrder();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
that.kag.stat.is_move_camera = false;
|
||||
}
|
||||
};
|
||||
|
||||
this.kag.stat.current_camera[pm.layer] = to_camera;
|
||||
|
||||
if(pm.wait =="false"){
|
||||
that.kag.ftag.nextOrder();
|
||||
}
|
||||
|
||||
//アニメーションの実行
|
||||
if(pm.layer=="layer_camera"){
|
||||
$(".layer_camera").css("-webkit-transform-origin", "center center");
|
||||
$(".layer_camera").a3d(a3d_define);
|
||||
this.kag.stat.current_camera_layer = "";
|
||||
}else{
|
||||
$("."+pm.layer +"_fore").css("-webkit-transform-origin", "center center");
|
||||
$("."+pm.layer +"_fore").a3d(a3d_define);
|
||||
this.kag.stat.current_camera_layer = pm.layer;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
play : function(obj, cb) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
#[reset_camera]
|
||||
:group
|
||||
カメラ操作
|
||||
:title
|
||||
カメラをリセットする
|
||||
:exp
|
||||
カメラの位置を初期値に戻します。
|
||||
[camera]タグを使った演出が終わった後は、必ず[reset_camera]で位置を元に戻して下さい。
|
||||
位置を戻さない場合は背景変更などで不具合が生じる場合があります。
|
||||
:sample
|
||||
:param
|
||||
time=初期位置にカメラが移動する時間をミリ秒で指定します。デフォルトは1000です。,
|
||||
wait=カメラ移動の完了を待つかどうかを指定します。falseを指定するとカメラ移動中もゲームを進行することができます。デフォルトはtrue,
|
||||
ease_type=カメラの戻り方を指定できます。デフォルトはease 詳細はcameraタグを確認。,
|
||||
layer=レイヤを指定します。背景ならbase 前景レイヤならう 0以上の数字。カメラの効果を特定レイヤだけに適応できます。
|
||||
#[end]
|
||||
*/
|
||||
|
||||
|
||||
tyrano.plugin.kag.tag.reset_camera = {
|
||||
|
||||
vital : [],
|
||||
|
||||
pm : {
|
||||
|
||||
time : 1000,
|
||||
|
||||
wait:"true",
|
||||
ease_type : "ease",
|
||||
layer:"layer_camera"
|
||||
|
||||
},
|
||||
|
||||
start : function(pm) {
|
||||
var that = this;
|
||||
//duration を確認する
|
||||
|
||||
if(parseInt(pm.time)<10){
|
||||
pm.time=10;
|
||||
}
|
||||
|
||||
var duration = pm.time + "ms";
|
||||
|
||||
var to_scale = 1;
|
||||
|
||||
var to_camera = {
|
||||
x:"0px",
|
||||
y:"0px",
|
||||
scale:"1",
|
||||
rotate:"0deg"
|
||||
}
|
||||
|
||||
var flag_complete = false;
|
||||
|
||||
that.kag.stat.is_move_camera = true;
|
||||
|
||||
var a3d_define = {
|
||||
frames : {
|
||||
|
||||
"0%" : {
|
||||
trans : this.kag.stat.current_camera[pm.layer]
|
||||
},
|
||||
"100%" : {
|
||||
trans : to_camera
|
||||
}
|
||||
},
|
||||
|
||||
config : {
|
||||
duration : duration,
|
||||
state : "running",
|
||||
easing : pm.ease_type
|
||||
},
|
||||
|
||||
complete:function(){
|
||||
//アニメーションが完了しないと次へはいかない
|
||||
if(pm.wait =="true" && flag_complete ==false){
|
||||
flag_complete=true; //最初の一回だけwait有効
|
||||
that.kag.ftag.nextOrder();
|
||||
}else{
|
||||
|
||||
//カメラを待ってる状態なら
|
||||
if(that.kag.stat.is_wait_camera == true){
|
||||
that.kag.stat.is_wait_camera = false;
|
||||
that.kag.ftag.nextOrder();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//リセットした時は、本当に消す
|
||||
$("."+pm.layer).css({
|
||||
"-animation-name":"",
|
||||
"-animation-duration":"",
|
||||
"-animation-play-state":"",
|
||||
"-animation-delay":"",
|
||||
"-animation-iteration-count":"",
|
||||
"-animation-direction": "",
|
||||
"-animation-fill-mode": "",
|
||||
"-animation-timing-function":"",
|
||||
"transform":""
|
||||
});
|
||||
|
||||
|
||||
that.kag.stat.is_move_camera = false;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
if(pm.layer!="layer_camera"){
|
||||
delete this.kag.stat.current_camera[pm.layer] ;
|
||||
}else{
|
||||
//全クリア
|
||||
this.kag.stat.current_camera = {};
|
||||
}
|
||||
|
||||
if(pm.wait =="false"){
|
||||
that.kag.ftag.nextOrder();
|
||||
}
|
||||
|
||||
//アニメーションの実行
|
||||
if(pm.layer=="layer_camera"){
|
||||
$(".layer_camera").css("-webkit-transform-origin", "center center");
|
||||
$(".layer_camera").a3d(a3d_define);
|
||||
this.kag.stat.current_camera_layer = "";
|
||||
}else{
|
||||
$("."+pm.layer +"_fore").css("-webkit-transform-origin", "center center");
|
||||
$("."+pm.layer +"_fore").a3d(a3d_define);
|
||||
this.kag.stat.current_camera_layer = "";
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
play : function(obj, cb) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
#[wait_camera]
|
||||
:group
|
||||
カメラ操作
|
||||
:title
|
||||
カメラの演出を待つ
|
||||
:exp
|
||||
このタグはカメラの操作中である場合、完了を待つことができます。
|
||||
例えば、cameraタグでwaitにfalseを指定して、ゲームを進行する場合、特定の位置で必ずカメラ演出の完了を待たせる事が出来ます
|
||||
|
||||
:sample
|
||||
|
||||
[camera zoom=2 x=180 y=100 time=5000]
|
||||
カメラ演出中[p]
|
||||
ここでもカメラ演出中[p]
|
||||
[wait_camera]
|
||||
カメラの演出が終わったので進行[p]
|
||||
|
||||
:param
|
||||
#[end]
|
||||
*/
|
||||
|
||||
tyrano.plugin.kag.tag.wait_camera = {
|
||||
start : function(pm) {
|
||||
|
||||
//今、カメラ中なら待つ
|
||||
if(this.kag.stat.is_move_camera == true){
|
||||
//this.kag.layer.hideEventLayer();
|
||||
this.kag.stat.is_wait_camera = true;
|
||||
}else{
|
||||
this.kag.ftag.nextOrder();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
#[mask]
|
||||
:group
|
||||
レイヤ関連
|
||||
:title
|
||||
スクリーンマスク表示
|
||||
:exp
|
||||
ゲーム画面全体を豊富な効果とともに暗転させることができます。
|
||||
暗転中にゲーム画面を再構築して[mask_off]タグでゲームを再開する使い方ができます。
|
||||
:sample
|
||||
;暗転開始
|
||||
[mask effect="fadeInDownBig" time=2000]
|
||||
|
||||
;裏で画面操作
|
||||
[bg storage="umi.jpg" time=500]
|
||||
|
||||
;暗転解除
|
||||
[mask_off]
|
||||
|
||||
:param
|
||||
time=暗転が完了するまでの時間をミリ秒で指定できます ,
|
||||
effect=暗転の効果を指定できます。デフォルトは「fadeIn」指定できるのは次のとおりです
|
||||
fadeIn/
|
||||
fadeInDownBig/
|
||||
fadeInLeftBig/
|
||||
fadeInRightBig/<br >
|
||||
fadeInUpBig/
|
||||
flipInX/
|
||||
flipInY/
|
||||
lightSpeedIn/<br >
|
||||
rotateIn/
|
||||
rotateInDownLeft/
|
||||
rotateInDownRight/
|
||||
rotateInUpLeft/<br >
|
||||
rotateInUpRight/
|
||||
zoomIn/
|
||||
zoomInDown/
|
||||
zoomInLeft/<br >
|
||||
zoomInRight/
|
||||
zoomInUp/
|
||||
slideInDown/
|
||||
slideInLeft/<br >
|
||||
slideInRight/
|
||||
slideInUp/
|
||||
bounceIn /
|
||||
bounceInDown/
|
||||
bounceInLeft/<br >
|
||||
bounceInRight/
|
||||
bounceInUp/
|
||||
rollIn,
|
||||
color=文字の色を指定して下さい。デフォルトは黒です。0xFFFFFF形式で指定します,
|
||||
graphic=暗転部分に独自画像を指定できます。画像はimageフォルダに配置してください,
|
||||
folder=graphicで指定するフォルダをimage以外に変更したい場合はこちらに記述します。例えばbgimage fgimageなどです
|
||||
|
||||
#[end]
|
||||
*/
|
||||
|
||||
|
||||
tyrano.plugin.kag.tag.mask = {
|
||||
|
||||
vital : [],
|
||||
|
||||
pm : {
|
||||
|
||||
time : 1000,
|
||||
effect:"fadeIn",
|
||||
color:"0x000000",
|
||||
graphic:"",
|
||||
folder:""
|
||||
|
||||
},
|
||||
|
||||
start : function(pm) {
|
||||
|
||||
var that = this;
|
||||
that.kag.layer.hideEventLayer();
|
||||
|
||||
var j_div = $("<div class='layer layer_mask' data-effect='"+pm.effect+"' style='z-index:100000000;position:absolute;'>");
|
||||
j_div.css("animation-duration",parseInt(pm.time)+"ms");
|
||||
|
||||
var sc_width = parseInt(that.kag.config.scWidth);
|
||||
var sc_height = parseInt(that.kag.config.scHeight);
|
||||
|
||||
j_div.css({width:sc_width,height:sc_height});
|
||||
|
||||
if(pm.color=="none"){
|
||||
j_div.css("background-color","");
|
||||
}else{
|
||||
j_div.css("background-color",$.convertColor(pm.color));
|
||||
}
|
||||
|
||||
if(pm.graphic !=""){
|
||||
var foler="";
|
||||
if (pm.folder != "") {
|
||||
folder = pm.folder;
|
||||
} else {
|
||||
folder = "image";
|
||||
}
|
||||
|
||||
var storage_url = "";
|
||||
|
||||
if(pm.graphic!=""){
|
||||
storage_url = "./data/"+folder+"/"+pm.graphic;
|
||||
j_div.css("background-image","url("+storage_url+")");
|
||||
}
|
||||
}
|
||||
|
||||
$(".tyrano_base").append(j_div);
|
||||
|
||||
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
|
||||
j_div.addClass('animated ' + pm.effect).one(animationEnd, function() {
|
||||
//$(this).removeClass('animated ' + pm.effect);
|
||||
that.kag.ftag.nextOrder();
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
#[mask_off]
|
||||
:group
|
||||
レイヤ関連
|
||||
:title
|
||||
スクリーンマスク消去
|
||||
:exp
|
||||
スクリーンマスクを消去してゲームを再開します。
|
||||
:sample
|
||||
;暗転開始
|
||||
[mask effect="fadeInDownBig" time=2000]
|
||||
|
||||
;裏で画面操作
|
||||
[bg storage="umi.jpg" time=500]
|
||||
|
||||
;暗転解除
|
||||
[mask_off]
|
||||
|
||||
:param
|
||||
time=暗転が完了するまでの時間をミリ秒で指定できます ,
|
||||
effect=暗転の効果を指定できます。デフォルトは「fadeOut」指定できるのは次のとおりです
|
||||
fadeOut/
|
||||
fadeOutDownBig/
|
||||
fadeOutLeftBig/
|
||||
fadeOutRightBig/
|
||||
fadeOutUpBig/
|
||||
flipOutX/<br >
|
||||
flipOutY/
|
||||
lightSpeedOut/
|
||||
rotateOut/
|
||||
rotateOutDownLeft/
|
||||
rotateOutDownRight/<br >
|
||||
rotateOutUpLeft/
|
||||
rotateOutUpRight/
|
||||
zoomOut/
|
||||
zoomOutDown/<br >
|
||||
zoomOutLeft/
|
||||
zoomOutRight/
|
||||
zoomOutUp/
|
||||
slideOutDown/<br >
|
||||
slideOutLeft/
|
||||
slideOutRight/
|
||||
slideOutUp/<br >
|
||||
bounceOut /
|
||||
bounceOutDown/
|
||||
bounceOutLeft/<br >
|
||||
bounceOutRight/
|
||||
bounceOutUp
|
||||
#[end]
|
||||
*/
|
||||
|
||||
|
||||
tyrano.plugin.kag.tag.mask_off = {
|
||||
|
||||
vital : [],
|
||||
|
||||
pm : {
|
||||
|
||||
time : 1000,
|
||||
effect:"fadeOut"
|
||||
|
||||
},
|
||||
|
||||
start : function(pm) {
|
||||
var that = this;
|
||||
var j_div = $(".layer_mask");
|
||||
|
||||
if (j_div.get(0)) {
|
||||
|
||||
var _effect = j_div.attr("data-effect");
|
||||
j_div.removeClass('animated '+_effect);
|
||||
j_div.css("animation-duration",parseInt(pm.time)+"ms");
|
||||
|
||||
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
|
||||
j_div.addClass('animated ' + pm.effect).one(animationEnd, function() {
|
||||
j_div.remove();
|
||||
that.kag.layer.showEventLayer();
|
||||
that.kag.ftag.nextOrder();
|
||||
});
|
||||
|
||||
}else{
|
||||
that.kag.layer.showEventLayer();
|
||||
that.kag.ftag.nextOrder();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
108
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/tyrano.base.js
Normal file
|
@ -0,0 +1,108 @@
|
|||
|
||||
tyrano.base ={
|
||||
|
||||
//読み込み対象のモジュール
|
||||
tyrano:null,
|
||||
modules:[],
|
||||
options:{
|
||||
|
||||
},
|
||||
|
||||
init:function(tyrano){
|
||||
this.tyrano = tyrano;
|
||||
},
|
||||
|
||||
setBaseSize:function(width,height){
|
||||
|
||||
this.tyrano.get(".tyrano_base").css("width",width).css("height",height).css("background-color","black");
|
||||
|
||||
//NW.js 以外の場合。absolute
|
||||
if(!$.isNWJS()){
|
||||
$(".tyrano_base").css("position","absolute");
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
//画面サイズをぴったりさせます
|
||||
fitBaseSize:function(width,height){
|
||||
|
||||
var that = this;
|
||||
var view_width = $.getViewPort().width;
|
||||
var view_height = $.getViewPort().height;
|
||||
|
||||
var width_f = view_width / width ;
|
||||
var height_f = view_height / height;
|
||||
|
||||
var scale_f = 0;
|
||||
|
||||
var space_width = 0;
|
||||
|
||||
var screen_ratio = this.tyrano.kag.config.ScreenRatio;
|
||||
|
||||
//比率を固定にしたい場合は以下 以下のとおりになる
|
||||
if(screen_ratio =="fix"){
|
||||
|
||||
if(width_f > height_f){
|
||||
scale_f = height_f;
|
||||
}else{
|
||||
scale_f = width_f;
|
||||
}
|
||||
|
||||
this.tyrano.kag.tmp.base_scale = scale_f;
|
||||
|
||||
setTimeout(function() {
|
||||
|
||||
//中央寄せなら、画面サイズ分を引く。
|
||||
if(that.tyrano.kag.config["ScreenCentering"] && that.tyrano.kag.config["ScreenCentering"]=="true"){
|
||||
|
||||
$(".tyrano_base").css("transform-origin","0 0");
|
||||
$(".tyrano_base").css({
|
||||
margin: 0
|
||||
});
|
||||
|
||||
var width = Math.abs(parseInt(window.innerWidth) - parseInt(that.tyrano.kag.config.scWidth*scale_f))/2;
|
||||
var height = Math.abs(parseInt(window.innerHeight) - parseInt(that.tyrano.kag.config.scHeight*scale_f))/2;
|
||||
|
||||
if(width_f > height_f){
|
||||
$(".tyrano_base").css("left",width+"px");
|
||||
$(".tyrano_base").css("top","0px");
|
||||
}else{
|
||||
|
||||
$(".tyrano_base").css("left","0px");
|
||||
$(".tyrano_base").css("top",height+"px");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$(".tyrano_base").css("transform", "scale(" + scale_f + ") ");
|
||||
if (parseInt(view_width) < parseInt(width)) {
|
||||
if (scale_f < 1) {
|
||||
window.scrollTo(width, height);
|
||||
}
|
||||
}
|
||||
|
||||
}, 100);
|
||||
|
||||
}else if(screen_ratio =="fit"){
|
||||
|
||||
//スクリーンサイズに合わせて自動的に調整される
|
||||
setTimeout(function() {
|
||||
$(".tyrano_base").css("transform","scaleX("+width_f+") scaleY("+height_f+")");
|
||||
window.scrollTo(width, height);
|
||||
},100);
|
||||
|
||||
}else{
|
||||
|
||||
//スクリーンサイズ固定
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
test:function(){
|
||||
//alert("tyrano test");
|
||||
}
|
||||
|
||||
};
|
483
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/tyrano.css
Normal file
|
@ -0,0 +1,483 @@
|
|||
/*reset css */
|
||||
@import url("font.css");
|
||||
|
||||
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,
|
||||
form,fieldset,input,textarea,p,blockquote,th,td{
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
table{
|
||||
border-collapse: collapse;
|
||||
border-spacing:0;
|
||||
}
|
||||
fieldset,img{
|
||||
border:0;
|
||||
}
|
||||
address,caption,cite,code,dfn,em,strong,th,var{
|
||||
font-weight:normal;
|
||||
font-style:normal;
|
||||
}
|
||||
ol,ul{
|
||||
list-style:none;
|
||||
}
|
||||
caption,th{
|
||||
text-align:left;
|
||||
}
|
||||
h1,h2,h3,h4,h5,h6{
|
||||
font-weight:normal;
|
||||
font-size:100%;
|
||||
}
|
||||
q:before,q:after{
|
||||
content:'';
|
||||
}
|
||||
abbr,acronym{
|
||||
border:0;
|
||||
}
|
||||
|
||||
|
||||
/*smart novel original css */
|
||||
|
||||
.vertical_text{
|
||||
|
||||
font-family:'@MS 明朝';
|
||||
/*color:white;*/
|
||||
writing-mode:tb-rl;
|
||||
writing-mode:vertical-rl ;
|
||||
-webkit-writing-mode:vertical-rl ;
|
||||
float:right;
|
||||
height:100%;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.layer_menu {
|
||||
display:none;
|
||||
font-size:1.3em;
|
||||
font-weight:bold;
|
||||
position:absolute;
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*メニュ-ボタン系*/
|
||||
.menu_item {position:relative;margin-top:3%;text-align:center;cursor:pointer}
|
||||
.menu_item img {width:auto;max-width:80%;max-height:10%;}
|
||||
.display_menu .button:first-child {margin-top:0;}
|
||||
.display_menu{
|
||||
overflow:visible;padding:0;
|
||||
z-index: 10000;
|
||||
width:100%;
|
||||
height:100%;
|
||||
position: absolute;
|
||||
display:block;
|
||||
/*overflow:visible;padding:2%;display:table-cell;vertical-align:middle*/
|
||||
}
|
||||
|
||||
/* セーブ時の画面の設定
|
||||
--------------------------*/
|
||||
/* セーブデータリスト全体の設定 */
|
||||
.save_list {
|
||||
display: table;
|
||||
table-layout: fixed;
|
||||
width: 70%;
|
||||
height:76px;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
border-top: 1px dotted #CCC;
|
||||
}
|
||||
|
||||
/* セーブデータの設定 */
|
||||
.save_list_item {
|
||||
display: table-row;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* セーブデータのサムネイル部分の設定 */
|
||||
.save_list_item_thumb {
|
||||
display: table-cell;
|
||||
width: 96px;
|
||||
height:72px;
|
||||
padding-top:5px;
|
||||
padding-left:10px;
|
||||
border-bottom: 1px dotted #CCC;
|
||||
|
||||
}
|
||||
|
||||
.save_list_item_thumb img {
|
||||
width: 96px;
|
||||
height: 72px;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* セーブデータのテキスト部文の設定 */
|
||||
.save_list_item_area {
|
||||
display: table-cell;
|
||||
vertical-align: top;
|
||||
padding: 0 10px;
|
||||
border-bottom: 1px dotted #CCC;
|
||||
}
|
||||
/* セーブデータの日付の設定 */
|
||||
.save_list_item_date {
|
||||
display: block;
|
||||
padding: 5px 0;
|
||||
line-height: 1;
|
||||
color:#48D1CC;
|
||||
}
|
||||
/* セーブデータのテキストの設定 */
|
||||
.save_list_item_text {
|
||||
display: block;
|
||||
line-height: 1.3;
|
||||
height: 48px;
|
||||
overflow: hidden;
|
||||
color:#666;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.layer_event_click{
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.layer{
|
||||
background-size:100% 100%;
|
||||
}
|
||||
|
||||
.button_menu{
|
||||
position:absolute;
|
||||
z-index:99999;
|
||||
top:20px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
/*
|
||||
CSSを修正することで、ゲーム画面をカスタマイズすることが可能です
|
||||
* */
|
||||
|
||||
/*ゲーム枠の外側の色を指定します*/
|
||||
|
||||
body{
|
||||
background-color:black;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
overflow:hidden;
|
||||
|
||||
}
|
||||
|
||||
/*次へのクリックを促すアイコン*/
|
||||
|
||||
.img_next{
|
||||
padding-left:3px;
|
||||
}
|
||||
|
||||
/*テキストボックスの共通スタイル*/
|
||||
.text_box{
|
||||
|
||||
}
|
||||
|
||||
.tyrano_base{
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
|
||||
}
|
||||
|
||||
/* button
|
||||
---------------------------------------------- */
|
||||
.glink_button {
|
||||
display: inline-block;
|
||||
zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */
|
||||
*display: inline;
|
||||
vertical-align: baseline;
|
||||
margin: 0 2px;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font: 14px/100% Arial, Helvetica, sans-serif;
|
||||
padding: .5em 2em .55em;
|
||||
text-shadow: 0 1px 1px rgba(0,0,0,.3);
|
||||
-webkit-border-radius: .5em;
|
||||
-moz-border-radius: .5em;
|
||||
border-radius: .5em;
|
||||
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
|
||||
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,.2);
|
||||
}
|
||||
.glink_button:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.glink_button:active {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
|
||||
.button_graphic {
|
||||
display: inline-block;
|
||||
zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */
|
||||
*display: inline;
|
||||
vertical-align: baseline;
|
||||
/*margin: 0 2px;*/
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font: 14px/100% Arial, Helvetica, sans-serif;
|
||||
|
||||
padding: 1em 2em 1em;
|
||||
color:white;
|
||||
text-shadow: 0 1px 1px rgba(0,0,0,.3);
|
||||
|
||||
|
||||
}
|
||||
.button_graphic:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.button_graphic:active {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.bigrounded {
|
||||
-webkit-border-radius: 2em;
|
||||
-moz-border-radius: 2em;
|
||||
border-radius: 2em;
|
||||
}
|
||||
.medium {
|
||||
font-size: 12px;
|
||||
padding: .4em 1.5em .42em;
|
||||
}
|
||||
.small {
|
||||
font-size: 11px;
|
||||
padding: .2em 1em .275em;
|
||||
}
|
||||
|
||||
/* color styles
|
||||
---------------------------------------------- */
|
||||
|
||||
/* black */
|
||||
.black {
|
||||
color: #d7d7d7;
|
||||
border: solid 1px #333;
|
||||
background: #333;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#666), to(#000));
|
||||
background: -moz-linear-gradient(top, #666, #000);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#666666', endColorstr='#000000');
|
||||
}
|
||||
.black:hover {
|
||||
background: #000;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#000));
|
||||
background: -moz-linear-gradient(top, #444, #000);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#000000');
|
||||
}
|
||||
.black:active {
|
||||
color: #666;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#000), to(#444));
|
||||
background: -moz-linear-gradient(top, #000, #444);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#666666');
|
||||
}
|
||||
|
||||
/* gray */
|
||||
.gray {
|
||||
color: #e9e9e9;
|
||||
border: solid 1px #555;
|
||||
background: #6e6e6e;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#888), to(#575757));
|
||||
background: -moz-linear-gradient(top, #888, #575757);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#888888', endColorstr='#575757');
|
||||
}
|
||||
.gray:hover {
|
||||
background: #616161;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#757575), to(#4b4b4b));
|
||||
background: -moz-linear-gradient(top, #757575, #4b4b4b);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#757575', endColorstr='#4b4b4b');
|
||||
}
|
||||
.gray:active {
|
||||
color: #afafaf;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#575757), to(#888));
|
||||
background: -moz-linear-gradient(top, #575757, #888);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#575757', endColorstr='#888888');
|
||||
}
|
||||
|
||||
/* white */
|
||||
.white {
|
||||
color: #606060;
|
||||
border: solid 1px #b7b7b7;
|
||||
background: #fff;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
|
||||
background: -moz-linear-gradient(top, #fff, #ededed);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
|
||||
}
|
||||
.white:hover {
|
||||
background: #ededed;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc));
|
||||
background: -moz-linear-gradient(top, #fff, #dcdcdc);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc');
|
||||
}
|
||||
.white:active {
|
||||
color: #999;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
|
||||
background: -moz-linear-gradient(top, #ededed, #fff);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff');
|
||||
}
|
||||
|
||||
/* orange */
|
||||
.orange {
|
||||
color: #fef4e9;
|
||||
border: solid 1px #da7c0c;
|
||||
background: #f78d1d;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#faa51a), to(#f47a20));
|
||||
background: -moz-linear-gradient(top, #faa51a, #f47a20);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#faa51a', endColorstr='#f47a20');
|
||||
}
|
||||
.orange:hover {
|
||||
background: #f47c20;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f88e11), to(#f06015));
|
||||
background: -moz-linear-gradient(top, #f88e11, #f06015);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f88e11', endColorstr='#f06015');
|
||||
}
|
||||
.orange:active {
|
||||
color: #fcd3a5;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f47a20), to(#faa51a));
|
||||
background: -moz-linear-gradient(top, #f47a20, #faa51a);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f47a20', endColorstr='#faa51a');
|
||||
}
|
||||
|
||||
/* red */
|
||||
.red {
|
||||
color: #faddde;
|
||||
border: solid 1px #980c10;
|
||||
background: #d81b21;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#ed1c24), to(#aa1317));
|
||||
background: -moz-linear-gradient(top, #ed1c24, #aa1317);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ed1c24', endColorstr='#aa1317');
|
||||
}
|
||||
.red:hover {
|
||||
background: #b61318;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#c9151b), to(#a11115));
|
||||
background: -moz-linear-gradient(top, #c9151b, #a11115);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#c9151b', endColorstr='#a11115');
|
||||
}
|
||||
.red:active {
|
||||
color: #de898c;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#aa1317), to(#ed1c24));
|
||||
background: -moz-linear-gradient(top, #aa1317, #ed1c24);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#aa1317', endColorstr='#ed1c24');
|
||||
}
|
||||
|
||||
/* blue */
|
||||
.blue {
|
||||
color: #d9eef7;
|
||||
border: solid 1px #0076a3;
|
||||
background: #0095cd;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#00adee), to(#0078a5));
|
||||
background: -moz-linear-gradient(top, #00adee, #0078a5);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00adee', endColorstr='#0078a5');
|
||||
}
|
||||
.blue:hover {
|
||||
background: #007ead;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#0095cc), to(#00678e));
|
||||
background: -moz-linear-gradient(top, #0095cc, #00678e);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0095cc', endColorstr='#00678e');
|
||||
}
|
||||
.blue:active {
|
||||
color: #80bed6;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#0078a5), to(#00adee));
|
||||
background: -moz-linear-gradient(top, #0078a5, #00adee);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0078a5', endColorstr='#00adee');
|
||||
}
|
||||
|
||||
/* rosy */
|
||||
.rosy {
|
||||
color: #fae7e9;
|
||||
border: solid 1px #b73948;
|
||||
background: #da5867;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f16c7c), to(#bf404f));
|
||||
background: -moz-linear-gradient(top, #f16c7c, #bf404f);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f16c7c', endColorstr='#bf404f');
|
||||
}
|
||||
.rosy:hover {
|
||||
background: #ba4b58;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#cf5d6a), to(#a53845));
|
||||
background: -moz-linear-gradient(top, #cf5d6a, #a53845);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cf5d6a', endColorstr='#a53845');
|
||||
}
|
||||
.rosy:active {
|
||||
color: #dca4ab;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#bf404f), to(#f16c7c));
|
||||
background: -moz-linear-gradient(top, #bf404f, #f16c7c);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#bf404f', endColorstr='#f16c7c');
|
||||
}
|
||||
|
||||
/* green */
|
||||
.green {
|
||||
color: #e8f0de;
|
||||
border: solid 1px #538312;
|
||||
background: #64991e;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#7db72f), to(#4e7d0e));
|
||||
background: -moz-linear-gradient(top, #7db72f, #4e7d0e);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#7db72f', endColorstr='#4e7d0e');
|
||||
}
|
||||
.green:hover {
|
||||
background: #538018;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#6b9d28), to(#436b0c));
|
||||
background: -moz-linear-gradient(top, #6b9d28, #436b0c);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#6b9d28', endColorstr='#436b0c');
|
||||
}
|
||||
.green:active {
|
||||
color: #a9c08c;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#4e7d0e), to(#7db72f));
|
||||
background: -moz-linear-gradient(top, #4e7d0e, #7db72f);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#4e7d0e', endColorstr='#7db72f');
|
||||
}
|
||||
|
||||
/* pink */
|
||||
.pink {
|
||||
color: #feeef5;
|
||||
border: solid 1px #d2729e;
|
||||
background: #f895c2;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#feb1d3), to(#f171ab));
|
||||
background: -moz-linear-gradient(top, #feb1d3, #f171ab);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#feb1d3', endColorstr='#f171ab');
|
||||
}
|
||||
.pink:hover {
|
||||
background: #d57ea5;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f4aacb), to(#e86ca4));
|
||||
background: -moz-linear-gradient(top, #f4aacb, #e86ca4);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f4aacb', endColorstr='#e86ca4');
|
||||
}
|
||||
.pink:active {
|
||||
color: #f3c3d9;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f171ab), to(#feb1d3));
|
||||
background: -moz-linear-gradient(top, #f171ab, #feb1d3);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f171ab', endColorstr='#feb1d3');
|
||||
}
|
||||
|
||||
/* 反転 */
|
||||
.reflect{
|
||||
-webkit-transform: scaleX(-1);
|
||||
-moz-transform: scaleX(-1);
|
||||
-ms-transform: scaleX(-1);
|
||||
-o-transform: scaleX(-1);
|
||||
transform: scaleX(-1);
|
||||
filter: FlipH;
|
||||
}
|
||||
|
||||
/*ダイアログボックス*/
|
||||
#alertify{
|
||||
z-index:9999999;
|
||||
}
|
||||
|
139
nwjs/packagefiles/tyranobuilder/tyranoeng/tyrano/tyrano.js
Normal file
|
@ -0,0 +1,139 @@
|
|||
function object(o) {
|
||||
var f = object.f, i, len, n, prop;
|
||||
f.prototype = o;
|
||||
n = new f;
|
||||
for (i=1, len=arguments.length; i<len; ++i)
|
||||
for (prop in arguments[i])
|
||||
n[prop] = arguments[i][prop];
|
||||
return n;
|
||||
}
|
||||
|
||||
object.f = function(){};
|
||||
|
||||
var tyrano ={};
|
||||
tyrano.plugin ={};
|
||||
|
||||
tyrano.core ={
|
||||
|
||||
base:null,
|
||||
|
||||
options:{
|
||||
|
||||
width:0,
|
||||
height:0,
|
||||
onComplete:function(){}
|
||||
|
||||
},
|
||||
|
||||
status:{
|
||||
loaded_plugin:0
|
||||
},
|
||||
|
||||
|
||||
init:function(options){
|
||||
|
||||
var that = this;
|
||||
|
||||
this.base = object(tyrano.base);
|
||||
this.base.init(this);
|
||||
|
||||
this.config = window.config;
|
||||
|
||||
|
||||
//スクリプトをロードして、そのオブジェクトを作成
|
||||
//alert("wwwww");
|
||||
that.loadModule();
|
||||
|
||||
},
|
||||
|
||||
//プラグインのロード処理
|
||||
loadPlugins:function(array_src,call_back){
|
||||
|
||||
var that = this;
|
||||
|
||||
var count_src = 0;
|
||||
|
||||
for(var i=0; i<array_src.length; i++){
|
||||
|
||||
$.getScript("./tyrano/plugins/"+array_src[i]+"/"+array_src[i]+".js", function(){
|
||||
|
||||
count_src++;
|
||||
|
||||
if(count_src == array_src.length){
|
||||
if(call_back){
|
||||
call_back(array_src);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
loadModule:function(){
|
||||
|
||||
var that = this;
|
||||
var array_src = ["kag"];
|
||||
|
||||
for(var i=0;i<array_src.length;i++){
|
||||
|
||||
var _name = array_src[i];
|
||||
this[_name] = object(tyrano.plugin[_name]);
|
||||
//操作を委譲
|
||||
this[_name].tyrano = this;
|
||||
this[_name].init();
|
||||
|
||||
}
|
||||
|
||||
this.completeLoad();
|
||||
|
||||
},
|
||||
|
||||
|
||||
//
|
||||
completeLoad:function(){
|
||||
|
||||
//console.log(plugin_name);
|
||||
|
||||
//読み込み対象のプラグイン数分実行されたらビルド処理へ
|
||||
this.build();
|
||||
|
||||
|
||||
},
|
||||
|
||||
//ローディング完了、システムを組み上げていきます
|
||||
build:function(){
|
||||
|
||||
|
||||
},
|
||||
|
||||
get:function(mark){
|
||||
return $(mark);
|
||||
},
|
||||
|
||||
test:function(){
|
||||
//alert("tyrano test");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var TYRANO = object(tyrano.core);
|
||||
window.TYRANO = TYRANO;
|
||||
|
||||
if (!('console' in window)) {
|
||||
|
||||
window.console = {};
|
||||
window.console.log = function(str){
|
||||
return str;
|
||||
};
|
||||
}
|
||||
|
||||
$(function(){
|
||||
//画面をノベル用に構築していくみたいな
|
||||
//yunagi.init();
|
||||
//DOM構築完了後の初期化
|
||||
//yunagi.init_loaded();
|
||||
TYRANO.init();
|
||||
|
||||
});
|
|
@ -0,0 +1,83 @@
|
|||
|
||||
//スマートフォン用のaudio オーバーライド
|
||||
var Audio = (function() {
|
||||
// クラス内定数
|
||||
var COUNTRY = 'aaaaa';
|
||||
|
||||
// コンストラクタ
|
||||
var Audio = function(storage_url) {
|
||||
if(!(this instanceof Audio)) {
|
||||
return new Audio(storage_url);
|
||||
}
|
||||
|
||||
this.storage_url = storage_url;
|
||||
//this.age = age;
|
||||
this.volume ="1";
|
||||
this.loop = false;
|
||||
this.currentTime = 0;
|
||||
this.map_event = {}; //コールバックが必要な部分について、イベント登録する。
|
||||
|
||||
}
|
||||
|
||||
var p = Audio.prototype;
|
||||
|
||||
// プロトタイプ内でメソッドを定義
|
||||
p.setName = function(name) {
|
||||
this.name = name;
|
||||
}
|
||||
p.getStorageUrl = function() {
|
||||
return this.storage_url;
|
||||
}
|
||||
|
||||
p.play = function(){
|
||||
alert("play:"+this.storage_url);
|
||||
var obj = {
|
||||
action:"play",
|
||||
storage:this.storage_url,
|
||||
loop:this.loop,
|
||||
volume:this.volume
|
||||
|
||||
};
|
||||
appJsInterface.audio(JSON.stringify(obj));
|
||||
}
|
||||
|
||||
p.stop = function(){
|
||||
alert("stop:"+this.storage_url);
|
||||
var obj = {
|
||||
action:"stop",
|
||||
storage:this.storage_url
|
||||
};
|
||||
appJsInterface.audio(JSON.stringify(obj));
|
||||
}
|
||||
|
||||
p.release = function(){
|
||||
|
||||
}
|
||||
|
||||
p.pause = function(){
|
||||
this.stop();
|
||||
}
|
||||
|
||||
//再生が終わったらcb呼び出し。/////////////////
|
||||
p.onended = function (cb){
|
||||
this.map_event["onended"] = cb;
|
||||
}
|
||||
|
||||
p.addEventListener=function(event_name,cb){
|
||||
this.map_event[event_name] = cb;
|
||||
}
|
||||
|
||||
return Audio;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
var Audio = new Person('太郎', 20);
|
||||
// プロトタイプ内のメソッド呼び出し
|
||||
taro.setName('日本太郎');
|
||||
console.log(taro.getName()); // 日本太郎
|
||||
*/
|
||||
|
||||
|