-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
43 lines (32 loc) · 2.09 KB
/
script.js
File metadata and controls
43 lines (32 loc) · 2.09 KB
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
// document.addEventListener("DOMContentLoaded", function () {
// // Get the audio element
// var audio = document.getElementById("bgMusic");
// // Check if the browser supports the 'autoplay' attribute
// var isAutoplaySupported = typeof audio.autoplay === "boolean" ? true : false;
// // Play background music only if autoplay is supported
// if (isAutoplaySupported) {
// audio.play();
// }
// });
var i = 0;
var txt1 =
"Hi Dear.....! << Now I wan't to say something special to you. <<< So , Please read everything carefully...! > When I saw you for the first time < You seems something Special to me. << As the days goes < you get closer to me....! << I don't know the reason why your thoughts always resonates inside my mind...! > Everything about you is always intresting for me...! << I am somewhat nervous Because I haven't said these words to anyone and I won't say to anyone in future...! > I Love my Parents so much than anything else in this world....! << Now You are the only person whom I love equally with my parents....! >I Love U <SweetHeart.....! | <<<< by Mysterious71..";
var speed = 65;
typeWriter();
typeWriter();
function typeWriter() {
if (i < txt1.length) {
if (txt1.charAt(i) == "<")
document.getElementById("text1").innerHTML += "</br>";
else if (txt1.charAt(i) == ">")
document.getElementById("text1").innerHTML = "";
else if (txt1.charAt(i) == "|") {
$(".bg_heart").css("background-image", "')");
} else document.getElementById("text1").innerHTML += txt1.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
}
// window.onload = function () {
// document.getElementById("bgMusic").play();
// }