From 6e4a9750b4476871207a522e0e99eb060c05ba28 Mon Sep 17 00:00:00 2001 From: vmandic Date: Mon, 29 Jan 2024 21:59:32 +0100 Subject: [PATCH] Add more CSS magic and input for URL --- src/static/crawl.html | 1 + src/static/css/styles.css | 82 +++++++++++++++++++++++++++++++++------ src/static/index.html | 25 +++++++----- src/static/js/index.js | 6 --- 4 files changed, 88 insertions(+), 26 deletions(-) diff --git a/src/static/crawl.html b/src/static/crawl.html index be8593c..f7e831b 100644 --- a/src/static/crawl.html +++ b/src/static/crawl.html @@ -13,6 +13,7 @@ name="description" content="Tris - A simple and free web crawler. Tris recursively crawls a website's domain HTML pages and collect its links, built by Vedran Mandić." /> + diff --git a/src/static/css/styles.css b/src/static/css/styles.css index 745cfd2..9461f78 100644 --- a/src/static/css/styles.css +++ b/src/static/css/styles.css @@ -1,5 +1,39 @@ :root { - font-size: 15px; + font-size: 15px; +} + +body, +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: "Raleway", Verdana, sans-serif; +} + +input[type="url"] { + border: 1px solid #999; + padding: .2rem .4rem; + width: 30vw; + outline: none; + transition: border-color 0.3s ease, box-shadow 0.3s ease; +} + +input[type="url"]:hover { + border-color: 1px solid #666; + box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.25); +} + +input[type="submit"] { + padding: .3rem .6rem; + background-color: #eee; + transition: background-color 0.3s ease; +} + +input[type="submit"]:hover { + background-color: #aaa; + cursor: pointer; } .container { @@ -7,23 +41,30 @@ } a { - color: rgb(112, 71, 200); + color: #dc143c; + background-color: #eee; + position: relative; + display: inline-block; + transition: transform 0.3s ease; + padding: 0 .4rem; } a:hover { - color: rgb(64, 40, 117); + color: #6e091e; + transform: skew(0, 1deg); } + h1 { font-size: 2rem; font-weight: bold; - margin-bottom: .5rem; + margin-bottom: 0.5rem; } h2 { font-size: 1.2rem; font-weight: bold; - margin: .5rem 0; + margin: 0.5rem 0; } pre { @@ -33,7 +74,7 @@ pre { span.result { display: inline-block; - margin: .5rem 0; + margin: 0.5rem 0; } header { @@ -46,14 +87,33 @@ header { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } +label input[type="checkbox"] { + display: inline-block; + position: relative; + top: 3px; +} + +footer { + background: #eee; +} + +footer a { + padding: 0 +}; + @media (max-width: 768px) { :root { font-size: 12px; } -} -label input[type="checkbox"] { - display: inline-block; - position: relative; - top: 3px; + input[type="url"] { + width: 100%; + margin: .4rem 0; + display: block; + } + + input[type="submit"] { + width: 100%; + display: block; + } } diff --git a/src/static/index.html b/src/static/index.html index 53f89fb..304409b 100644 --- a/src/static/index.html +++ b/src/static/index.html @@ -11,6 +11,7 @@ name="description" content="Tris - A simple and free web crawler. Tris recursively crawls a website's domain HTML pages and collect its links, built by Vedran Mandić." /> + @@ -92,14 +93,17 @@

How to use:


- Navigate to the following link (or modify the url query string - parameter) to start crawling it by using the settings stated below: - - - -
+ Navigate or modify the target domain to start crawling it by using the settings stated below. +

+
+ + +
+

-

Current crawler settings:

Loading settings...

@@ -112,14 +116,17 @@

Source Code:

>https://github.com/vmandic/tris-simple-spider-scraper

+ + diff --git a/src/static/js/index.js b/src/static/js/index.js index 3ff2240..7937aa3 100644 --- a/src/static/js/index.js +++ b/src/static/js/index.js @@ -15,12 +15,6 @@ const loadCrawlerSettings = () => { xhr.send(); }; -const setCrawlLink = () => { - const absoluteLink = document.querySelector("#crawl-link").getAttribute("href"); - document.querySelector("#crawl-link-text").innerHTML = window.location.origin + absoluteLink; -}; - document.addEventListener("DOMContentLoaded", function () { - setCrawlLink(); loadCrawlerSettings(); });