Swap MR+ ad fallback to MRS (#3890)

* Replace Modrinth+ ad placeholder promo with Modrinth Servers promo

* Color toggle on web

* Remove plus link click helper
This commit is contained in:
Prospector
2025-07-02 21:50:33 -07:00
committed by GitHub
parent 497b2e977e
commit 4964c8d373
3 changed files with 55 additions and 24 deletions

View File

@@ -32,8 +32,32 @@ function updateAdPosition() {
<template> <template>
<div ref="adsWrapper" class="ad-parent relative flex w-full justify-center cursor-pointer bg-bg"> <div ref="adsWrapper" class="ad-parent relative flex w-full justify-center cursor-pointer bg-bg">
<div class="flex max-h-[250px] min-h-[250px] min-w-[300px] max-w-[300px] flex-col gap-4 p-6"> <a
<p class="m-0 text-2xl font-bold text-contrast">75% of ad revenue goes to creators</p> href="https://modrinth.gg?from=app-placeholder"
</div> target="_blank"
class="flex max-h-[250px] min-h-[250px] min-w-[300px] max-w-[300px] flex-col gap-4 rounded-[inherit]"
>
<img
src="https://cdn-raw.modrinth.com/modrinth-servers-placeholder-light.webp"
alt="Host your next server with Modrinth Servers"
class="hidden light-image rounded-[inherit]"
/>
<img
src="https://cdn-raw.modrinth.com/modrinth-servers-placeholder-dark.webp"
alt="Host your next server with Modrinth Servers"
class="dark-image rounded-[inherit]"
/>
</a>
</div> </div>
</template> </template>
<style lang="scss" scoped>
.light, .light-mode {
.dark-image {
display: none;
}
.light-image {
display: block;
}
}
</style>

View File

@@ -1,15 +1,20 @@
<template> <template>
<div class="ad-parent relative mb-3 flex w-full justify-center rounded-2xl bg-bg-raised"> <div class="ad-parent relative mb-3 flex w-full justify-center rounded-2xl bg-bg-raised">
<div class="flex max-h-[250px] min-h-[250px] min-w-[300px] max-w-[300px] flex-col gap-4 p-6"> <nuxt-link
<p class="m-0 text-2xl font-bold text-contrast">75% of ad revenue goes to creators</p> to="/servers"
<nuxt-link to="/plus" class="mt-auto items-center gap-1 text-purple hover:underline"> class="flex max-h-[250px] min-h-[250px] min-w-[300px] max-w-[300px] flex-col gap-4 rounded-[inherit]"
<span> >
Support creators and Modrinth ad-free with <img
<span class="font-bold">Modrinth+</span> src="https://cdn-raw.modrinth.com/modrinth-servers-placeholder-light.webp"
</span> alt="Host your next server with Modrinth Servers"
<ChevronRightIcon class="relative top-[3px] h-5 w-5" /> class="light-image hidden rounded-[inherit]"
</nuxt-link> />
</div> <img
src="https://cdn-raw.modrinth.com/modrinth-servers-placeholder-dark.webp"
alt="Host your next server with Modrinth Servers"
class="dark-image rounded-[inherit]"
/>
</nuxt-link>
<div <div
class="absolute top-0 flex items-center justify-center overflow-hidden rounded-2xl bg-bg-raised" class="absolute top-0 flex items-center justify-center overflow-hidden rounded-2xl bg-bg-raised"
> >
@@ -18,8 +23,6 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { ChevronRightIcon } from "@modrinth/assets";
useHead({ useHead({
script: [ script: [
// { // {
@@ -137,3 +140,16 @@ iframe[id^="google_ads_iframe"] {
} }
} }
</style> </style>
<style lang="scss" scoped>
.light,
.light-mode {
.dark-image {
display: none;
}
.light-image {
display: block;
}
}
</style>

View File

@@ -95,15 +95,6 @@
}); });
document.addEventListener("contextmenu", (event) => event.preventDefault()); document.addEventListener("contextmenu", (event) => event.preventDefault());
const plusLink = document.getElementById("plus-link");
plusLink.addEventListener("click", function () {
window.__TAURI_INTERNALS__.invoke("plugin:ads|record_ads_click", {});
window.__TAURI_INTERNALS__.invoke("plugin:ads|open_link", {
path: "https://modrinth.com/plus",
origin: "https://modrinth.com",
});
});
</script> </script>
</body> </body>
</html> </html>