小姐姐,我好喜欢你,你愿意做我女朋友吗?
*{ -webkit-tap-highlight-color:rgba(0,0,0,0); -webkit-box-sizing: border-box; box-sizing: border-box; }
html{ width: 100%; height: 100%; }
body{ max-width: 100%; margin: 0 auto; background: #0b3443; color: #f0f0f0;}
.share_img{ width: 0; height: 0; overflow: hidden; opacity: 0; }
.content{ padding: 80px 20px;}
.text_wrapper{ display: -webkit-box; display: flex; }
.text_wrapper .text{ padding-top: 20px; padding-left: 20px; }
.hide{ display: none !important; }
p{ margin: 0; }
.btn-groups{ padding-right: 20px; text-align: center; }
.heart-btn{ display: inline-block; animation: breath 0.8s linear 0s infinite both; -webkit-animation: breath 0.8s linear 0s infinite both; }
.btn{ position: relative; display: inline-block; width: 60px; height: 60px; margin: 0 30px; transform: rotate(45deg); -webkit-transform: rotate(45deg);}
.btn span{ display: block; width: 100%; height: 100%; line-height: 60px; margin-top: -10px; margin-left: -10px; text-align: center; transform: rotate(-45deg); -webkit-transform: rotate(-45deg); }
.btn-a{ background: #d26ae5; }
.btn-b{ background: #c9c9c9; }
.btn-a:before{ content: ''; position: absolute; display: block; width: 30px; height: 60px; background: #d26ae5; left: -29px; top: 0; border-top-left-radius: 60px; border-bottom-left-radius: 60px; }
.btn-a:after{ content: ''; position: absolute; display: block; width: 60px; height: 30px; background: #d26ae5; left: 0; top: -29px; border-top-left-radius: 60px; border-top-right-radius: 60px;}
.btn-b:before{ content: ''; position: absolute; display: block; width: 30px; height: 60px; background: #c9c9c9; left: -29px; top: 0; border-top-left-radius: 60px; border-bottom-left-radius: 60px; }
.btn-b:after{ content: ''; position: absolute; display: block; width: 60px; height: 30px; background: #c9c9c9; left: 0; top: -29px; border-top-left-radius: 60px; border-top-right-radius: 60px;}
.container{ }
.container .mask{ position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); }
.container .modal{ width: 80%; height: 160px; position: absolute; top: 50%; left: 50%; padding: 20px 15px; border-radius: 5px; transform: translate(-50%, -70%); -webkit-transform: translate(-50%,-70%); background: #f3f3f3;}
.container .modal p{ margin-top: 20px; margin-bottom: 20px; font-size: 16px; color: #353535; text-align: center;}
.confirm{ display: block; width: 120px; height: 40px; margin: 0 auto; border: none; font-size: 16px; border-radius: 5px; color: #ffffff; background: #f45cae; }
.type_words{ padding: 12px 20px; }
.footer{height:90px;width:100%;background-color: #ddd;position: fixed;bottom: 0;}
@keyframes breath {
0% {
transform: scale3d(1,1,1);
-webkit-transform: scale3d(1,1,1);
transform-origin: 50% 50%;
}
50%{
transform: scale3d(1.02,1.02,1.02);
-webkit-transform: scale3d(1.02,1.02,1.02);
transform-origin: 50% 50%;
}
100%{
transform: scale3d(1,1,1);
-webkit-transform: scale3d(1,1,1);
transform-origin: 50% 50%;
}
}
$(function() {
$('#yes').click(function(event) {//愿意调用
modal('我就知道小姐姐一定会愿意的。(^_^)', function() {
$('.page_one').addClass('hide');
$('.page_two').removeClass('hide');
// typeWrite();
// fireworks();
typeWrite();
$('.page_two').fireworks({
sound: false,
opacity: 0.9,
width: '100%',
height: '100%'
});
// var audio = document.createElement('audio');//生成一个audio元素
// audio.controls = true;//控件显示
// audio.src="D:\后来.mp3";//音乐路径
// document.body.appendChild(audio);//把他添加到页面中去
var bgAudio = new Audio();//
bgAudio.setAttribute('src','D:/images/哈哈哈.mp3')
bgAudio.loop = false;
bgAudio.play();//音乐播放
// bgAudio.pause();//停止播放
// bgAudio.currentTime = 0;//从头开始播放
});
});
$('#no').click(function(event) {//不愿意调用
modal('我不想', A);//我不想
});
});
function A() {
modal('在需要尽全力的时候偷懒', B);//在需要尽全力的时候偷懒
}
function B() {
modal('看到别人在努力又很没安全感', C);//看到别人在努力又很没安全感
}
function C() {
modal('最近我想了很多', D);
}
function D() {
modal('发现我有很多不足', E);
}
function E() {
modal('我还是爱你', F);
}
function F() {
modal('但是我尊重你的决定', G);
}
function G() {
modal('谢谢你', H);
}
function H() {
modal('是你让我认知了我的不足我一定会慢慢变得更好', I);
}
function I() {
modal('也谢谢你出现在我的生命里',j);
}
function j() {
modal('在今后没有我的日子里', k);
}
function k() {
modal('希望你能够好好照顾你自己',function() {
fireworks();
});
}
function fireworks() {
$('.page_one').addClass('hide');
$('.page_two').removeClass('hide');
typeWrite();
$('.page_two').fireworks({
sound: false,
opacity: 0.9,
width: '100%',
height: '100%'
});
var bgAudio = new Audio();//
bgAudio.setAttribute('src','D:/images/需要人陪.mp3')
bgAudio.loop = false;
bgAudio.play();//音乐播放
}
function modal(content, callback) {
var tpl = '
'
'+'
'
'+ content +'
'+''+
'
'
$('body').append(tpl);
$(document).on('click', '.confirm', function() {
$('.container').remove();
callback();
});
}
var myWords = '有人说,人的一生会遇到2920万人,而两个人相爱的概率只有0.000049。在这茫茫人海中,两个人能相遇就值得感激,能相爱更是一种难得。所以,我很庆幸上天让我遇见了你。我希望有个如你一般的人,能看完我写过的所有状态,读完我所有的日志,看完我从小到大的照片,试着听我喜欢的歌。如果可以,甚至陪我去我喜欢的地方,只想弥补错过你的青春。';
var x = 0;
var speed = 150;
var current = 0;
function typeWrite(){
$('.type_words').html(myWords.substring(0, x++)+'_');
var timer = setTimeout("typeWrite()", speed);
if (x == myWords.length) {
x = myWords.length;
clearTimeout(timer)
}
}
小姐姐,我好喜欢你,你愿意做我女朋友吗?
注意!
需要引入jquery.fireworks.js和jquery.min.js,详情请看代码逻辑。其他图片引用,音乐引用不在多说自己变换