Refactor: / (main.ts) -> /get (get.ts), /start (start.ts) -> / (index.ts)
This commit is contained in:
14
templates/get.ejs
Normal file
14
templates/get.ejs
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<%= parsed.lang %>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title><%= parsed.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<h1><%= parsed.title %></h1>
|
||||
<main><%- parsed.content %></main>
|
||||
</body>
|
||||
</html>
|
@ -1,14 +1,80 @@
|
||||
<% 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 lang="<%= parsed.lang %>">
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title><%= parsed.title %></title>
|
||||
<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>
|
||||
<h1><%= parsed.title %></h1>
|
||||
<main><%- parsed.content %></main>
|
||||
<main>
|
||||
<header>
|
||||
<h1>txt.</h1>
|
||||
<p><%= desc %></p>
|
||||
</header>
|
||||
<form action="/get" 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 value="" selected>Default</option>
|
||||
<% engineList.forEach((engine) => { %>
|
||||
<option value="<%= engine %>">
|
||||
<%= engine %>
|
||||
</option>
|
||||
<% }) %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input">
|
||||
<label for="format">Format</label>
|
||||
<select name="format">
|
||||
<option value="html" selected>HTML</option>
|
||||
<option value="text">Text</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,80 +0,0 @@
|
||||
<% 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>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<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>
|
||||
<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 value="" selected>Default</option>
|
||||
<% engineList.forEach((engine) => { %>
|
||||
<option value="<%= engine %>">
|
||||
<%= engine %>
|
||||
</option>
|
||||
<% }) %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input">
|
||||
<label for="format">Format</label>
|
||||
<select name="format">
|
||||
<option value="html" selected>HTML</option>
|
||||
<option value="text">Text</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user