added sellout

This commit is contained in:
Jack 2020-10-31 20:20:35 +00:00
parent 613273cde8
commit 4c9dbf60dd
3 changed files with 2595 additions and 2509 deletions

View file

@ -860,7 +860,7 @@ a:hover {
#centerContent {
max-width: 1000px;
// min-width: 500px;
margin: 0 auto;
// margin: 0 auto;
display: grid;
grid-auto-flow: row;
min-height: 100vh;
@ -869,6 +869,7 @@ a:hover {
align-items: center;
z-index: 999;
grid-template-rows: auto 1fr auto;
width: 100%;
&.wide125 {
max-width: 1250px;
}
@ -3016,11 +3017,6 @@ key {
}
}
#ad {
justify-content: center;
display: flex;
}
@keyframes flashKey {
from {
color: var(--bg-color);

File diff suppressed because it is too large Load diff

View file

@ -69,7 +69,7 @@ let defaultConfig = {
minWpmCustomSpeed: 100,
highlightMode: "letter",
alwaysShowCPM: false,
enableAds: false,
enableAds: "off",
};
let cookieConfig = null;
@ -225,17 +225,61 @@ function applyConfig(configObj) {
// accountFilters = configObj.resultFilters;
// }
// config = configObj;
try {
setEnableAds(configObj.enableAds, true);
if (config.enableAds) {
$("#ad").removeClass("hidden");
if (config.enableAds === "on") {
$("#ad1").removeClass("hidden");
$("#ad1")
.html(`<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Horizontal Ad -->
<ins class="adsbygoogle"
style="display:inline-block;width:850px;height:90px"
data-ad-client="ca-pub-7261919841327810"
data-ad-slot="2225821478"></ins>`);
(adsbygoogle = window.adsbygoogle || []).push({});
} else if (config.enableAds === "max") {
$("#ad1").removeClass("hidden");
$("#ad2").removeClass("hidden");
$("#ad3").removeClass("hidden");
$("#ad1").html(`<script
async
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
></script>
<!-- Horizontal Ad -->
<ins
class="adsbygoogle"
style="display: inline-block; width: 1000px; height: 90px"
data-ad-client="ca-pub-7261919841327810"
data-ad-slot="2225821478"
></ins>`);
$("#ad2")
.html(`<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Vertical 1 -->
<ins class="adsbygoogle"
style="display:inline-block;width:160px;height:600px"
data-ad-client="ca-pub-7261919841327810"
data-ad-slot="6376286644"></ins>`);
$("#ad3")
.html(`<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Vertical 2 -->
<ins class="adsbygoogle"
style="display:inline-block;width:160px;height:600px"
data-ad-client="ca-pub-7261919841327810"
data-ad-slot="1159796595"></ins>`);
(adsbygoogle = window.adsbygoogle || []).push({});
(adsbygoogle = window.adsbygoogle || []).push({});
(adsbygoogle = window.adsbygoogle || []).push({});
} else {
$("#ad").remove();
$("#ad1").remove();
$("#ad2").remove();
$("#ad3").remove();
}
} catch (e) {
console.log("error initialising ads " + e.message);
$("#ad").remove();
$("#ad1").remove();
$("#ad2").remove();
$("#ad3").remove();
}
}
Object.keys(defaultConfig).forEach((configKey) => {
@ -590,8 +634,8 @@ function setQuickEnd(qe, nosave) {
}
function setEnableAds(val, nosave) {
if (val == undefined) {
val = false;
if (val == undefined || val === true || val === false) {
val = "off";
}
config.enableAds = val;
if (!nosave) saveConfigToCookie();