mirror of
https://github.com/aykhans/oh-my-url.git
synced 2025-07-03 01:15:22 +00:00
🎉 first commit
This commit is contained in:
82
app/templates/index.html
Normal file
82
app/templates/index.html
Normal file
@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Oh My URL</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 600px;
|
||||
margin: 50px auto;
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
label {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
input[type="url"] {
|
||||
padding: 8px;
|
||||
margin-bottom: 15px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 10px 15px;
|
||||
width: 20%;
|
||||
margin: 0 auto;
|
||||
font-size: medium;
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
background-color: #007bff;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
|
||||
button:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<h1>Oh My URL!</h1>
|
||||
<form action="/" method="post">
|
||||
{{ if .Error }}
|
||||
<label for="urlInput" style="color: red;">{{ .Error }}</label>
|
||||
{{ end }}
|
||||
<input type="url" id="urlInput" name="url" placeholder="https://example.com/" value="{{ if .MainURL }}{{ .MainURL }}{{ end }}" required>
|
||||
{{ if .ShortedURL }}
|
||||
<label for="urlOutput">Shortened URL: <a href="{{.ShortedURL}}" target="_blank">{{.ShortedURL}}</a></label>
|
||||
{{ end }}
|
||||
<button type="submit">Get URL</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user