-
Notifications
You must be signed in to change notification settings - Fork 30
/
index.html
117 lines (89 loc) · 5.86 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
<!doctype html>
<html lang="en">
<head>
<title>Writty</title>
<!-- Meta Tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="shortcut icon" href="favicon.png">
<!--Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,400;0,500;0,700;1,400;1,500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Buenard:wght@400;700&family=Ubuntu:ital,wght@0,400;0,500;0,700;1,400;1,500&display=swap" rel="stylesheet">
<script defer src="https://use.fontawesome.com/releases/v5.7.2/js/all.js" integrity="sha384-0pzryjIRos8mFBWMzSSZApWtPl/5++eIfzYmTgBBmXYdhvxPc+XcFEk+zJwDgWbP" crossorigin="anonymous"></script>
<!-- JS Libraries -->
<script defer src="https://unpkg.com/turndown/dist/turndown.js"></script>
<script defer src="https://unpkg.com/showdown/dist/showdown.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jitbit/HtmlSanitizer@master/HtmlSanitizer.js"></script>
<script src="https://printjs-4de6.kxcdn.com/print.min.js"></script>
<!-- SimpleBar core -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/simplebar@latest/dist/simplebar.css" />
<script src="https://cdn.jsdelivr.net/npm/simplebar@latest/dist/simplebar.min.js"></script>
<!--CSS -->
<link rel="stylesheet" href="writty.css">
</head>
<body>
<div class="container">
<div class="topbar">
<div class="topbar-row">
<label class="switch">
<input id="theme-switch" type="checkbox">
<div class="switch-slider" title="Theme switch"> <span class="sun"><i class="fas fa-sun"></i></span><span class="moon"><i class="fas fa-moon"></i></span></div>
</label>
<button class="topbar-button" onclick="toggleRTL()" type="button"><i class="fas fa-exchange-alt"></i> RTL Mode</button>
<button class="topbar-button" onclick="clearStorage()" type="button"><i class="fas fa-pencil-alt"></i> New Text</button>
<button class="topbar-button" onclick="triggerImportFile()" type="button"><i class="fas fa-upload"></i> Import Text</button>
<input id="import-file" type="file" accept=".md,.html">
</div>
</div>
<div class="toolbar">
<div class="popup">
<button type="button" class="popup-button toolbar-button"><i class="fas fa-heading"></i></button>
<div class="popup-window">
<button title="Heading format" class="popup-item Heading" data-edit="formatBlock:h1">Heading</button>
<button title="Subheading format" class="popup-item Subheading" data-edit="formatBlock:h2">Subheading</button>
<button title="Body format" class="popup-item Body" data-edit="formatBlock:p">Body</button>
<button title="Caption format" class="popup-item Caption" data-edit="formatBlock:h5">Caption</button>
</div>
</div>
<button title="Bold" class="toolbar-button" data-edit="bold"><i class="fas fa-bold"></i></button>
<button title="Italic" class="toolbar-button" data-edit="italic"><i class="fas fa-italic"></i></button>
<button title="Underline" class="toolbar-button" data-edit="underline"><i class="fas fa-underline"></i></button>
<button title="Quote" class="toolbar-button" data-edit="formatBlock:blockquote"><i class="fas fa-quote-right"></i></button>
<button title="Unordered list" class="toolbar-button" data-edit="insertUnorderedList"><i class="fas fa-list-ul"></i></button>
<button title="Ordered list" class="toolbar-button" data-edit="insertOrderedList"><i class="fas fa-list-ol"></i></button>
<button title="Insert link" class="toolbar-button" type="button" data-edt="insertLink"><i class="fas fa-link"></i></button>
<div class="popup">
<button title="Image" type="button" class="popup-button toolbar-button no-caret"><i class="fas fa-image"></i></button>
<div class="popup-window">
<label class="popup-button" for="imageUpload"><i class="fas fa-arrow-circle-up"></i> Upload Image</label>
<input type="file" name="imageUpload" hidden id="imageUpload" accept=".gif,.jpg,.jpeg,.png">
</div>
</div>
<div class="popup">
<button title="Download" class="toolbar-button last"><i class="fas fa-download"></i></button>
<div class="popup-window">
<button class="popup-button" onclick="printJS('content','html')"><i class="fas fa-file-pdf"></i> Print or save PDF</button>
<button class="popup-button" onclick='downloadContent("html")'><i class="fas fa-file-code"></i> Download HTML</button>
<button class="popup-button" onclick='downloadContent("txt")'><i class="fas fa-file-alt"></i> Download TXT</button>
<button class="popup-button" onclick='downloadContent("md")'><i class="fas fa-file"></i> Download MD</button>
</div>
</div>
<span id="counter">0</span>
</div>
<div id="editor" class="editor" data-simplebar data-simplebar-auto-hide="false">
<div id="content" class="content" contenteditable="true">
<p>Start writing...✏️</p>
</div>
</div>
</div>
<div class="bottom-bar">
<div class="bottom-row">
<a href="https://writtyapp.com" target="_blank"><img class="logo" border="0" alt="About Writty" src="writtybottom.svg" width="50"></a>
</div>
</div>
<!-- Writty JS -->
<script src="writty.js"></script>
<!-- Autosave -->
<script src="writtyautosave.js"></script>
</body>
</html>