initting
This commit is contained in:
63
ui/_/code/components/EmailJoinForm.js
Normal file
63
ui/_/code/components/EmailJoinForm.js
Normal file
@@ -0,0 +1,63 @@
|
||||
css(`
|
||||
email-join-form {
|
||||
display: flex
|
||||
}
|
||||
`)
|
||||
|
||||
export default class EmailJoinForm extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
this.querySelector('#submit-button').addEventListener('click', () => this.submitEmail());
|
||||
}
|
||||
|
||||
isValidEmail(email) {
|
||||
const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,16}$/;
|
||||
return emailRegex.test(email);
|
||||
}
|
||||
|
||||
showError(message) {
|
||||
$(this).find('#form-message')
|
||||
.css('color', 'red')
|
||||
.text(message);
|
||||
}
|
||||
|
||||
showSuccess(message) {
|
||||
$(this).find('#form-message')
|
||||
.css('color', 'green')
|
||||
.text(message);
|
||||
}
|
||||
|
||||
clearError() {
|
||||
this.querySelector('#form-message').textContent = '';
|
||||
}
|
||||
|
||||
async submitEmail() {
|
||||
const email = this.querySelector('#email-input').value.trim();
|
||||
this.clearError();
|
||||
|
||||
if (!this.isValidEmail(email)) {
|
||||
this.showError('Please enter a valid email address.');
|
||||
return;
|
||||
}
|
||||
|
||||
const res = await fetch('/api/join', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ email }),
|
||||
});
|
||||
|
||||
if (res.ok) {
|
||||
this.showSuccess('Email sent.');
|
||||
} else {
|
||||
const error = await res.text();
|
||||
this.showError(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("email-join-form", EmailJoinForm);
|
||||
1047
ui/_/code/quill.js
Normal file
1047
ui/_/code/quill.js
Normal file
File diff suppressed because one or more lines are too long
104
ui/_/code/shared.css
Normal file
104
ui/_/code/shared.css
Normal file
@@ -0,0 +1,104 @@
|
||||
:root {
|
||||
--main: var(--brown);
|
||||
--accent: var(--gold);
|
||||
|
||||
--tan: #FFDFB4;
|
||||
--gold: #F2B36F;
|
||||
--divider: #bb7c36;
|
||||
--green: #0857265c;
|
||||
--red: #BC1C02;
|
||||
--brown: #812A18;
|
||||
--darkbrown: #3f0808;
|
||||
|
||||
--accent2: var(--green);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--main: var(--brown);
|
||||
--accent: var(--gold);
|
||||
--accent2: var(--gold);
|
||||
}
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Canterbury';
|
||||
src: url('/_/fonts/Canterbury/Canterbury.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Bona Nova';
|
||||
src: url('/_/fonts/BonaNova/BonaNova-Regular.woff') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Bona Nova';
|
||||
src: url('/_/fonts/BonaNova/BonaNova-Bold.woff') format('truetype');
|
||||
font-weight: bold;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Bona Nova', sans-serif;
|
||||
font-size: 16px;
|
||||
background-color: var(--main);
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
#title {
|
||||
padding: 5px 10px;
|
||||
font-size: 1.7rem;
|
||||
position: fixed; top: 4.5vh; left: 6vw;
|
||||
cursor: pointer; z-index: 1;
|
||||
}
|
||||
|
||||
a {
|
||||
cursor: default;
|
||||
text-decoration: none;
|
||||
text-underline-offset: 5px;
|
||||
transition: background .02s, color .2s;
|
||||
user-select: none;
|
||||
color: var(--accent);
|
||||
display: inline-block; /* makes background and padding behave */
|
||||
padding: 0.2em 0.5em; /* adds breathing room */
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
background: var(--green);
|
||||
color: var(--tan);
|
||||
}
|
||||
|
||||
a:active {
|
||||
background: var(--red); /* background color works now */
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: transparent;
|
||||
color: var(--accent);
|
||||
padding: 0.5em;
|
||||
box-shadow: none;
|
||||
border: 1px solid var(--accent);
|
||||
border-radius: 0.3em;
|
||||
}
|
||||
|
||||
input {
|
||||
background-color: transparent;
|
||||
border: 1px solid var(--accent2);
|
||||
padding-left: 1em;
|
||||
padding-top: 0.5em;
|
||||
padding-bottom: 0.5em;
|
||||
border-radius: 0.3em;
|
||||
}
|
||||
|
||||
input::placeholder {
|
||||
color: var(--accent)
|
||||
}
|
||||
|
||||
input:focus {
|
||||
outline: 1px solid var(--red);
|
||||
}
|
||||
BIN
ui/_/fonts/BonaNova/BonaNova-Bold.woff
Normal file
BIN
ui/_/fonts/BonaNova/BonaNova-Bold.woff
Normal file
Binary file not shown.
BIN
ui/_/fonts/BonaNova/BonaNova-Italic.woff
Normal file
BIN
ui/_/fonts/BonaNova/BonaNova-Italic.woff
Normal file
Binary file not shown.
BIN
ui/_/fonts/BonaNova/BonaNova-Regular.woff
Normal file
BIN
ui/_/fonts/BonaNova/BonaNova-Regular.woff
Normal file
Binary file not shown.
BIN
ui/_/fonts/BonaNova/bona-nova-webfont.zip
Normal file
BIN
ui/_/fonts/BonaNova/bona-nova-webfont.zip
Normal file
Binary file not shown.
18
ui/_/fonts/BonaNova/bona-nova-webfont/example.html
Normal file
18
ui/_/fonts/BonaNova/bona-nova-webfont/example.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="style.css"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Generated from: http://font.download</h1><br/>
|
||||
<h1 style="font-family:'Bona Nova Regular';font-weight:normal;font-size:42px">AaBbCcDdEeFfGgHhŞşIıİi Example</h1>
|
||||
<h1 style="font-family:'Bona Nova Italic';font-weight:normal;font-size:42px">AaBbCcDdEeFfGgHhŞşIıİi Example</h1>
|
||||
<h1 style="font-family:'Bona Nova Bold';font-weight:normal;font-size:42px">AaBbCcDdEeFfGgHhŞşIıİi Example</h1>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
24
ui/_/fonts/BonaNova/bona-nova-webfont/style.css
Normal file
24
ui/_/fonts/BonaNova/bona-nova-webfont/style.css
Normal file
@@ -0,0 +1,24 @@
|
||||
/* #### Generated By: http://font.download #### */
|
||||
|
||||
@font-face {
|
||||
font-family: 'Bona Nova Regular';
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
src: local('Bona Nova Regular'), url('BonaNova-Regular.woff') format('woff');
|
||||
}
|
||||
|
||||
|
||||
@font-face {
|
||||
font-family: 'Bona Nova Italic';
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
src: local('Bona Nova Italic'), url('BonaNova-Italic.woff') format('woff');
|
||||
}
|
||||
|
||||
|
||||
@font-face {
|
||||
font-family: 'Bona Nova Bold';
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
src: local('Bona Nova Bold'), url('BonaNova-Bold.woff') format('woff');
|
||||
}
|
||||
BIN
ui/_/fonts/BonaNova/old/BonaNova-Bold.ttf
Executable file
BIN
ui/_/fonts/BonaNova/old/BonaNova-Bold.ttf
Executable file
Binary file not shown.
BIN
ui/_/fonts/BonaNova/old/BonaNova-Italic.ttf
Executable file
BIN
ui/_/fonts/BonaNova/old/BonaNova-Italic.ttf
Executable file
Binary file not shown.
BIN
ui/_/fonts/BonaNova/old/BonaNova-Regular.ttf
Executable file
BIN
ui/_/fonts/BonaNova/old/BonaNova-Regular.ttf
Executable file
Binary file not shown.
BIN
ui/_/fonts/Canterbury/Canterbury.ttf
Executable file
BIN
ui/_/fonts/Canterbury/Canterbury.ttf
Executable file
Binary file not shown.
BIN
ui/_/fonts/CrimsonText/CrimsonText-Bold.ttf
Executable file
BIN
ui/_/fonts/CrimsonText/CrimsonText-Bold.ttf
Executable file
Binary file not shown.
BIN
ui/_/fonts/CrimsonText/CrimsonText-BoldItalic.ttf
Executable file
BIN
ui/_/fonts/CrimsonText/CrimsonText-BoldItalic.ttf
Executable file
Binary file not shown.
BIN
ui/_/fonts/CrimsonText/CrimsonText-Italic.ttf
Executable file
BIN
ui/_/fonts/CrimsonText/CrimsonText-Italic.ttf
Executable file
Binary file not shown.
BIN
ui/_/fonts/CrimsonText/CrimsonText-Regular.ttf
Executable file
BIN
ui/_/fonts/CrimsonText/CrimsonText-Regular.ttf
Executable file
Binary file not shown.
BIN
ui/_/fonts/CrimsonText/CrimsonText-SemiBold.ttf
Executable file
BIN
ui/_/fonts/CrimsonText/CrimsonText-SemiBold.ttf
Executable file
Binary file not shown.
BIN
ui/_/fonts/CrimsonText/CrimsonText-SemiBoldItalic.ttf
Executable file
BIN
ui/_/fonts/CrimsonText/CrimsonText-SemiBoldItalic.ttf
Executable file
Binary file not shown.
93
ui/_/fonts/CrimsonText/OFL.txt
Executable file
93
ui/_/fonts/CrimsonText/OFL.txt
Executable file
@@ -0,0 +1,93 @@
|
||||
Copyright 2010 The Crimson Text Project Authors (https://github.com/googlefonts/Crimson)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://openfontlicense.org
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Reference in New Issue
Block a user