-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
137 lines (117 loc) · 4.49 KB
/
index.html
File metadata and controls
137 lines (117 loc) · 4.49 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
<!doctype html>
<html lang="en">
<head>
<title>Bauhaus Echo</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta id="gameViewport" name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="favicon.png">
<link href="styles.css" rel="stylesheet" type="text/css">
<!-- Google AdSense — auto ads enabled at account level -->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2501747033825166"
crossorigin="anonymous"></script>
</head>
<body>
<!-- ================================================================= -->
<!-- NAG OVERLAY — shown before first game and between every game -->
<!-- ================================================================= -->
<div id="nag-overlay">
<div id="nag-box">
<div id="nag-header">
<h1 id="nag-title">BAUHAUS ECHO</h1>
<p id="nag-tagline">A visual memory puzzle</p>
</div>
<div id="nag-pitch">
<p><strong>Want the full experience without ads?</strong></p>
<p>Support us on itch.io for just $2 — desktop, no ads, ever.</p>
</div>
<div id="nag-store-links">
<a href="https://suchsoftware.itch.io/bauhaus-echo"
target="_blank" rel="noopener noreferrer"
class="nag-btn nag-btn-primary">
Buy on itch.io — $2
</a>
<div id="nag-mobile-row">
<a href="https://apps.apple.com/us/app/bauhaus-echo/id6759010657"
target="_blank" rel="noopener noreferrer"
class="nag-btn nag-btn-store">
App Store
</a>
<a href="https://play.google.com/store/apps/details?id=com.suchsoftware.bauhausecho"
target="_blank" rel="noopener noreferrer"
class="nag-btn nag-btn-store">
Google Play
</a>
</div>
</div>
<div id="nag-divider"></div>
<!-- AdSense display ad — replace data-ad-slot with your unit ID -->
<div id="nag-ad-container">
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-2501747033825166"
data-ad-slot="3097663248"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
</div>
<button id="nag-continue" onclick="dismissNagOverlay()">
Continue to Web Version ▸
</button>
<p id="nag-fine-print">Free with ads between games</p>
</div>
</div>
<!-- Game canvas container -->
<div align="center" id="embed-html"></div>
<script>
// ================================================================
// Nag overlay state machine
// ================================================================
(function() {
var overlay = document.getElementById('nag-overlay');
var embed = document.getElementById('embed-html');
var gwtLoaded = false;
// Request the first ad for the initial overlay (defer until layout is done)
setTimeout(function() {
try { (adsbygoogle = window.adsbygoogle || []).push({}); } catch(e) { console.warn('AdSense init error:', e); }
}, 500);
// Called when user clicks "Continue to Web Version"
// Also called from GwtAdManager via JSNI after between-game nag
window.dismissNagOverlay = function() {
overlay.style.display = 'none';
// If a rewarded-ad session was pending, notify GWT
if (window.__gwtRewardCallback) {
try { window.__gwtRewardCallback(); } catch(e) {}
}
if (!gwtLoaded) {
// First dismiss: inject GWT script to start the game
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = 'html/html.nocache.js';
document.body.appendChild(s);
gwtLoaded = true;
// Attach input handlers once GWT creates the canvas
s.onload = function() {
setTimeout(function() {
embed.addEventListener('mousedown', blockDefault, false);
embed.addEventListener('mouseup', blockDefault, false);
}, 500);
};
}
};
// Called from GwtAdManager.showInterstitialAd() via JSNI
// Shows the nag overlay on top of the running game
window.showNagOverlay = function() {
overlay.style.display = 'flex';
// Request a fresh ad each time the overlay appears
try { (adsbygoogle = window.adsbygoogle || []).push({}); } catch(e) {}
};
// Block right-click and default mouse behaviour on the canvas
function blockDefault(evt) {
evt.preventDefault();
evt.stopPropagation();
window.focus();
}
document.addEventListener('contextmenu', function(e) { e.preventDefault(); });
})();
</script>
</body>
</html>