Componentize islands
This commit is contained in:
41
src/lib/islands/input-island.svelte
Normal file
41
src/lib/islands/input-island.svelte
Normal file
@@ -0,0 +1,41 @@
|
||||
<script>
|
||||
import Island from "$lib/islands/island.svelte";
|
||||
export let variables = {
|
||||
title: "Uninitialised",
|
||||
action: "/",
|
||||
placeholder: "Uninitialised",
|
||||
queryName: "uninitiailsed"
|
||||
};
|
||||
</script>
|
||||
|
||||
<form action={variables.action}>
|
||||
<input class="form-input" type="text" id="input-headcode" name={variables.queryName} placeholder={variables.placeholder}>
|
||||
<br>
|
||||
<button class="form-button" type="submit">Submit</button>
|
||||
</form>
|
||||
|
||||
<style>
|
||||
.form-input {
|
||||
width: 75%;
|
||||
height: 30px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
border-radius: 50px;
|
||||
border: none;
|
||||
text-align: center;
|
||||
font-family: urwgothic, 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
|
||||
}
|
||||
.form-button {
|
||||
width: 50%;
|
||||
margin-bottom: 5px;
|
||||
margin-top: 5px;
|
||||
border: none;
|
||||
border-radius: 20px;
|
||||
padding: 5px;
|
||||
font-family: urwgothic, 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
background-color: var(--main-bg-color);
|
||||
color: var(--link-color);
|
||||
}
|
||||
</style>
|
||||
25
src/lib/islands/island.svelte
Normal file
25
src/lib/islands/island.svelte
Normal file
@@ -0,0 +1,25 @@
|
||||
<script>
|
||||
export const title = "Uninitialised"
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<span>{title}</span>
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
<style>
|
||||
span {
|
||||
font-family: urwgothic, 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 20px;
|
||||
}
|
||||
div {
|
||||
width: 75%;
|
||||
max-width: 400px;
|
||||
margin: auto;
|
||||
margin-top: 25px;
|
||||
padding: 10px;
|
||||
background-color: var(--overlay-color);
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
4
src/lib/islands/quick-link-island.svelte
Normal file
4
src/lib/islands/quick-link-island.svelte
Normal file
@@ -0,0 +1,4 @@
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user