feat(ads): restore custom AdBanner with Admitad link
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
---
|
||||
interface Props {
|
||||
size: "leaderboard" | "rectangle" | "tile";
|
||||
}
|
||||
|
||||
const { size } = Astro.props;
|
||||
|
||||
const ads = [
|
||||
{
|
||||
href: "https://kjuzv.com/g/q6gfnfvsq067a6d0fce8a804937a48/?erid=MvGzQC98w3Z1gMq1kx5ACoy5",
|
||||
label: "Читай-город — книги со скидкой",
|
||||
sublabel: "Более 3 млн книг с доставкой по всей России",
|
||||
cta: "Купить",
|
||||
ctaMobile: "Купить",
|
||||
},
|
||||
];
|
||||
|
||||
const ad = ads[Math.floor(Math.random() * ads.length)];
|
||||
|
||||
const specs = {
|
||||
leaderboard: { class: "w-full h-[90px]", horizontal: true },
|
||||
rectangle: { class: "w-full max-w-[300px] h-[250px]", horizontal: false },
|
||||
tile: { class: "w-full h-[250px]", horizontal: false },
|
||||
};
|
||||
|
||||
const { class: sizeClass, horizontal } = specs[size];
|
||||
---
|
||||
|
||||
<aside aria-label="Реклама">
|
||||
<a
|
||||
href={ad.href}
|
||||
target="_blank"
|
||||
rel="noopener sponsored"
|
||||
class={`${sizeClass} flex ${horizontal ? "flex-row items-center gap-4 px-6" : "flex-col items-center justify-center gap-3 px-4"} rounded-xl border border-zinc-800 bg-zinc-900/50 hover:border-accent/50 hover:bg-zinc-900 transition-colors duration-200 group`}
|
||||
>
|
||||
<svg
|
||||
class="shrink-0 text-accent"
|
||||
width={horizontal ? "32" : "40"}
|
||||
height={horizontal ? "32" : "40"}
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20" />
|
||||
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z" />
|
||||
</svg>
|
||||
|
||||
{
|
||||
horizontal ? (
|
||||
<>
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="text-xs font-medium text-zinc-500 uppercase tracking-widest mb-0.5">
|
||||
Реклама
|
||||
</div>
|
||||
<div class="text-sm font-semibold text-zinc-100 group-hover:text-accent transition-colors leading-tight">
|
||||
{ad.label}
|
||||
</div>
|
||||
<div class="text-xs text-zinc-500 mt-0.5">{ad.sublabel}</div>
|
||||
</div>
|
||||
<span class="shrink-0 text-xs font-semibold text-white bg-accent px-3 py-1.5 rounded-lg group-hover:bg-accent-hover transition-colors whitespace-nowrap">
|
||||
{ad.cta}
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<div class="text-center">
|
||||
<div class="text-xs font-medium text-zinc-500 uppercase tracking-widest mb-2">
|
||||
Реклама
|
||||
</div>
|
||||
<div class="text-base font-semibold text-zinc-100 group-hover:text-accent transition-colors leading-snug">
|
||||
{ad.label}
|
||||
</div>
|
||||
<div class="text-xs text-zinc-500 mt-1">{ad.sublabel}</div>
|
||||
</div>
|
||||
<span class="text-xs font-semibold text-white bg-accent px-4 py-2 rounded-lg group-hover:bg-accent-hover transition-colors">
|
||||
{ad.ctaMobile}
|
||||
</span>
|
||||
</>
|
||||
)
|
||||
}
|
||||
</a>
|
||||
</aside>
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
import BaseLayout from "./BaseLayout.astro";
|
||||
import AdBanner from "../components/AdBanner.astro";
|
||||
import SeoBlock from "../components/SeoBlock.astro";
|
||||
import FaqBlock from "../components/FaqBlock.astro";
|
||||
import RelatedGenerators from "../components/RelatedGenerators.astro";
|
||||
@@ -136,6 +137,10 @@ const breadcrumbSchema = {
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<div class="mt-12 flex justify-center">
|
||||
<AdBanner size="leaderboard" />
|
||||
</div>
|
||||
|
||||
<SeoBlock
|
||||
lang={lang}
|
||||
howTo={isRu ? generator.ruHowTo : generator.howTo}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
import BaseLayout from "@/layouts/BaseLayout.astro";
|
||||
import GeneratorCard from "@/components/GeneratorCard.astro";
|
||||
import AdBanner from "@/components/AdBanner.astro";
|
||||
import { generators } from "@/data/generators";
|
||||
import { useT } from "@/i18n/translations";
|
||||
import type { Lang } from "@/i18n/translations";
|
||||
@@ -69,6 +70,8 @@ const webSiteSchema = {
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<AdBanner size="leaderboard" />
|
||||
|
||||
<main class="mt-8">
|
||||
<div
|
||||
class="grid gap-3"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
import BaseLayout from "@/layouts/BaseLayout.astro";
|
||||
import GeneratorCard from "@/components/GeneratorCard.astro";
|
||||
import AdBanner from "@/components/AdBanner.astro";
|
||||
import { generators } from "@/data/generators";
|
||||
import { useT } from "@/i18n/translations";
|
||||
import type { Lang } from "@/i18n/translations";
|
||||
@@ -65,6 +66,8 @@ const webSiteSchema = {
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<AdBanner size="leaderboard" />
|
||||
|
||||
<main class="mt-8">
|
||||
<div
|
||||
class="grid gap-3"
|
||||
|
||||
Reference in New Issue
Block a user