-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
109 lines (105 loc) · 4.11 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Our Love Story</title>
<style type="text/css">
@font-face {
font-family: dight;
src: url('digital-7_mono.ttf');
}
</style>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="js/jquery.js"></script>
<script type="text/javascript" src="js/garden.js"></script>
<script type="text/javascript" src="js/function.js"></script>
</head>
<body>
<audio autoplay="autoplay" loop id="audio">
<source src="https://webfs.yun.kugou.com/201906181720/df8516f41060d125febf1e8af3bd5474/G070/M01/16/13/JpQEAFet0OeAL6EGAEh6jVG1Pk4651.mp3" type="audio/mpeg" />
Your browser does not support the audio element.
</audio>
<div id="mainDiv">
<div id="content">
<div id="code">
<span class="comments">/**</span><br/>
<span class="space"/><span class="comments">* We are both programmers,</span><br />
<span class="space"/><span class="comments">* so I write some code to describe our stories.</span><br />
<span class="space"/><span class="comments">*/</span><br />
Boy i = <span class="keyword">new</span> Boy(<span class="string">"Muyy"</span>);<br />
Girl u = <span class="keyword">new</span> Gril(<span class="string">"Poem"</span>);<br />
<span class="comments">// Nov 2, 2017, I told you I love you. </span><br />
i.love(u);<br />
<span class="comments">// Luckily, you accepted and became my girlfriend eversince.</span><br />
u.accepted();<br />
<span class="comments">// Since then, I miss u every day.</span><br />
i.miss(u);<br />
<span class="comments">// And take care of u and our love.</span><br />
i.takeCareOf(u);<br />
<span class="comments">// You say that you won't be so easy to marry me.</span><br />
<span class="comments">// So I keep waiting and I have confidence that you will.</span><br />
<span class="keyword">boolean</span> isHesitate = <span class="keyword">true</span>;<br />
<span class="keyword">while</span> (isHesitate) {<br />
<span class="placeholder"/>i.waitFor(u);<br />
<span class="placeholder"/><span class="comments">// I think it is an important decision</span><br />
<span class="placeholder"/><span class="comments">// and you should think it over.</span><br />
<span class="placeholder"/>isHesitate = u.thinkOver();<br />
}<br />
<span class="comments">// After a romantic wedding, we will live happily ever after.</span><br />
i.marry(u);<br />
i.liveHappilyWith(u);<br />
</div>
<div id="loveHeart">
<canvas id="garden"></canvas>
<div id="words">
<div id="messages">
Poem, I have fallen in love with you for
<div id="elapseClock"></div>
</div>
<div id="loveu">
Love u forever and ever.<br/>
<div class="signature">- chenxiangjun</div>
</div>
</div>
</div>
</div>
<div id="copyright">
Inspired by <a href="https://github.com/chenxiangjun2010/myblog">FlowerPower</a> project.<br />
Copyright © 2017 <a href='https://github.com/chenxiangjun2010'>chenxiangjun</a>
</div>
</div>
<script type="text/javascript">
let offsetX = $("#loveHeart").width() / 2;
let offsetY = $("#loveHeart").height() / 2 - 55;
let together = new Date();
together.setFullYear(2017, 0, 26); //2017/1/26
together.setHours(20);
together.setMinutes(0);
together.setSeconds(0);
together.setMilliseconds(0);
if (!document.createElement('canvas').getContext) {
let msg = document.createElement("div");
msg.id = "errorMsg";
msg.innerHTML = "Your browser doesn't support HTML5!";
document.body.appendChild(msg);
$("#code").css("display", "none");
} else {
setTimeout(function() {
startHeartAnimation();
}, 5000);
timeElapse(together);
adjustCodePosition();
$("#code").typewriter(); // 打字效果
}
document.addEventListener('DOMContentLoaded', function () {
function audioAutoPlay() {
var audio = document.getElementById('audio');
audio.play();
}
audioAutoPlay();
})
</script>
</body>
</html>