-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
49 lines (47 loc) · 1.07 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>frame one</title>
<style>
html, body {
height: 100%;
}
body {
font-size: 15vw;
line-height: 1em;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Open Sans, Helvetica, Arial, sans-serif;
font-weight: 600;
margin: 0;
text-align: center;
}
.title {
transition: color 1s linear;
position: absolute;
top: 48%;
left: 0;
right: 0;
transform: translate(0, -50%);
}
.title.active {
color: red;
}
</style>
</head>
<body>
<span class="title">frame one</span>
<script>
var title = document.getElementsByClassName('title')[0];
window.addEventListener('message', receiveMessage, false);
function receiveMessage(event) {
if (event.data.visible) {
title.classList.add('active');
console.log('frame-one is visible');
} else {
title.classList.remove('active');
console.log('frame-one not visible');
}
}
</script>
</body>
</html>