提交 c4173135 编写于 作者: S sunshine

🚀 update

上级 1af94bfa
*{-webkit-box-sizing:border-box;margin:0;padding:0;}
body{background-color:#fff;}
a{color:#fff;text-decoration:none;}
#div_container{position:relative;margin:0 auto;width:500px;font-size:1em;}
.div_pure_words{position:relative;display:none;}
.div_pure_words_bg{width:500px;min-height:500px;background-size:100%;background-repeat:repeat;background-attachment:fixed;}
.div_pure_words_height{visibility:hidden;padding:30px;color:#fff;text-align:justify;white-space:pre-wrap;font-size:1.1em;font-family:"Microsoft YaHei",Arial;}
.div_pw_typed{position:absolute;top:0;right:0;bottom:0;left:0;padding:30px;width:500px;background:rgba(255,255,255,.8);text-align:justify;}
#span_pw_typed{width:100%;white-space:pre-wrap;font-size:1.1em;font-family:"Microsoft YaHei",Arial;}
#div_start_bg{position:absolute;top:0;left:0;z-index:44;width:100%;height:100%;background-color:#fff;}
#div_btn_inner{padding-left:430px;width:500px;color:#fff;text-shadow:1px 1px 1px #000;}
.div_btn{position:fixed;z-index:999;width:42px;height:42px;border:2px solid #fff;border-radius:50%;text-align:center;font-size:1em;line-height:40px;cursor:pointer;}
#div_music{top:30px;border:none;}
#div_record{top:100px;background-color:rgba(0,0,0,.5);}
#div_support{top:170px;background-color:rgba(0,0,0,.3);}
.div_music_tips{position:fixed;top:70px;z-index:999;}
.div_record_tips{position:fixed;top:140px;z-index:999;}
.div_btn_big{position:fixed;z-index:999;padding:10px 0;width:52px;border-radius:5px;background-color:rgba(112,128,144,.6);text-align:center;font-size:1.1em;line-height:1.3em;cursor:pointer;}
#div_s_upload{top:360px;}
#div_s_sound{top:440px;}
#div_s_choose{top:520px;}
#div_s_qa{top:600px;}
@-webkit-keyframes music_play_rotate{0%{-webkit-transform:rotate(0);}
100%{-webkit-transform:rotate(360deg);}
}
@-webkit-keyframes btn_rotate{0%{-webkit-transform:rotate(0);}
40%{-webkit-transform:rotate(0);}
50%{-webkit-transform:rotate(30deg);}
60%{-webkit-transform:rotate(0);}
70%{-webkit-transform:rotate(30deg);}
80%{-webkit-transform:rotate(0);}
100%{-webkit-transform:rotate(0);}
}
#div_onlyyou{position:relative;z-index:666;display:none;width:100%;background-size:100%;background-repeat:repeat;}
#div_oy_inner{position:absolute;top:0;right:0;bottom:0;left:0;padding:12% 10% 0 10%;width:100%;min-height:400px;background:rgba(255,255,255,.8);text-align:center;}
.div_oy_text{margin:0 auto 60px auto;text-align:left;font-weight:300;font-size:1.1em;}
.div_oy_text h1{margin:14px 0;font-size:1.8em;}
.div_oy_text p{margin:14px 0;}
.div_oy_text img{width:100%;border-radius:5px;}
#ul_oy_benefit li{display:none;margin:14px 0;}
#ul_oy_benefit,#ul_oy_btn{list-style:none;}
#ul_oy_btn li{display:inline;margin:20px 40px;padding:10px 15px;border:1px solid #fff;border-radius:5px;background-color:rgba(0,0,0,.6);color:#fff;font-size:1.4em;}
#div_oy_note,#div_oy_yes{position:relative;display:none;margin:-60px auto;padding:5% 0;width:100%;height:180px;border-radius:5px;background-color:#fff;color:gray;text-align:center;font-size:1.4em;}
#div_oy_note_close{position:absolute;top:20px;right:20px;width:40px;height:40px;}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>我喜欢你❤️!</title>
<meta charset="UTF-8">
<title>小孙同学</title>
<meta name="language" content="zh-CN">
<meta name="title" content="小孙同学">
<meta name="github" content="https://github.com/sun0225SUN/Awesome-Love-Code">
<meta name="describe" content="收集不易,您的star是我坚持的动力,同时也欢迎各位PR! ">
<link rel="icon" type="image/x-icon" href="https://cdn.jsdelivr.net/gh/sun0225SUN/photos/img/20210715233345.png">
<!-- style -->
<link type="text/css" rel="stylesheet" href="css/theme.css" />
<script src="js/jquery-2.0.3.min.js"></script>
</head>
<body>
<div id="div_container">
<!-- 最外层div,用于居中兼容PC和移动 -->
<div id="div_start_bg"></div>
<div id="div_onlyyou">
<!-- 用于设置背景 -->
<div id="div_oy_inner">
<!-- 用于存放content -->
<div class="div_oy_text">
<h1></h1>
<img class="img_oy_text" src="" />
<p class="p_oy_text"></p>
<div></div>
<ul id="ul_oy_benefit">
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
<li class="li_oy_benefit"></li>
</ul>
</div>
<ul id="ul_oy_btn">
<li onclick="oy_go_next()">Yes&nbsp;&nbsp;</li>
<li onclick="oy_show_benefit()">No&nbsp;&nbsp;</li>
</ul>
<div id="div_oy_note" onclick="oy_hide_note()">
<img src="images/emoji_kelian.jpg" alt="" /><br />请告诉我Yes!
<div id="div_oy_note_close"></div>
</div>
<div id="div_oy_yes">
<img src="images/emoji_bixin.jpg" alt="" /><br />太好了!哈哈~
</div>
</div>
</div>
<div class="div_pure_words">
<div class="div_pure_words_bg">
<div class="div_pure_words_height"></div>
</div>
<div class="div_pw_typed">
<span id="span_pw_typed"></span>
</div>
</div>
<div id="div_btn_container">
<div id="div_btn_inner">
<div class="div_music_tips"></div>
<div class="div_btn" id="div_music" onclick="music_switch()">
<!-- 音乐按钮部分 -->
<img id="img_music" src="images/music_note_big.png"
style="-webkit-animation: music_play_rotate 1s linear infinite;" />
<!-- 您的浏览器不支持播放音乐 -->
<audio id="audio_music" autoplay="autoplay" loop="loop">
<source type="audio/mpeg" />
</audio>
</div>
<div class="div_record_tips"></div>
<div class="div_btn" id="div_record" onclick="record_switch()">
<audio id="audio_record" loop="loop">
<source type="audio/mpeg" />
</audio>
</div>
</div>
</div>
</div>
<script>
//判断客户端设备,选择写入meta
function init_viewport() {
if (navigator.userAgent.indexOf("Android") != -1) {
var version = parseFloat(RegExp.$1);
if (version > 2.3) {
var width =
window.outerWidth == 0 ? window.screen.width : window.outerWidth;
var phoneScale = parseInt(width) / 500;
document.write(
'<meta name="viewport" content="width=500, minimum-scale = ' +
phoneScale +
", maximum-scale = " +
phoneScale +
', target-densitydpi=device-dpi">'
);
} else {
document.write(
'<meta name="viewport" content="width=500, target-densitydpi=device-dpi, user-scalable=0">'
);
}
} else if (navigator.userAgent.indexOf("iPhone") != -1) {
var phoneScale = parseInt(window.screen.width) / 500;
document.write(
'<meta name="viewport" content="width=500, min-height=750, initial-scale=' +
phoneScale +
", maximum-scale=" +
phoneScale +
', user-scalable=0" /> '
); //0.75 0.82
} else {
document.write(
'<meta name="viewport" content="width=500, height=750, initial-scale=0.64" /> '
); //0.75 0.82
}
}
init_viewport();
var theme = "pure_words";
console.log("theme ->" + theme);
var theme_content = {
pure_words_content:
"遇见你,是我所有美好故事的开始,看见你的第一眼,上帝就在我耳边说了四个字,在劫难逃!\n你的过去我来不及参与,你的未来我一定奉陪到底!\n我爱你!<um style='color: #F44336;'>💕</um>",
typed_bool: "typed_y",
cursor_char: "cursor_heart",
bg_style_pure_words: "bg_opacity",
bg_img: "images/3.jpg",
simple_page_content: "",
video_page_content: "",
};
console.log(theme_content);
var music_json = {
music_select: "m_online",
m_online_id: "7",
m_online_url: "images/1.mp3",
m_upload_name: "null",
m_upload_url: "null",
};
console.log(music_json);
var record_json = {
record_bool: "r_false",
r_wechat_time: "null",
r_wechat_url: "null",
r_wechat_amr: "null",
};
console.log(record_json);
var main_title = "我喜欢你❤️";
// console.log(main_title);
if (main_title == "" || main_title == "null") {
//允许标题为空
document.title = "慢慢喜欢你";
}
var window_height = $(window).height();
console.log("window_height ->" + window_height);
var pure_words_content = theme_content["pure_words_content"];
var str_cursorChar;
var typed_bool;
var interval_pw_height;
var height_div_pw = $(".div_pure_words_height").height();
function init_pure_words() {
$(".div_pure_words_height").html(pure_words_content + "22222"); //初始化复制内容,撑开文档高度
// 初始化设置div的bg图片 初始化设置div的bg图片
if (
typeof theme_content["bg_style_pure_words"] != "undefined" &&
theme_content["bg_style_pure_words"] == "bg_opacity"
) {
if (
typeof theme_content["bg_img"] != "undefined" &&
theme_content["bg_img"] != ""
) {
$(".div_pure_words_bg").css({
"background-image": "url(" + theme_content["bg_img"] + ")",
});
}
}
//以下是打字效果的js
if (
typeof theme_content["cursor_char"] != "undefined" &&
theme_content["cursor_char"] != ""
) {
switch (
theme_content["cursor_char"] //设置打字光标的样式
) {
case "cursor_heart":
str_cursorChar = '<um style="color: #F44336;">❤</um>';
break;
case "cursor_sub":
str_cursorChar = "_";
break;
case "cursor_music":
str_cursorChar = "";
break;
case "cursor_star":
str_cursorChar = "";
break;
case "cursor_sun":
str_cursorChar = "";
break;
default:
str_cursorChar = "|";
}
} else {
//处理全新作品,默认显示打字效果
str_cursorChar = "";
}
//判断用户有没有选择打字效果
if (
typeof theme_content["typed_bool"] != "undefined" &&
theme_content["typed_bool"] != ""
) {
typed_bool = theme_content["typed_bool"] == "typed_y" ? true : false;
} else {
typed_bool = false; //默认显示打字效果
}
display_pure_words();
$(".div_pure_words").fadeIn();
interval_pw_height = setInterval(function () {
console.log(
"div_pure_words_height -> " + $(".div_pure_words_height").height()
);
var least_height_div_pw = $(".div_pure_words_height").height();
if (least_height_div_pw > height_div_pw) {
height_div_pw = least_height_div_pw;
} else {
clearInterval(interval_pw_height);
$(".div_pure_words_height").height(least_height_div_pw + 100);
if ($(".div_pure_words_height").height() < window_height) {
$(".div_pure_words_height").height(window_height); //不能小于窗口的高度
console.log("let us be high as window");
}
}
}, 100);
}
function display_pure_words() {
if (typed_bool) {
var typed_pure_words = new Typed("#span_pw_typed", {
strings: [pure_words_content],
//输入内容, 支持html标签
typeSpeed: 120,
//打字速度
cursorChar: str_cursorChar,
//替换光标的样式
contentType: "html",
//值为html时,将打印的文本标签直接解析html标签
onComplete: function (abc) {
// console.log(abc);
console.log("finished typing words");
// console.log($('#span_pw_typed').height()-$(".div_pure_words_height").height());
},
});
} else {
//如果不需要打字效果就直接显示
$("#span_pw_typed").html(pure_words_content).fadeIn();
}
init_attachment();
}
var start_content = {
chase_title:
"做我女朋友好不好<um style='color: #F44336;'>!</um>",
chase_text:
"承蒙你的出现,够我喜欢好多年,我希望,以后你能用我的名字拒绝所有人<um style='color: #F44336;'>💕</um>",
chase_benefit: [
"你是我拔掉氧气罐都想吻的人",
"你是我跑完8000米还想拥抱的人",
"你是我自罚三杯都不肯开口的秘密",
"你是我赴汤蹈火都不肯放下的执着",
"你是我电量只剩1%也想回信息的人",
"你是我穷极一生不想醒来的梦",
],
bg_style: "bg_custom",
bg_img: "images/2.jpg",
img_bool: "img_true",
img_src: "images/1.gif",
}; //可能为null
console.log(start_content);
var start_id;
$(function () {
//此事件为触发互动创意
start_id = "onlyyou"; //可能为null
init_start(start_id);
});
function init_start(start_id) {
console.log("init_start ->" + start_id);
switch (start_id) {
case "loveformat":
$(".div_loveformat").show();
init_loveformat();
break;
case "hearttree":
$("#div_hearttree").show();
init_hearttree();
break;
case "courage":
$("#div_courage").show();
init_courage();
break;
case "birthdaycake":
$("#div_dbcake").show();
init_birthdaycake();
break;
case "intersect":
$("#div_intersect").show();
init_intersect();
break;
case "onlyyou":
$("#div_onlyyou").show();
init_onlyyou();
break;
default:
init_theme();
}
}
//开始动画主体部分
function init_theme() {
console.log("init_theme");
$("#div_start_bg").fadeOut();
init_pure_words();
}
var attachment = "null"; //可能为null
var attached_content = {
bool_save: false,
}; //可能为null
console.log(attached_content);
function init_attachment() {
//开始attachment
console.log("init_attachment ->" + attachment);
switch (attachment) {
case "timer":
init_at_timer();
break;
default:
return;
}
}
</script>
<!-- JQuery -->
<script src="js/typed.min.js"></script>
<script src="js/start_onlyyou.js"></script>
<script src="js/jweixin-1.2.0.js"></script>
<script src="js/theme_common.js"></script>
</body>
</html>
\ No newline at end of file
此差异已折叠。
!function(e,n){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return n(e)}):n(e,!0)}(this,function(e,n){function i(n,i,t){e.WeixinJSBridge?WeixinJSBridge.invoke(n,o(i),function(e){c(n,e,t)}):l(n,t)}function t(n,i,t){e.WeixinJSBridge?WeixinJSBridge.on(n,function(e){t&&t.trigger&&t.trigger(e),c(n,e,i)}):t?l(n,t):l(n,i)}function o(e){return e=e||{},e.appId=A.appId,e.verifyAppId=A.appId,e.verifySignType="sha1",e.verifyTimestamp=A.timestamp+"",e.verifyNonceStr=A.nonceStr,e.verifySignature=A.signature,e}function r(e){return{timeStamp:e.timestamp+"",nonceStr:e.nonceStr,package:e.package,paySign:e.paySign,signType:e.signType||"SHA1"}}function a(e){return e.postalCode=e.addressPostalCode,delete e.addressPostalCode,e.provinceName=e.proviceFirstStageName,delete e.proviceFirstStageName,e.cityName=e.addressCitySecondStageName,delete e.addressCitySecondStageName,e.countryName=e.addressCountiesThirdStageName,delete e.addressCountiesThirdStageName,e.detailInfo=e.addressDetailInfo,delete e.addressDetailInfo,e}function c(e,n,i){"openEnterpriseChat"==e&&(n.errCode=n.err_code),delete n.err_code,delete n.err_desc,delete n.err_detail;var t=n.errMsg;t||(t=n.err_msg,delete n.err_msg,t=s(e,t),n.errMsg=t),(i=i||{})._complete&&(i._complete(n),delete i._complete),t=n.errMsg||"",A.debug&&!i.isInnerInvoke&&alert(JSON.stringify(n));var o=t.indexOf(":");switch(t.substring(o+1)){case"ok":i.success&&i.success(n);break;case"cancel":i.cancel&&i.cancel(n);break;default:i.fail&&i.fail(n)}i.complete&&i.complete(n)}function s(e,n){var i=e,t=h[i];t&&(i=t);var o="ok";if(n){var r=n.indexOf(":");"confirm"==(o=n.substring(r+1))&&(o="ok"),"failed"==o&&(o="fail"),-1!=o.indexOf("failed_")&&(o=o.substring(7)),-1!=o.indexOf("fail_")&&(o=o.substring(5)),"access denied"!=(o=(o=o.replace(/_/g," ")).toLowerCase())&&"no permission to execute"!=o||(o="permission denied"),"config"==i&&"function not exist"==o&&(o="ok"),""==o&&(o="fail")}return n=i+":"+o}function d(e){if(e){for(var n=0,i=e.length;n<i;++n){var t=e[n],o=g[t];o&&(e[n]=o)}return e}}function l(e,n){if(!(!A.debug||n&&n.isInnerInvoke)){var i=h[e];i&&(e=i),n&&n._complete&&delete n._complete,console.log('"'+e+'",',n||"")}}function u(e){if(!(_||w||A.debug||M<"6.0.2"||V.systemType<0)){var n=new Image;V.appId=A.appId,V.initTime=C.initEndTime-C.initStartTime,V.preVerifyTime=C.preVerifyEndTime-C.preVerifyStartTime,N.getNetworkType({isInnerInvoke:!0,success:function(e){V.networkType=e.networkType;var i="https://open.weixin.qq.com/sdk/report?v="+V.version+"&o="+V.isPreVerifyOk+"&s="+V.systemType+"&c="+V.clientVersion+"&a="+V.appId+"&n="+V.networkType+"&i="+V.initTime+"&p="+V.preVerifyTime+"&u="+V.url;n.src=i}})}}function p(){return(new Date).getTime()}function f(n){T&&(e.WeixinJSBridge?n():S.addEventListener&&S.addEventListener("WeixinJSBridgeReady",n,!1))}function m(){N.invoke||(N.invoke=function(n,i,t){e.WeixinJSBridge&&WeixinJSBridge.invoke(n,o(i),t)},N.on=function(n,i){e.WeixinJSBridge&&WeixinJSBridge.on(n,i)})}if(!e.jWeixin){var g={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest",openEnterpriseRedPacket:"getRecevieBizHongBaoRequest",startSearchBeacons:"startMonitoringBeacons",stopSearchBeacons:"stopMonitoringBeacons",onSearchBeacons:"onBeaconsInRange",consumeAndShareCard:"consumedShareCard",openAddress:"editAddress"},h=function(){var e={};for(var n in g)e[g[n]]=n;return e}(),S=e.document,y=S.title,v=navigator.userAgent.toLowerCase(),I=navigator.platform.toLowerCase(),_=!(!I.match("mac")&&!I.match("win")),w=-1!=v.indexOf("wxdebugger"),T=-1!=v.indexOf("micromessenger"),k=-1!=v.indexOf("android"),x=-1!=v.indexOf("iphone")||-1!=v.indexOf("ipad"),M=function(){var e=v.match(/micromessenger\/(\d+\.\d+\.\d+)/)||v.match(/micromessenger\/(\d+\.\d+)/);return e?e[1]:""}(),C={initStartTime:p(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},V={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:x?1:k?2:-1,clientVersion:M,url:encodeURIComponent(location.href)},A={},P={_completes:[]},L={state:0,data:{}};f(function(){C.initEndTime=p()});var B=!1,O=[],N={config:function(e){A=e,l("config",e);var n=!1!==A.check;f(function(){if(n)i(g.config,{verifyJsApiList:d(A.jsApiList)},function(){P._complete=function(e){C.preVerifyEndTime=p(),L.state=1,L.data=e},P.success=function(e){V.isPreVerifyOk=0},P.fail=function(e){P._fail?P._fail(e):L.state=-1};var e=P._completes;return e.push(function(){u()}),P.complete=function(n){for(var i=0,t=e.length;i<t;++i)e[i]();P._completes=[]},P}()),C.preVerifyStartTime=p();else{L.state=1;for(var e=P._completes,t=0,o=e.length;t<o;++t)e[t]();P._completes=[]}}),A.beta&&m()},ready:function(e){0!=L.state?e():(P._completes.push(e),!T&&A.debug&&e())},error:function(e){M<"6.0.2"||(-1==L.state?e(L.data):P._fail=e)},checkJsApi:function(e){var n=function(e){var n=e.checkResult;for(var i in n){var t=h[i];t&&(n[t]=n[i],delete n[i])}return e};i("checkJsApi",{jsApiList:d(e.jsApiList)},(e._complete=function(e){if(k){var i=e.checkResult;i&&(e.checkResult=JSON.parse(i))}e=n(e)},e))},onMenuShareTimeline:function(e){t(g.onMenuShareTimeline,{complete:function(){i("shareTimeline",{title:e.title||y,desc:e.title||y,img_url:e.imgUrl||"",link:e.link||location.href,type:e.type||"link",data_url:e.dataUrl||""},e)}},e)},onMenuShareAppMessage:function(e){t(g.onMenuShareAppMessage,{complete:function(n){"favorite"===n.scene?i("sendAppMessage",{title:e.title||y,desc:e.desc||"",link:e.link||location.href,img_url:e.imgUrl||"",type:e.type||"link",data_url:e.dataUrl||""}):i("sendAppMessage",{title:e.title||y,desc:e.desc||"",link:e.link||location.href,img_url:e.imgUrl||"",type:e.type||"link",data_url:e.dataUrl||""},e)}},e)},onMenuShareQQ:function(e){t(g.onMenuShareQQ,{complete:function(){i("shareQQ",{title:e.title||y,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},onMenuShareWeibo:function(e){t(g.onMenuShareWeibo,{complete:function(){i("shareWeiboApp",{title:e.title||y,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},onMenuShareQZone:function(e){t(g.onMenuShareQZone,{complete:function(){i("shareQZone",{title:e.title||y,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},startRecord:function(e){i("startRecord",{},e)},stopRecord:function(e){i("stopRecord",{},e)},onVoiceRecordEnd:function(e){t("onVoiceRecordEnd",e)},playVoice:function(e){i("playVoice",{localId:e.localId},e)},pauseVoice:function(e){i("pauseVoice",{localId:e.localId},e)},stopVoice:function(e){i("stopVoice",{localId:e.localId},e)},onVoicePlayEnd:function(e){t("onVoicePlayEnd",e)},uploadVoice:function(e){i("uploadVoice",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},downloadVoice:function(e){i("downloadVoice",{serverId:e.serverId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},translateVoice:function(e){i("translateVoice",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},chooseImage:function(e){i("chooseImage",{scene:"1|2",count:e.count||9,sizeType:e.sizeType||["original","compressed"],sourceType:e.sourceType||["album","camera"]},(e._complete=function(e){if(k){var n=e.localIds;try{n&&(e.localIds=JSON.parse(n))}catch(e){}}},e))},getLocation:function(e){},previewImage:function(e){i(g.previewImage,{current:e.current,urls:e.urls},e)},uploadImage:function(e){i("uploadImage",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},downloadImage:function(e){i("downloadImage",{serverId:e.serverId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},getLocalImgData:function(e){!1===B?(B=!0,i("getLocalImgData",{localId:e.localId},(e._complete=function(e){if(B=!1,O.length>0){var n=O.shift();wx.getLocalImgData(n)}},e))):O.push(e)},getNetworkType:function(e){var n=function(e){var n=e.errMsg;e.errMsg="getNetworkType:ok";var i=e.subtype;if(delete e.subtype,i)e.networkType=i;else{var t=n.indexOf(":"),o=n.substring(t+1);switch(o){case"wifi":case"edge":case"wwan":e.networkType=o;break;default:e.errMsg="getNetworkType:fail"}}return e};i("getNetworkType",{},(e._complete=function(e){e=n(e)},e))},openLocation:function(e){i("openLocation",{latitude:e.latitude,longitude:e.longitude,name:e.name||"",address:e.address||"",scale:e.scale||28,infoUrl:e.infoUrl||""},e)},getLocation:function(e){e=e||{},i(g.getLocation,{type:e.type||"wgs84"},(e._complete=function(e){delete e.type},e))},hideOptionMenu:function(e){i("hideOptionMenu",{},e)},showOptionMenu:function(e){i("showOptionMenu",{},e)},closeWindow:function(e){i("closeWindow",{},e=e||{})},hideMenuItems:function(e){i("hideMenuItems",{menuList:e.menuList},e)},showMenuItems:function(e){i("showMenuItems",{menuList:e.menuList},e)},hideAllNonBaseMenuItem:function(e){i("hideAllNonBaseMenuItem",{},e)},showAllNonBaseMenuItem:function(e){i("showAllNonBaseMenuItem",{},e)},scanQRCode:function(e){i("scanQRCode",{needResult:(e=e||{}).needResult||0,scanType:e.scanType||["qrCode","barCode"]},(e._complete=function(e){if(x){var n=e.resultStr;if(n){var i=JSON.parse(n);e.resultStr=i&&i.scan_code&&i.scan_code.scan_result}}},e))},openAddress:function(e){i(g.openAddress,{},(e._complete=function(e){e=a(e)},e))},openProductSpecificView:function(e){i(g.openProductSpecificView,{pid:e.productId,view_type:e.viewType||0,ext_info:e.extInfo},e)},addCard:function(e){for(var n=e.cardList,t=[],o=0,r=n.length;o<r;++o){var a=n[o],c={card_id:a.cardId,card_ext:a.cardExt};t.push(c)}i(g.addCard,{card_list:t},(e._complete=function(e){var n=e.card_list;if(n){for(var i=0,t=(n=JSON.parse(n)).length;i<t;++i){var o=n[i];o.cardId=o.card_id,o.cardExt=o.card_ext,o.isSuccess=!!o.is_succ,delete o.card_id,delete o.card_ext,delete o.is_succ}e.cardList=n,delete e.card_list}},e))},chooseCard:function(e){i("chooseCard",{app_id:A.appId,location_id:e.shopId||"",sign_type:e.signType||"SHA1",card_id:e.cardId||"",card_type:e.cardType||"",card_sign:e.cardSign,time_stamp:e.timestamp+"",nonce_str:e.nonceStr},(e._complete=function(e){e.cardList=e.choose_card_info,delete e.choose_card_info},e))},openCard:function(e){for(var n=e.cardList,t=[],o=0,r=n.length;o<r;++o){var a=n[o],c={card_id:a.cardId,code:a.code};t.push(c)}i(g.openCard,{card_list:t},e)},consumeAndShareCard:function(e){i(g.consumeAndShareCard,{consumedCardId:e.cardId,consumedCode:e.code},e)},chooseWXPay:function(e){i(g.chooseWXPay,r(e),e)},openEnterpriseRedPacket:function(e){i(g.openEnterpriseRedPacket,r(e),e)},startSearchBeacons:function(e){i(g.startSearchBeacons,{ticket:e.ticket},e)},stopSearchBeacons:function(e){i(g.stopSearchBeacons,{},e)},onSearchBeacons:function(e){t(g.onSearchBeacons,e)},openEnterpriseChat:function(e){i("openEnterpriseChat",{useridlist:e.userIds,chatname:e.groupName},e)}},E=1,b={};return S.addEventListener("error",function(e){if(!k){var n=e.target,i=n.tagName,t=n.src;if(("IMG"==i||"VIDEO"==i||"AUDIO"==i||"SOURCE"==i)&&-1!=t.indexOf("wxlocalresource://")){e.preventDefault(),e.stopPropagation();var o=n["wx-id"];if(o||(o=E++,n["wx-id"]=o),b[o])return;b[o]=!0,wx.ready(function(){wx.getLocalImgData({localId:t,success:function(e){n.src=e.localData}})})}}},!0),S.addEventListener("load",function(e){if(!k){var n=e.target,i=n.tagName;n.src;if("IMG"==i||"VIDEO"==i||"AUDIO"==i||"SOURCE"==i){var t=n["wx-id"];t&&(b[t]=!1)}}},!0),n&&(e.wx=e.jWeixin=N),N}});
\ No newline at end of file
function init_onlyyou(){
// 初始化两个div的高度
$("#div_onlyyou").css({"height":$(window).height()+260+"px"});
$("#div_oy_inner").css({"height":$(window).height()+260+"px"});
// 设置自定义背景
var start_bg_img=start_content['bg_img'];
if(typeof(start_content['bg_style'])!='undefined' && start_content['bg_style']=='bg_custom'){
if(typeof(start_bg_img)!='undefined' && start_bg_img!=''){
$("#div_onlyyou").css({"background-image": 'url('+start_bg_img+')'});
}
}
if(typeof(start_content['chase_title'])!='undefined' && start_content['chase_title']!=''){
$('.div_oy_text h1').html(start_content['chase_title']); //加载自定义内容
}else{
$('.div_oy_text h1').html('做我女朋友好不好'); //设置默认值
}
if(typeof(start_content['chase_text'])!='undefined' && start_content['chase_text']!=''){
$('.div_oy_text .p_oy_text').html(start_content['chase_text']); //加载自定义内容
}else{ //设置默认值
$('.div_oy_text .p_oy_text').html('小可爱,我喜欢你好久了。不只是遇见你,即使只是想起你,都会让我小鹿突突地乱撞。我一定会好好地疼你,你做我女朋友好不好?');
}
// 设置正文之前的照片
if(typeof(start_content['img_bool'])!='undefined' && start_content['img_bool']=='img_true'){ //如果设置了照片就显示
if(typeof(start_content['img_src'])!='undefined' && start_content['img_src']!=''){
$(".img_oy_text").attr('src', start_content['img_src']);
}
}
if(typeof(start_content['img_bool'])=='undefined' || typeof(start_content['chase_text'])=='undefined'){
var random_img=random_img_as();
$(".img_oy_text").attr('src', random_img);
}
}
var array_oy_benefit;
//加载内容或设置默认值
if(typeof(start_content['chase_benefit'])!='undefined'){
array_oy_benefit=start_content['chase_benefit'];
// array_oy_benefit = array_oy_benefit.filter(function (s) {
// return s && s.trim(); // 去掉空值
// }); //全空作品,但是却定义了key的情况
if(array_oy_benefit[0]==''){
array_oy_benefit[0]='我会把全部工资都给你';
}
if(array_oy_benefit[1]==''){
array_oy_benefit[1]='每天做好吃的给你';
}
if(array_oy_benefit[2]==''){
array_oy_benefit[2]='你睡不着时给你讲故事';
}
if(array_oy_benefit[3]==''){
array_oy_benefit[3]='给你自由去做喜欢的事情';
}
}else{
array_oy_benefit=['我会把全部工资都给你','每天做好吃的给你','你睡不着时给你讲故事','给你自由去做喜欢的事情'];
}
console.log(array_oy_benefit);
var index_text_oy=0;
var count_text_oy=array_oy_benefit.length;
console.log('一共有'+count_text_oy+'条件');
function oy_show_benefit(){
var oy_text_height=$(".div_oy_text").height();
if(index_text_oy<count_text_oy){
console.log('now the index_benefit_oy is->'+index_text_oy);
console.log('now the benefit_oy is->'+array_oy_benefit[index_text_oy]);
$(".li_oy_benefit").eq(index_text_oy).html(array_oy_benefit[index_text_oy]).show();
if($(document).height()-oy_text_height<520){ //随着文字的增多,实时调整高度
$("#div_onlyyou").css({"height":$(document).height()+160+"px"});
$("#div_oy_inner").css({"height":$(document).height()+"px"});
console.log('update the document height +120');
}
index_text_oy++;
} else{
oy_show_note();
}
}
function oy_show_note(){
$("#div_oy_note").show();
}
function oy_hide_note(){
$("#div_oy_note").hide();
}
function oy_go_next(){
$("#div_oy_yes").show();
setTimeout(function(){
$('#div_onlyyou').fadeOut();
init_theme();
},2000);
setTimeout(function(){
$('#div_onlyyou').remove();
},3000);
}
function random_img_as(){ //获取随机的模板图片
// console.log('random_img_as');
var random_num=Math.floor(Math.random()*(array_as_pics_s.length)); //随机取值
var random_img=array_as_pics_s[random_num];
return random_img;
}
var audio_music=document.getElementById('audio_music');
var audio_record=document.getElementById('audio_record');
if(typeof(music_json['music_select'])!='undefined' && music_json['music_select']!='null' && music_json['music_select']!=''){
if(music_json['music_select']=='m_online' && music_json['m_online_url']!='null' && music_json['m_online_url']!=''){ //选择在线列表
$('#audio_music').attr('src',music_json['m_online_url']);
}
if(music_json['music_select']=='m_upload' && music_json['m_upload_url']!='null' && music_json['m_upload_url']!=''){ //选择在线列表并且上传了歌曲
$('#audio_music').attr('src',music_json['m_upload_url']);
}
if(music_json['music_select']=='m_upload' && (music_json['m_upload_url']=='null' || music_json['m_upload_url']=='')){ //选择在线列表但是没有上传歌曲
console.log('music_select m_upload but m_upload_url is null, set defaulted music');
var random_music=random_music_as();
$('#audio_music').attr('src',random_music);
}
if(theme!='audio_list' || (theme=='audio_list' && start_id!='null')){
audio_music.play(); //触发音乐自动播放
}else{
audio_music.pause();
console.log('audio_list && no start');
}
}else{ //全新作品或空作品
console.log('set random music');
var random_music=random_music_as();
$('#audio_music').attr('src',random_music);
if(theme!='audio_list' || (theme=='audio_list' && start_id!='null')){
audio_music.play(); //触发音乐自动播放
}else{
audio_music.pause();
console.log('audio_list && no start');
}
}
if(typeof(record_json['record_bool'])!='undefined' && record_json['record_bool']!='null' && record_json['record_bool']!=''){
if(record_json['record_bool']=='r_true' && record_json['r_wechat_url']!='null' && record_json['r_wechat_url']!=''){ //选择要语音
$('#audio_record').attr('src',record_json['r_wechat_url']);
}
if(record_json['record_bool']=='r_true' && (record_json['r_wechat_url']=='null' || record_json['r_wechat_url']=='')){ //选择要语音,但却没有录语音
$('#div_record').hide(); //不显示
$('#div_record_tips').hide();
}
if(record_json['record_bool']=='r_false'){ //如果不要语音则不显示
$('#div_record').hide();
$('#div_record_tips').hide();
}
}else{
if(theme_content['bool_save']==false){ //全新作品或未保存内容,且未定义语音
console.log('set random record');
$('#audio_record').attr('src','http://cdn.aitetu520.com/chongqin_shenlin.mp3');
}else{ //非全新作品或已保存内容,但未定义语音,则不显示语音
$('#div_record').hide();
$('#div_record_tips').hide();
}
}
function random_music_as(){ //获取随机的模板图片
// console.log('random_words_as');
var random_num=Math.floor(Math.random()*(array_as_music.length)); //随机取值
var random_music=array_as_music[random_num];
return random_music;
}
//控制音乐切换播放暂停
var img_music=document.getElementById('img_music');
var timeout_music;
function music_switch(){ //切换
clearTimeout(timeout_music);
if(audio_music.paused){
console.log('switch music to play');
audio_music.play();
audio_record.pause(); //播放音乐时录音一定暂停
img_music.style.webkitAnimation="music_play_rotate 1s linear infinite";
$(".div_music_tips").html("正播放").show();
timeout_music=setTimeout(function(){$(".div_music_tips").hide()}, 2500);
}else{
console.log('switch music to paused');
audio_music.pause();
// audio_record.play(); //
img_music.style.webkitAnimation="";
$(".div_music_tips").html("已暂停").show();
timeout_music=setTimeout(function(){$(".div_music_tips").hide()}, 2500);
}
}
var timeout_record;
var div_record=document.getElementById('div_record');
function record_switch(){ //切换
clearTimeout(timeout_record);
if(audio_record.paused){
console.log('switch record to play');
audio_record.play();
audio_music.pause(); //
img_music.style.webkitAnimation="";
div_record.style.webkitAnimation="btn_rotate 1s linear infinite";
$(".div_record_tips").html("正播放").show();
timeout_record=setTimeout(function(){$(".div_record_tips").hide()}, 2500);
}else{
console.log('switch record to pause');
audio_record.pause(); //播放音乐时录音一定暂停
audio_music.play();
img_music.style.webkitAnimation="music_play_rotate 1s linear infinite";
div_record.style.webkitAnimation="";
$(".div_record_tips").html("已暂停").show();
timeout_record=setTimeout(function(){$(".div_record_tips").hide()}, 2500);
}
}
wx.ready(function(){
console.log('wx.ready success to start');
audio_music.play(); //触发音乐自动播放
wx.checkJsApi({
jsApiList: ['updateAppMessageShareData','updateTimelineShareData'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
success: function(res) {
console.log('wx.checkJsApi success');
if(theme!='audio_list' || (theme=='audio_list' && start_id!='null')){
audio_music.play(); //触发音乐自动播放
}else{
audio_music.pause();
console.log('audio_list && no start');
}
},
complete: function(res) {
console.log('wx.checkJsApi complete');
if(theme!='audio_list' || (theme=='audio_list' && start_id!='null')){
audio_music.play(); //触发音乐自动播放
}else{
audio_music.pause();
console.log('audio_list && no start');
}
}
});
});
wx.error(function(res){
console.log('wx.error -> '+res);
audio_music.play();
wx.checkJsApi({
jsApiList: ['updateAppMessageShareData','updateTimelineShareData'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
success: function(res) {
console.log('wx.checkJsApi success');
if(theme!='audio_list' || (theme=='audio_list' && start_id!='null')){
audio_music.play(); //触发音乐自动播放
}else{
audio_music.pause();
console.log('audio_list && no start');
}
},
complete: function(res) {
console.log('wx.checkJsApi complete');
if(theme!='audio_list' || (theme=='audio_list' && start_id!='null')){
audio_music.play(); //触发音乐自动播放
}else{
audio_music.pause();
console.log('audio_list && no start');
}
}
});
});
\ No newline at end of file
/*!
*
* typed.js - A JavaScript Typing Animation Library
* Author: Matt Boldt <me@mattboldt.com>
* Version: v2.0.9
* Url: https://github.com/mattboldt/typed.js
* License(s): MIT
*
*/
(function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Typed=e():t.Typed=e()})(this,function(){return function(t){function e(n){if(s[n])return s[n].exports;var i=s[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var s={};return e.m=t,e.c=s,e.p="",e(0)}([function(t,e,s){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var s=0;s<e.length;s++){var n=e[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,s,n){return s&&t(e.prototype,s),n&&t(e,n),e}}(),r=s(1),o=s(3),a=function(){function t(e,s){n(this,t),r.initializer.load(this,s,e),this.begin()}return i(t,[{key:"toggle",value:function(){this.pause.status?this.start():this.stop()}},{key:"stop",value:function(){this.typingComplete||this.pause.status||(this.toggleBlinking(!0),this.pause.status=!0,this.options.onStop(this.arrayPos,this))}},{key:"start",value:function(){this.typingComplete||this.pause.status&&(this.pause.status=!1,this.pause.typewrite?this.typewrite(this.pause.curString,this.pause.curStrPos):this.backspace(this.pause.curString,this.pause.curStrPos),this.options.onStart(this.arrayPos,this))}},{key:"destroy",value:function(){this.reset(!1),this.options.onDestroy(this)}},{key:"reset",value:function(){var t=arguments.length<=0||void 0===arguments[0]||arguments[0];clearInterval(this.timeout),this.replaceText(""),this.cursor&&this.cursor.parentNode&&(this.cursor.parentNode.removeChild(this.cursor),this.cursor=null),this.strPos=0,this.arrayPos=0,this.curLoop=0,t&&(this.insertCursor(),this.options.onReset(this),this.begin())}},{key:"begin",value:function(){var t=this;this.typingComplete=!1,this.shuffleStringsIfNeeded(this),this.insertCursor(),this.bindInputFocusEvents&&this.bindFocusEvents(),this.timeout=setTimeout(function(){t.currentElContent&&0!==t.currentElContent.length?t.backspace(t.currentElContent,t.currentElContent.length):t.typewrite(t.strings[t.sequence[t.arrayPos]],t.strPos)},this.startDelay)}},{key:"typewrite",value:function(t,e){var s=this;this.fadeOut&&this.el.classList.contains(this.fadeOutClass)&&(this.el.classList.remove(this.fadeOutClass),this.cursor&&this.cursor.classList.remove(this.fadeOutClass));var n=this.humanizer(this.typeSpeed),i=1;return this.pause.status===!0?void this.setPauseStatus(t,e,!0):void(this.timeout=setTimeout(function(){e=o.htmlParser.typeHtmlChars(t,e,s);var n=0,r=t.substr(e);if("^"===r.charAt(0)&&/^\^\d+/.test(r)){var a=1;r=/\d+/.exec(r)[0],a+=r.length,n=parseInt(r),s.temporaryPause=!0,s.options.onTypingPaused(s.arrayPos,s),t=t.substring(0,e)+t.substring(e+a),s.toggleBlinking(!0)}if("`"===r.charAt(0)){for(;"`"!==t.substr(e+i).charAt(0)&&(i++,!(e+i>t.length)););var u=t.substring(0,e),l=t.substring(u.length+1,e+i),c=t.substring(e+i+1);t=u+l+c,i--}s.timeout=setTimeout(function(){s.toggleBlinking(!1),e>=t.length?s.doneTyping(t,e):s.keepTyping(t,e,i),s.temporaryPause&&(s.temporaryPause=!1,s.options.onTypingResumed(s.arrayPos,s))},n)},n))}},{key:"keepTyping",value:function(t,e,s){0===e&&(this.toggleBlinking(!1),this.options.preStringTyped(this.arrayPos,this)),e+=s;var n=t.substr(0,e);this.replaceText(n),this.typewrite(t,e)}},{key:"doneTyping",value:function(t,e){var s=this;this.options.onStringTyped(this.arrayPos,this),this.toggleBlinking(!0),this.arrayPos===this.strings.length-1&&(this.complete(),this.loop===!1||this.curLoop===this.loopCount)||(this.timeout=setTimeout(function(){s.backspace(t,e)},this.backDelay))}},{key:"backspace",value:function(t,e){var s=this;if(this.pause.status===!0)return void this.setPauseStatus(t,e,!0);if(this.fadeOut)return this.initFadeOut();this.toggleBlinking(!1);var n=this.humanizer(this.backSpeed);this.timeout=setTimeout(function(){e=o.htmlParser.backSpaceHtmlChars(t,e,s);var n=t.substr(0,e);if(s.replaceText(n),s.smartBackspace){var i=s.strings[s.arrayPos+1];i&&n===i.substr(0,e)?s.stopNum=e:s.stopNum=0}e>s.stopNum?(e--,s.backspace(t,e)):e<=s.stopNum&&(s.arrayPos++,s.arrayPos===s.strings.length?(s.arrayPos=0,s.options.onLastStringBackspaced(),s.shuffleStringsIfNeeded(),s.begin()):s.typewrite(s.strings[s.sequence[s.arrayPos]],e))},n)}},{key:"complete",value:function(){this.options.onComplete(this),this.loop?this.curLoop++:this.typingComplete=!0}},{key:"setPauseStatus",value:function(t,e,s){this.pause.typewrite=s,this.pause.curString=t,this.pause.curStrPos=e}},{key:"toggleBlinking",value:function(t){this.cursor&&(this.pause.status||this.cursorBlinking!==t&&(this.cursorBlinking=t,t?this.cursor.classList.add("typed-cursor--blink"):this.cursor.classList.remove("typed-cursor--blink")))}},{key:"humanizer",value:function(t){return Math.round(Math.random()*t/2)+t}},{key:"shuffleStringsIfNeeded",value:function(){this.shuffle&&(this.sequence=this.sequence.sort(function(){return Math.random()-.5}))}},{key:"initFadeOut",value:function(){var t=this;return this.el.className+=" "+this.fadeOutClass,this.cursor&&(this.cursor.className+=" "+this.fadeOutClass),setTimeout(function(){t.arrayPos++,t.replaceText(""),t.strings.length>t.arrayPos?t.typewrite(t.strings[t.sequence[t.arrayPos]],0):(t.typewrite(t.strings[0],0),t.arrayPos=0)},this.fadeOutDelay)}},{key:"replaceText",value:function(t){this.attr?this.el.setAttribute(this.attr,t):this.isInput?this.el.value=t:"html"===this.contentType?this.el.innerHTML=t:this.el.textContent=t}},{key:"bindFocusEvents",value:function(){var t=this;this.isInput&&(this.el.addEventListener("focus",function(e){t.stop()}),this.el.addEventListener("blur",function(e){t.el.value&&0!==t.el.value.length||t.start()}))}},{key:"insertCursor",value:function(){this.showCursor&&(this.cursor||(this.cursor=document.createElement("span"),this.cursor.className="typed-cursor",this.cursor.innerHTML=this.cursorChar,this.el.parentNode&&this.el.parentNode.insertBefore(this.cursor,this.el.nextSibling)))}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,s){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t},o=function(){function t(t,e){for(var s=0;s<e.length;s++){var n=e[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,s,n){return s&&t(e.prototype,s),n&&t(e,n),e}}(),a=s(2),u=n(a),l=function(){function t(){i(this,t)}return o(t,[{key:"load",value:function(t,e,s){if("string"==typeof s?t.el=document.querySelector(s):t.el=s,t.options=r({},u["default"],e),t.isInput="input"===t.el.tagName.toLowerCase(),t.attr=t.options.attr,t.bindInputFocusEvents=t.options.bindInputFocusEvents,t.showCursor=!t.isInput&&t.options.showCursor,t.cursorChar=t.options.cursorChar,t.cursorBlinking=!0,t.elContent=t.attr?t.el.getAttribute(t.attr):t.el.textContent,t.contentType=t.options.contentType,t.typeSpeed=t.options.typeSpeed,t.startDelay=t.options.startDelay,t.backSpeed=t.options.backSpeed,t.smartBackspace=t.options.smartBackspace,t.backDelay=t.options.backDelay,t.fadeOut=t.options.fadeOut,t.fadeOutClass=t.options.fadeOutClass,t.fadeOutDelay=t.options.fadeOutDelay,t.isPaused=!1,t.strings=t.options.strings.map(function(t){return t.trim()}),"string"==typeof t.options.stringsElement?t.stringsElement=document.querySelector(t.options.stringsElement):t.stringsElement=t.options.stringsElement,t.stringsElement){t.strings=[],t.stringsElement.style.display="none";var n=Array.prototype.slice.apply(t.stringsElement.children),i=n.length;if(i)for(var o=0;o<i;o+=1){var a=n[o];t.strings.push(a.innerHTML.trim())}}t.strPos=0,t.arrayPos=0,t.stopNum=0,t.loop=t.options.loop,t.loopCount=t.options.loopCount,t.curLoop=0,t.shuffle=t.options.shuffle,t.sequence=[],t.pause={status:!1,typewrite:!0,curString:"",curStrPos:0},t.typingComplete=!1;for(var o in t.strings)t.sequence[o]=o;t.currentElContent=this.getCurrentElContent(t),t.autoInsertCss=t.options.autoInsertCss,this.appendAnimationCss(t)}},{key:"getCurrentElContent",value:function(t){var e="";return e=t.attr?t.el.getAttribute(t.attr):t.isInput?t.el.value:"html"===t.contentType?t.el.innerHTML:t.el.textContent}},{key:"appendAnimationCss",value:function(t){var e="data-typed-js-css";if(t.autoInsertCss&&(t.showCursor||t.fadeOut)&&!document.querySelector("["+e+"]")){var s=document.createElement("style");s.type="text/css",s.setAttribute(e,!0);var n="";t.showCursor&&(n+="\n .typed-cursor{\n opacity: 1;\n }\n .typed-cursor.typed-cursor--blink{\n animation: typedjsBlink 0.7s infinite;\n -webkit-animation: typedjsBlink 0.7s infinite;\n animation: typedjsBlink 0.7s infinite;\n }\n @keyframes typedjsBlink{\n 50% { opacity: 0.0; }\n }\n @-webkit-keyframes typedjsBlink{\n 0% { opacity: 1; }\n 50% { opacity: 0.0; }\n 100% { opacity: 1; }\n }\n "),t.fadeOut&&(n+="\n .typed-fade-out{\n opacity: 0;\n transition: opacity .25s;\n }\n .typed-cursor.typed-cursor--blink.typed-fade-out{\n -webkit-animation: 0;\n animation: 0;\n }\n "),0!==s.length&&(s.innerHTML=n,document.body.appendChild(s))}}}]),t}();e["default"]=l;var c=new l;e.initializer=c},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s={strings:["These are the default values...","You know what you should do?","Use your own!","Have a great day!"],stringsElement:null,typeSpeed:0,startDelay:0,backSpeed:0,smartBackspace:!0,shuffle:!1,backDelay:700,fadeOut:!1,fadeOutClass:"typed-fade-out",fadeOutDelay:500,loop:!1,loopCount:1/0,showCursor:!0,cursorChar:"|",autoInsertCss:!0,attr:null,bindInputFocusEvents:!1,contentType:"html",onComplete:function(t){},preStringTyped:function(t,e){},onStringTyped:function(t,e){},onLastStringBackspaced:function(t){},onTypingPaused:function(t,e){},onTypingResumed:function(t,e){},onReset:function(t){},onStop:function(t,e){},onStart:function(t,e){},onDestroy:function(t){}};e["default"]=s,t.exports=e["default"]},function(t,e){"use strict";function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var s=0;s<e.length;s++){var n=e[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,s,n){return s&&t(e.prototype,s),n&&t(e,n),e}}(),i=function(){function t(){s(this,t)}return n(t,[{key:"typeHtmlChars",value:function(t,e,s){if("html"!==s.contentType)return e;var n=t.substr(e).charAt(0);if("<"===n||"&"===n){var i="";for(i="<"===n?">":";";t.substr(e+1).charAt(0)!==i&&(e++,!(e+1>t.length)););e++}return e}},{key:"backSpaceHtmlChars",value:function(t,e,s){if("html"!==s.contentType)return e;var n=t.substr(e).charAt(0);if(">"===n||";"===n){var i="";for(i=">"===n?"<":"&";t.substr(e-1).charAt(0)!==i&&(e--,!(e<0)););e--}return e}}]),t}();e["default"]=i;var r=new i;e.htmlParser=r}])});
//# sourceMappingURL=typed.min.js.map
......@@ -25,5 +25,25 @@
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/202201282031986.jpg"/>
</a>
</td>
</tr>
<tr>
<td valign="top">
<a href="https://sun0225sun.github.io/Awesome-Love-Code/001-sincere_heart">
<p align="center">001-sincere_heart</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/202201282300626.jpg"/>
</a>
</td>
<!-- <td valign="top">
<a href="https://sun0225sun.github.io/Awesome-Love-Code/002-love_rose">
<p align="center">002-love_rose</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/202201271431597.jpg"/>
</a>
</td>
<td valign="top">
<a href="https://sun0225sun.github.io/Awesome-Love-Code/003-love_letter">
<p align="center">003-love_letter</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/202201282031986.jpg"/>
</a>
</td> -->
</tr>
</table>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册