feat(ads): update ad review timeline

This commit is contained in:
alam00000
2026-10-31 14:25:09 +05:30
parent fac51527c8
commit ba5821e43f
6 changed files with 92 additions and 63 deletions
+4 -4
View File
@@ -81,8 +81,8 @@
<i data-lucide="circle-check"></i>
<p>
<strong>Payment received, thanks.</strong>
We review every ad and usually put it live within two business
days. To change anything, email
We review every ad and put it live within 24 hours. To change
anything, email
<a
href="mailto:[email protected]?subject=Ad%20for%20BentoPDF"
class="text-indigo-400 hover:underline"
@@ -243,8 +243,8 @@
<span class="lp-tile"><i data-lucide="rocket"></i></span>
<h3>Go live</h3>
<p>
We review every ad by hand and usually put it live within two
business days. Need a new logo or link later? Just email us.
We review every ad by hand and put it live within 24 hours. Need
a new logo or link later? Just email us.
</p>
</div>
</div>
+24 -12
View File
@@ -1,9 +1,19 @@
const DODO_API = 'https://test.dodopayments.com';
const PRODUCTS = new Map([
['top', 'pdt_0Nqt0672sYJEtrkIb2K6m'],
['second', 'pdt_0Nqt069LgdQFPo1tFS1yF'],
]);
const MODES = {
live: {
api: 'https://live.dodopayments.com',
products: new Map([
['top', 'pdt_0Nqv9McKI1iCBXb7z4DB7'],
['second', 'pdt_0Nqv9OYDLwWZsu1hzpZ0c'],
]),
},
test: {
api: 'https://test.dodopayments.com',
products: new Map([
['top', 'pdt_0Nqt0672sYJEtrkIb2K6m'],
['second', 'pdt_0Nqt069LgdQFPo1tFS1yF'],
]),
},
};
const FIELDS = [
{
@@ -36,11 +46,11 @@ function redirect(location) {
});
}
async function createCheckout(productId, page) {
const response = await fetch(`${DODO_API}/checkouts`, {
async function createCheckout(key, api, productId, page) {
const response = await fetch(`${api}/checkouts`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DODO_PAYMENTS_API_KEY}`,
Authorization: `Bearer ${key}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
@@ -60,7 +70,7 @@ async function createCheckout(productId, page) {
typeof checkout_url !== 'string' ||
!checkout_url.startsWith('https://')
) {
throw new Error(`Dodo returned no checkout URL: ${body}`);
throw new Error('Dodo returned no checkout URL');
}
return checkout_url;
}
@@ -68,11 +78,13 @@ async function createCheckout(productId, page) {
export async function GET(request) {
const url = new URL(request.url);
const page = `${url.origin}/advertise`;
const productId = PRODUCTS.get(url.searchParams.get('row'));
const key = process.env.DODO_PAYMENTS_API_KEY ?? '';
const mode = key.startsWith('dodo_live_') ? MODES.live : MODES.test;
const productId = mode.products.get(url.searchParams.get('row'));
if (!productId) return redirect(`${page}#pricing`);
try {
return redirect(await createCheckout(productId, page));
return redirect(await createCheckout(key, mode.api, productId, page));
} catch (error) {
console.error(error);
return redirect(`${page}?checkout=failed`);
+49 -26
View File
@@ -348,6 +348,7 @@
</div>
</div>
{{#if showAds}}
<section
id="ads-section"
class="lp-ads hide-section"
@@ -364,47 +365,72 @@
<div class="lp-ads-grid lp-cross">
<a
class="lp-ad lp-ad--top"
href="#"
href="https://www.nvidia.com/"
rel="sponsored noopener"
target="_blank"
>
<span class="lp-ad-logo" style="--ad-tint: #f97316">A</span>
<span class="lp-ad-text"><b>Acme Invoices</b></span>
<span class="lp-ad-logo" style="--ad-tint: #76b900"
><svg viewBox="0 0 24 24" aria-hidden="true">
<path
fill="currentColor"
d="M8.948 8.798v-1.43a7 7 0 0 1 .424-.018c3.922-.124 6.493 3.374 6.493 3.374s-2.774 3.851-5.75 3.851a3.7 3.7 0 0 1-1.158-.185v-4.346c1.528.185 1.837.857 2.747 2.385l2.04-1.714s-1.492-1.952-4-1.952a6 6 0 0 0-.796.035m0-4.735v2.138l.424-.027c5.45-.185 9.01 4.47 9.01 4.47s-4.08 4.964-8.33 4.964a6.5 6.5 0 0 1-1.095-.097v1.325c.3.035.61.062.91.062c3.957 0 6.82-2.023 9.593-4.408c.459.371 2.34 1.263 2.73 1.652c-2.633 2.208-8.772 3.984-12.253 3.984c-.335 0-.653-.018-.971-.053v1.864H24V4.063zm0 10.326v1.131c-3.657-.654-4.673-4.46-4.673-4.46s1.758-1.944 4.673-2.262v1.237H8.94c-1.528-.186-2.73 1.245-2.73 1.245s.68 2.412 2.739 3.11M2.456 10.9s2.164-3.197 6.5-3.533V6.201C4.153 6.59 0 10.653 0 10.653s2.35 6.802 8.948 7.42v-1.237c-4.84-.6-6.492-5.936-6.492-5.936"
/></svg
></span>
<span class="lp-ad-text"><b>NVIDIA</b></span>
</a>
<a
class="lp-ad lp-ad--top"
href="#"
href="https://vercel.com/"
rel="sponsored noopener"
target="_blank"
>
<span class="lp-ad-logo" style="--ad-tint: #22c55e">G</span>
<span class="lp-ad-text"><b>Globex Mail</b></span>
<span class="lp-ad-logo" style="--ad-tint: #000"
><svg viewBox="0 0 24 24" aria-hidden="true">
<path fill="currentColor" d="m12 1.608l12 20.784H0Z" /></svg
></span>
<span class="lp-ad-text"><b>Vercel</b></span>
</a>
<a
class="lp-ad lp-ad--top"
href="#"
rel="sponsored noopener"
class="lp-ad lp-ad--top lp-ad--open"
href="https://www.bentopdf.com/api/ad-checkout?row=top"
target="_blank"
rel="noopener noreferrer"
>
<span class="lp-ad-logo" style="--ad-tint: #0ea5e9">I</span>
<span class="lp-ad-text"><b>Initech Notes</b></span>
<span class="lp-ad-logo"><i data-lucide="plus"></i></span>
<span class="lp-ad-text"><b>Your logo here</b></span>
</a>
<a
class="lp-ad lp-ad--top"
href="#"
class="lp-ad lp-ad--top lp-ad--open"
href="https://www.bentopdf.com/api/ad-checkout?row=top"
target="_blank"
rel="noopener noreferrer"
>
<span class="lp-ad-logo"><i data-lucide="plus"></i></span>
<span class="lp-ad-text"><b>Your logo here</b></span>
</a>
<a
class="lp-ad"
href="https://www.digitalocean.com/"
rel="sponsored noopener"
target="_blank"
>
<span class="lp-ad-logo" style="--ad-tint: #e11d48">H</span>
<span class="lp-ad-text"><b>Hooli Sign</b></span>
<span class="lp-ad-logo" style="--ad-tint: #0080ff"
><svg viewBox="0 0 24 24" aria-hidden="true">
<path
fill="currentColor"
d="M12.04 0C5.408-.02.005 5.37.005 11.992h4.638c0-4.923 4.882-8.731 10.064-6.855a6.95 6.95 0 0 1 4.147 4.148c1.889 5.177-1.924 10.055-6.84 10.064v-4.61H7.391v4.623h4.61V24c7.86 0 13.967-7.588 11.397-15.83c-1.115-3.59-3.985-6.446-7.575-7.575A12.8 12.8 0 0 0 12.039 0zM7.39 19.362H3.828v3.564H7.39zm-3.563 0v-2.978H.85v2.978z"
/></svg
></span>
<span class="lp-ad-text"><b>DigitalOcean</b></span>
</a>
<a class="lp-ad" href="#" rel="sponsored noopener" target="_blank">
<span class="lp-ad-logo" style="--ad-tint: #a855f7">U</span>
<span class="lp-ad-text"><b>Umbrella VPN</b></span>
</a>
<a class="lp-ad" href="#" rel="sponsored noopener" target="_blank">
<span class="lp-ad-logo" style="--ad-tint: #eab308">S</span>
<span class="lp-ad-text"><b>Stark Backup</b></span>
<a
class="lp-ad lp-ad--open"
href="https://www.bentopdf.com/api/ad-checkout?row=second"
target="_blank"
rel="noopener noreferrer"
>
<span class="lp-ad-logo"><i data-lucide="plus"></i></span>
<span class="lp-ad-text"><b>Your logo here</b></span>
</a>
<a
class="lp-ad lp-ad--open"
@@ -425,11 +451,8 @@
<span class="lp-ad-text"><b>Your logo here</b></span>
</a>
</div>
<p class="lp-ads-note">
Ads are plain logos and links. No tracking pixels, no scripts, no
pop-ups.
</p>
</section>
{{/if}}
<div
id="tool-grid"
+6 -7
View File
@@ -2238,6 +2238,11 @@ body.lp ::selection {
font-size: 17px;
}
.lp-ad-logo svg {
width: 60%;
height: 60%;
}
.lp-ad-text {
display: flex;
flex-direction: column;
@@ -2280,13 +2285,7 @@ body.lp ::selection {
color: var(--lp-accent-3);
}
.lp-ads-note {
margin: 12px 0 0;
font-size: 13px;
color: var(--lp-dim);
}
@media (min-width: 900px) {
@media (min-width: 1024px) {
.lp-ads-grid {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
-13
View File
@@ -19,19 +19,6 @@
<span data-i18n="footer.version">Version</span>
<span id="app-version">{{appVersion}}</span>
</p>
<a
href="https://www.digitalocean.com/?refcode=d93c189ef6d0&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge"
target="_blank"
rel="noopener noreferrer"
class="hide-section inline-block mt-4"
>
<img
src="{{baseUrl}}images/badge.svg"
alt="DigitalOcean Referral Badge"
width="150"
height="32"
/>
</a>
</div>
<div>
+9 -1
View File
@@ -685,6 +685,11 @@ export default defineConfig(({ command }) => {
(command === 'serve' || process.env.INCLUDE_DOCS === 'true')
? '/docs/'
: 'https://www.bentopdf.com/docs';
const showAds =
command === 'serve' ||
['bentopdf.com', 'www.bentopdf.com'].includes(
process.env.VERCEL_PROJECT_PRODUCTION_URL ?? ''
);
if (USE_CDN) {
console.log('[Vite] Using CDN for WASM files (with local fallback)');
@@ -709,6 +714,7 @@ export default defineConfig(({ command }) => {
brandLogo: process.env.VITE_BRAND_LOGO || '',
footerText: process.env.VITE_FOOTER_TEXT || '',
appVersion: process.env.npm_package_version || 'Unknown',
showAds,
},
}),
languageRouterPlugin(),
@@ -804,7 +810,9 @@ export default defineConfig(({ command }) => {
licensing: resolve(__dirname, 'licensing.html'),
kura: resolve(__dirname, 'kura.html'),
'hyper-compress': resolve(__dirname, 'hyper-compress.html'),
advertise: resolve(__dirname, 'advertise.html'),
...(showAds
? { advertise: resolve(__dirname, 'advertise.html') }
: {}),
...Object.fromEntries(
fs
.readdirSync(resolve(__dirname, 'blog'))