-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
111 lines (105 loc) · 3.45 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>A Love Letter to PanZiying</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: digit;
src: url('digital-7_mono.ttf') format("truetype");
}
@font-face {
font-family: Delius Swash Caps;
src: url('DeliusSwashCaps-Regular.ttf') format("truetype");
}
@font-face {
font-family: Great Vibes;
src: url('GreatVibes-Regular.ttf') format("truetype");
}
</style>
<link href="css/default.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/garden.js"></script>
<script type="text/javascript" src="js/functions.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="applicable-device"content="pc,mobile"/>
</head>
<body>
<audio id="bgm" autoplay="autoplay" loop="loop" preload="auto" src="res/chengdu1.mp3">不支持</audio>
<div id="mainDiv">
<div id="content">
<div id="note">
<span>
<h2>Hi Ziying!</h2>
<p>How's going?</p>
</div>
<div id="loveHeart">
<canvas id="garden"></canvas>
<!--
<div id="words">
<div id="messages">
Ziying, I am in love with you for
<div id="elapseClock"></div>
</div>
<div id="love-u">
Love u forever and ever.<br/>
<div class="signature">- Dongfeng</div>
</div>
</div>
--!>
</div>
</div>
<div id="copyright">
Inspired by <a href="http://www.openrise.com/lab/FlowerPower/">FlowerPower</a> project.<br />
Copyright © 2017 <a href='https://github.com/ThomasWu994'>Thomas Wu</a> 2017
Copyright © 2018 <a href='http://panziying.com'>panziying.com</a> 2017-2018<br/>
</div>
</div>
<script type="text/javascript">
var audio = document.getElementById('bgm');
$('html').one('touchstart',function(){
audio.play();
});
var offsetX = $("#loveHeart").width() / 2;
var offsetY = $("#loveHeart").height() / 2 - 55;
var together = new Date();
together.setFullYear(2017, 12, 24);
together.setHours(22);
together.setMinutes(0);
together.setSeconds(0);
together.setMilliseconds(0);
if (!document.createElement('canvas').getContext) {
var msg = document.createElement("div");
msg.id = "errorMsg";
msg.innerHTML = "Your browser doesn't support HTML5!<br/>Recommend use Chrome 14+/IE 9+/Firefox 7+/Safari 4+";
document.body.appendChild(msg);
$("#note").css("display", "none")
document.execCommand("stop");
} else {
$("#note").typewriter();
if ($(window).width() < 767) {
setTimeout(function(){
$("#note").fadeOut(2000, function () {
showHeart();
})
}, 45000);
}
else {
setTimeout(function () {
startHeartAnimation();
}, 2000);
}
timeElapse(together);
setInterval(function () {
timeElapse(together);
}, 200);
//adjustCodePosition();
}
function showHeart() {
$("#loveHeart").fadeIn(1000, function () {
startHeartAnimation();
});
}
</script>
</body>
</html>