index.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!-- templates/index.html -->
  2. <!DOCTYPE html>
  3. <html lang="zh-CN">
  4. <head>
  5. <meta charset="UTF-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>短网址生成器</title>
  9. <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0-alpha1/css/bootstrap.min.css" rel="stylesheet">
  10. <style>
  11. body {
  12. font-family: Arial, sans-serif;
  13. margin: 20px;
  14. }
  15. h1, h2, p {
  16. text-align: center;
  17. }
  18. form {
  19. max-width: 400px;
  20. margin: 20px auto;
  21. }
  22. input {
  23. width: 100%;
  24. padding: 10px;
  25. margin: 8px 0;
  26. box-sizing: border-box;
  27. }
  28. button {
  29. background-color: #4CAF50;
  30. color: white;
  31. padding: 10px 15px;
  32. border: none;
  33. border-radius: 5px;
  34. cursor: pointer;
  35. width: 100%;
  36. }
  37. button:hover {
  38. background-color: #45a049;
  39. }
  40. .result {
  41. margin: 20px;
  42. padding: 20px;
  43. border: 1px solid #ddd;
  44. border-radius: 5px;
  45. }
  46. </style>
  47. </head>
  48. <body>
  49. <div class="container">
  50. <h1 class="mt-5">短网址生成器</h1>
  51. <form class="mt-4" action="/shorten" method="post">
  52. <div class="mb-3">
  53. <label for="url" class="form-label">输入原始网址:</label>
  54. <input type="url" id="url" name="url" class="form-control" placeholder="https://example.com" required>
  55. </div>
  56. <button type="submit" class="btn btn-primary">生成短网址</button>
  57. </form>
  58. {% block content %}{% endblock %}
  59. </div>
  60. <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
  61. </body>
  62. </html>