Skip to content

Commit 168105e

Browse files
authored
Update sponsor.html
1 parent 611a5dd commit 168105e

File tree

1 file changed

+1
-339
lines changed

1 file changed

+1
-339
lines changed

assets/html/sponsor.html

Lines changed: 1 addition & 339 deletions
Original file line numberDiff line numberDiff line change
@@ -8,344 +8,6 @@
88
<title>Document</title>
99
</head>
1010
<body>
11-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
12-
<script>
13-
var win = this;
14-
var spoElem, shaElem, carElem;
15-
var sponsorStyles = getSponsorStyles();
16-
17-
const styleElem = document.createElement("style");
18-
styleElem.innerHTML = sponsorStyles;
19-
document.head.appendChild(styleElem);
20-
21-
function loadSponsorElem() {
22-
class SponsorElem extends HTMLElement {
23-
constructor(){
24-
super();
25-
26-
this.src = "//cdn.carbonads.com/carbon.js?serve=CE7DP53N&placement=virtual-keyboardjsorg";
27-
this.sha = this.attachShadow({mode: 'closed'});
28-
this.styles = sponsorStyles;
29-
}
30-
31-
connectedCallback() {
32-
33-
const pmg = document.createElement("div");
34-
pmg.className = 'p_mg';
35-
36-
const pmi = document.createElement("div");
37-
pmi.className = 'p_mi';
38-
39-
const pmo = document.createElement("div");
40-
pmo.className = 'p_mo';
41-
pmo.style.display = "none";
42-
pmo.innerHTML = `
43-
<a href="https://hge.to/thanks" target="_blank"><img src="https://virtual-keyboard.js.org/assets/img/supporthg.png" width="335" height="130" /></a>
44-
`;
45-
46-
pmg.appendChild(pmi);
47-
pmg.appendChild(pmo);
48-
49-
this.sha.appendChild(pmg);
50-
51-
spoElem = this;
52-
shaElem = this.sha;
53-
carElem = pmi;
54-
55-
const styleElem = document.createElement("style");
56-
styleElem.innerHTML = this.styles;
57-
shaElem.prepend(styleElem);
58-
59-
const scr = document.createElement('script');
60-
scr.src = "https://impr.spv.workers.dev/sa";
61-
this.sha.appendChild(scr);
62-
63-
let carSpot;
64-
65-
const observer = new MutationObserver(function() {
66-
carSpot = carElem.querySelector('#carbonads');
67-
});
68-
69-
// call `observe()` on that MutationObserver instance,
70-
// passing it the element to observe, and the options object
71-
observer.observe(carElem, {subtree: true, childList: true});
72-
73-
/**
74-
* If elem is not ready in 10 seconds show replacement
75-
*/
76-
setTimeout(() => {
77-
if(!carSpot){
78-
$(pmo).show();
79-
$(pmi).hide();
80-
}
81-
}, 10000);
82-
}
83-
}
84-
85-
window.customElements.define("sponsor-element", SponsorElem);
86-
}
87-
88-
function getSponsorStyles() {
89-
return `
90-
body, html {
91-
margin: 0;
92-
padding: 0;
93-
display: flex;
94-
align-items: center;
95-
width: 100%;
96-
font-family:'Raleway', sans-serif;
97-
}
98-
99-
#carbonads,
100-
#hgeads {
101-
font-family:'Raleway', sans-serif;
102-
}
103-
104-
#carbonads,
105-
#hgeads {
106-
display: flex;
107-
max-width: 330px;
108-
background-color: hsl(0, 0%, 98%);
109-
}
110-
111-
.page-docs #carbonads,
112-
.page-docs #hgeads {
113-
display: flex;
114-
max-width: 330px;
115-
background-color: hsl(0, 0%, 10%);
116-
}
117-
118-
#carbonads a,
119-
#hgeads a {
120-
color: inherit;
121-
text-decoration: none;
122-
}
123-
124-
.page-docs #carbonads a,
125-
.page-docs #hgeads a {
126-
color: #ddd;
127-
}
128-
129-
#carbonads a:hover,
130-
#hgeads a:hover {
131-
color: inherit;
132-
}
133-
134-
#carbonads span,
135-
#hgeads span {
136-
position: relative;
137-
display: block;
138-
overflow: hidden;
139-
width: 100%;
140-
}
141-
142-
#carbonads .carbon-wrap,
143-
#hgeads .hge-wrap {
144-
display: flex;
145-
position: relative;
146-
}
147-
148-
.carbon-img,
149-
.hge-img {
150-
display: block;
151-
margin: 0;
152-
line-height: 1;
153-
}
154-
155-
.carbon-img img,
156-
.hge-img img {
157-
display: block;
158-
object-fit: cover;
159-
}
160-
161-
.carbon-text,
162-
.hge-text {
163-
/*font-size: 13px;
164-
padding: 10px;
165-
line-height: 1.5;
166-
text-align: left;
167-
width: 100%;*/
168-
169-
font-size: 14px;
170-
font-weight: 500;
171-
padding: 10px;
172-
line-height: 1.5;
173-
text-align: left;
174-
width: 100%;
175-
text-overflow: ellipsis;
176-
height: 75px;
177-
overflow: hidden;
178-
overflow: hidden;
179-
white-space: inherit;
180-
display: -webkit-box;
181-
-webkit-line-clamp: 4;
182-
-webkit-box-orient: vertical;
183-
overflow: hidden;
184-
}
185-
186-
.carbon-poweredby,
187-
.hge-poweredby {
188-
/*display: block;
189-
padding: 8px 10px;
190-
text-align: center;
191-
text-transform: uppercase;
192-
letter-spacing: .5px;
193-
font-weight: 600;
194-
font-size: 9px;
195-
line-height: 1;
196-
color: #7b7b7b !important;
197-
background: #f1f1f1;
198-
position: absolute;
199-
right: 0;
200-
bottom: 0;*/
201-
202-
padding: 0;
203-
text-align: center;
204-
text-transform: uppercase;
205-
letter-spacing: .5px;
206-
font-weight: 600;
207-
opacity: 0.5;
208-
font-size: 9px;
209-
line-height: 1;
210-
color: rgba(0,0,0,0) !important;
211-
background: none;
212-
position: absolute;
213-
right: 0;
214-
bottom: 0;
215-
width: 30px;
216-
}
217-
218-
.carbon-poweredby:after, .hge-poweredby:after {
219-
content: "ad";
220-
color: black;
221-
background: #d9d9d9;
222-
height: 20px;
223-
position: absolute;
224-
width: 26px;
225-
right: 0;
226-
bottom: 0;
227-
display: flex;
228-
align-items: center;
229-
justify-content: center;
230-
}
231-
232-
.p_mg,
233-
.p_mi {
234-
width: 100%;
235-
}
236-
237-
.page-docs .carbon-poweredby,
238-
.page-docs .hge-poweredby {
239-
background: #1e2021;
240-
color: #aaa;
241-
}
242-
243-
.page-sidebar #carbonads,
244-
.page-sidebar #hgeads {
245-
margin: 20px;
246-
}
247-
248-
.page-sidebar #carbonads .carbon-wrap,
249-
.page-sidebar #hgeads .hge-wrap {
250-
display: flex;
251-
flex-flow: column;
252-
}
253-
254-
.page-sidebar #carbonads .carbon-img,
255-
.page-sidebar #hgeads .hge-img {
256-
margin: 0;
257-
display: flex;
258-
align-items: center;
259-
justify-content: center;
260-
min-height: 170px;
261-
}
262-
263-
.page-sidebar #carbonads .carbon-img img,
264-
.page-sidebar #hgeads .hge-img img {
265-
width: 100%;
266-
height: auto;
267-
max-width: none !important;
268-
}
269-
270-
.content .page-aside.inlineAsideHtml #carbonads,
271-
.content .page-aside.inlineAsideHtml #hgeads {
272-
width: 100% !important;
273-
max-width: unset !important;
274-
background-color: transparent;
275-
position: relative;
276-
max-height: 160px;
277-
font-family:'Raleway', sans-serif;
278-
}
279-
280-
.content .page-aside.inlineAsideHtml #carbonads>span,
281-
.content .page-aside.inlineAsideHtml #hgeads>span {
282-
display: flex;
283-
width: 100%;
284-
}
285-
286-
.content .page-aside.inlineAsideHtml #carbonads .carbon-wrap,
287-
.content .page-aside.inlineAsideHtml #hgeads .hge-wrap {
288-
display: flex;
289-
}
290-
291-
.content .page-aside.inlineAsideHtml #carbonads .carbon-img,
292-
.content .page-aside.inlineAsideHtml #hgeads .hge-img {
293-
max-height: unset;
294-
max-width: 250px;
295-
overflow: hidden;
296-
height: auto;
297-
}
298-
299-
.content .page-aside.inlineAsideHtml #carbonads .carbon-img img,
300-
.content .page-aside.inlineAsideHtml #hgeads .hge-img img {
301-
display: block;
302-
max-width: unset !important;
303-
height: auto;
304-
height: 100%;
305-
width: 100%;
306-
object-fit: cover;
307-
background: #efefef;
308-
}
309-
310-
.content .page-aside.inlineAsideHtml #carbonads a.carbon-text,
311-
.content .page-aside.inlineAsideHtml #hgeads a.hge-text {
312-
font-size: 22px;
313-
padding: 20px;
314-
}
315-
316-
.content .page-aside.inlineAsideHtml #carbonads .carbon-poweredby,
317-
.content .page-aside.inlineAsideHtml #hgeads .hge-poweredby {
318-
height: 26px;
319-
bottom: 11px;
320-
position: absolute;
321-
right: 0;
322-
font-size: 10px;
323-
}
324-
`;
325-
}
326-
327-
$(window).on('load', function() {
328-
/*if ($('#carbonads').length) {
329-
$('.p_mo').hide();
330-
} else {
331-
const spoTag = document.createElement('sponsor-element');
332-
document.body.appendChild(spoTag);
333-
$('.p_mg').remove();
334-
loadSponsorElem();
335-
}*/
336-
337-
// Rotate
338-
const curUrl = new URL(window.location);
339-
const params = curUrl.searchParams;
340-
const refval = parseFloat(params.get('ref') || 0);
341-
params.set("ref", refval+1);
342-
343-
/*setTimeout(() => {
344-
win.location.replace(curUrl.toString());
345-
}, 30000);*/
346-
});
347-
</script>
348-
349-
<div class="p_mg"><div class="p_mi"><script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CE7DP53N&placement=virtual-keyboardjsorg" id="_carbonads_js"></script></div></div>
11+
<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CE7DP53N&placement=virtual-keyboardjsorg&format=cover" id="_carbonads_js"></script>
35012
</body>
35113
</html>

0 commit comments

Comments
 (0)