✨feature: Make pages responsive
This commit is contained in:
@@ -15,11 +15,12 @@ type Prompt = {
|
|||||||
};
|
};
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="border-b mb-4">
|
<div class="border-b mb-4 flex justify-between items-center">
|
||||||
<h2 id="prompt-count" class="text-xl font-semibold text-gray-300 mb-2"></h2>
|
<h2 id="prompt-count" class="text-xl font-semibold text-gray-300 mb-2"></h2>
|
||||||
|
<a href="#filters" class="block lg:hidden bg-blue-600 text-white px-2 py-0 pb-1 mb-2 rounded cursor-pointer hover:bg-blue-700 transition-colors duration-300">Filters ↓</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="prompt-grid" class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
|
<div id="prompt-grid" class="grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3">
|
||||||
{prompts.map((p: Prompt) => (
|
{prompts.map((p: Prompt) => (
|
||||||
<div class="prompt-card" data-type={p.type} data-tags={(p.tags ?? []).join(',')}>
|
<div class="prompt-card" data-type={p.type} data-tags={(p.tags ?? []).join(',')}>
|
||||||
<PromptCard {...p} />
|
<PromptCard {...p} />
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
// TODO: Add options for AND/OR switching and sort by options
|
// TODO: Add options for AND/OR switching and sort by options
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="w-64 h-full p-4 text-gray-100">
|
<aside id="filters" class="w-full lg:w-64 h-full p-4 text-gray-100 order-1 lg:order-none">
|
||||||
<a href="/add" id="add-prompt" class="block w-fit bg-green-600 text-white px-4 py-2 mb-4 rounded hover:bg-green-700 transition-colors duration-300">
|
<a href="/add" id="add-prompt" class="block w-fit bg-green-600 text-white px-4 py-2 mb-4 rounded hover:bg-green-700 transition-colors duration-300">
|
||||||
Add Prompt
|
Add Prompt
|
||||||
</a>
|
</a>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<fieldset class="flex flex-col">
|
<fieldset class="flex flex-col">
|
||||||
<legend class="block text-lg font-semibold mb-1">Tags</legend>
|
<legend class="block text-lg font-semibold mb-1">Tags</legend>
|
||||||
<div class="flex flex-wrap gap-2 max-w-[30rem]">
|
<div class="flex flex-wrap gap-2 lg:max-w-[30rem]">
|
||||||
{Astro.props.allTags.map((tag: string) => (
|
{Astro.props.allTags.map((tag: string) => (
|
||||||
<label class="relative inline-flex items-center cursor-pointer">
|
<label class="relative inline-flex items-center cursor-pointer">
|
||||||
<input
|
<input
|
||||||
@@ -57,4 +57,4 @@
|
|||||||
Reset Filters
|
Reset Filters
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</aside>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const code = `[
|
|||||||
`;
|
`;
|
||||||
---
|
---
|
||||||
|
|
||||||
<aside class="w-64 h-full p-4 text-gray-100">
|
<aside class="w-full lg:w-64 h-full p-4 text-gray-100 order-1 lg:order-none">
|
||||||
<h2 class="text-lg font-semibold mb-4">Add a prompt</h2>
|
<h2 class="text-lg font-semibold mb-4">Add a prompt</h2>
|
||||||
|
|
||||||
<p class="text-sm">Use the form to add a new AI prompt to the catalog.</p>
|
<p class="text-sm">Use the form to add a new AI prompt to the catalog.</p>
|
||||||
@@ -30,7 +30,7 @@ const code = `[
|
|||||||
|
|
||||||
<h2 class="text-lg font-semibold mt-6 mb-4">Export</h2>
|
<h2 class="text-lg font-semibold mt-6 mb-4">Export</h2>
|
||||||
|
|
||||||
<p class="text-sm">To export prompts to a JSON file, select the prompts using the checkboxes, and click the button below.</p>
|
<p class="text-sm">To export prompts to a JSON file, select the prompts using the checkboxes, and click the button below the checkboxes.</p>
|
||||||
|
|
||||||
<p class="text-sm mt-2">To export all prompts, leave all checkboxes unchecked.</p>
|
<p class="text-sm mt-2">To export all prompts, leave all checkboxes unchecked.</p>
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// Sidebar.astro
|
// Sidebar.astro
|
||||||
---
|
---
|
||||||
|
|
||||||
<aside class="w-64 h-full p-4 text-gray-100">
|
<aside class="w-full lg:w-64 h-full p-4 text-gray-100 order-1 lg:order-none">
|
||||||
<h2 class="text-lg font-semibold mb-4">Edit a prompt</h2>
|
<h2 class="text-lg font-semibold mb-4">Edit a prompt</h2>
|
||||||
|
|
||||||
<p class="text-sm">Use the form to edit an AI prompt in the catalog.</p>
|
<p class="text-sm">Use the form to edit an AI prompt in the catalog.</p>
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ const supabaseKey = import.meta.env.PUBLIC_SUPABASE_ANON_KEY;
|
|||||||
<p class="text-sm mt-1">Add or import new AI prompts to the catalog</p>
|
<p class="text-sm mt-1">Add or import new AI prompts to the catalog</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="flex">
|
<main class="flex flex-col lg:flex-row">
|
||||||
<Sidebar />
|
<Sidebar />
|
||||||
|
|
||||||
<div class="border-l flex-1 flex flex-col overflow-hidden">
|
<div class="border-b lg:border-l flex-1 flex flex-col overflow-hidden">
|
||||||
<div class="flex-1 overflow-y-auto p-4">
|
<div class="flex-1 overflow-y-auto p-4">
|
||||||
<div id="success" class="bg-green-100 text-green-700 p-4 rounded mb-4 hidden">
|
<div id="success" class="bg-green-100 text-green-700 p-4 rounded mb-4 hidden">
|
||||||
Prompt added successfully!
|
Prompt added successfully!
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ const supabaseKey = import.meta.env.PUBLIC_SUPABASE_ANON_KEY;
|
|||||||
<p class="text-sm mt-1">Edit an existing AI prompt in the catalog</p>
|
<p class="text-sm mt-1">Edit an existing AI prompt in the catalog</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="flex">
|
<main class="flex flex-col lg:flex-row">
|
||||||
<Sidebar />
|
<Sidebar />
|
||||||
|
|
||||||
<div class="border-l flex-1 flex flex-col overflow-hidden">
|
<div class="border-b lg:border-l flex-1 flex flex-col overflow-hidden">
|
||||||
<main class="flex-1 overflow-y-auto p-4">
|
<main class="flex-1 overflow-y-auto p-4">
|
||||||
<div id="edit-root">Loading...</div>
|
<div id="edit-root">Loading...</div>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const allTags = Array.from(
|
|||||||
new Set(
|
new Set(
|
||||||
prompts?.flatMap((p) => p.tags ?? [])
|
prompts?.flatMap((p) => p.tags ?? [])
|
||||||
)
|
)
|
||||||
).sort();
|
).sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()));
|
||||||
---
|
---
|
||||||
|
|
||||||
<MainLayout page="Home">
|
<MainLayout page="Home">
|
||||||
@@ -22,11 +22,11 @@ const allTags = Array.from(
|
|||||||
<p class="text-sm mt-1">Save and explore AI prompts</p>
|
<p class="text-sm mt-1">Save and explore AI prompts</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="flex">
|
<main class="flex flex-col lg:flex-row">
|
||||||
<SearchBar allTags={allTags} />
|
<SearchBar allTags={allTags} />
|
||||||
|
|
||||||
<div class="border-l flex-1 flex flex-col overflow-hidden">
|
<div class="border-b lg:border-l flex-1 flex flex-col overflow-hidden">
|
||||||
<div class="flex-1 overflow-y-auto px-6 pt-2 pb-4">
|
<div class="flex-1 overflow-y-auto px-4 lg:px-6 pt-2 pb-4">
|
||||||
{error
|
{error
|
||||||
? <p class="text-red-500">Supabase error: {error.message}</p>
|
? <p class="text-red-500">Supabase error: {error.message}</p>
|
||||||
: <FilteredPromptList prompts={prompts} />}
|
: <FilteredPromptList prompts={prompts} />}
|
||||||
|
|||||||
Reference in New Issue
Block a user