mirror of
https://github.com/txtdot/txtdot
synced 2024-10-18 14:40:19 +03:00
Basic HTML + CSS; description moved to template
This commit is contained in:
parent
f688304c07
commit
4dbc4fc8a0
@ -1,13 +1,8 @@
|
||||
import { FastifyInstance } from "fastify";
|
||||
import { engineList } from "../handlers/main";
|
||||
|
||||
const desc = (
|
||||
"txtdot is a HTTP proxy that parses text, links and pictures " +
|
||||
"from pages reducing internet traffic, removing ads and heavy scripts"
|
||||
);
|
||||
|
||||
export default async function parseRoute(fastify: FastifyInstance) {
|
||||
fastify.get("/start", async (_, reply) => {
|
||||
return reply.view("/templates/start.ejs", { desc, engineList });
|
||||
return reply.view("/templates/start.ejs", { engineList });
|
||||
});
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
<% const desc = "txtdot is a HTTP proxy that parses text, links and pictures from pages reducing internet traffic, removing ads and heavy scripts" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@ -6,32 +7,74 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="description" content="<%= desc %>">
|
||||
<title>txt. main page</title>
|
||||
<!-- CSS must be moved to a separate file later -->
|
||||
<style>
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
main {
|
||||
max-width: 50rem;
|
||||
width: fit-content;
|
||||
margin: auto;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.input-grid {
|
||||
display: grid;
|
||||
grid-template-columns: auto min-content;
|
||||
width: fit-content;
|
||||
}
|
||||
.input-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
#url {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form action="/">
|
||||
<label for="url">URL</label>
|
||||
<input type="text" name="url">
|
||||
<p>
|
||||
<main>
|
||||
<header>
|
||||
<h1>txt.</h1>
|
||||
<p><%= desc %></p>
|
||||
</header>
|
||||
<form action="/" method="get" class="input-grid">
|
||||
<div class="input">
|
||||
<input type="text" name="url" id="url" placeholder="URL">
|
||||
</div>
|
||||
<div class="input">
|
||||
<input type="submit" id="submit" value="Parse">
|
||||
</div>
|
||||
<div class="input-row">
|
||||
<div class="input">
|
||||
<label for="engine">Engine</label>
|
||||
<select name="engine">
|
||||
<option selected value>Standard</option>
|
||||
<% engineList.forEach((engine)=>{
|
||||
%>
|
||||
<option value="" selected>Default</option>
|
||||
<% engineList.forEach((engine) => { %>
|
||||
<option value="<%= engine %>">
|
||||
<%= engine %>
|
||||
</option>
|
||||
<% }) %>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
</div>
|
||||
<div class="input">
|
||||
<label for="format">Format</label>
|
||||
<select name="format">
|
||||
<option selected value>Standard</option>
|
||||
<option value="html">HTML</option>
|
||||
<option value="html" selected>HTML</option>
|
||||
<option value="text">Text</option>
|
||||
</select>
|
||||
</p>
|
||||
<input type="submit">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user