Skip to content

Commit f302b70

Browse files
committed
changed some stuff, maybe it works?
1 parent 3106374 commit f302b70

File tree

4 files changed

+33
-55
lines changed

4 files changed

+33
-55
lines changed

components/chead.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,13 @@
1616
<title>{{title}}</title>
1717
<script src="/assets/scripts/navigation.js"></script>
1818
<adBlockDetect />
19+
20+
{% if (ads == "true") %}
21+
<script>
22+
window.adsEnabled = true;
23+
</script>
24+
{% else %}
25+
<script>
26+
window.adsEnabled = false;
27+
</script>
28+
{% endif %}

static/assets/scripts/home.js

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -457,13 +457,6 @@ try {
457457
}
458458
document.getElementById("check-roms").innerHTML = "";
459459
document.getElementById("check-roms").appendChild(div);
460-
} else {
461-
setTimeout(() => {
462-
if (Date.now() - lastInputTime >= failedInputCheckLag) {
463-
client.from("failed_search")
464-
.insert([{ search_content: searchInput.value }])
465-
}
466-
}, failedInputCheckLag);
467460
}
468461
} else {
469462
showAds();
@@ -523,7 +516,7 @@ try {
523516
if (needToLoadAds) {
524517
loadAds();
525518
} else {
526-
const ads = document.querySelectorAll(".tad");
519+
const ads = document.querySelectorAll(".xxx");
527520
ads.forEach(ad => {
528521
ad.style.display = "flex";
529522
});
@@ -532,7 +525,7 @@ try {
532525
function hideAds() {
533526
log("Hiding ads");
534527
showingAds = false;
535-
const ads = document.querySelectorAll(".tad");
528+
const ads = document.querySelectorAll(".xxx");
536529
ads.forEach(ad => {
537530
ad.style.display = "none";
538531
});
@@ -626,7 +619,7 @@ try {
626619
sortDirectionText.innerHTML = sortStates[sortState][1];
627620
}
628621
function shuffleAds() {
629-
const ads = document.querySelectorAll(".tad");
622+
const ads = document.querySelectorAll(".xxx");
630623
ads.forEach(ad => {
631624
ad.remove();
632625
var randomCard = document.querySelector(".cards").children[Math.floor(Math.random() * document.querySelector(".cards").children.length)];
@@ -821,7 +814,7 @@ try {
821814
removeCards();
822815
cardsArray.forEach(card => cardsContainer.appendChild(card));
823816
}
824-
function loadAds(num = 3) {
817+
function loadAds(num = 5) {
825818
log(`Loading ${num} ads`);
826819
if (!window.adsEnabled) return;
827820
if (!showingAds) {
@@ -831,23 +824,23 @@ try {
831824
};
832825
needToLoadAds = false;
833826
for (let i = 0; i < num; i++) {
834-
const adHTML = `<div data-mndbanid="c5cf29fe-386b-45f3-a462-bc8326f5a713"></div>`;
827+
const adID = `mmt-ad-${Math.random().toString(16).slice(2)}-${num}`;
828+
const adHTML = `<div id="${adID}"></div>`;
835829
const adCard = document.createElement("div");
836-
adCard.classList.add("tad");
830+
adCard.classList.add("xxx");
837831
adCard.innerHTML = adHTML;
838-
adCard.style.backgroundImage = `url('/assets/images/loading.gif')`;
839-
adCard.style.backgroundSize = "fit";
840-
adCard.style.backgroundRepeat = "no-repeat";
841-
adCard.style.backgroundPosition = "center";
832+
// adCard.style.backgroundImage = `url('/assets/images/loading.gif')`;
833+
// adCard.style.backgroundSize = "fit";
834+
// adCard.style.backgroundRepeat = "no-repeat";
835+
// adCard.style.backgroundPosition = "center";
842836

843837
var randomCard = document.querySelector(".cards").children[Math.floor(Math.random() * document.querySelector(".cards").children.length)];
844838
document.querySelector(".cards").insertBefore(adCard, randomCard);
845-
}
846-
const script = document.createElement("script");
847-
script.src = "https://ss.mrmnd.com/banner.js";
848-
document.body.appendChild(script);
849-
script.onload = () => {
850-
log("Ads loaded");
839+
$MMT = window.$MMT || {};
840+
$MMT.cmd = $MMT.cmd || [];
841+
$MMT.cmd.push(function () {
842+
$MMT.display.slots.push(adID);
843+
});
851844
}
852845
}
853846
function rerenderCards(layout) {

static/assets/styles/home.css

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ header.shadow {
7777
flex-wrap: wrap;
7878
justify-content: center;
7979
padding: 20px;
80+
margin-right: 280px;
8081
/* min-height: 50vh; */
8182
}
8283

@@ -383,24 +384,13 @@ button#sort, button#pickforme {
383384
font-size: 18px;
384385
}
385386

386-
.ads {
387-
display: flex;
388-
flex-direction: row;
389-
justify-content: center;
390-
align-items: center;
391-
margin-top: 20px;
392-
position: fixed;
393-
z-index: 999;
394-
}
395387

396-
.ads.r {
388+
.xxx.r {
397389
right: 0;
398-
top: calc(50vh - (600px) / 2);
399-
}
400-
401-
.ads.l {
402-
left: 0;
403-
top: calc(50vh - (600px) / 2);
390+
position: fixed;
391+
min-width: 300px;
392+
height: 600px;
393+
bottom: 0;
404394
}
405395

406396
.row {
@@ -410,20 +400,6 @@ button#sort, button#pickforme {
410400
align-items: center;
411401
}
412402

413-
.tad {
414-
width: 500px;
415-
height: 325px;
416-
margin: 15px;
417-
position: relative;
418-
overflow: hidden;
419-
border-radius: 10px;
420-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
421-
transition: all 0.3s ease;
422-
display: flex;
423-
flex-direction: column;
424-
align-items: center;
425-
justify-content: center;
426-
}
427403
.trealad {
428404
width: 300px;
429405
height: 250px;

static/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@
3737
</div>
3838
<div class="subContainer">
3939
<div class="row">
40-
<div class="ads r">
40+
<div class="xxx r">
4141
<!-- MONUMETRIC D: 300x250,160x600,300x600 T: 300x250,160x600,300x600 M: START -->
42-
4342
<div id="mmt-69fd2258-841e-496e-b471-7fee303347da"></div>
4443
<script type="text/javascript"
4544
data-cfasync="false">$MMT = window.$MMT || {}; $MMT.cmd = $MMT.cmd || []; $MMT.cmd.push(function () { $MMT.display.slots.push(["69fd2258-841e-496e-b471-7fee303347da"]); })</script>

0 commit comments

Comments
 (0)