スキル一覧に戻る
gianpaj

promo-banner

by gianpaj

Voice cloning and Text to Speech platform. Perfect for content creators, developers, and storytellers.

16🍴 2📅 2026年1月22日
GitHubで見るManusで実行

SKILL.md


name: promo-banner description: Set up promotional banners with optional countdown timers. Use when creating seasonal sales, limited-time offers, or marketing campaigns that need dismissable banners with i18n support and theme customization.

Promo Banner Setup

Configure promotional banners across landing pages and dashboard.

Environment Variables

Add to .env or deployment environment:

# Required
NEXT_PUBLIC_PROMO_ENABLED=true
NEXT_PUBLIC_PROMO_ID=winter_sale_2026          # Unique ID for cookie tracking
NEXT_PUBLIC_PROMO_TRANSLATIONS=winterSaleBanner # Translation key in promos dict

# Optional
NEXT_PUBLIC_PROMO_THEME=pink                    # pink (default), orange, or blue
NEXT_PUBLIC_PROMO_COUNTDOWN_END_DATE=2026-01-31T23:59:59Z  # UTC ISO 8601

# Bonus credits (if applicable)
NEXT_PUBLIC_PROMO_BONUS_STARTER=2000
NEXT_PUBLIC_PROMO_BONUS_STANDARD=7500
NEXT_PUBLIC_PROMO_BONUS_PRO=105000

Add Translations

Add banner translations to each locale file in lib/i18n/dictionaries/{lang}.json under the promos key:

{
  "promos": {
    "yourPromoBanner": {
      "text": "🎉 Your Promo – Get up to 35% extra credits!\nLimited time offer",
      "ctaLoggedIn": "Claim Offer",
      "ctaLoggedOut": "Sign Up Now",
      "ariaLabelDismiss": "Dismiss promo banner",
      "countdown": {
        "prefix": "Ends in:",
        "days": "Days",
        "hours": "Hours",
        "minutes": "Min",
        "seconds": "Sec"
      },
      "pricing": {
        "bannerText": "🎉 Your Promo"
      }
    }
  }
}

Repeat for en.json, es.json, de.json, and other supported locales.

Component Usage

The PromoBanner component is already integrated in:

  • app/[lang]/page.tsx (landing page)
  • app/[lang]/(dashboard)/dashboard.ui.tsx (dashboard)
  • app/[lang]/blog/[slug]/page.tsx (blog pages)

Props:

<PromoBanner
  text={promoDict.text}
  ctaLink={`/${lang}/signup`}           // or /dashboard/credits for logged-in
  ctaText={promoDict.ctaLoggedOut}      // or ctaLoggedIn
  ariaLabelDismiss={promoDict.ariaLabelDismiss}
  isEnabled={process.env.NEXT_PUBLIC_PROMO_ENABLED === 'true'}
  inDashboard={false}                   // true for fixed positioning in dashboard
  countdown={                           // optional
    process.env.NEXT_PUBLIC_PROMO_COUNTDOWN_END_DATE
      ? {
          enabled: true,
          endDate: process.env.NEXT_PUBLIC_PROMO_COUNTDOWN_END_DATE,
          labels: promoDict.countdown,
        }
      : undefined
  }
/>

Theme Colors

Available themes in app/globals.css:

ThemePrimary Color
pinkPink 500/600
orangeOrange 500/600
blueCustom purple

Add new themes by extending the CSS variables:

[data-promo-theme="green"] {
  --promo-primary: theme("colors.green.500");
  --promo-primary-dark: theme("colors.green.600");
  --promo-accent: theme("colors.green.400");
  --promo-text: theme("colors.green.600");
  --promo-text-dark: theme("colors.green.400");
}

Dismissal Behavior

  • Banner dismissal sets cookie {PROMO_ID}-dismissed for 30 days
  • Cookie prevents banner from reappearing for that user
  • Server action: app/[lang]/actions/promos.ts
  • Client cookie utility: lib/cookies.ts (with fallback for older browsers)

Checklist

  1. Set NEXT_PUBLIC_PROMO_ENABLED=true
  2. Set unique NEXT_PUBLIC_PROMO_ID (changes cookie name)
  3. Set NEXT_PUBLIC_PROMO_TRANSLATIONS to match translation key
  4. Add translations to all locale files
  5. Optionally set countdown end date and theme
  6. Deploy and verify banner appears on landing and dashboard

スコア

総合スコア

70/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

0/5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

レビュー

💬

レビュー機能は近日公開予定です