-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
40 lines (39 loc) · 3.59 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
<!--
aquietplace
http://github.com/joevennix/aquietplace
Just a small writing tool.
BSD3 license
-->
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<title>aquietplace</title>
<style>
quietplace{position:absolute;top:0;left:0;right:0;bottom:0;font-family:monospace;font-size:16px;overflow-y:auto;overflow-x:hidden;padding:4em;max-width:40em;margin:0 auto;outline:0;line-height:1.4}fullscreen{position:absolute;top:3px;right:8px;font-size:22px;color:#aaa;cursor:pointer;font-family:Arial;padding:5px}fullscreen:hover{color:#000}:fullscreen,:-webkit-full-screen,:-moz-full-screen,:-ms-fullscreen{background:#fff}bg{position:absolute;top:0;left:0;right:0;bottom:0;display:none}intro{-webkit-opacity:0;-moz-opacity:0;opacity:0;-webkit-transition:all 1s ease;-moz-transition:all 1s ease;-ms-transition:all 1s ease;-o-transition:all 1s ease;transition:all 1s ease;font-family:monospace;font-size:48px;text-align:center;display:block;position:absolute;top:50%;left:0;right:0;margin-top:-100px}intro.bold{opacity:1}html,body{min-height:100%}title,version{display:block}version{color:#bbb;font-size:22px;margin-top:8px}*{background:#fff}@media print{quietplace{position:static;height:auto}}
</style>
<script>
"webkitIsFullScreen"in document?(Document.prototype.cancelFullScreen=Document.prototype.webkitCancelFullScreen,HTMLElement.prototype.requestFullScreen=HTMLElement.prototype.webkitRequestFullScreen):"mozFullScreen"in document&&(Document.prototype.cancelFullScreen=document.mozCancelFullScreen,HTMLElement.prototype.requestFullScreen=HTMLElement.prototype.mozRequestFullScreen);
</script>
<script>
!function(){function e(){t||(t=setTimeout(function(){t=null,n()},2e3))}function n(){try{localStorage[i]=o.innerHTML}catch(e){}}var o,t,c,l,a,u,i="";window.onhashchange=function(){i=location.pathname,location.hash.length&&(i+=location.hash);try{localStorage[i]&&""!==localStorage[i]&&(o.innerHTML=localStorage[i])}catch(e){}},window.onkeydown=function(e){var n=e.keyCode||e.charCode||0;if(83===n&&e.metaKey){e.preventDefault();var t=document.createElement("a"),c=o.innerHTML.replace(/<\s*br\s*>/gi,"\r\n");c=c.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,""),t.setAttribute("download",((location.hash||"aqiuetplace")+".txt").replace(/^#/,"")),t.setAttribute("href","data:text,"+encodeURI(c)),t.style="display: none",document.body.appendChild(t),t.click(),document.body.removeChild(t)}},window.onload=function(){u=!1,o=document.querySelector("quietplace"),l=document.querySelector("bg"),c=document.querySelector("fullscreen"),a=document.querySelector("intro"),a.className+="bold",window.onhashchange(),o.onkeydown=o.onkeyup=e,c.onclick=function(){u?(u=!1,document.cancelFullScreen&&(document.cancelFullScreen(),o.focus())):(u=!0,l.requestFullScreen&&(l.requestFullScreen(),o.focus()))},setTimeout(function(){a.style.display="none",l.style.display="block",setTimeout(function(){o.focus()})},1e3)},window.onbeforeunload=function(){n()}}();
</script>
</head>
<body>
<intro>
<title>aquiet.place</title>
<version>v0.1</version>
</intro>
<bg>
<quietplace contenteditable='true' spellcheck='false' tabindex='0'>
<p>Just a small writing tool.</p>
<p>You can type things in here.</p>
<p>The document is autosaved into your browser cache. No data is ever sent anywhere.</p>
<p>To start a new document, just add a #newDocumentName to the URL.</p>
<p>Enjoy.</p>
<p><a href='http://github.com/joevennix/aquietplace'>http://github.com/joevennix/aquietplace</a></p>
</quietplace>
<fullscreen title='Fullscreen'>⤢</fullscreen>
</bg>
</body>
</html>