removed blade and htmx

This commit is contained in:
2026-05-06 23:16:09 +03:00
parent dff3748623
commit 98efb76f7b
31 changed files with 235 additions and 465 deletions
+51 -37
View File
@@ -1,54 +1,68 @@
<script>
import {getContext} from "svelte";
import SpinnerButton from "../common/SpinnerButton.svelte";
import { getContext } from "svelte";
import { apiPost } from "../../helpers";
const channel = getContext("channel");
let email = "";
let message = "";
let submitted = false;
function login(e) {
e.preventDefault();
axios
.post(channel.lucentUrl + "/login", {
email: email,
apiPost(channel.lucentUrl + "/login", { email: email })
.then(() => {
submitted = true;
})
.then((response) => {
console.log(response)
message = "You will receive an email with a login link"
})
.catch((error) => {
});
.catch(() => {});
}
</script>
<div class="wrapper-tiny">
{#if message}
<div class="alert alert-info" role="alert">
{message}
</div>
{:else}
<form on:submit={login}>
<div class="mb-3">
<label for="emailaddress" class="form-label">Email address</label>
<input
type="email"
bind:value={email}
class="form-control"
id="emailaddress"
required
/>
<div class="scope-login">
<div class="bg-image"></div>
<div class="login-form">
{#if submitted}
<div class="alert alert-info" role="alert">
<p>
You will receive an email with a login link at <b>{email}</b
>.
</p>
<p>Check your spam folder</p>
</div>
{:else}
<div class="form">
<h2 class="mb-5">Enter Lucent</h2>
<form on:submit={login}>
<p>
Submit your email address and you will receive a <b
>login link</b
> to your email
</p>
<p>Don't forget to check your spam folder</p>
<div class="mt-5 mb-3">
<label for="emailaddress" class="form-label"
>Email address</label
>
<input
type="email"
bind:value={email}
class="form-control"
id="emailaddress"
required
/>
</div>
<div class="text-center mt-5 d-block">
<SpinnerButton label="Login"/>
<button class="bt bt-primary">
Send email
<img
alt="indicator"
id="indicator"
class="htmx-indicator"
src="/img/spinner.svg"
/>
</button>
</form>
</div>
</form>
{/if}
{/if}
</div>
</div>
+25 -26
View File
@@ -1,43 +1,42 @@
<script>
import {getContext} from "svelte";
import SpinnerButton from "../common/SpinnerButton.svelte";
import SuccessAlert from "../common/SuccessAlert.svelte";
import { getContext } from "svelte";
import { apiPost } from "../../helpers";
const channel = getContext("channel");
export let email;
export let token;
let successAlert;
function login(e) {
e.preventDefault();
axios
.post(channel.lucentUrl + "/verify", {
email: email,
token: token,
})
apiPost(channel.lucentUrl + "/verify", {
email: email,
token: token,
})
.then((response) => {
window.location = channel.lucentUrl;
})
.catch((error) => {
});
.catch((error) => {});
}
</script>
<SuccessAlert bind:this={successAlert}/>
<div class="wrapper-tiny">
<form on:submit={login}>
<div class="mb-3 text-center">
<h3>Login as {email}</h3>
<div class="scope-login">
<div class="bg-image"></div>
<div class="login-form">
<div class="form">
<h2 class="mb-5">Welcome to Lucent</h2>
<form on:submit={login}>
<button class="bt bt-primary">
Enter as {email}
<img
alt="indicator"
id="indicator"
class="htmx-indicator"
src="/img/spinner.svg"
/>
</button>
</form>
<div class="form-errors"></div>
</div>
<div class="text-center mt-5 d-block">
<SpinnerButton label="Enter"/>
</div>
</form>
</div>
</div>