-
Notifications
You must be signed in to change notification settings - Fork 14
/
sampleOSMTemplate.html
188 lines (173 loc) · 9.04 KB
/
sampleOSMTemplate.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<html><head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" charset="UTF-8">
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=ABeeZee|Abel|Aclonica|Acme|Actor|Advent+Pro|Alata|Alatsi|Aldrich|Alef|Alegreya+Sans|Alegreya+Sans+SC|Allerta|Allerta+Stencil|Almarai|Amaranth|Amiko|Anaheim|Andika|Andika+New+Basic|Antic|Anton|Archivo|Archivo+Black|Archivo+Narrow|Arimo|Armata|Arsenal|Arya|Asap|Asap+Condensed|Assistant|Asul|Athiti|Average+Sans|B612|Bai+Jamjuree|Barlow|Barlow+Condensed|Barlow+Semi+Condensed|Basic|Be+Vietnam|Belleza|BenchNine|Biryani|Black+And+White+Picture|Black+Han+Sans|Blinker|Bubbler+One|Cabin|Cabin+Condensed|Cagliostro|Cairo|Cambay|Candal|Cantarell|Cantora+One|Capriola|Carme|Carrois+Gothic|Carrois+Gothic+SC|Catamaran|Chakra+Petch|Changa|Chathura|Chau+Philomene+One|Chivo|Coda+Caption|Commissioner|Convergence|Cuprum|DM+Sans|Darker+Grotesque|Days+One|Denk+One|Dhurjati|Didact+Gothic|Do+Hyeon|Doppio+One|Dorsa|Dosis|Duru+Sans|Economica|El+Messiri|Electrolize|Encode+Sans|Encode+Sans+Condensed|Encode+Sans+Expanded|Encode+Sans+Semi+Condensed|Encode+Sans+Semi+Expanded|Englebert|Epilogue|Exo|Exo+2|Fahkwang|Farro|Federo|Fira+Sans|Fira+Sans+Condensed|Fira+Sans+Extra+Condensed|Fjalla+One|Francois+One|Fresca|GFS+Neohellenic|Gafata|Galdeano|Gayathri|Geo|Gidugu|Gothic+A1|Gotu|Gudea|Hammersmith+One|Harmattan|Heebo|Hind|Hind+Guntur|Hind+Madurai|Hind+Siliguri|Hind+Vadodara|Homenaje|IBM+Plex+Sans|IBM+Plex+Sans+Condensed|Imprima|Inder|Inria+Sans|Inter|Istok+Web|Jaldi|Jockey+One|Josefin+Sans|Jost|Jua|Julius+Sans+One|Jura|K2D|Kanit|Kantumruy|Karla|Khand|Khula|Kite+One|KoHo|Kodchasan|Kosugi|Kosugi+Maru|Krona+One|Krub|Kulim+Park|Kumbh+Sans|Lato|Lekton|Lexend+Deca|Lexend+Exa|Lexend+Giga|Lexend+Mega|Lexend+Peta|Lexend+Tera|Lexend+Zetta|Libre+Franklin|Livvic|M+PLUS+1p|M+PLUS+Rounded+1c|Mada|Magra|Mako|Mallanna|Mandali|Manjari|Manrope|Marmelad|Martel+Sans|Marvel|Maven+Pro|Meera+Inimai|Merriweather+Sans|Metrophobic|Michroma|Mina|Miriam+Libre|Mitr|Molengo|Monda|Montserrat|Montserrat+Alternates|Montserrat+Subrayada|Mouse+Memoirs|Mukta|Mukta+Mahee|Mukta+Malar|Mukta+Vaani|Mulish|NTR|Nanum+Gothic|News+Cycle|Niramit|Nobile|Notable|Noto+Sans|Noto+Sans+HK|Noto+Sans+JP|Noto+Sans+KR|Noto+Sans+SC|Noto+Sans+TC|Numans|Nunito|Nunito+Sans|Open+Sans|Open+Sans+Condensed|Orbitron|Orienta|Oswald|Overpass|Oxygen|PT+Sans|PT+Sans+Caption|PT+Sans+Narrow|Padauk|Palanquin|Palanquin+Dark|Pathway+Gothic+One|Pattaya|Pavanam|Paytone+One|Philosopher|Play|Pontano+Sans|Poppins|Port+Lligat+Sans|Pragati+Narrow|Prompt|Proza+Libre|Public+Sans|Puritan|Quantico|Quattrocento+Sans|Questrial|Quicksand|Rajdhani|Raleway|Ramabhadra|Rambla|Rationale|Recursive|Red+Hat+Display|Red+Hat+Text|Reem+Kufi|Roboto|Roboto+Condensed|Ropa+Sans|Rosario|Rubik|Rubik+Mono+One|Ruda|Ruluko|Rum+Raisin|Russo+One|Saira|Saira+Condensed|Saira+Extra+Condensed|Saira+Semi+Condensed|Sansita|Sarabun|Sarala|Sarpanch|Sawarabi+Gothic|Sawarabi+Mincho|Scada|Secular+One|Sen|Seymour+One|Shanti|Share+Tech|Signika|Signika+Negative|Sintony|Six+Caps|Snippet|Sora|Source+Sans+Pro|Space+Grotesk|Spartan|Spinnaker|Strait|Stylish|Sulphur+Point|Sunflower|Syncopate|Syne|Tajawal|Tauri|Teko|Telex|Tenali+Ramakrishna|Tenor+Sans|Text+Me+One|Thasadith|Timmana|Titillium+Web|Tomorrow|Trispace|Ubuntu|Ubuntu+Condensed|Varela|Varela+Round|Varta|Viga|Voltaire|Wendy+One|Wire+One|Work+Sans|Yanone+Kaffeesatz|Yantramanav">
<style>
.moe-container {
display: inline-block;
background: transparent;
overflow:hidden;
}
.moe-image {
width: 100%;
}
body {
height: 100vh;
width: 100vw;
display: flex;
flex: 1;
justify-content: center;
align-items: center;
background: rgba(0, 0, 0, 0.3);
}
.close-icon {
position: absolute;
right: 15px;
top: 10px;
width: 32px;
height: 32px;
opacity: 1;
z-index: 9999999;
}
.button-container {
position: absolute;
bottom: 30px;
z-index: 999999;
transform: translate(-50%);
left: 50%;
}
.moe-button {
background: #007bff;
color: #ffff;
padding: 10px;
border-radius: 5px;
cursor: pointer; border: 1px transparent;
}
.moe-button:focus,.moe-inapp-close:focus{
border: solid 1px #000;
}.moe-button.moe-active, .moe-inapp-close.moe-active{
border: solid 1px #000;
}
@media only screen and (max-width: 600px) {
.frame {
width: 80%;
background: transparent;
}
}
</style>
</head>
<body style="margin: 0px; z-index: 9999;" marginheight="0" data--w-e-b="center" class="">
<!-- The external link on href is not found to be working in browsers of some iPhone models, please use onclick as an alternative that works for all platforms
For example,
instead of: <a href="url" target="_blank"> Link text </a>
use: <a onclick="window.open('url', '_blank')"> Link text </a>
-->
<div style="display: inline-block; position: relative;">
<div data-id="CONTAINER" style="position: relative; display: inline-block; z-index: 999999;" class="moe-element moe-container" data-editor-type="MOE_EDITOR">
<img data-id="IMAGE" class="moe-element moe-image" src="https://s3.amazonaws.com/moe-email-campaigns/onsite/web_new_arrival.jpg">
</div>
<div class="button-container no-bounds">
<button data-id="BUTTON" class="btn moe-button moe-element" id="interested" type="button" style="z-index: 999999; display: inline-block; margin-bottom: 53px;" contenteditable="false">I am Interested</button>
</div>
<div class="button-container no-bounds">
<button data-id="BUTTON" class="btn moe-button moe-element" id="not_interested" type="button" style="z-index: 999999; display: inline-block;" contenteditable="false">I am not Interested</button>
</div>
<button data-id="CLOSE" type="button" class="close close-icon moe-inapp-close moe-element" aria-label="Close" id="close-icon"> x </button>
</div>
<script>
var btn1 = document.getElementById("not_interested");
var btn2 = document.getElementById("interested");
var closeBtn = document.querySelector(".moe-inapp-close");
var activeElement = '';
// document.body.focus();
function focusButton(btnType) {
console.log('btn focussed. btn type: ', btnType, 'active elem: ', activeElement);
if(btnType === 'up' || btnType === 'down') {
removeActiveClass();
if(!activeElement) {
activeElement = 'btn1';
// btn1.focus();
btn1.classList.add('moe-active');
} else if(btnType === 'up' && activeElement === 'btn1') {
activeElement = 'btn2';
// btn2.focus();
btn2.classList.add('moe-active');
} else if(btnType === 'up' && activeElement === 'btn2') {
activeElement = 'closeBtn';
// closeBtn.focus();
closeBtn.classList.add('moe-active');
} else if(btnType === 'up' && activeElement === 'closeBtn') {
activeElement = 'btn1';
// btn1.focus();
btn1.classList.add('moe-active');
} else if(btnType === 'down' && activeElement === 'closeBtn') {
activeElement = 'btn2';
// btn2.focus();
btn2.classList.add('moe-active');
} else if(btnType === 'down' && activeElement === 'btn2') {
activeElement = 'btn1';
// btn1.focus();
btn1.classList.add('moe-active');
} else if(btnType === 'down' && activeElement === 'btn1') {
activeElement = 'closeBtn';
// closeBtn.focus();
closeBtn.classList.add('moe-active');
}
console.log('active elem after op: ', activeElement);
}
}
function clickFocusedButton() {
if (activeElement === 'btn1') {
// btn1.click();
console.log('btn1')
window.parent.Moengage.track_event('MOE_RESPONSE', {intention: 'not interested'})
} else if (activeElement === 'btn2') {
// btn2.click();
console.log('btn2')
window.parent.Moengage.track_event('MOE_RESPONSE', {intention: 'interested'})
} else if (activeElement === 'closeBtn') {
// closeBtn.click();
console.log('closeBtn')
window.parent.Moengage.track_event('MOE_INAPP_CLOSE');
if(window.parent.Moengage.onsite.displayManager.testCampaign) {
window.parent.Moengage.onsite.displayManager.dismissTestInapp(window.parent.Moengage.onsite.displayManager.testCampaign.draftId)
} else {
Object.keys(window.parent.Moengage.onsite.displayManager.campaignRenderMap).forEach(k => {
if(window.parent.Moengage.onsite.displayManager.campaignRenderMap[k].active) {
window.parent.Moengage.onsite.displayManager.dismissInapp(k)
}
})
}
}
}
function removeActiveClass() {
document.querySelectorAll('.moe-active').forEach(el => {
el.classList.remove('moe-active');
})
}
// add eventListener for keydown
window.parent.document.addEventListener("keydown", function (e) {
// window.addEventListener("keydown", function (e) {
switch (e.keyCode) {
case 37: //LEFT arrow
focusButton('left');
break;
case 38: //UP arrow
focusButton('up');
break;
case 39: //RIGHT arrow
focusButton('right');
break;
case 40: //DOWN arrow
focusButton('down');
break;
case 13: //OK button
clickFocusedButton();
break;
default:
console.log("Key code : " + e.keyCode);
break;
}
});
</script>
</body></html>