-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
474 additions
and
68 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
VITE_MATOMO_URL="https://leaphyeasybloqs.com/matomo/" | ||
VITE_MATOMO_SITE_ID="1" | ||
VITE_BACKEND_URL="https://leaphyeasybloqs.com" | ||
VITE_RECORDINGS_API="https://recordings.leaphyeasybloqs.com" | ||
VITE_RECORDINGS_ADDRESS=".leaphyeasybloqs.com" |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
VITE_BACKEND_URL="https://testleaphyeasybloqs.com" | ||
VITE_RECORDINGS_API="http://localhost:5173" | ||
VITE_RECORDINGS_ADDRESS=".localhost" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
<script lang="ts"> | ||
import Button from "$components/ui/Button.svelte"; | ||
import Select from "$components/ui/Select.svelte"; | ||
import TextInput from "$components/ui/TextInput.svelte"; | ||
import type { PopupState } from "$state/popup.svelte"; | ||
import { faCircle } from "@fortawesome/free-solid-svg-icons"; | ||
import { getContext } from "svelte"; | ||
import Fa from "svelte-fa"; | ||
import { _ } from "svelte-i18n"; | ||
interface Props { | ||
id: string; | ||
name: string; | ||
acceptsSubmissions: boolean; | ||
suggestNames: boolean; | ||
acceptsNewParticipants: boolean; | ||
showSubmit: boolean; | ||
names: { id: string; name: string }[]; | ||
} | ||
const config: Props = $props(); | ||
const popupState = getContext<PopupState>("state"); | ||
let name = $state( | ||
config.acceptsNewParticipants | ||
? localStorage.getItem("name") || "" | ||
: config.names[0]?.name, | ||
); | ||
async function done() { | ||
localStorage.setItem("name", name); | ||
popupState.close(name); | ||
} | ||
function onsubmit(event: SubmitEvent) { | ||
event.preventDefault(); | ||
done(); | ||
} | ||
</script> | ||
|
||
{#if config.acceptsSubmissions} | ||
<form class="content" {onsubmit}> | ||
<h2> | ||
<span class="icon"> | ||
<Fa icon={faCircle} /> | ||
</span> | ||
{$_("RECORDING")} | ||
</h2> | ||
|
||
<p class="description">{$_("RECORDING_DESCRIPTION", { values: { | ||
project: config.name | ||
}})}</p> | ||
|
||
<div class="input"> | ||
{#if config.acceptsNewParticipants} | ||
<TextInput | ||
placeholder={$_("NAME")} | ||
bind:value={name} | ||
suggestions={config.names?.map(name => name.name)} | ||
mode="secondary" | ||
required | ||
focus | ||
rounded={true}> | ||
</TextInput> | ||
{:else} | ||
{#if config.names.length > 0} | ||
<Select | ||
options={config.names.map(name => ([name.name, name.name]))} | ||
bind:value={name} | ||
mode="secondary" full | ||
/> | ||
{:else} | ||
<p>{$_("NO_PARTICIPANTS")}</p> | ||
{/if} | ||
|
||
{/if} | ||
</div> | ||
|
||
<div class="actions"> | ||
<Button type="submit" mode={"primary"} name={$_("CONTINUE")}/> | ||
</div> | ||
</form> | ||
{:else} | ||
<form action={import.meta.env.VITE_BACKEND_URL} class="content"> | ||
<h2>{$_("PROJECT_SUBMISSIONS_CLOSED")}</h2> | ||
<p class="description">{$_("SUBMISSIONS_CLOSED_DESCRIPTION")}</p> | ||
<div class="actions"> | ||
<Button type="submit" mode="primary" name={$_("CONTINUE")} /> | ||
</div> | ||
</form> | ||
{/if} | ||
|
||
<style> | ||
.input { | ||
padding-bottom: 10px; | ||
} | ||
.content { | ||
padding: 20px; | ||
display: flex; | ||
flex-direction: column; | ||
min-width: 400px; | ||
text-align: center; | ||
} | ||
.actions { | ||
display: flex; | ||
justify-content: center; | ||
margin-top: 20px; | ||
} | ||
.icon { | ||
color: red; | ||
} | ||
.description { | ||
white-space: pre-line; | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<script lang="ts"> | ||
interface Props { | ||
open: boolean; | ||
options: [string, any][]; | ||
mode: "primary" | "secondary"; | ||
onselect?: (value: string) => void; | ||
} | ||
const { open, options, mode, onselect }: Props = $props(); | ||
</script> | ||
|
||
{#if open} | ||
<div class="popup" class:secondary={mode === 'secondary'}> | ||
<div class="container"> | ||
{#each options as option (option[1])} | ||
<button type="button" onclick={() => onselect(option[1])} class="option" | ||
>{option[0]}</button> | ||
{/each} | ||
</div> | ||
</div> | ||
{/if} | ||
|
||
<style> | ||
.option { | ||
position: relative; | ||
background: var(--primary-dark-tint); | ||
color: var(--on-primary); | ||
border: none; | ||
padding: 10px 15px; | ||
border-radius: 20px; | ||
} | ||
.secondary .option { | ||
background: var(--secondary); | ||
color: var(--on-secondary); | ||
} | ||
.popup { | ||
width: 100%; | ||
position: absolute; | ||
max-height: 400px; | ||
overflow-y: auto; | ||
z-index: 99; | ||
border-radius: 20px; | ||
border-top-left-radius: 0; | ||
border-top-right-radius: 0; | ||
overflow: hidden; | ||
box-shadow: var(--shadow-el1); | ||
} | ||
.container { | ||
overflow-y: auto; | ||
max-height: 200px; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
.option { | ||
background: var(--primary); | ||
border-radius: 0; | ||
text-overflow: ellipsis; | ||
width: 100%; | ||
} | ||
.secondary .option { | ||
background: var(--robot); | ||
} | ||
</style> |
Oops, something went wrong.