From 860c6706ec137cad3835b2615414395a0d977c8c Mon Sep 17 00:00:00 2001 From: Michael Lopez Date: Sun, 15 Feb 2015 13:31:07 -0700 Subject: [PATCH 1/2] added .gitignore since I'm using osx and intellij --- .gitignore | Bin 0 -> 1208 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..2fe02512bf8f63c91391f1eda3bcd29f4db84ab2 GIT binary patch literal 1208 zcmZ`(O>f&U4DDIJfD{q6zf{l-LS)eK(?8fi!5mrz0~{lqw?LuZZy%BbbCg z$mzs4o8F~sn0Z0x=-~oh`f7M2j~DRV#!>=z7jP5fBsAGHOj^sGF&_)+oY6KgCB|CA zhH+(+!iyY!sR0(6Y314!)S$i8&a{9b^uX9D1dtZNR{4v2r|aO90y z%YSCuI6MMaZvNjTIjZ3B6qAm39%G1dskQRWi=k-@(~ZVcvyCFP=8B53`q>z1NDf zDUtO#XS}8KejO9Gsda-;oepGIg29b%I8Xzn^bG~DzB%AIH+AUd^)YddZ&@t!Bz)My ziMvqZMr6svI5Cf_o?LV4%=;L@Q~Bd4t72NtvsBO&Diw#*&{s}>zLZa@Hr9FaVrF&l z(Dll3RGe#)7GxdZC!6d!JIgVzZQoVil1rwTf6SJABvo*$0_l{W0yajp3|b4{1ld~$ z4W*SS${57ukn#6VS68NZ&9iT5z89$u2O5Q5$T~Mby?ax%Sk|Q=+}uAyQjH%*x!uo% lX(b_=uc)AT1)J({A6$cMUiE Date: Sun, 15 Feb 2015 15:12:05 -0700 Subject: [PATCH 2/2] added the ability to specify css styles in the querystring parameter "css". - refactored documents css from index.html to essay.css - copied essay.css to alt.css just to give me somewhere to test and changed the body background to beccapurple (#663399). - to test the alt.css append this querystring parameter to a working myword instance: ?url=https://dl.dropboxusercontent.com/u/36518280/misc/myWordDemo.json&css=./alt.css if no css is specified it defaults to essay.css --- alt.css | 121 +++++++++++++++++++++++++++++++++++++++++++++++ essay.css | 121 +++++++++++++++++++++++++++++++++++++++++++++++ index.html | 135 ++++------------------------------------------------- 3 files changed, 251 insertions(+), 126 deletions(-) create mode 100644 alt.css create mode 100644 essay.css diff --git a/alt.css b/alt.css new file mode 100644 index 0000000..999c2db --- /dev/null +++ b/alt.css @@ -0,0 +1,121 @@ +body { + font-family: Ubuntu; + font-size: 12px; + background-color: #663399; +} +.divPageBody { + width: 60%; + margin-top: 90px; + margin-left: auto; + margin-right: auto; +} +.divBackgroundImage { + position: absolute; + width: 100%; + height: 400px; + margin-left: 0; + margin-top: 0; + border-top: 1px solid silver; + z-index: 10; + + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + background-position: center; + background-repeat: no-repeat; +} +.divPageTopText { + width: 70%; + margin-left: auto; + margin-right: auto; + margin-top: 160px; +} +.divPageTopText a { + color: white; +} +.divPageTitle { + font-size: 50px; + letter-spacing: -0.02em; + font-weight: 700; + font-style: normal; + letter-spacing: -0.04em; + line-height: 1.1; + margin-bottom: 8px; + color: white; + text-shadow: 1px 1px black; +} +.divPageByline { + font-size: 18px; + color: white; + margin-bottom: .5em; + text-shadow: 1px 1px black; +} +.divPageDescription { + font-size: 24px; + color: white; + margin-top: .5em; + height: 3em; + text-shadow: 1px 1px black; +} +.divEssayText { + font-family: "Georgia"; + font-size: 24px; + line-height: 145%; + width: 55%; + margin-top: 125px; + margin-left: auto;; + margin-right: auto; + margin-bottom: 400px; +} +.divSubhead { + font-family: "Ubuntu"; + font-weight: bold; + margin-top: 1em; + margin-bottom: .15em; +} +.divMarkdownText h4 { + font-size: 24px; + margin-top: 1.25em; + margin-bottom: .75em; +} +.divVersionNumber { + position: absolute; + top: 0; + right:0; + font-size: 13px; + padding: 5px; + color: white; + z-index: 20; +} +.divVersionNumber a { + color: white; +} + + /* styles for phone */ +@media only screen +and (min-device-width : 320px) +and (max-device-width : 480px) { + .divPageTopText { + width: 80%; + margin-top: 110px; + } + .divPageTitle { + font-size: 44px; + } + .divPageDescription { + font-size: 18px; + line-height: 110%; + } + .divEssayText { + width: 80%; + margin-top: 125px; + margin-left: auto;; + margin-right: auto; + margin-bottom: 400px; + } + .divVersionNumber { + position: absolute; + padding: 2px; + } +} diff --git a/essay.css b/essay.css new file mode 100644 index 0000000..05e89e7 --- /dev/null +++ b/essay.css @@ -0,0 +1,121 @@ +body { + font-family: Ubuntu; + font-size: 18px; + background-color: whitesmoke; +} +.divPageBody { + width: 60%; + margin-top: 90px; + margin-left: auto; + margin-right: auto; +} +.divBackgroundImage { + position: absolute; + width: 100%; + height: 400px; + margin-left: 0; + margin-top: 0; + border-top: 1px solid silver; + z-index: 10; + + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + background-position: center; + background-repeat: no-repeat; +} +.divPageTopText { + width: 70%; + margin-left: auto; + margin-right: auto; + margin-top: 160px; +} +.divPageTopText a { + color: white; +} +.divPageTitle { + font-size: 50px; + letter-spacing: -0.02em; + font-weight: 700; + font-style: normal; + letter-spacing: -0.04em; + line-height: 1.1; + margin-bottom: 8px; + color: white; + text-shadow: 1px 1px black; +} +.divPageByline { + font-size: 18px; + color: white; + margin-bottom: .5em; + text-shadow: 1px 1px black; +} +.divPageDescription { + font-size: 24px; + color: white; + margin-top: .5em; + height: 3em; + text-shadow: 1px 1px black; +} +.divEssayText { + font-family: "Georgia"; + font-size: 24px; + line-height: 145%; + width: 55%; + margin-top: 125px; + margin-left: auto;; + margin-right: auto; + margin-bottom: 400px; +} +.divSubhead { + font-family: "Ubuntu"; + font-weight: bold; + margin-top: 1em; + margin-bottom: .15em; +} +.divMarkdownText h4 { + font-size: 24px; + margin-top: 1.25em; + margin-bottom: .75em; +} +.divVersionNumber { + position: absolute; + top: 0; + right:0; + font-size: 13px; + padding: 5px; + color: white; + z-index: 20; +} +.divVersionNumber a { + color: white; +} + + /* styles for phone */ +@media only screen +and (min-device-width : 320px) +and (max-device-width : 480px) { + .divPageTopText { + width: 80%; + margin-top: 110px; + } + .divPageTitle { + font-size: 44px; + } + .divPageDescription { + font-size: 18px; + line-height: 110%; + } + .divEssayText { + width: 80%; + margin-top: 125px; + margin-left: auto;; + margin-right: auto; + margin-bottom: 400px; + } + .divVersionNumber { + position: absolute; + padding: 2px; + } +} diff --git a/index.html b/index.html index 62aaffc..3950af2 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,8 @@ - + + @@ -49,13 +50,17 @@ } function startup () { var urlparam = decodeURIComponent (getURLParameter ("url")), urlEssay = "essay.json", jstruct, imgurl = defaultImageUrl;; + var cssparam = decodeURIComponent (getURLParameter ("css")), urlCSS = "essay.css"; var markdown = new Markdown.Converter (), now = new Date (), flmarkdown; - console.log ("startup"); + console.log ("startup"); $("#idVersionNumber").html ("v" + appConsts.version + ""); initGoogleAnalytics (); if (urlparam != "null") { urlEssay = urlparam; } + if (cssparam != "null") { + urlCSS = cssparam; + } readHttpFile (urlEssay, function (s) { try { jstruct = JSON.parse (s); @@ -137,135 +142,13 @@ console.log ("startup: essay text before Markdown processing == " + essaytext); essaytext = "
" + markdown.makeHtml (essaytext) + "
"; } - + // stylesheet if utilized + $("link#idCSS").attr("href", urlCSS); $("#idEssayText").html (essaytext); }); self.setInterval (function () {everySecond ()}, 1000); } - -