-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwritings.html
144 lines (129 loc) · 2.73 KB
/
writings.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Записки Трубецкого</title>
</head>
<body>
<div id="odeyalo">
<img src="images/borikmm_book.jpg" id="book" width="400">
<div id="click">
<span id="text">Нажми на меня!!!</span>
</div>
<audio src="" id="audio" controls></audio>
</div>
</body>
</html>
<style>
html, body {
overflow: hidden;
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
body {
background: no-repeat center/100% url("images/room_borikmm.jpg");
}
/*
#button {
border: 3px rgb(145, 145, 145) solid;
background-color: #bcbcbc;
margin-bottom: 4px;
font-size: 32px;
}
*/
#odeyalo {
opacity: 0;
display: block;
position: absolute;
width: fit-content;
height: fit-content;
top: 200%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
justify-content: center;
align-content: center;
text-align: center;
transition: 2s;
}
#odeyalo #click {
opacity: 0;
background-color: rgba(0,0,0,0.5);
position:absolute;
top: 0;
left:0;
bottom:0;
right: 0;
width:100%;
height: 100%;
content: " ";
transition: 1s;
}
#click #text {
position: inherit;
top: 50%;
left: 50%;
font-size: 38px;
color: #dfdfdf;
transform: translateX(-50%) translateY(-50%);
}
#odeyalo #click:hover {
opacity: 1;
}
#pulsemon {
width: 60px;
height: 60px;
}
#audio {
display: flex;
width: 100%;
}
/*
#odeyalo #pulsemon {
position: absolute;
margin: auto;
top: 50%;
bottom: 50%;
}*/
</style>
<script>
var book = document.getElementById("odeyalo")
var subsequator = document.getElementById("click")
var audios = [
"audio/val01.mp3",
"audio/val02.mp3",
]
var player = document.getElementById("audio")
window.onload = ()=>{
setTimeout(()=>{book.style.opacity = 1;},700);
book.style.top = "50%";
player.src = audios[0]
}
subsequator.onclick = ()=>{
book.style.transition = "1s"
book.style.opacity = 0;
setTimeout(()=>{
book.getElementsByTagName("img")[0].src = "images/opened-book-1.png"
player.play()
book.getElementsByTagName("img")[0].width = 820 // Some fixes...
book.removeChild(subsequator) // remove the "Нажми на меня" text
synkronisera = ()=>{
player.src = audios[1] // Change audio file (NEXT)
player.play() // Play audio...
tempage = setInterval(()=>{
if(player.currentTime>=16.2) { // - Pulsemon! Synkronisera!!!!
book.getElementsByTagName("img")[0].src = "images/opened-book-2.png"
clearInterval(tempage)
}
})
player.removeEventListener("ended", synkronisera)
}
player.addEventListener(
"ended", // On end...
synkronisera
)
},900)
setTimeout(()=>{book.style.opacity = 1;},1500)
}
</script>