Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/view/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ export async function GET(
<body style="margin:0;background:#030712;color:#f3f4f6;font-family:system-ui,sans-serif;min-height:100vh">
<header style="display:flex;align-items:center;justify-content:space-between;padding:.75rem 1.5rem;background:#111827;border-bottom:1px solid #1f2937">
<a href="/" style="font-size:1.125rem;font-weight:600;color:#fff;text-decoration:none">Slide Generator</a>
<a href="${esc(editUrl)}" style="padding:.375rem .75rem;font-size:.75rem;background:#2563eb;color:#fff;border-radius:.375rem;text-decoration:none">Éditer</a>
<div style="display:flex;align-items:center;gap:.5rem">
<a href="${esc(editUrl)}" style="padding:.375rem .75rem;font-size:.75rem;background:#1f2937;color:#d1d5db;border-radius:.375rem;text-decoration:none">Éditer</a>
<a href="${esc(imageUrl)}" download="${esc(title)}.png" style="padding:.375rem .75rem;font-size:.75rem;background:#2563eb;color:#fff;border-radius:.375rem;text-decoration:none">↓ PNG</a>
</div>
</header>
<main style="max-width:896px;margin:0 auto;padding:2rem 1.5rem">
<img src="${esc(imageUrl)}" alt="${esc(title)}" style="width:100%;border-radius:.5rem;box-shadow:0 25px 50px -12px rgba(0,0,0,.25)"/>
Expand Down
5 changes: 4 additions & 1 deletion app/view/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ export async function GET(request: NextRequest) {
<body style="margin:0;background:#030712;color:#f3f4f6;font-family:system-ui,sans-serif;min-height:100vh">
<header style="display:flex;align-items:center;justify-content:space-between;padding:.75rem 1.5rem;background:#111827;border-bottom:1px solid #1f2937">
<a href="/" style="font-size:1.125rem;font-weight:600;color:#fff;text-decoration:none">Slide Generator</a>
<a href="${esc(editUrl)}" style="padding:.375rem .75rem;font-size:.75rem;background:#2563eb;color:#fff;border-radius:.375rem;text-decoration:none">Éditer</a>
<div style="display:flex;align-items:center;gap:.5rem">
<a href="${esc(editUrl)}" style="padding:.375rem .75rem;font-size:.75rem;background:#1f2937;color:#d1d5db;border-radius:.375rem;text-decoration:none">Éditer</a>
<a href="${esc(imageUrl)}" download="${esc(title)}.png" style="padding:.375rem .75rem;font-size:.75rem;background:#2563eb;color:#fff;border-radius:.375rem;text-decoration:none">↓ PNG</a>
</div>
</header>
<main style="max-width:896px;margin:0 auto;padding:2rem 1.5rem">
<img src="${esc(imageUrl)}" alt="${esc(title)}" style="width:100%;border-radius:.5rem;box-shadow:0 25px 50px -12px rgba(0,0,0,.25)"/>
Expand Down
6 changes: 5 additions & 1 deletion components/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,11 @@ export function Playground({ templates, initialParams }: Props) {
onClick={handleCopyUrl}
disabled={hasNoOgFields || copySuccess === 'loading'}
title={hasNoOgFields ? 'Renseigner au moins un champ Open Graph' : undefined}
className="px-3 py-1.5 text-xs bg-gray-800 hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed text-gray-300 rounded-md transition-colors"
className={`px-3 py-1.5 text-xs rounded-md transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${
hasNoOgFields
? 'bg-gray-800 text-gray-300'
: 'bg-emerald-600 hover:bg-emerald-500 text-white'
}`}
>
{copySuccess === 'loading' ? '...' : copySuccess === 'done' ? '✓ Copied!' : copySuccess === 'error' ? '✗ Error' : 'Copy URL'}
</button>
Expand Down
Loading