Xlnk commited on
Commit
74e191a
·
verified ·
1 Parent(s): cee81f7

Update templates/edit.html

Browse files
Files changed (1) hide show
  1. templates/edit.html +165 -165
templates/edit.html CHANGED
@@ -1,166 +1,166 @@
1
- <!DOCTYPE html>
2
- <html>
3
-
4
- <head>
5
- <title>Edit {{file}} | x0HOST</title>
6
- <style>
7
- * {
8
- box-sizing: border-box
9
- }
10
-
11
- body {
12
- background: #020617;
13
- color: #fff;
14
- font-family: system-ui;
15
- padding: 30px;
16
- margin: 0
17
- }
18
-
19
- .container {
20
- max-width: 1200px;
21
- margin: 0 auto
22
- }
23
-
24
- h1 {
25
- color: #22c55e;
26
- font-size: 1.4rem;
27
- margin-bottom: 5px
28
- }
29
-
30
- .breadcrumb {
31
- margin-bottom: 20px
32
- }
33
-
34
- .breadcrumb a {
35
- color: #22c55e;
36
- text-decoration: none
37
- }
38
-
39
- .editor-wrap {
40
- background: #0f172a;
41
- border-radius: 12px;
42
- overflow: hidden;
43
- border: 1px solid #1e293b
44
- }
45
-
46
- .toolbar {
47
- background: #1e293b;
48
- padding: 12px 16px;
49
- display: flex;
50
- justify-content: space-between;
51
- align-items: center
52
- }
53
-
54
- .file-path {
55
- font-family: monospace;
56
- color: #94a3b8;
57
- font-size: 14px
58
- }
59
-
60
- textarea {
61
- width: 100%;
62
- height: calc(100vh - 250px);
63
- min-height: 400px;
64
- background: #0f172a;
65
- color: #e2e8f0;
66
- border: none;
67
- padding: 20px;
68
- font-family: 'Fira Code', 'Consolas', monospace;
69
- font-size: 14px;
70
- line-height: 1.6;
71
- resize: vertical;
72
- outline: none
73
- }
74
-
75
- textarea:focus {
76
- background: #0a0f1a
77
- }
78
-
79
- .actions {
80
- display: flex;
81
- gap: 10px
82
- }
83
-
84
- .btn {
85
- padding: 10px 20px;
86
- border-radius: 8px;
87
- border: none;
88
- cursor: pointer;
89
- font-weight: 600;
90
- transition: all 0.2s
91
- }
92
-
93
- .btn-save {
94
- background: #22c55e;
95
- color: #000
96
- }
97
-
98
- .btn-save:hover {
99
- background: #16a34a
100
- }
101
-
102
- .btn-cancel {
103
- background: #334155;
104
- color: #fff
105
- }
106
-
107
- .btn-cancel:hover {
108
- background: #475569
109
- }
110
-
111
- .btn-preview {
112
- background: #3b82f6;
113
- color: #fff
114
- }
115
-
116
- .btn-preview:hover {
117
- background: #2563eb
118
- }
119
- </style>
120
- </head>
121
-
122
- <body>
123
- <div class="container">
124
- <div class="breadcrumb">
125
- <a href="/dashboard">Dashboard</a> / <a href="/files/{{site_id}}">{{site_id}}</a> /
126
- <strong>{{file}}</strong>
127
- </div>
128
-
129
- <form method="post" action="/save/{{site_id}}/{{file}}">
130
- <div class="editor-wrap">
131
- <div class="toolbar">
132
- <span class="file-path">📄 {{file}}</span>
133
- <div class="actions">
134
- <a href="/h/{{site_id}}/{{file}}" target="_blank" class="btn btn-preview">👁️ Preview</a>
135
- <a href="/files/{{site_id}}" class="btn btn-cancel">Cancel</a>
136
- <button type="submit" class="btn btn-save">💾 Save</button>
137
- </div>
138
- </div>
139
- <textarea name="content" spellcheck="false" autofocus>{{content}}</textarea>
140
- </div>
141
- </form>
142
- </div>
143
-
144
- <script>
145
- // Ctrl+S to save
146
- document.addEventListener('keydown', function (e) {
147
- if ((e.ctrlKey || e.metaKey) && e.key === 's') {
148
- e.preventDefault();
149
- document.querySelector('form').submit();
150
- }
151
- });
152
-
153
- // Tab key support in textarea
154
- document.querySelector('textarea').addEventListener('keydown', function (e) {
155
- if (e.key === 'Tab') {
156
- e.preventDefault();
157
- const start = this.selectionStart;
158
- const end = this.selectionEnd;
159
- this.value = this.value.substring(0, start) + ' ' + this.value.substring(end);
160
- this.selectionStart = this.selectionEnd = start + 2;
161
- }
162
- });
163
- </script>
164
- </body>
165
-
166
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <title>Edit {{file}} | h</title>
6
+ <style>
7
+ * {
8
+ box-sizing: border-box
9
+ }
10
+
11
+ body {
12
+ background: #020617;
13
+ color: #fff;
14
+ font-family: system-ui;
15
+ padding: 30px;
16
+ margin: 0
17
+ }
18
+
19
+ .container {
20
+ max-width: 1200px;
21
+ margin: 0 auto
22
+ }
23
+
24
+ h1 {
25
+ color: #22c55e;
26
+ font-size: 1.4rem;
27
+ margin-bottom: 5px
28
+ }
29
+
30
+ .breadcrumb {
31
+ margin-bottom: 20px
32
+ }
33
+
34
+ .breadcrumb a {
35
+ color: #22c55e;
36
+ text-decoration: none
37
+ }
38
+
39
+ .editor-wrap {
40
+ background: #0f172a;
41
+ border-radius: 12px;
42
+ overflow: hidden;
43
+ border: 1px solid #1e293b
44
+ }
45
+
46
+ .toolbar {
47
+ background: #1e293b;
48
+ padding: 12px 16px;
49
+ display: flex;
50
+ justify-content: space-between;
51
+ align-items: center
52
+ }
53
+
54
+ .file-path {
55
+ font-family: monospace;
56
+ color: #94a3b8;
57
+ font-size: 14px
58
+ }
59
+
60
+ textarea {
61
+ width: 100%;
62
+ height: calc(100vh - 250px);
63
+ min-height: 400px;
64
+ background: #0f172a;
65
+ color: #e2e8f0;
66
+ border: none;
67
+ padding: 20px;
68
+ font-family: 'Fira Code', 'Consolas', monospace;
69
+ font-size: 14px;
70
+ line-height: 1.6;
71
+ resize: vertical;
72
+ outline: none
73
+ }
74
+
75
+ textarea:focus {
76
+ background: #0a0f1a
77
+ }
78
+
79
+ .actions {
80
+ display: flex;
81
+ gap: 10px
82
+ }
83
+
84
+ .btn {
85
+ padding: 10px 20px;
86
+ border-radius: 8px;
87
+ border: none;
88
+ cursor: pointer;
89
+ font-weight: 600;
90
+ transition: all 0.2s
91
+ }
92
+
93
+ .btn-save {
94
+ background: #22c55e;
95
+ color: #000
96
+ }
97
+
98
+ .btn-save:hover {
99
+ background: #16a34a
100
+ }
101
+
102
+ .btn-cancel {
103
+ background: #334155;
104
+ color: #fff
105
+ }
106
+
107
+ .btn-cancel:hover {
108
+ background: #475569
109
+ }
110
+
111
+ .btn-preview {
112
+ background: #3b82f6;
113
+ color: #fff
114
+ }
115
+
116
+ .btn-preview:hover {
117
+ background: #2563eb
118
+ }
119
+ </style>
120
+ </head>
121
+
122
+ <body>
123
+ <div class="container">
124
+ <div class="breadcrumb">
125
+ <a href="/dashboard">Dashboard</a> / <a href="/files/{{site_id}}">{{site_id}}</a> /
126
+ <strong>{{file}}</strong>
127
+ </div>
128
+
129
+ <form method="post" action="/save/{{site_id}}/{{file}}">
130
+ <div class="editor-wrap">
131
+ <div class="toolbar">
132
+ <span class="file-path">📄 {{file}}</span>
133
+ <div class="actions">
134
+ <a href="/h/{{site_id}}/{{file}}" target="_blank" class="btn btn-preview">👁️ Preview</a>
135
+ <a href="/files/{{site_id}}" class="btn btn-cancel">Cancel</a>
136
+ <button type="submit" class="btn btn-save">💾 Save</button>
137
+ </div>
138
+ </div>
139
+ <textarea name="content" spellcheck="false" autofocus>{{content}}</textarea>
140
+ </div>
141
+ </form>
142
+ </div>
143
+
144
+ <script>
145
+ // Ctrl+S to save
146
+ document.addEventListener('keydown', function (e) {
147
+ if ((e.ctrlKey || e.metaKey) && e.key === 's') {
148
+ e.preventDefault();
149
+ document.querySelector('form').submit();
150
+ }
151
+ });
152
+
153
+ // Tab key support in textarea
154
+ document.querySelector('textarea').addEventListener('keydown', function (e) {
155
+ if (e.key === 'Tab') {
156
+ e.preventDefault();
157
+ const start = this.selectionStart;
158
+ const end = this.selectionEnd;
159
+ this.value = this.value.substring(0, start) + ' ' + this.value.substring(end);
160
+ this.selectionStart = this.selectionEnd = start + 2;
161
+ }
162
+ });
163
+ </script>
164
+ </body>
165
+
166
  </html>