-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
203 lines (179 loc) · 6.95 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE html>
<html>
<head>
<title>Meridian : Real Time Markdown Editor</title>
<link href="style.css" rel="stylesheet">
<link rel="favicon" href="./images/favicon.ico" />
<!-- <link href="https://fonts.googleapis.com/css?family=Catamaran&display=swap" rel="stylesheet"> -->
<title>Meridian: Real Time Offline Markdown Editor</title>
<meta name="description" content="Real-Time Offline Markdown Editor By Kaustubh Saxena" />
<link rel="canonical" href="https://meridian.epsilon.now.sh" />
<meta name="keywords" content="meridian, markdown editor, real-time markdown" />
<meta property="og:title" content="Meridian: Real Time Offline Markdown Editor" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://meridian.epsilon.now.sh" />
<meta property="og:description" content="Best Thing Happened to Markdown - By Kaustubh Saxena" />
<meta property="og:image" content="http://pad.haroopress.com/docs/en/markdown-doc-logos/images/markdown.png" />
</head>
<body class="container-fluid">
<div id="_meridian_loader_wrapper" class="wrapper">
<div class="loaderParent">
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<span class="typewriter"><h1>Meridian</h1></span>
</div>
</div>
<div class="_meridian_container" id="_meridian_container">
<div class="fixedPane">
<section class="header">
<h1>Meridian</h1>
<div class="menu">
<ul>
<li onclick="initiateDownload('md')">Export to Markdown</li>
<li onclick="initiateDownload('html')">Export to HTML</li>
<li onclick="goto('github')">Github</li>
</ul>
</div>
</section>
<section>
<div class="secondPane">
<div class="documentName">
<label>Document Name</label>
<span id="documentNameText" contenteditable>Meridian</span>
</div>
<div class="social">
<span>
Made with ❤️ by xassuak
</span>
<span onclick="goto('linkedin')">
<img src="./images/linkedin.png" />
</span>
<span onclick="goto('quora')">
<img src="./images/quora.png" />
</span>
<span onclick="goto()">
<img src="./images/github.png" />
</span>
</div>
</div>
<div class="documentStats">
<span class="label">Markdown</span>
<div>
<span class="label">Characters : <span id="characters"></span></span>
<span class="label">Words : <span id="words"></span></span>
</div>
<span class="label">Preview</span>
</div>
</section>
</div>
<section class="row content">
<textarea onkeyup="calculateStats()" class="col-md-6 full-height" id="pad">
## Meridian
Real Time Markdown Editor with Offline Support.
## Technologies Used -
- HTML5
- VanillaJS
- ShowdownJS
- Service Workers for Offline Support
## How It works
- Type some Markdown on the left
- Preview HTML in the right
- That's It.
## Supports Images too
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/1280px-Markdown-mark.svg.png" alt="drawing" width="200" />
## Offline support As soon as the internet disconnects, service workers will kick in order to support and run the cached
content for offline mode.
## How to Run
Clone this repository and run index.html
```
git clone [email protected]:kaustubh03/meridian.git
```
*More Features coming soon. Stay Tuned*
</textarea>
<div class="col-md-6 full-height" id="markdown"></div>
</section>
</div>
<script src="./js/showdown.min.js"></script>
<script src="./js/script.js"></script>
</body>
<script>
function initiateDownload(type){
let documentName = document.getElementById('documentNameText').textContent;
switch(type){
case "md":
let markdown = document.getElementById('pad').textContent;
download(documentName, markdown, 'data:text/markdown;charset=utf-8,');
break;
case "html":
let html = document.getElementById('markdown').innerHTML;
download(documentName, html, 'data:text/html;charset=utf-8,');
break;
default:
let text = document.getElementById('pad').textContent;
download(documentName, text, 'data:text/plain;charset=utf-8,');
break;
}
}
function goto(type){
switch(type){
case "github":
window.open('https://github.com/kaustubh03/meridian');
break;
case "linkedin":
window.open('https://www.linkedin.com/in/kaustubh-saxena-b953ba27/');
break;
case "quora":
window.open('https://www.quora.com/profile/Kaustubh-Saxena-2')
break;
default:
window.open('https://github.com/kaustubh03');
break;
}
}
// Register the service worker
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/service-worker.js').then(function (registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function (err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
}
</script>
</html>