-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
137 lines (121 loc) · 5.17 KB
/
index.html
File metadata and controls
137 lines (121 loc) · 5.17 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
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
<HTML>
<HEAD>
<META NAME="viewport" CONTENT="width=device-width, initial-scale=1">
<TITLE>HYPERGAMBLING RESEARCH</TITLE>
<STYLE>
BODY { margin: 0; padding: 0 25px 40px; }
TABLE { border-collapse: collapse; border-spacing: 0; }
TD.divider { height: 2px; font-size: 0; line-height: 0; }
IMG { width: 100%; height: auto; display: block; margin: 0; padding: 0; }
VIDEO { width: 100%; height: auto; display: block; margin: 0; padding: 0; }
A { color: #DDDDDD; text-decoration: underline; }
A:visited { color: #DDDDDD; }
A:hover { color: #FFFF00; }
.video-label { font-family: Courier New, Courier; color: #DDDDDD; font-weight: bold; font-size: 16px; }
@media (max-width: 600px) { .video-label { font-size: 9px; } }
</STYLE>
</HEAD>
<BODY BGCOLOR="#FF0000" ALINK=#DDDDDD VLINK=#DDDDDD LINK=#DDDDDD>
<CENTER>
<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 STYLE="position: fixed; top: 0; left: 0; right: 0; z-index: 999;">
<TR><TD BGCOLOR=#000000 ALIGN=CENTER STYLE="padding: 16px 0;">
<FONT FACE="Courier New,Courier" COLOR="#FFFFFF" SIZE=+1><B>
HYPERGAMBLING RESEARCH
</B></FONT>
</TABLE>
<!-- Spacer to push content below fixed header -->
<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD STYLE="height: 77px;"></TABLE>
<DIV ID="entries"></DIV>
</CENTER>
<SCRIPT SRC="entries.js"></SCRIPT>
<SCRIPT>
function needsDivider(prevType, currType) {
var dividerTypes = ['text', 'link', 'keyword'];
return dividerTypes.indexOf(prevType) !== -1 && dividerTypes.indexOf(currType) !== -1;
}
function escapeHTML(str) {
var div = document.createElement('div');
div.appendChild(document.createTextNode(str));
return div.innerHTML;
}
var isMuted = false;
function pauseAllExcept(current) {
var wrappers = document.querySelectorAll('.video-wrap');
for (var i = 0; i < wrappers.length; i++) {
var v = wrappers[i].querySelector('video');
if (v !== current && !v.paused) {
v.pause();
}
}
}
function videoTap(container) {
var v = container.querySelector('video');
var o = container.querySelector('.play-overlay');
if (v.paused) { pauseAllExcept(v); v.muted = isMuted; v.play(); }
else { v.pause(); }
}
function toggleMute() {
isMuted = !isMuted;
var videos = document.querySelectorAll('video');
for (var i = 0; i < videos.length; i++) videos[i].muted = isMuted;
var btns = document.querySelectorAll('.mute-btn');
for (var i = 0; i < btns.length; i++) btns[i].textContent = isMuted ? 'UNMUTE' : 'MUTE';
}
function renderEntries(entries) {
var container = document.getElementById('entries');
var html = '';
var prevType = null;
for (var i = 0; i < entries.length; i++) {
var entry = entries[i];
if (prevType !== null && needsDivider(prevType, entry.type)) {
html += '<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD CLASS="divider" BGCOLOR=#000000></TABLE>\n';
}
if (entry.type === 'text') {
html += '<TABLE WIDTH=100% CELLPADDING=8 CELLSPACING=0>';
html += '<TR><TD BGCOLOR=#333333>';
html += '<FONT FACE="Courier New,Courier" COLOR=#DDDDDD>';
html += '<B>' + escapeHTML(entry.content).replace(/\n/g, '<BR>') + '</B>';
html += '</FONT>';
html += '</TABLE>\n';
} else if (entry.type === 'image') {
html += '<IMG SRC="' + escapeHTML(entry.src) + '" STYLE="pointer-events: auto;">\n';
} else if (entry.type === 'video') {
html += '<DIV CLASS="video-wrap" STYLE="position:relative;cursor:pointer" ONCLICK="videoTap(this)">';
html += '<VIDEO PLAYSINLINE WEBKIT-PLAYSINLINE PRELOAD="metadata" WIDTH=100% STYLE="display:block">';
html += '<SOURCE SRC="' + escapeHTML(entry.src) + '#t=0.001" TYPE="video/mp4">';
html += '</VIDEO>';
html += '<DIV CLASS="play-overlay video-label" STYLE="position:absolute;top:8px;left:8px;pointer-events:none;background:#333333;padding:4px 8px">';
html += 'TAP TO PLAY/PAUSE';
html += '</DIV>';
html += '<DIV CLASS="mute-btn video-label" ONCLICK="event.stopPropagation();toggleMute()" STYLE="position:absolute;top:8px;right:8px;cursor:pointer;pointer-events:auto;background:#333333;padding:4px 8px">';
html += (isMuted ? 'UNMUTE' : 'MUTE');
html += '</DIV>';
html += '</DIV>\n';
} else if (entry.type === 'keyword') {
html += '<TABLE WIDTH=100% CELLPADDING=8 CELLSPACING=0>';
html += '<TR><TD BGCOLOR=#333333 ALIGN=CENTER>';
html += '<FONT FACE="Courier New,Courier" COLOR=#FF0000 SIZE=+2>';
html += '<B>' + escapeHTML(entry.content).replace(/\n/g, '<BR>') + '</B>';
html += '</FONT>';
html += '</TABLE>\n';
} else if (entry.type === 'link') {
html += '<TABLE WIDTH=100% CELLPADDING=8 CELLSPACING=0>';
html += '<TR><TD BGCOLOR=#333333 ALIGN=CENTER>';
html += '<FONT FACE="Courier New,Courier" COLOR=#DDDDDD SIZE=+1><B>';
html += '<A HREF="' + escapeHTML(entry.url) + '">' + escapeHTML(entry.title) + '</A>';
html += '</B></FONT>';
html += '<FONT FACE="Courier New,Courier" SIZE=-1 COLOR=#DDDDDD><BR>';
html += '<B>' + escapeHTML(entry.description) + '</B>';
html += '</FONT>';
html += '</TABLE>\n';
}
prevType = entry.type;
}
container.innerHTML = html;
}
if (typeof ENTRIES_DATA !== 'undefined') {
renderEntries(ENTRIES_DATA);
}
</SCRIPT>
</BODY>
</HTML>