gave it some style

This commit is contained in:
dez 2024-03-28 08:19:29 +01:00
parent 35ab82393c
commit 0d8e354d64
3 changed files with 155 additions and 5 deletions

View file

@ -28,7 +28,7 @@ var templates = template.Must(template.New("").Funcs(funcs).ParseFiles("template
func main() {
http.HandleFunc("/", handleSearch)
http.HandleFunc("/search", handleSearch)
fmt.Println("Server is listening on port 5000...")
fmt.Println("Server is listening on http://localhost:5000")
log.Fatal(http.ListenAndServe(":5000", nil))
}

View file

@ -5,15 +5,70 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TailsX</title>
<title>TailsGo</title>
<link rel="stylesheet" type="text/css" href="./style.css">
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f5f5f5; /* Change the background color to your preference */
font-family: Arial, sans-serif; /* Change the font family to your preference */
}
.search-container {
text-align: center;
background-color: #fff; /* Change the background color to your preference */
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Add a subtle shadow effect */
}
.search-container h1 {
font-size: 36px;
color: #333; /* Change the title color to your preference */
margin-bottom: 20px;
}
.search-container input[type="text"] {
width: 80%;
padding: 10px;
border: 1px solid #ccc; /* Add a border */
border-radius: 4px;
font-size: 16px;
margin-bottom: 20px;
}
.search-container .search-button-wrapper {
display: flex;
justify-content: center;
}
.search-container .search-button-wrapper button {
padding: 10px 20px;
margin: 0 10px;
font-size: 16px;
background-color: #007bff; /* Change the button background color to your preference */
color: #fff; /* Change the button text color to your preference */
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.search-container .search-button-wrapper button:hover {
background-color: #0056b3; /* Change the button hover background color to your preference */
}
</style>
</head>
<body>
<form action="/search" class="search-container" method="post" autocomplete="off">
<h1>Tails<span class="X">Go</span></h1>
<input type="text" name="q" autofocus />
<input type="submit" class="hide" />
<div class="search-button-wrapper">
<button name="t" type="submit">Search with TailsGo</button>
<button name="t" type="submit">Search images with TailsGo</button>

View file

@ -7,13 +7,108 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ .Title }}</title>
<link rel="stylesheet" type="text/css" href="/static/style.css">
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif; /* Change the font family to your preference */
background-color: #f5f5f5; /* Change the background color to your preference */
}
.results-search-container {
text-align: center;
background-color: #fff; /* Change the background color to your preference */
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Add a subtle shadow effect */
margin: 20px auto;
max-width: 600px; /* Adjust the max-width to your preference */
}
.results-search-container h1 {
font-size: 24px;
color: #333; /* Change the title color to your preference */
margin-bottom: 20px;
}
.results-search-container input[type="text"] {
width: calc(100% - 120px); /* Adjust the width to leave space for the button */
padding: 10px;
border: 1px solid #ccc; /* Add a border */
border-radius: 4px;
font-size: 16px;
margin-bottom: 20px;
}
.results-search-container .sub-search-button-wrapper {
display: flex;
justify-content: center;
}
.results-search-container .sub-search-button-wrapper button {
padding: 10px 20px;
margin: 0 10px;
font-size: 16px;
background-color: #007bff; /* Change the button background color to your preference */
color: #fff; /* Change the button text color to your preference */
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.results-search-container .sub-search-button-wrapper button img {
vertical-align: middle;
margin-right: 5px; /* Adjust the margin between the icon and text */
}
.results-search-container .sub-search-button-wrapper button:hover {
background-color: #0056b3; /* Change the button hover background color to your preference */
}
.fetched {
text-align: center;
margin-top: 20px;
}
.snip,
.snipp {
text-align: center;
margin-top: 20px;
}
.results {
background-color: #fff; /* Change the background color to your preference */
padding: 20px;
margin: 20px auto;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Add a subtle shadow effect */
max-width: 600px; /* Adjust the max-width to your preference */
}
.results a {
text-decoration: none;
color: #007bff; /* Change the link color to your preference */
font-weight: bold;
}
.results h3 {
font-size: 20px;
margin-top: 10px;
margin-bottom: 5px;
}
.results p {
font-size: 16px;
margin-bottom: 0;
}
</style>
</head>
<body>
<form action="/search" class="results-search-container" method="post" autocomplete="off">
<h1 class="logomobile"><a class="no-decoration" href="./">Tails<span class="X">Go</span></a></h1>
<input type="text" name="q" value="{{ .Query }}" />
<input type="submit" class="hide" />
<div class="sub-search-button-wrapper">
<button name="t"><img src="/static/searchicon.png" alt="text result" />General</button>
</div>