mirror of
https://github.com/txtdot/txtdot
synced 2024-10-18 22:50: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 { FastifyInstance } from "fastify";
|
||||||
import { engineList } from "../handlers/main";
|
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) {
|
export default async function parseRoute(fastify: FastifyInstance) {
|
||||||
fastify.get("/start", async (_, reply) => {
|
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>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
@ -6,32 +7,74 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="description" content="<%= desc %>">
|
<meta name="description" content="<%= desc %>">
|
||||||
<title>txt. main page</title>
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form action="/">
|
<main>
|
||||||
<label for="url">URL</label>
|
<header>
|
||||||
<input type="text" name="url">
|
<h1>txt.</h1>
|
||||||
<p>
|
<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>
|
<label for="engine">Engine</label>
|
||||||
<select name="engine">
|
<select name="engine">
|
||||||
<option selected value>Standard</option>
|
<option value="" selected>Default</option>
|
||||||
<% engineList.forEach((engine)=>{
|
<% engineList.forEach((engine) => { %>
|
||||||
%>
|
|
||||||
<option value="<%= engine %>">
|
<option value="<%= engine %>">
|
||||||
<%= engine %>
|
<%= engine %>
|
||||||
</option>
|
</option>
|
||||||
<% }) %>
|
<% }) %>
|
||||||
</select>
|
</select>
|
||||||
</p>
|
</div>
|
||||||
<p>
|
<div class="input">
|
||||||
<label for="format">Format</label>
|
<label for="format">Format</label>
|
||||||
<select name="format">
|
<select name="format">
|
||||||
<option selected value>Standard</option>
|
<option value="html" selected>HTML</option>
|
||||||
<option value="html">HTML</option>
|
|
||||||
<option value="text">Text</option>
|
<option value="text">Text</option>
|
||||||
</select>
|
</select>
|
||||||
</p>
|
</div>
|
||||||
<input type="submit">
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user