fix(dm): OAuth redirect_uri, orange buttons, denser layout, hide lang switcher
- Fix OAuth redirect_uri mismatch in VK/Yandex callbacks (use PUBLIC_APP_URL) - Make quick dice buttons and anchor nav links orange by default - Densify DM Dashboard layout (smaller gaps, tighter spacing) - Hide LanguageSwitcher/Blog/About/Privacy links on DM pages - Increase notes textarea height for better usability
This commit is contained in:
@@ -39,7 +39,7 @@ const quickDice = [
|
||||
<button
|
||||
type="button"
|
||||
data-notation={d.notation}
|
||||
class="quick-dice-btn bg-[var(--bg-secondary)] border border-[var(--border-color)] text-[var(--text-primary)] rounded-lg px-2 py-2 text-sm font-semibold hover:border-[var(--accent)] hover:text-[var(--accent)] active:bg-[var(--accent)]/10 active:border-[var(--accent)] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--bg-primary)]"
|
||||
class="quick-dice-btn border border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/10 rounded-lg px-2 py-2 text-sm font-semibold hover:bg-[var(--accent)]/20 active:bg-[var(--accent)]/30 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--bg-primary)]"
|
||||
>
|
||||
{d.label}
|
||||
</button>
|
||||
|
||||
@@ -3,7 +3,7 @@ import DmButton from './DmButton.astro';
|
||||
---
|
||||
|
||||
<div class="w-full">
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<span id="notes-saved-indicator" class="text-sm text-[var(--accent)] opacity-0 transition-opacity duration-300">
|
||||
Saved
|
||||
</span>
|
||||
@@ -12,11 +12,11 @@ import DmButton from './DmButton.astro';
|
||||
|
||||
<textarea
|
||||
id="notes-textarea"
|
||||
class="w-full h-64 resize-y rounded-xl bg-[var(--bg-secondary)] border border-[var(--border-color)] text-[var(--text-primary)] placeholder:text-[var(--text-secondary)] p-4 hover:border-[var(--text-secondary)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--bg-primary)] transition-shadow duration-150"
|
||||
class="w-full h-80 resize-y rounded-xl bg-[var(--bg-secondary)] border border-[var(--border-color)] text-[var(--text-primary)] placeholder:text-[var(--text-secondary)] p-4 hover:border-[var(--text-secondary)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--bg-primary)] transition-shadow duration-150"
|
||||
placeholder="Type your notes here..."
|
||||
></textarea>
|
||||
|
||||
<div class="mt-4 flex justify-end">
|
||||
<div class="mt-3 flex justify-end">
|
||||
<DmButton id="notes-clear-btn" variant="secondary" size="sm">Clear</DmButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,12 +13,13 @@ interface Props {
|
||||
ogType?: string;
|
||||
articlePubDate?: Date;
|
||||
articleModDate?: Date;
|
||||
hideLanguageSwitcher?: boolean;
|
||||
}
|
||||
|
||||
const lang = (Astro.currentLocale as Lang) || "en";
|
||||
const T = useT(lang);
|
||||
|
||||
const { title = T.defaultTitle, description = T.defaultDesc, ogImage = "/og-default.jpg", ogType = "website", articlePubDate, articleModDate } = Astro.props;
|
||||
const { title = T.defaultTitle, description = T.defaultDesc, ogImage = "/og-default.jpg", ogType = "website", articlePubDate, articleModDate, hideLanguageSwitcher = false } = Astro.props;
|
||||
|
||||
const ogImageUrl = ogImage.startsWith("http") ? ogImage : `https://randify.pro${ogImage}`;
|
||||
|
||||
@@ -105,7 +106,7 @@ const orgSchema = {
|
||||
<body class="bg-zinc-950 text-zinc-100 min-h-screen font-sans antialiased">
|
||||
<Starfield />
|
||||
<div class="relative z-10">
|
||||
<LanguageSwitcher />
|
||||
{!hideLanguageSwitcher && <LanguageSwitcher />}
|
||||
<slot />
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -16,7 +16,7 @@ const {
|
||||
} = Astro.props;
|
||||
---
|
||||
|
||||
<BaseLayout title={title} description={description}>
|
||||
<BaseLayout title={title} description={description} hideLanguageSwitcher={true}>
|
||||
<div class="min-h-screen bg-[var(--bg-primary)] text-[var(--text-primary)] flex flex-col">
|
||||
<DmHeader title={title}>
|
||||
<a
|
||||
|
||||
@@ -26,7 +26,7 @@ export const GET: APIRoute = async ({ url, request }) => {
|
||||
});
|
||||
}
|
||||
|
||||
const redirectUri = `${url.origin}/api/auth/callback/vk`;
|
||||
const redirectUri = `${process.env.PUBLIC_APP_URL || url.origin}/api/auth/callback/vk`;
|
||||
|
||||
const tokenRes = await fetch(vkOAuthConfig.tokenUrl, {
|
||||
method: 'POST',
|
||||
|
||||
@@ -26,7 +26,7 @@ export const GET: APIRoute = async ({ url, request }) => {
|
||||
});
|
||||
}
|
||||
|
||||
const redirectUri = `${url.origin}/api/auth/callback/yandex`;
|
||||
const redirectUri = `${process.env.PUBLIC_APP_URL || url.origin}/api/auth/callback/yandex`;
|
||||
|
||||
const tokenRes = await fetch(yandexOAuthConfig.tokenUrl, {
|
||||
method: 'POST',
|
||||
|
||||
@@ -9,14 +9,14 @@ import { dmTranslations as T } from "@/i18n/dm-translations";
|
||||
---
|
||||
|
||||
<DmLayout>
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
|
||||
<!-- Subtitle -->
|
||||
<p class="text-[var(--text-secondary)] text-base mb-4">
|
||||
{T.subtitle}
|
||||
</p>
|
||||
|
||||
<!-- Anchor Navigation -->
|
||||
<nav aria-label="Инструменты" class="mb-8">
|
||||
<nav aria-label="Инструменты" class="mb-6">
|
||||
<ul class="flex flex-wrap gap-2">
|
||||
{[
|
||||
{ id: "dice", label: T.anchorDice },
|
||||
@@ -27,7 +27,7 @@ import { dmTranslations as T } from "@/i18n/dm-translations";
|
||||
<li>
|
||||
<a
|
||||
href={`#${item.id}`}
|
||||
class="inline-flex items-center px-3 py-1.5 rounded-full bg-[var(--bg-card)] border border-[var(--border-color)] text-[var(--text-secondary)] text-sm font-medium hover:bg-[var(--accent)]/10 hover:text-[var(--accent)] hover:border-[var(--accent)]/30 active:bg-[var(--accent)]/20 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--bg-primary)]"
|
||||
class="inline-flex items-center px-3 py-1.5 rounded-full bg-[var(--accent)]/10 border border-[var(--accent)]/30 text-[var(--accent)] text-sm font-medium hover:bg-[var(--accent)]/20 active:bg-[var(--accent)]/30 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--bg-primary)]"
|
||||
>
|
||||
{item.label}
|
||||
</a>
|
||||
@@ -37,10 +37,10 @@ import { dmTranslations as T } from "@/i18n/dm-translations";
|
||||
</nav>
|
||||
|
||||
<!-- Dashboard Grid -->
|
||||
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
||||
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4">
|
||||
<!-- Dice Roller -->
|
||||
<section id="dice" aria-labelledby="dice-heading">
|
||||
<div class="flex items-center gap-3 mb-3">
|
||||
<div class="flex items-center gap-3 mb-2">
|
||||
<span class="w-1 h-6 bg-[var(--accent)] rounded-full" aria-hidden="true"></span>
|
||||
<h2 id="dice-heading" class="text-lg font-bold text-[var(--text-primary)]">
|
||||
{T.dice}
|
||||
@@ -51,7 +51,7 @@ import { dmTranslations as T } from "@/i18n/dm-translations";
|
||||
|
||||
<!-- Initiative Tracker -->
|
||||
<section id="initiative" aria-labelledby="initiative-heading">
|
||||
<div class="flex items-center gap-3 mb-3">
|
||||
<div class="flex items-center gap-3 mb-2">
|
||||
<span class="w-1 h-6 bg-[var(--accent)] rounded-full" aria-hidden="true"></span>
|
||||
<h2 id="initiative-heading" class="text-lg font-bold text-[var(--text-primary)]">
|
||||
{T.initiative}
|
||||
@@ -62,7 +62,7 @@ import { dmTranslations as T } from "@/i18n/dm-translations";
|
||||
|
||||
<!-- Open5e Reference -->
|
||||
<section id="reference" aria-labelledby="reference-heading">
|
||||
<div class="flex items-center gap-3 mb-3">
|
||||
<div class="flex items-center gap-3 mb-2">
|
||||
<span class="w-1 h-6 bg-[var(--accent)] rounded-full" aria-hidden="true"></span>
|
||||
<h2 id="reference-heading" class="text-lg font-bold text-[var(--text-primary)]">
|
||||
{T.reference}
|
||||
@@ -75,7 +75,7 @@ import { dmTranslations as T } from "@/i18n/dm-translations";
|
||||
|
||||
<!-- Notes Panel -->
|
||||
<section id="notes" aria-labelledby="notes-heading">
|
||||
<div class="flex items-center gap-3 mb-3">
|
||||
<div class="flex items-center gap-3 mb-2">
|
||||
<span class="w-1 h-6 bg-[var(--accent)] rounded-full" aria-hidden="true"></span>
|
||||
<h2 id="notes-heading" class="text-lg font-bold text-[var(--text-primary)]">
|
||||
{T.notes}
|
||||
|
||||
Reference in New Issue
Block a user