-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
104 lines (102 loc) · 2.77 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Editor</title>
<link rel="icon" href="/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/icons/safari-pinned-tab.svg" color="#264de3">
<meta name="msapplication-TileColor" content="#2d89ef">
<meta name="theme-color" content="#364663">
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #fff;
}
nav {
display: flex;
flex-flow: row nowrap;
justify-content: flex-start;
align-items: center;
gap: 2ch;
padding: 0 2ch;
color: #fff;
background-color: hsl(219, 29%, 30%);
border-radius: 1rem;
box-shadow: 0px 5px 20px -10px #000b;
}
#logo {
width: 2rem;
height: 2rem;
filter: saturate(2);
}
nav h1 {
margin: 0;
font-weight: 600;
}
nav ul {
display: flex;
flex-flow: row wrap;
justify-content: flex-start;
align-items: center;
gap: 1ch 4ch;
margin-left: auto;
list-style: none;
}
nav ul a {
color: inherit;
}
.tagline {
position: relative;
display: block;
width: fit-content;
padding: 0.1em 1em 0.3em;
color: #fff;
background-color: hsl(219, 29%, 30%);
border-radius: 1em;
}
#editor,
#output {
display: block;
max-height: min(40rem, 40vh);
border-radius: 0.4rem;
overflow: auto;
}
#output {
min-height: 5rem;
padding: 0.5ch 1ch;
white-space: pre;
border: 1px solid #1e1e1e;
}
</style>
<script type="module" defer>
import { CSSEditor } from '/src/index.ts';
const editor = new CSSEditor('#editor');
const output = document.getElementById('output');
editor.onUpdate(() => output.innerText = editor.stringify() );
</script>
</head>
<body>
<header>
<nav>
<img id="logo" src="/src/assets/branding/logo.svg" alt="logo" width="50" height="50">
<h1>CSS Editor</h1>
<ul>
<li><a href="https://www.npmjs.com/package/@css-canvas/editor" target="_blank" rel="noreferrer" title="Install CSS Editor with NPM">Install</a></li>
<li><a href="https://github.com/CSS-Canvas/CSS-Editor" target="_blank" rel="noreferrer" title="Check out the source on GitHub">Source</a></li>
</ul>
</nav>
</header>
<main>
<p class="tagline">An optimized editor, just for CSS.</p>
<h2>Editor:</h2>
<div id="editor"></div>
<h2>Output:</h2>
<output id="output"></output>
</main>
</body>
</html>