-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
92 lines (88 loc) · 3.88 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
<!doctype html>
<html lang="en" data-theme="dark">
<head>
<meta charset="utf-8">
<title>Web page data URI generator</title>
<meta name="description" content="Self-contained web page data URI generator.">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://unpkg.com/@picocss/[email protected]/css/pico.min.css" integrity="sha384-3edOW8hbyoE5dcN5KLGzXBJ7ObwLWlQTONfez9ieFk2/YbX+mo7NbktAT69X+xZK" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Data URI site generator</h1>
<p>
Create a web page contained inside a link that can be sent to others. No hosting needed.
</p>
<a href="https://github.com/mattiasw/self-contained" class="github">GitHub repo</a>
<main>
<div class="grid import-container import-container--collapsed">
<button name="show-import" class="outline">Import from previous data URI</button>
<label>
Import from previous data URI:
<input type="text" name="import">
</label>
<div>
<button name="import-button">Import</button>
</div>
</div>
<div class="grid">
<form>
<label>
HTML:
<textarea name="site-content" class="site-content" autocorrect="off" spellcheck="false"><!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My self-contained web page</title>
<meta name="description" content="Self-contained web page data URI generator.">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://unpkg.com/@picocss/[email protected]/css/pico.min.css" integrity="sha384-3edOW8hbyoE5dcN5KLGzXBJ7ObwLWlQTONfez9ieFk2/YbX+mo7NbktAT69X+xZK" crossorigin="anonymous">
<style>
h1 {
text-align: center;
}
</style>
</head>
<body>
<main class="container">
<h1>Hello World!</h1>
<button id="button">Clicked <span id="num-clicks">0</span> time(s)</button>
</main>
<script>
(function () {
let numClicks = 0;
document.addEventListener('click', function () {
numClicks++;
document.querySelector('#num-clicks').textContent = numClicks;
});
}());
</script>
</body>
</html>
</textarea>
</label>
<div class="grid">
<label>
<input type="checkbox" name="minify">
Minify (keep unchecked if you want to save the data URI to continue later)
</label>
</div>
<div class="grid">
<button type="submit" class="generate-button">Generate</button>
<button type="button" class="copy-button" disabled>Copy data URI</button>
</div>
<label>
Data URI:
<textarea name="data-uri" class="output" readonly></textarea>
<small>Size: <span class="size">-</span></small>
</label>
</form>
<div>
Preview:
<iframe class="preview" src="about:blank"></iframe>
</div>
</div>
</main>
<script src="script.js" type="module"></script>
</body>
</html>