apps/sipp/server/templates/index.html 2.1 K raw
1
{{define "index.html"}}<!doctype html>
2
<html lang="en">
3
  <head>
4
    <meta charset="UTF-8" />
5
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
    <meta name="theme-color" content="#121113" />
7
    <link rel="stylesheet" href="/assets/darkmatter.css" />
8
    <link rel="stylesheet" href="/static/styles.css" />
9
    <link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png">
10
    <link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
11
    <link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
12
    <link rel="manifest" href="/static/site.webmanifest">
13
    <title>Sipp</title>
14
    <meta name="description" content="Minimal Code Sharing">
15
    <meta property="og:url" content="{{.BaseURL}}">
16
    <meta property="og:type" content="website">
17
    <meta property="og:title" content="Sipps">
18
    <meta property="og:description" content="Minimal Code Sharing">
19
    <meta property="og:image" content="{{.BaseURL}}/static/og.png">
20
    <meta name="twitter:card" content="summary_large_image">
21
    <meta property="twitter:url" content="{{.BaseURL}}">
22
    <meta name="twitter:title" content="Sipps">
23
    <meta name="twitter:description" content="Minimal Code Sharing">
24
    <meta name="twitter:image" content="{{.BaseURL}}/static/og.png">
25
  </head>
26
  <body>
27
    <div class="header">
28
      <a href="/" class="logo"><h1>SIPP</h1></a>
29
      <nav class="links">
30
        <a href="/admin">admin</a>
31
      </nav>
32
    </div>
33
    <form id="snippetForm" method="POST" action="/snippets">
34
      <div>
35
        <input placeholder="index.ts" type="text" id="name" name="name" required>
36
      </div>
37
      <div>
38
        <textarea placeholder="// paste your code here" id="content" name="content" required></textarea>
39
      </div>
40
      <button type="submit">Create Snippet</button>
41
    </form>
42
    <script>
43
      document.getElementById('content').addEventListener('keydown', (e) => {
44
        if (e.metaKey && e.key === 'Enter' || e.ctrlKey && e.key === 'Enter') {
45
          e.preventDefault();
46
          document.getElementById('snippetForm').requestSubmit();
47
        }
48
      });
49
    </script>
50
  </body>
51
</html>{{end}}