mirror of
https://github.com/cupcakearmy/blaze.git
synced 2025-12-07 19:55:00 +00:00
proposal
This commit is contained in:
2
templates/browse.eta
Normal file
2
templates/browse.eta
Normal file
@@ -0,0 +1,2 @@
|
||||
{{~ include("./search.eta", it) }}
|
||||
<section>{{~ it.content }}</section>
|
||||
2
templates/error.eta
Normal file
2
templates/error.eta
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1>Error: {{= it.code }}</h1>
|
||||
<p>{{= it.message }}</p>
|
||||
3
templates/home.eta
Normal file
3
templates/home.eta
Normal file
@@ -0,0 +1,3 @@
|
||||
<div style="margin: 10rem auto">
|
||||
{{~ include("./search", it) }}
|
||||
</div>
|
||||
136
templates/layout.eta
Normal file
136
templates/layout.eta
Normal file
@@ -0,0 +1,136 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>{{= it.title }}</title>
|
||||
<style>
|
||||
/*! modern-normalize v2.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
|
||||
*,
|
||||
::after,
|
||||
::before {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html {
|
||||
font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
||||
line-height: 1.15;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-moz-tab-size: 4;
|
||||
tab-size: 4;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
hr {
|
||||
height: 0;
|
||||
color: inherit;
|
||||
}
|
||||
abbr[title] {
|
||||
text-decoration: underline dotted;
|
||||
}
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
table {
|
||||
text-indent: 0;
|
||||
border-color: inherit;
|
||||
}
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit;
|
||||
font-size: 100%;
|
||||
line-height: 1.15;
|
||||
margin: 0;
|
||||
}
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
[type='button'],
|
||||
[type='reset'],
|
||||
[type='submit'],
|
||||
button {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
::-moz-focus-inner {
|
||||
border-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
:-moz-focusring {
|
||||
outline: 1px dotted ButtonText;
|
||||
}
|
||||
:-moz-ui-invalid {
|
||||
box-shadow: none;
|
||||
}
|
||||
legend {
|
||||
padding: 0;
|
||||
}
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
::-webkit-inner-spin-button,
|
||||
::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
[type='search'] {
|
||||
-webkit-appearance: textfield;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button;
|
||||
font: inherit;
|
||||
}
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
:root {
|
||||
--blaze-primary: #ff9400;
|
||||
--blaze-bg: #fff8ee;
|
||||
--blaze-text: #120c02;
|
||||
}
|
||||
|
||||
main {
|
||||
color: var(--blaze-text);
|
||||
max-width: 50rem;
|
||||
width: 100%;
|
||||
padding: 1rem;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>{{~ it.body }}</main>
|
||||
</body>
|
||||
</html>
|
||||
42
templates/results.eta
Normal file
42
templates/results.eta
Normal file
@@ -0,0 +1,42 @@
|
||||
{{~ include("./search.eta", it) }}
|
||||
<ol class="blaze_results">
|
||||
{{ it.results.forEach(function(result){ }}
|
||||
<li>
|
||||
<a href="{{= result.url }}">
|
||||
<article>
|
||||
<pre>{{= result.url }}</pre>
|
||||
<h2>{{= result.title }}</h2>
|
||||
<p>{{~ result.description }}</p>
|
||||
</article>
|
||||
</a>
|
||||
</li>
|
||||
{{ }) }}
|
||||
</ol>
|
||||
<style>
|
||||
.blaze_results li {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.blaze_results a {
|
||||
color: inherit;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
.blaze_results pre {
|
||||
margin: 0;
|
||||
overflow: auto;
|
||||
font-size: 0.75em;
|
||||
}
|
||||
.blaze_results p {
|
||||
margin: 0;
|
||||
}
|
||||
.blaze_results h2 {
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
ol.blaze_results {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
48
templates/search.eta
Normal file
48
templates/search.eta
Normal file
@@ -0,0 +1,48 @@
|
||||
<form class="blaze_form" action="/search" method="get">
|
||||
<a style="font-size: 2rem; font-weight: bold" href="/" data-preserve-link>Bla⚡️e</a>
|
||||
<input type="search" name="q" placeholder="search something..." value="{{= it.needle }}" />
|
||||
<button type="submit">Search 🔎</button>
|
||||
</form>
|
||||
<style>
|
||||
form.blaze_form {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
align-items: flex-end;
|
||||
padding: 0.5rem;
|
||||
border: 2px dashed black;
|
||||
}
|
||||
|
||||
.blaze_form a {
|
||||
text-decoration: inherit;
|
||||
color: inherit;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
.blaze_form input,
|
||||
.blaze_form button {
|
||||
border-radius: 0;
|
||||
background-color: var(--blaze-bg);
|
||||
color: var(--blaze-text);
|
||||
border: 2px solid var(--blaze-primary);
|
||||
}
|
||||
.blaze_form input {
|
||||
padding: 0.25rem 0.25rem;
|
||||
min-width: 10rem;
|
||||
flex: 1;
|
||||
}
|
||||
.blaze_form button {
|
||||
padding: 0.25rem 0.5rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 30rem) {
|
||||
form.blaze_form {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.blaze_form input,
|
||||
.blaze_form button {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user