Pārlūkot izejas kodu

新增code-server样式代码

刘清 4 mēnešus atpakaļ
revīzija
861206c8e9

+ 4
- 0
media/favicon-dark-support.svg Parādīt failu

@@ -0,0 +1,4 @@
1
+<svg width="100%" height="100%" viewBox="0 0 147 147" xmlns="http://www.w3.org/2000/svg">
2
+  <style>@media (prefers-color-scheme: dark) {* { fill: white; }}</style>
3
+  <path d="m42.4214,39.655c-24.4057,0 -42.1554,13.1721 -42.1554,33.845c0,20.5814 18.4892,33.845 42.1554,33.845c23.6662,0 38.1803,-11.6171 38.7349,-28.7225l-21.0777,-0.4574c-0.9244,9.3303 -9.1059,15.1845 -17.6572,15.1845c-11.7406,0 -20.4306,-7.5922 -20.4306,-19.8496c0,-12.2574 8.69,-19.9868 20.4306,-20.2155c8.5513,-0.183 16.9177,5.9457 17.4723,15.276l21.0777,-0.6403c-0.4622,-16.8311 -14.1442,-28.2652 -38.55,-28.2652zm48.8446,2l55.468,0l0,64.0311l-55.468,0l0,-64.0311z" clip-rule="evenodd" fill-rule="evenodd"/>
4
+</svg>

Binārs
media/favicon.ico Parādīt failu


+ 3
- 0
media/favicon.svg Parādīt failu

@@ -0,0 +1,3 @@
1
+<svg width="100%" height="100%" viewBox="0 0 147 147" xmlns="http://www.w3.org/2000/svg">
2
+  <path d="m42.4214,39.655c-24.4057,0 -42.1554,13.1721 -42.1554,33.845c0,20.5814 18.4892,33.845 42.1554,33.845c23.6662,0 38.1803,-11.6171 38.7349,-28.7225l-21.0777,-0.4574c-0.9244,9.3303 -9.1059,15.1845 -17.6572,15.1845c-11.7406,0 -20.4306,-7.5922 -20.4306,-19.8496c0,-12.2574 8.69,-19.9868 20.4306,-20.2155c8.5513,-0.183 16.9177,5.9457 17.4723,15.276l21.0777,-0.6403c-0.4622,-16.8311 -14.1442,-28.2652 -38.55,-28.2652zm48.8446,2l55.468,0l0,64.0311l-55.468,0l0,-64.0311z" clip-rule="evenodd" fill-rule="evenodd"/>
3
+</svg>

Binārs
media/pwa-icon-192.png Parādīt failu


Binārs
media/pwa-icon-512.png Parādīt failu


Binārs
media/pwa-icon-maskable-192.png Parādīt failu


Binārs
media/pwa-icon-maskable-512.png Parādīt failu


Binārs
media/templates.png Parādīt failu


+ 33
- 0
pages/error.css Parādīt failu

@@ -0,0 +1,33 @@
1
+.error-display {
2
+  box-sizing: border-box;
3
+  padding: 20px;
4
+  text-align: center;
5
+}
6
+
7
+.error-display > .header {
8
+  font-size: 6rem;
9
+  margin: 0;
10
+}
11
+
12
+.error-display > .body {
13
+  color: #444;
14
+  color: light-dark(#444, #ccc);
15
+  font-size: 1.2rem;
16
+}
17
+
18
+.error-display > .links {
19
+  margin-top: 16px;
20
+}
21
+
22
+.error-display > .links > .link {
23
+  color: rgb(87, 114, 245);
24
+  text-decoration: none;
25
+}
26
+
27
+.error-display > .links > .link:hover {
28
+  text-decoration: underline;
29
+}
30
+
31
+.error-display .success {
32
+  color: green;
33
+}

+ 35
- 0
pages/error.html Parādīt failu

@@ -0,0 +1,35 @@
1
+<!doctype html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta
6
+      name="viewport"
7
+      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"
8
+    />
9
+    <meta
10
+      http-equiv="Content-Security-Policy"
11
+      content="style-src 'self'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;"
12
+    />
13
+    <meta name="color-scheme" content="light dark" />
14
+    <title>{{ERROR_TITLE}} - code-server</title>
15
+    <link rel="icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon-dark-support.svg" />
16
+    <link rel="alternate icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon.ico" />
17
+    <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
18
+    <link rel="apple-touch-icon" sizes="192x192" href="{{CS_STATIC_BASE}}/src/browser/media/pwa-icon-192.png" />
19
+    <link rel="apple-touch-icon" sizes="512x512" href="{{CS_STATIC_BASE}}/src/browser/media/pwa-icon-512.png" />
20
+    <link href="{{CS_STATIC_BASE}}/src/browser/pages/global.css" rel="stylesheet" />
21
+    <link href="{{CS_STATIC_BASE}}/src/browser/pages/error.css" rel="stylesheet" />
22
+    <meta id="coder-options" data-settings="{{OPTIONS}}" />
23
+  </head>
24
+  <body>
25
+    <div class="center-container">
26
+      <div class="error-display">
27
+        <h2 class="header">{{ERROR_HEADER}}</h2>
28
+        <div class="body">{{ERROR_BODY}}</div>
29
+        <div class="links">
30
+          <a class="link" href="{{BASE}}{{TO}}">go home</a>
31
+        </div>
32
+      </div>
33
+    </div>
34
+  </body>
35
+</html>

+ 101
- 0
pages/global.css Parādīt failu

@@ -0,0 +1,101 @@
1
+:root {
2
+  color-scheme: light dark;
3
+}
4
+
5
+html,
6
+body,
7
+#root {
8
+  height: 100%;
9
+  width: 100%;
10
+}
11
+
12
+body {
13
+  background: rgb(244, 247, 252);
14
+  background: light-dark(rgb(244, 247, 252), #111827);
15
+  color: #111;
16
+  color: light-dark(#111, #ddd);
17
+  margin: 0;
18
+  font-family:
19
+    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
20
+    "Segoe UI Emoji", "Segoe UI Symbol";
21
+  overflow: hidden;
22
+}
23
+
24
+input,
25
+button {
26
+  font-family: inherit;
27
+  font-size: 1rem;
28
+  line-height: 1rem;
29
+}
30
+
31
+.-button {
32
+  background-color: rgb(87, 114, 245);
33
+  background-color: light-dark(rgb(87, 114, 245), rgb(26, 86, 219));
34
+  border-radius: 5px;
35
+  border: none;
36
+  box-sizing: border-box;
37
+  color: white;
38
+  color: light-dark(white, white);
39
+  cursor: pointer;
40
+  padding: 18px 20px;
41
+  font-weight: 500;
42
+  text-decoration: none;
43
+}
44
+
45
+.center-container {
46
+  align-items: center;
47
+  box-sizing: border-box;
48
+  display: flex;
49
+  flex-direction: column;
50
+  justify-content: center;
51
+  min-height: 100%;
52
+  padding: 20px;
53
+  width: 100%;
54
+}
55
+
56
+.card-box {
57
+  background-color: rgb(250, 253, 258);
58
+  background-color: light-dark(rgb(250, 253, 258), #1f2937);
59
+  border-radius: 5px;
60
+  box-shadow:
61
+    light-dark(rgba(60, 66, 87, 0.117647), rgba(10, 10, 10, 0.617647)) 0px 7px 14px 0px,
62
+    rgba(0, 0, 0, 0.117647) 0px 3px 6px 0px;
63
+  max-width: 650px;
64
+  width: 100%;
65
+}
66
+
67
+.card-box > .header {
68
+  border-bottom: 1px solid #ddd;
69
+  border-bottom: 1px solid light-dark(#ddd, #111827);
70
+  color: #444;
71
+  color: light-dark(#444, #fff);
72
+  padding: 30px;
73
+}
74
+
75
+.card-box > .header > .main {
76
+  margin: 0;
77
+  font-size: 1.5rem;
78
+}
79
+
80
+.card-box > .header > .sub {
81
+  color: #555;
82
+  color: light-dark(#555, #9ca3af);
83
+  margin-top: 10px;
84
+}
85
+
86
+.card-box > .content {
87
+  padding: 40px;
88
+}
89
+
90
+.card-box > .content > .none {
91
+  margin: 2px 0;
92
+}
93
+
94
+.card-box + .card-box {
95
+  margin-top: 26px;
96
+}
97
+
98
+canvas {
99
+  top: 0;
100
+  left: 0;
101
+}

+ 67
- 0
pages/login.css Parādīt failu

@@ -0,0 +1,67 @@
1
+body {
2
+  min-height: 568px;
3
+  min-width: 320px;
4
+  overflow: auto;
5
+}
6
+
7
+.login-form {
8
+  display: flex;
9
+  flex-direction: column;
10
+  flex: 1;
11
+  justify-content: center;
12
+}
13
+
14
+.login-form > .field {
15
+  display: flex;
16
+  flex-direction: row;
17
+  width: 100%;
18
+}
19
+
20
+@media (max-width: 600px) {
21
+  .login-form > .field {
22
+    flex-direction: column;
23
+  }
24
+}
25
+
26
+.login-form > .error {
27
+  color: red;
28
+  margin-top: 16px;
29
+}
30
+
31
+.login-form > .field > .password {
32
+  background-color: rgb(244, 247, 252);
33
+  background-color: light-dark(rgb(244, 247, 252), #374151);
34
+  border-radius: 5px;
35
+  border: 1px solid #ddd;
36
+  border: 1px solid light-dark(#ddd, #4b5563);
37
+  box-sizing: border-box;
38
+  flex: 1;
39
+  padding: 16px;
40
+}
41
+
42
+.login-form > .field > .password::placeholder {
43
+  color: rgb(148 163 184);
44
+}
45
+
46
+.login-form > .field > .password:focus {
47
+  outline: 2px solid rgb(63, 131, 248);
48
+}
49
+
50
+.login-form > .user {
51
+  display: none;
52
+}
53
+
54
+.login-form > .field > .submit {
55
+  margin-left: 20px;
56
+}
57
+
58
+@media (max-width: 600px) {
59
+  .login-form > .field > .submit {
60
+    margin-left: 0px;
61
+    margin-top: 16px;
62
+  }
63
+}
64
+
65
+input {
66
+  -webkit-appearance: none;
67
+}

+ 62
- 0
pages/login.html Parādīt failu

@@ -0,0 +1,62 @@
1
+<!doctype html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <meta
6
+      name="viewport"
7
+      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"
8
+    />
9
+    <meta
10
+      http-equiv="Content-Security-Policy"
11
+      content="style-src 'self'; script-src 'self' 'unsafe-inline'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;"
12
+    />
13
+    <meta name="color-scheme" content="light dark" />
14
+    <title>{{I18N_LOGIN_TITLE}}</title>
15
+    <link rel="icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon-dark-support.svg" />
16
+    <link rel="alternate icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon.ico" />
17
+    <link rel="manifest" href="{{BASE}}/manifest.json" crossorigin="use-credentials" />
18
+    <link rel="apple-touch-icon" sizes="192x192" href="{{CS_STATIC_BASE}}/src/browser/media/pwa-icon-192.png" />
19
+    <link rel="apple-touch-icon" sizes="512x512" href="{{CS_STATIC_BASE}}/src/browser/media/pwa-icon-512.png" />
20
+    <link href="{{CS_STATIC_BASE}}/src/browser/pages/global.css" rel="stylesheet" />
21
+    <link href="{{CS_STATIC_BASE}}/src/browser/pages/login.css" rel="stylesheet" />
22
+    <meta id="coder-options" data-settings="{{OPTIONS}}" />
23
+  </head>
24
+  <body>
25
+    <div class="center-container">
26
+      <div class="card-box">
27
+        <div class="header">
28
+          <h1 class="main">{{WELCOME_TEXT}}</h1>
29
+          <div class="sub">{{I18N_LOGIN_BELOW}} {{PASSWORD_MSG}}</div>
30
+        </div>
31
+        <div class="content">
32
+          <form class="login-form" method="post">
33
+            <input class="user" type="text" autocomplete="username" />
34
+            <input id="base" type="hidden" name="base" value="{{BASE}}" />
35
+            <input id="href" type="hidden" name="href" value="" />
36
+            <div class="field">
37
+              <input
38
+                required
39
+                autofocus
40
+                class="password"
41
+                type="password"
42
+                placeholder="{{I18N_PASSWORD_PLACEHOLDER}}"
43
+                name="password"
44
+                autocomplete="current-password"
45
+              />
46
+              <input class="submit -button" value="{{I18N_SUBMIT}}" type="submit" />
47
+            </div>
48
+            {{ERROR}}
49
+          </form>
50
+        </div>
51
+      </div>
52
+    </div>
53
+    <script>
54
+      // Inform the backend about the path since the proxy might have rewritten
55
+      // it out of the headers and cookies must be set with absolute paths.
56
+      const el = document.getElementById("href")
57
+      if (el) {
58
+        el.value = location.href
59
+      }
60
+    </script>
61
+  </body>
62
+</html>

+ 2
- 0
robots.txt Parādīt failu

@@ -0,0 +1,2 @@
1
+User-agent: *
2
+Disallow: /