feat: containerize with Docker Compose + Ollama
Add full Docker setup so the app runs with a single 'docker compose up':
- Dockerfile: multi-stage build (node:22-alpine) for the SvelteKit app
- docker-compose.yml: three services:
1. ollama: runs Ollama server with persistent volume for models
2. model-init: one-shot container that pulls the configured model
after Ollama is healthy, then exits
3. app: the SvelteKit app, starts only after model-init succeeds
- .env.docker: set OLLAMA_MODEL to control which model is pulled
- .dockerignore: keeps image lean
- Switched adapter-auto to adapter-node (required for Docker/Node hosting)
- Updated README with Docker and local dev instructions
Usage:
docker compose up # default: llama3
OLLAMA_MODEL=gemma2 docker compose up # any Ollama model
This commit is contained in:
@@ -1,456 +1,478 @@
|
||||
<script lang="ts">
|
||||
import { categories, styles, getStylesByCategory, getIntensityConfig } from '$lib/styles';
|
||||
import type { Style, StyleCategory, ConversionResponse } from '$lib/types';
|
||||
import LoadingModal from '$lib/components/LoadingModal.svelte';
|
||||
import {
|
||||
categories,
|
||||
styles,
|
||||
getStylesByCategory,
|
||||
getIntensityConfig,
|
||||
} from "$lib/styles";
|
||||
import type { Style, StyleCategory, ConversionResponse } from "$lib/types";
|
||||
import LoadingModal from "$lib/components/LoadingModal.svelte";
|
||||
|
||||
let inputText = $state('');
|
||||
let selectedCategoryId = $state('');
|
||||
let selectedStyleId = $state('');
|
||||
let intensity = $state(3);
|
||||
let outputText = $state('');
|
||||
let loading = $state(false);
|
||||
let error = $state('');
|
||||
let systemPrompt = $state('');
|
||||
let userMessage = $state('');
|
||||
let modelName = $state('');
|
||||
let showPrompt = $state(false);
|
||||
let copied = $state(false);
|
||||
let inputText = $state("");
|
||||
let selectedCategoryId = $state("");
|
||||
let selectedStyleId = $state("");
|
||||
let intensity = $state(3);
|
||||
let outputText = $state("");
|
||||
let loading = $state(false);
|
||||
let error = $state("");
|
||||
let systemPrompt = $state("");
|
||||
let userMessage = $state("");
|
||||
let modelName = $state("");
|
||||
let showPrompt = $state(false);
|
||||
let copied = $state(false);
|
||||
|
||||
let availableStyles = $derived(
|
||||
selectedCategoryId ? getStylesByCategory(selectedCategoryId) : []
|
||||
);
|
||||
let availableStyles = $derived(
|
||||
selectedCategoryId ? getStylesByCategory(selectedCategoryId) : [],
|
||||
);
|
||||
|
||||
let canConvert = $derived(
|
||||
inputText.trim().length > 0 && selectedStyleId.length > 0 && !loading
|
||||
);
|
||||
let canConvert = $derived(
|
||||
inputText.trim().length > 0 && selectedStyleId.length > 0 && !loading,
|
||||
);
|
||||
|
||||
let intensityLabel = $derived(getIntensityConfig(intensity)?.label ?? '');
|
||||
let intensityLabel = $derived(getIntensityConfig(intensity)?.label ?? "");
|
||||
|
||||
function onCategoryChange() {
|
||||
selectedStyleId = '';
|
||||
if (availableStyles.length === 1) {
|
||||
selectedStyleId = availableStyles[0].id;
|
||||
}
|
||||
}
|
||||
function onCategoryChange() {
|
||||
selectedStyleId = "";
|
||||
if (availableStyles.length === 1) {
|
||||
selectedStyleId = availableStyles[0].id;
|
||||
}
|
||||
}
|
||||
|
||||
async function handleConvert() {
|
||||
if (!canConvert) return;
|
||||
async function handleConvert() {
|
||||
if (!canConvert) return;
|
||||
|
||||
loading = true;
|
||||
error = '';
|
||||
outputText = '';
|
||||
systemPrompt = '';
|
||||
userMessage = '';
|
||||
modelName = '';
|
||||
showPrompt = false;
|
||||
loading = true;
|
||||
error = "";
|
||||
outputText = "";
|
||||
systemPrompt = "";
|
||||
userMessage = "";
|
||||
modelName = "";
|
||||
showPrompt = false;
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/convert', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
text: inputText,
|
||||
styleId: selectedStyleId,
|
||||
intensity
|
||||
})
|
||||
});
|
||||
try {
|
||||
const res = await fetch("/api/convert", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
text: inputText,
|
||||
styleId: selectedStyleId,
|
||||
intensity,
|
||||
}),
|
||||
});
|
||||
|
||||
const data = await res.json();
|
||||
const data = await res.json();
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(data.error || 'Conversion failed');
|
||||
}
|
||||
if (!res.ok) {
|
||||
throw new Error(data.error || "Conversion failed");
|
||||
}
|
||||
|
||||
const result: ConversionResponse = data;
|
||||
outputText = result.converted;
|
||||
systemPrompt = result.systemPrompt;
|
||||
userMessage = result.userMessage;
|
||||
modelName = result.model;
|
||||
} catch (err) {
|
||||
error = err instanceof Error ? err.message : 'Something went wrong';
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
}
|
||||
const result: ConversionResponse = data;
|
||||
outputText = result.converted;
|
||||
systemPrompt = result.systemPrompt;
|
||||
userMessage = result.userMessage;
|
||||
modelName = result.model;
|
||||
} catch (err) {
|
||||
error = err instanceof Error ? err.message : "Something went wrong";
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function handleCopy() {
|
||||
try {
|
||||
await navigator.clipboard.writeText(outputText);
|
||||
copied = true;
|
||||
setTimeout(() => (copied = false), 2000);
|
||||
} catch {
|
||||
// Fallback: select text
|
||||
const textarea = document.querySelector('.output-text');
|
||||
if (textarea instanceof HTMLElement) {
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(textarea);
|
||||
const sel = window.getSelection();
|
||||
sel?.removeAllRanges();
|
||||
sel?.addRange(range);
|
||||
}
|
||||
}
|
||||
}
|
||||
async function handleCopy() {
|
||||
try {
|
||||
await navigator.clipboard.writeText(outputText);
|
||||
copied = true;
|
||||
setTimeout(() => (copied = false), 2000);
|
||||
} catch {
|
||||
// Fallback: select text
|
||||
const textarea = document.querySelector(".output-text");
|
||||
if (textarea instanceof HTMLElement) {
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(textarea);
|
||||
const sel = window.getSelection();
|
||||
sel?.removeAllRanges();
|
||||
sel?.addRange(range);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<main class="container">
|
||||
<h1 class="title">English Style Converter</h1>
|
||||
<p class="subtitle">Transform your text into different English styles and tones</p>
|
||||
<h1 class="title">English Style Converter</h1>
|
||||
<p class="subtitle">
|
||||
Transform your text into different English styles and tones
|
||||
</p>
|
||||
|
||||
<div class="card">
|
||||
<div class="form-group">
|
||||
<label for="input-text">Your Text</label>
|
||||
<textarea
|
||||
id="input-text"
|
||||
bind:value={inputText}
|
||||
placeholder="Enter the English text you want to convert..."
|
||||
rows="5"
|
||||
disabled={loading}
|
||||
></textarea>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="form-group">
|
||||
<label for="input-text">Your Text</label>
|
||||
<textarea
|
||||
id="input-text"
|
||||
bind:value={inputText}
|
||||
placeholder="Enter the English text you want to convert... DO NOT ENTER ANY PERSONAL INFORMATION!!"
|
||||
rows="5"
|
||||
disabled={loading}
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
<div class="selectors">
|
||||
<div class="form-group">
|
||||
<label for="category">Style Category</label>
|
||||
<select
|
||||
id="category"
|
||||
bind:value={selectedCategoryId}
|
||||
onchange={onCategoryChange}
|
||||
disabled={loading}
|
||||
>
|
||||
<option value="">Choose a category...</option>
|
||||
{#each categories as cat}
|
||||
<option value={cat.id}>{cat.emoji} {cat.label}</option>
|
||||
{/each}
|
||||
</select>
|
||||
</div>
|
||||
<div class="selectors">
|
||||
<div class="form-group">
|
||||
<label for="category">Style Category</label>
|
||||
<select
|
||||
id="category"
|
||||
bind:value={selectedCategoryId}
|
||||
onchange={onCategoryChange}
|
||||
disabled={loading}
|
||||
>
|
||||
<option value="">Choose a category...</option>
|
||||
{#each categories as cat}
|
||||
<option value={cat.id}>{cat.emoji} {cat.label}</option>
|
||||
{/each}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="style">Style</label>
|
||||
<select id="style" bind:value={selectedStyleId} disabled={loading || !selectedCategoryId}>
|
||||
{#if !selectedCategoryId}
|
||||
<option value="">Select a category first...</option>
|
||||
{:else if availableStyles.length === 0}
|
||||
<option value="">No styles available</option>
|
||||
{:else}
|
||||
<option value="">Choose a style...</option>
|
||||
{#each availableStyles as style}
|
||||
<option value={style.id}>{style.label}</option>
|
||||
{/each}
|
||||
{/if}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="style">Style</label>
|
||||
<select
|
||||
id="style"
|
||||
bind:value={selectedStyleId}
|
||||
disabled={loading || !selectedCategoryId}
|
||||
>
|
||||
{#if !selectedCategoryId}
|
||||
<option value="">Select a category first...</option>
|
||||
{:else if availableStyles.length === 0}
|
||||
<option value="">No styles available</option>
|
||||
{:else}
|
||||
<option value="">Choose a style...</option>
|
||||
{#each availableStyles as style}
|
||||
<option value={style.id}>{style.label}</option>
|
||||
{/each}
|
||||
{/if}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="intensity">
|
||||
Intensity: <span class="intensity-label">{intensityLabel || 'Strong'}</span>
|
||||
</label>
|
||||
<div class="slider-row">
|
||||
<span class="slider-end">Subtle</span>
|
||||
<input
|
||||
id="intensity"
|
||||
type="range"
|
||||
min="1"
|
||||
max="5"
|
||||
step="1"
|
||||
bind:value={intensity}
|
||||
disabled={loading}
|
||||
/>
|
||||
<span class="slider-end">Maximum</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="intensity">
|
||||
Intensity: <span class="intensity-label"
|
||||
>{intensityLabel || "Strong"}</span
|
||||
>
|
||||
</label>
|
||||
<div class="slider-row">
|
||||
<span class="slider-end">Subtle</span>
|
||||
<input
|
||||
id="intensity"
|
||||
type="range"
|
||||
min="1"
|
||||
max="5"
|
||||
step="1"
|
||||
bind:value={intensity}
|
||||
disabled={loading}
|
||||
/>
|
||||
<span class="slider-end">Maximum</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="convert-btn" onclick={handleConvert} disabled={!canConvert}>
|
||||
{#if loading}
|
||||
Converting...
|
||||
{:else}
|
||||
✨ Convert
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
class="convert-btn"
|
||||
onclick={handleConvert}
|
||||
disabled={!canConvert}
|
||||
>
|
||||
{#if loading}
|
||||
Converting...
|
||||
{:else}
|
||||
✨ Convert
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{#if error}
|
||||
<div class="output-card error-card">
|
||||
<p class="error-text">⚠️ {error}</p>
|
||||
</div>
|
||||
{/if}
|
||||
{#if error}
|
||||
<div class="output-card error-card">
|
||||
<p class="error-text">⚠️ {error}</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if outputText}
|
||||
<div class="output-card">
|
||||
<div class="output-header">
|
||||
<h3>Result</h3>
|
||||
<button class="copy-btn" onclick={handleCopy}>
|
||||
{#if copied}
|
||||
✓ Copied!
|
||||
{:else}
|
||||
📋 Copy
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
<div class="output-text">{outputText}</div>
|
||||
{#if modelName}
|
||||
<p class="model-attribution">Responded by {modelName}</p>
|
||||
{/if}
|
||||
</div>
|
||||
{#if outputText}
|
||||
<div class="output-card">
|
||||
<div class="output-header">
|
||||
<h3>Result</h3>
|
||||
<button class="copy-btn" onclick={handleCopy}>
|
||||
{#if copied}
|
||||
✓ Copied!
|
||||
{:else}
|
||||
📋 Copy
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
<div class="output-text">{outputText}</div>
|
||||
{#if modelName}
|
||||
<p class="model-attribution">Responded by {modelName}</p>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="prompt-section">
|
||||
<button class="prompt-toggle" onclick={() => (showPrompt = !showPrompt)}>
|
||||
{showPrompt ? '▼' : '▶'} Show prompt
|
||||
</button>
|
||||
{#if showPrompt}
|
||||
<div class="prompt-content">
|
||||
<div class="prompt-block">
|
||||
<h4>System Prompt</h4>
|
||||
<pre>{systemPrompt}</pre>
|
||||
</div>
|
||||
<div class="prompt-block">
|
||||
<h4>User Message</h4>
|
||||
<pre>{userMessage}</pre>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<div class="prompt-section">
|
||||
<button
|
||||
class="prompt-toggle"
|
||||
onclick={() => (showPrompt = !showPrompt)}
|
||||
>
|
||||
{showPrompt ? "▼" : "▶"} Show prompt
|
||||
</button>
|
||||
{#if showPrompt}
|
||||
<div class="prompt-content">
|
||||
<div class="prompt-block">
|
||||
<h4>System Prompt</h4>
|
||||
<pre>{systemPrompt}</pre>
|
||||
</div>
|
||||
<div class="prompt-block">
|
||||
<h4>User Message</h4>
|
||||
<pre>{userMessage}</pre>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</main>
|
||||
|
||||
{#if loading}
|
||||
<LoadingModal />
|
||||
<LoadingModal />
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.container {
|
||||
max-width: 680px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem 1.5rem;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.container {
|
||||
max-width: 680px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem 1.5rem;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 2rem;
|
||||
font-weight: 800;
|
||||
color: #1f2937;
|
||||
text-align: center;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
.title {
|
||||
font-size: 2rem;
|
||||
font-weight: 800;
|
||||
color: #1f2937;
|
||||
text-align: center;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
text-align: center;
|
||||
color: #6b7280;
|
||||
margin-bottom: 2rem;
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
.subtitle {
|
||||
text-align: center;
|
||||
color: #6b7280;
|
||||
margin-bottom: 2rem;
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #ffffff;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 12px;
|
||||
padding: 1.5rem;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.card {
|
||||
background: #ffffff;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 12px;
|
||||
padding: 1.5rem;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
color: #374151;
|
||||
margin-bottom: 0.4rem;
|
||||
}
|
||||
.form-group label {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
color: #374151;
|
||||
margin-bottom: 0.4rem;
|
||||
}
|
||||
|
||||
textarea,
|
||||
select {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 8px;
|
||||
font-size: 0.95rem;
|
||||
font-family: inherit;
|
||||
background: #fafafa;
|
||||
color: #1f2937;
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
textarea,
|
||||
select {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 8px;
|
||||
font-size: 0.95rem;
|
||||
font-family: inherit;
|
||||
background: #fafafa;
|
||||
color: #1f2937;
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
|
||||
textarea:focus,
|
||||
select:focus {
|
||||
outline: none;
|
||||
border-color: #3b82f6;
|
||||
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
||||
}
|
||||
textarea:focus,
|
||||
select:focus {
|
||||
outline: none;
|
||||
border-color: #3b82f6;
|
||||
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
min-height: 100px;
|
||||
}
|
||||
textarea {
|
||||
resize: vertical;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
.selectors {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 1rem;
|
||||
}
|
||||
.selectors {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.intensity-label {
|
||||
color: #3b82f6;
|
||||
font-weight: 700;
|
||||
}
|
||||
.intensity-label {
|
||||
color: #3b82f6;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.slider-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
.slider-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.slider-end {
|
||||
font-size: 0.8rem;
|
||||
color: #9ca3af;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.slider-end {
|
||||
font-size: 0.8rem;
|
||||
color: #9ca3af;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
input[type='range'] {
|
||||
flex: 1;
|
||||
}
|
||||
input[type="range"] {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.convert-btn {
|
||||
width: 100%;
|
||||
padding: 0.85rem;
|
||||
background: #3b82f6;
|
||||
color: #ffffff;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
font-size: 1.05rem;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, opacity 0.2s;
|
||||
}
|
||||
.convert-btn {
|
||||
width: 100%;
|
||||
padding: 0.85rem;
|
||||
background: #3b82f6;
|
||||
color: #ffffff;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
font-size: 1.05rem;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
background 0.2s,
|
||||
opacity 0.2s;
|
||||
}
|
||||
|
||||
.convert-btn:hover:not(:disabled) {
|
||||
background: #2563eb;
|
||||
}
|
||||
.convert-btn:hover:not(:disabled) {
|
||||
background: #2563eb;
|
||||
}
|
||||
|
||||
.convert-btn:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.convert-btn:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.output-card {
|
||||
margin-top: 1.5rem;
|
||||
background: #ffffff;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 12px;
|
||||
padding: 1.25rem;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.output-card {
|
||||
margin-top: 1.5rem;
|
||||
background: #ffffff;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 12px;
|
||||
padding: 1.25rem;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.error-card {
|
||||
border-color: #fca5a5;
|
||||
background: #fef2f2;
|
||||
}
|
||||
.error-card {
|
||||
border-color: #fca5a5;
|
||||
background: #fef2f2;
|
||||
}
|
||||
|
||||
.error-text {
|
||||
color: #dc2626;
|
||||
font-weight: 500;
|
||||
}
|
||||
.error-text {
|
||||
color: #dc2626;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.output-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
.output-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.output-header h3 {
|
||||
margin: 0;
|
||||
font-size: 1.1rem;
|
||||
color: #1f2937;
|
||||
}
|
||||
.output-header h3 {
|
||||
margin: 0;
|
||||
font-size: 1.1rem;
|
||||
color: #1f2937;
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
padding: 0.35rem 0.75rem;
|
||||
background: #f3f4f6;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 6px;
|
||||
font-size: 0.85rem;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
.copy-btn {
|
||||
padding: 0.35rem 0.75rem;
|
||||
background: #f3f4f6;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 6px;
|
||||
font-size: 0.85rem;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.copy-btn:hover {
|
||||
background: #e5e7eb;
|
||||
}
|
||||
.copy-btn:hover {
|
||||
background: #e5e7eb;
|
||||
}
|
||||
|
||||
.output-text {
|
||||
white-space: pre-wrap;
|
||||
line-height: 1.6;
|
||||
color: #1f2937;
|
||||
font-size: 1rem;
|
||||
}
|
||||
.output-text {
|
||||
white-space: pre-wrap;
|
||||
line-height: 1.6;
|
||||
color: #1f2937;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.model-attribution {
|
||||
margin-top: 0.75rem;
|
||||
font-size: 0.8rem;
|
||||
color: #9ca3af;
|
||||
font-style: italic;
|
||||
}
|
||||
.model-attribution {
|
||||
margin-top: 0.75rem;
|
||||
font-size: 0.8rem;
|
||||
color: #9ca3af;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.prompt-section {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.prompt-section {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.prompt-toggle {
|
||||
background: none;
|
||||
border: none;
|
||||
color: #3b82f6;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
.prompt-toggle {
|
||||
background: none;
|
||||
border: none;
|
||||
color: #3b82f6;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
.prompt-toggle:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.prompt-toggle:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.prompt-content {
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
.prompt-content {
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
.prompt-block {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.prompt-block {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.prompt-block h4 {
|
||||
font-size: 0.85rem;
|
||||
color: #6b7280;
|
||||
margin-bottom: 0.4rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
.prompt-block h4 {
|
||||
font-size: 0.85rem;
|
||||
color: #6b7280;
|
||||
margin-bottom: 0.4rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.prompt-block pre {
|
||||
background: #f9fafb;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 8px;
|
||||
padding: 0.75rem;
|
||||
font-size: 0.85rem;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
color: #374151;
|
||||
margin: 0;
|
||||
}
|
||||
.prompt-block pre {
|
||||
background: #f9fafb;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 8px;
|
||||
padding: 0.75rem;
|
||||
font-size: 0.85rem;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
color: #374151;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.selectors {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
.selectors {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 1rem;
|
||||
}
|
||||
.container {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.title {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user