Added basic comments.

This commit is contained in:
2023-06-11 05:32:02 +02:00
parent 9a9b92a6b1
commit 0d5744e3ff
26 changed files with 441 additions and 89 deletions

View File

@@ -1,14 +1,16 @@
.input {
box-sizing: border-box;
padding: .5rem .75rem;
font-size: 1rem;
flex-basis: 0;
border: solid 1px var(--grey-light-30);
border-radius: .25rem;
background: var(--grey-light-60);
font: inherit;
&:focus {
outline: none;
border-color: var(--primary-light-30);
border-color: var(--primary-light-50);
}
}

View File

@@ -3,6 +3,8 @@
--primary-light-10: hsl(300, 50%, 40%);
--primary-light-20: hsl(300, 50%, 50%);
--primary-light-30: hsl(300, 50%, 60%);
--primary-light-40: hsl(300, 50%, 75%);
--primary-light-50: hsl(300, 50%, 80%);
--grey-dark-40: #222;
--grey-dark-30: #444;
@@ -13,6 +15,8 @@
--grey-light-20: #ccc;
--grey-light-30: #ddd;
--grey-light-40: #eee;
--grey-light-50: #fafafa;
--grey-light-60: #fcfcfc;
--background-dark-20: #eee;
--background-dark-10: #f8f8f8;

View File

@@ -15,7 +15,7 @@ function getQuery(data) {
}
export async function get(path, query = {}) {
const res = await fetch(`${path}${getQuery(query)}`);
const res = await fetch(`/api${path}${getQuery(query)}`);
const body = await res.json();
if (res.ok) {
@@ -26,7 +26,7 @@ export async function get(path, query = {}) {
}
export async function post(path, data, { query } = {}) {
const res = await fetch(`${path}${getQuery(query)}`, {
const res = await fetch(`/api${path}${getQuery(query)}`, {
method: 'POST',
body: JSON.stringify(data),
...postHeaders,
@@ -46,7 +46,7 @@ export async function post(path, data, { query } = {}) {
}
export async function patch(path, data, { query } = {}) {
const res = await fetch(`${path}${getQuery(query)}`, {
const res = await fetch(`/api${path}${getQuery(query)}`, {
method: 'PATCH',
body: JSON.stringify(data),
...postHeaders,
@@ -66,7 +66,7 @@ export async function patch(path, data, { query } = {}) {
}
export async function del(path, { data, query } = {}) {
const res = await fetch(`${path}${getQuery(query)}`, {
const res = await fetch(`/api${path}${getQuery(query)}`, {
method: 'DELETE',
body: JSON.stringify(data),
...postHeaders,

View File

@@ -2,3 +2,7 @@
export default function navigate(path) {
window.location.href = path;
}
export function reload() {
window.location.reload();
}