-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add shrapnel as default teaser
- Loading branch information
Robin Bryce
committed
Aug 26, 2024
1 parent
1856ff4
commit e448543
Showing
16 changed files
with
374 additions
and
31 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions
70
apps/gav0/src/lib/components/molecules/FormImagePrompt.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<script lang="ts"> | ||
// --- lib depsa | ||
import type {FormMethod} from "$lib/components/molecules/forms"; | ||
// --- framework | ||
// import { onMount , setContext, getContext, onDestroy } from 'svelte' | ||
// --- external components | ||
// --- components | ||
// --- app lib | ||
//import { getLogger } from '$lib/log.js' | ||
// --- app stores | ||
// --- constants | ||
// const log = getLogger('PromptMessage') | ||
// --- data imports | ||
// --- component properties | ||
export let method: FormMethod = "POST"; | ||
export let action: string; | ||
export let placeholder: string = "Describe the image you want"; | ||
// --- component state properties | ||
// --- svelte bound variables | ||
// let instance = undefined | ||
// --- svelte lifecycle callbacks | ||
// test support hook | ||
// onMount(async () => {}) | ||
// --- on dom event callbacks | ||
// --- contract state callbacks | ||
// --- component helpers | ||
</script> | ||
|
||
<!-- Prompt Messages Container - Modify the height according to your need --> | ||
<div class="flex h-[97vh] w-full flex-col"> | ||
<form | ||
method={method} action={action} | ||
class="flex w-full items-center rounded-b-md border-t border-slate-300 bg-slate-200 p-2 dark:border-slate-700 dark:bg-slate-900" | ||
> | ||
<label for="chat" class="sr-only">{placeholder}</label> | ||
<textarea | ||
id="chat-input" | ||
rows="1" | ||
class="mx-2 flex min-h-full w-full rounded-md border border-slate-300 bg-slate-50 p-2 text-base text-slate-900 placeholder-slate-400 focus:border-blue-600 focus:outline-none focus:ring-1 focus:ring-blue-600 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-50 dark:placeholder-slate-400 dark:focus:border-blue-600 dark:focus:ring-blue-600" | ||
placeholder={placeholder} | ||
></textarea> | ||
<div> | ||
<button | ||
class="inline-flex hover:text-blue-600 dark:text-slate-200 dark:hover:text-blue-600 sm:p-2" | ||
type="submit" | ||
> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
class="h-6 w-6" | ||
aria-hidden="true" | ||
viewBox="0 0 24 24" | ||
stroke-width="2" | ||
stroke="currentColor" | ||
fill="none" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
> | ||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path> | ||
<path d="M10 14l11 -11"></path> | ||
<path d="M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5" | ||
></path> | ||
</svg> | ||
<span class="sr-only">Send message</span> | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
<style> | ||
</style> |
92 changes: 92 additions & 0 deletions
92
apps/gav0/src/lib/components/molecules/FormTextPrompt.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<script lang="ts"> | ||
// --- lib depsa | ||
import type {FormMethod} from "$lib/components/molecules/forms"; | ||
// --- framework | ||
// import { onMount , setContext, getContext, onDestroy } from 'svelte' | ||
// --- external components | ||
// --- components | ||
// --- app lib | ||
//import { getLogger } from '$lib/log.js' | ||
// --- app stores | ||
// --- constants | ||
// const log = getLogger('PromptMessage') | ||
// --- data imports | ||
// --- component properties | ||
export let method: FormMethod = "POST"; | ||
export let action: string; | ||
// --- component state properties | ||
// --- svelte bound variables | ||
// let instance = undefined | ||
// --- svelte lifecycle callbacks | ||
// test support hook | ||
// onMount(async () => {}) | ||
// --- on dom event callbacks | ||
// --- contract state callbacks | ||
// --- component helpers | ||
</script> | ||
|
||
<!-- Prompt Messages Container - Modify the height according to your need --> | ||
<div class="flex h-[97vh] w-full flex-col"> | ||
<form | ||
method={method} action={action} | ||
class="flex w-full items-center rounded-b-md border-t border-slate-300 bg-slate-200 p-2 dark:border-slate-700 dark:bg-slate-900" | ||
> | ||
<label for="chat" class="sr-only">Enter your prompt</label> | ||
<div> | ||
<button | ||
class="hover:text-blue-600 dark:text-slate-200 dark:hover:text-blue-600 sm:p-2" | ||
type="button" | ||
> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
class="h-6 w-6" | ||
aria-hidden="true" | ||
viewBox="0 0 24 24" | ||
stroke-width="2" | ||
stroke="currentColor" | ||
fill="none" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
> | ||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path> | ||
<path d="M12 5l0 14"></path> | ||
<path d="M5 12l14 0"></path> | ||
</svg> | ||
<span class="sr-only">Add</span> | ||
</button> | ||
</div> | ||
<textarea | ||
id="chat-input" | ||
rows="1" | ||
class="mx-2 flex min-h-full w-full rounded-md border border-slate-300 bg-slate-50 p-2 text-base text-slate-900 placeholder-slate-400 focus:border-blue-600 focus:outline-none focus:ring-1 focus:ring-blue-600 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-50 dark:placeholder-slate-400 dark:focus:border-blue-600 dark:focus:ring-blue-600" | ||
placeholder="Enter your prompt" | ||
></textarea> | ||
<div> | ||
<button | ||
class="inline-flex hover:text-blue-600 dark:text-slate-200 dark:hover:text-blue-600 sm:p-2" | ||
type="submit" | ||
> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
class="h-6 w-6" | ||
aria-hidden="true" | ||
viewBox="0 0 24 24" | ||
stroke-width="2" | ||
stroke="currentColor" | ||
fill="none" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
> | ||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path> | ||
<path d="M10 14l11 -11"></path> | ||
<path d="M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5" | ||
></path> | ||
</svg> | ||
<span class="sr-only">Send message</span> | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
<style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
enum FormMethodName { | ||
POST = "POST", | ||
GET = "GET" | ||
} | ||
|
||
type FormMethod = keyof typeof FormMethodName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
apps/gav0/src/lib/components/organisms/CardImageGenerator.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<script lang="ts"> | ||
// --- lib deps | ||
// --- framework | ||
// import { onMount , setContext, getContext, onDestroy } from 'svelte' | ||
// --- external components | ||
// --- components | ||
import FormImagePrompt from "$lib/components/molecules/FormImagePrompt.svelte"; | ||
// --- app lib | ||
// --- app stores | ||
// --- constants | ||
// --- data imports | ||
// --- component properties | ||
export let title: string = "Image Generator" | ||
export let action: string; | ||
export let placeholder: string = "Describe the image you want"; | ||
// --- component state properties | ||
// --- svelte bound variables | ||
// let instance = undefined | ||
// --- svelte lifecycle callbacks | ||
// test support hook | ||
// onMount(async () => {}) | ||
// --- on dom event callbacks | ||
// --- contract state callbacks | ||
// --- component helpers | ||
</script> | ||
<div class="card p-4">{title}</div> | ||
<FormImagePrompt method="POST" action={action} placeholder={placeholder}/> | ||
<style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.