diff --git a/big.css b/big.css new file mode 100644 index 0000000..86e788f --- /dev/null +++ b/big.css @@ -0,0 +1,39 @@ +body { + font-family: 'Helvetica'; + letter-spacing:-5px; + background:#000; + background-size:100%; + color:#fff; + margin:0; + padding:0; + font-weight:bold; +} + +h1, h2, h3, p { + margin:0; +} + +em, a { + font-style:normal; + color:#8dbd0c; +} + +a { + background: #34d0e7; + color:#000; + text-decoration:none; +} + +img { + width:100%; +} + +div { + cursor:pointer; + cursor:hand; + position:absolute; + top:0; + left:0; +} + +.GreenDOT {background:#0f0;} \ No newline at end of file diff --git a/big.js b/big.js new file mode 100644 index 0000000..51537a1 --- /dev/null +++ b/big.js @@ -0,0 +1,56 @@ +window.onload = function() { + var converter = new Showdown.converter(); + var md = document.getElementById("md"); + var html = converter.makeHtml(md.innerHTML); + md.innerHTML = html.replace(/\<(\/)?p\>/g,'<$1div>'); + var s = document.getElementsByTagName('div'), cur = 0; + if (!s) return; + function go(n) { + cur = n; + var i = 1e3, e = s[n]; + for (var k = 0; k < s.length; k++) s[k].style.display = 'none'; + e.style.display = 'inline'; + e.style.fontSize = i + 'px'; + if (e.firstChild.nodeName === 'IMG') { + document.body.style.backgroundImage = 'url(' + e.firstChild.src + ')'; + e.firstChild.style.display = 'none'; + } else { + document.body.style.backgroundImage = ''; + document.body.style.backgroundColor = e.style.backgroundColor; + } + while ( + e.offsetWidth > window.innerWidth || + e.offsetHeight > window.innerHeight) { + e.style.fontSize = (i -= 10) + 'px'; + if (i < 0) break; + } + e.style.marginTop = ((window.innerHeight - e.offsetHeight) / 2) + 'px'; + if (window.location.hash !== n) window.location.hash = n; + document.title = e.textContent || e.innerText; + } + document.onclick = function() { + go(++cur % (s.length)); + }; + document.onkeydown = function(e) { + (e.which === 39) && go(Math.min(s.length - 1, ++cur)); + (e.which === 37) && go(Math.max(0, --cur)); + }; + var xStart; + md.addEventListener("touchstart",function(e){xStart = e.changedTouches[0].pageX}, false) + md.addEventListener("touchend",function(e){var test = e.changedTouches[0].pageX-xStart; + (test < 0) && go(Math.min(s.length - 1, ++cur)); + (test > 0) && go(Math.max(0, --cur)); + }, false) + function parse_hash() { + return Math.max(Math.min( + s.length - 1, + parseInt(window.location.hash.substring(1), 10)), 0); + } + if (window.location.hash) cur = parse_hash() || cur; + window.onhashchange = function() { + var c = parse_hash(); + if (c !== cur) go(c); + }; + + go(cur); +}; diff --git a/index.html b/index.html new file mode 100644 index 0000000..389609c --- /dev/null +++ b/index.html @@ -0,0 +1,135 @@ +
"+d+"\n
",A(d)+e}),a=a.replace(/~0/,""),a},z=function(a){return a+="~0",a=a.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g,function(a,b,c){var d=b,e=c;return e=C(e),e=M(e),e=e.replace(/^\n+/g,""),e=e.replace(/\n+$/g,""),e=""+e+"\n
",A(e)}),a=a.replace(/~0/,""),a},A=function(a){return a=a.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(d.push(a)-1)+"K\n\n"},B=function(a){return a=a.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(a,b,c,d,e){var f=d;return f=f.replace(/^([ \t]*)/g,""),f=f.replace(/[ \t]*$/g,""),f=C(f),b+""+f+"
"}),a},C=function(a){return a=a.replace(/&/g,"&"),a=a.replace(//g,">"),a=N(a,"*_{}[]\\",!1),a},D=function(a){return a=a.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"$2"),a=a.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"$2"),a},E=function(a){return a=a.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(a,b){var c=b;return c=c.replace(/^[ \t]*>[ \t]?/gm,"~0"),c=c.replace(/~0/g,""),c=c.replace(/^[ \t]+$/gm,""),c=o(c),c=c.replace(/(^|\n)/g,"$1 "),c=c.replace(/(\s*[^\r]+?<\/pre>)/gm,function(a,b){var c=b;return c=c.replace(/^ /mg,"~0"),c=c.replace(/~0/g,""),c}),A("\n"+c+"\n")}),a},F=function(a){a=a.replace(/^\n+/g,""),a=a.replace(/\n+$/g,"");var b=a.split(/\n{2,}/g),c=[],e=b.length;for(var f=0;f=0?c.push(g):g.search(/\S/)>=0&&(g=p(g),g=g.replace(/^([ \t]*)/g," "),g+="
",c.push(g))}e=c.length;for(var f=0;f=0){var h=d[RegExp.$1];h=h.replace(/\$/g,"$$$$"),c[f]=c[f].replace(/~K\d+K/,h)}return c.join("\n\n")},G=function(a){return a=a.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),a=a.replace(/<(?![a-z\/?\$!])/gi,"<"),a},H=function(a){return a=a.replace(/\\(\\)/g,O),a=a.replace(/\\([`*_{}\[\]()>#+-.!])/g,O),a},I=function(a){return a=a.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,'$1'),a=a.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(a,b){return J(K(b))}),a},J=function(a){var b=[function(a){return""+a.charCodeAt(0)+";"},function(a){return""+a.charCodeAt(0).toString(16)+";"},function(a){return a}];return a="mailto:"+a,a=a.replace(/./g,function(a){if(a=="@")a=b[Math.floor(Math.random()*2)](a);else if(a!=":"){var c=Math.random();a=c>.9?b[2](a):c>.45?b[1](a):b[0](a)}return a}),a=''+a+"",a=a.replace(/">.+:/g,'">'),a},K=function(a){return a=a.replace(/~E(\d+)E/g,function(a,b){var c=parseInt(b);return String.fromCharCode(c)}),a},L=function(a){return a=a.replace(/^(\t|[ ]{1,4})/gm,"~0"),a=a.replace(/~0/g,""),a},M=function(a){return a=a.replace(/\t(?=\t)/g," "),a=a.replace(/\t/g,"~A~B"),a=a.replace(/~B(.+?)~A/g,function(a,b,c){var d=b,e=4-d.length%4;for(var f=0;f