diff options
author | m-r-r <raybaudroigm@gmail.com> | 2012-07-26 15:01:23 +0200 |
---|---|---|
committer | m-r-r <raybaudroigm@gmail.com> | 2012-07-26 15:01:23 +0200 |
commit | c55d10de9c103e2c023ef1f40f4f4c0502570e69 (patch) | |
tree | 60525471c4c5386b00f8707c4d3d060f2b31cf43 /dev-random2/static | |
parent | 98f0d46f2bbddf86e8d202b533af35fa79da2d2f (diff) | |
download | pelican-themes-c55d10de9c103e2c023ef1f40f4f4c0502570e69.zip pelican-themes-c55d10de9c103e2c023ef1f40f4f4c0502570e69.tar.gz pelican-themes-c55d10de9c103e2c023ef1f40f4f4c0502570e69.tar.bz2 |
[dev-random2] Theme upgrade
Diffstat (limited to 'dev-random2/static')
-rw-r--r-- | dev-random2/static/css/normalize.css | 500 | ||||
-rw-r--r-- | dev-random2/static/css/pygments.css | 62 | ||||
-rw-r--r-- | dev-random2/static/css/skeleton.css | 64 | ||||
-rw-r--r-- | dev-random2/static/css/theme.css | 189 | ||||
-rw-r--r-- | dev-random2/static/js/html5shiv.js | 3 | ||||
-rw-r--r-- | dev-random2/static/js/microTags.js | 159 | ||||
-rw-r--r-- | dev-random2/static/js/microTags.min.js | 18 |
7 files changed, 995 insertions, 0 deletions
diff --git a/dev-random2/static/css/normalize.css b/dev-random2/static/css/normalize.css new file mode 100644 index 0000000..8fa27e0 --- /dev/null +++ b/dev-random2/static/css/normalize.css @@ -0,0 +1,500 @@ +/*! normalize.css 2012-07-07T09:50 UTC - http://github.com/necolas/normalize.css */ + +/* ========================================================================== + HTML5 display definitions + ========================================================================== */ + +/* + * Corrects `block` display not defined in IE6/7/8/9 & FF3. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section, +summary { + display: block; +} + +/* + * Corrects `inline-block` display not defined in IE6/7/8/9 & FF3. + */ + +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +/* + * Prevents modern browsers from displaying `audio` without controls. + * Remove excess height in iOS5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/* + * Addresses styling for `hidden` attribute not present in IE7/8/9, FF3, S4. + * Known issue: no IE6 support. + */ + +[hidden] { + display: none; +} + +/* ========================================================================== + Base + ========================================================================== */ + +/* + * 1. Corrects text resizing oddly in IE6/7 when body `font-size` is set using + * `em` units. + * 2. Prevents iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-size: 100%; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ + -ms-text-size-adjust: 100%; /* 2 */ +} + +/* + * Addresses `font-family` inconsistency between `textarea` and other form + * elements. + */ + +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} + +/* + * Addresses margins handled incorrectly in IE6/7. + */ + +body { + margin: 0; +} + +/* ========================================================================== + Links + ========================================================================== */ + +/* + * Addresses `outline` inconsistency between Chrome and other browsers. + */ + +a:focus { + outline: thin dotted; +} + +/* + * Improves readability when focused and also mouse hovered in all browsers. + * people.opera.com/patrickl/experiments/keyboard/test + */ + +a:active, +a:hover { + outline: 0; +} + +/* ========================================================================== + Typography + ========================================================================== */ + +/* + * Addresses font sizes and margins set differently in IE6/7. + * Addresses font sizes within `section` and `article` in FF4+, Chrome, S5. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +h2 { + font-size: 1.5em; + margin: 0.83em 0; +} + +h3 { + font-size: 1.17em; + margin: 1em 0; +} + +h4 { + font-size: 1em; + margin: 1.33em 0; +} + +h5 { + font-size: 0.83em; + margin: 1.67em 0; +} + +h6 { + font-size: 0.75em; + margin: 2.33em 0; +} + +/* + * Addresses styling not present in IE7/8/9, S5, Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/* + * Addresses style set to `bolder` in FF3+, S4/5, Chrome. + */ + +b, +strong { + font-weight: bold; +} + +blockquote { + margin: 1em 40px; +} + +/* + * Addresses styling not present in S5, Chrome. + */ + +dfn { + font-style: italic; +} + +/* + * Addresses styling not present in IE6/7/8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/* + * Addresses margins set differently in IE6/7. + */ + +p, +pre { + margin: 1em 0; +} + +/* + * Corrects font family set oddly in IE6, S4/5, Chrome. + * en.wikipedia.org/wiki/User:Davidgothberg/Test59 + */ + +code, +kbd, +pre, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} + +/* + * Improves readability of pre-formatted text in all browsers. + */ + +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} + +/* + * Addresses CSS quotes not supported in IE6/7. + */ + +q { + quotes: none; +} + +/* + * Addresses `quotes` property not supported in S4. + */ + +q:before, +q:after { + content: ''; + content: none; +} + +small { + font-size: 75%; +} + +/* + * Prevents `sub` and `sup` affecting `line-height` in all browsers. + * gist.github.com/413930 + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ========================================================================== + Lists + ========================================================================== */ + +/* + * Addresses margins set differently in IE6/7. + */ + +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +/* + * Addresses paddings set differently in IE6/7. + */ + +menu, +ol, +ul { + padding: 0 0 0 40px; +} + +/* + * Corrects list images handled incorrectly in IE7. + */ + +nav ul, +nav ol { + list-style: none; + list-style-image: none; +} + +/* ========================================================================== + Embedded content + ========================================================================== */ + +/* + * 1. Removes border when inside `a` element in IE6/7/8/9, FF3. + * 2. Improves image quality when scaled in IE7. + * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ + */ + +img { + border: 0; /* 1 */ + -ms-interpolation-mode: bicubic; /* 2 */ +} + +/* + * Corrects overflow displayed oddly in IE9. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* ========================================================================== + Figures + ========================================================================== */ + +/* + * Addresses margin not present in IE6/7/8/9, S5, O11. + */ + +figure { + margin: 0; +} + +/* ========================================================================== + Forms + ========================================================================== */ + +/* + * Corrects margin displayed oddly in IE6/7. + */ + +form { + margin: 0; +} + +/* + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/* + * 1. Corrects color not being inherited in IE6/7/8/9. + * 2. Corrects text not wrapping in FF3. + * 3. Corrects alignment displayed oddly in IE6/7. + */ + +legend { + border: 0; /* 1 */ + padding: 0; + white-space: normal; /* 2 */ + *margin-left: -7px; /* 3 */ +} + +/* + * 1. Corrects font size not being inherited in all browsers. + * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome. + * 3. Improves appearance and consistency in all browsers. + */ + +button, +input, +select, +textarea { + font-size: 100%; /* 1 */ + margin: 0; /* 2 */ + vertical-align: baseline; /* 3 */ + *vertical-align: middle; /* 3 */ +} + +/* + * Addresses FF3/4 setting `line-height` on `input` using `!important` in the + * UA stylesheet. + */ + +button, +input { + line-height: normal; +} + +/* + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Corrects inability to style clickable `input` types in iOS. + * 3. Improves usability and consistency of cursor style between image-type + * `input` and others. + * 4. Removes inner spacing in IE7 without affecting normal text inputs. + * Known issue: inner spacing remains in IE6. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ + *overflow: visible; /* 4 */ +} + +/* + * Re-set default cursor for disabled elements. + */ + +button[disabled], +input[disabled] { + cursor: default; +} + +/* + * 1. Addresses box sizing set to content-box in IE8/9. + * 2. Removes excess padding in IE8/9. + * 3. Removes excess padding in IE7. + * Known issue: excess padding remains in IE6. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ + *height: 13px; /* 3 */ + *width: 13px; /* 3 */ +} + +/* + * 1. Addresses `appearance` set to `searchfield` in S5, Chrome. + * 2. Addresses `box-sizing` set to `border-box` in S5, Chrome (include `-moz` + * to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/* + * Removes inner padding and search cancel button in S5, Chrome on OS X. + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/* + * Removes inner padding and border in FF3+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/* + * 1. Removes default vertical scrollbar in IE6/7/8/9. + * 2. Improves readability and alignment in all browsers. + */ + +textarea { + overflow: auto; /* 1 */ + vertical-align: top; /* 2 */ +} + +/* ========================================================================== + Tables + ========================================================================== */ + +/* + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/dev-random2/static/css/pygments.css b/dev-random2/static/css/pygments.css new file mode 100644 index 0000000..2e0adf3 --- /dev/null +++ b/dev-random2/static/css/pygments.css @@ -0,0 +1,62 @@ +pre .hll { background-color: #ffffcc } +pre { background: #ffffff; } +pre .c { color: #808080 } /* Comment */ +pre .err { color: #F00000; background-color: #F0A0A0 } /* Error */ +pre .k { color: #008000; font-weight: bold } /* Keyword */ +pre .o { color: #303030 } /* Operator */ +pre .cm { color: #808080 } /* Comment.Multiline */ +pre .cp { color: #507090 } /* Comment.Preproc */ +pre .c1 { color: #808080 } /* Comment.Single */ +pre .cs { color: #cc0000; font-weight: bold } /* Comment.Special */ +pre .gd { color: #A00000 } /* Generic.Deleted */ +pre .ge { font-style: italic } /* Generic.Emph */ +pre .gr { color: #FF0000 } /* Generic.Error */ +pre .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +pre .gi { color: #00A000 } /* Generic.Inserted */ +pre .go { color: #808080 } /* Generic.Output */ +pre .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +pre .gs { font-weight: bold } /* Generic.Strong */ +pre .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +pre .gt { color: #0040D0 } /* Generic.Traceback */ +pre .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +pre .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +pre .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +pre .kp { color: #003080; font-weight: bold } /* Keyword.Pseudo */ +pre .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +pre .kt { color: #303090; font-weight: bold } /* Keyword.Type */ +pre .m { color: #6000E0; font-weight: bold } /* Literal.Number */ +pre .s { background-color: #fff0f0 } /* Literal.String */ +pre .na { color: #0000C0 } /* Name.Attribute */ +pre .nb { color: #007020 } /* Name.Builtin */ +pre .nc { color: #B00060; font-weight: bold } /* Name.Class */ +pre .no { color: #003060; font-weight: bold } /* Name.Constant */ +pre .nd { color: #505050; font-weight: bold } /* Name.Decorator */ +pre .ni { color: #800000; font-weight: bold } /* Name.Entity */ +pre .ne { color: #F00000; font-weight: bold } /* Name.Exception */ +pre .nf { color: #0060B0; font-weight: bold } /* Name.Function */ +pre .nl { color: #907000; font-weight: bold } /* Name.Label */ +pre .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +pre .nt { color: #007000 } /* Name.Tag */ +pre .nv { color: #906030 } /* Name.Variable */ +pre .ow { color: #000000; font-weight: bold } /* Operator.Word */ +pre .w { color: #bbbbbb } /* Text.Whitespace */ +pre .mf { color: #6000E0; font-weight: bold } /* Literal.Number.Float */ +pre .mh { color: #005080; font-weight: bold } /* Literal.Number.Hex */ +pre .mi { color: #0000D0; font-weight: bold } /* Literal.Number.Integer */ +pre .mo { color: #4000E0; font-weight: bold } /* Literal.Number.Oct */ +pre .sb { background-color: #fff0f0 } /* Literal.String.Backtick */ +pre .sc { color: #0040D0 } /* Literal.String.Char */ +pre .sd { color: #D04020 } /* Literal.String.Doc */ +pre .s2 { background-color: #fff0f0 } /* Literal.String.Double */ +pre .se { color: #606060; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */ +pre .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */ +pre .si { background-color: #e0e0e0 } /* Literal.String.Interpol */ +pre .sx { color: #D02000; background-color: #fff0f0 } /* Literal.String.Other */ +pre .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */ +pre .s1 { background-color: #fff0f0 } /* Literal.String.Single */ +pre .ss { color: #A06000 } /* Literal.String.Symbol */ +pre .bp { color: #007020 } /* Name.Builtin.Pseudo */ +pre .vc { color: #306090 } /* Name.Variable.Class */ +pre .vg { color: #d07000; font-weight: bold } /* Name.Variable.Global */ +pre .vi { color: #3030B0 } /* Name.Variable.Instance */ +pre .il { color: #0000D0; font-weight: bold } /* Literal.Number.Integer.Long */ diff --git a/dev-random2/static/css/skeleton.css b/dev-random2/static/css/skeleton.css new file mode 100644 index 0000000..a823bc7 --- /dev/null +++ b/dev-random2/static/css/skeleton.css @@ -0,0 +1,64 @@ +/* vim: ts=4 sw=4 et: */ + +html, body { + height: 100%; + width: 100%; + margin: 0; + padding: 0; +} + +#page { + max-width: 950px; + min-width: 240px; + margin: 0 auto; + padding: 0 1em; +} + +#page-head, +#page-body, +#page-foot { + clear: both; + margin: 0; + padding: 0; +} + +#page-side { + float: left; + width: 30%; + height: 100%; + margin-top: 0; +} + +#page-main { + float: right; + height: 100%; + width: 67%; +} + + + +@media screen and (max-width: 550px) { + #page-main, + #page-side { + width: auto; + clear: both; + } + + #page-side ul { + column-count: 2; + -moz-column-count: 2; + -webkit-column-count: 2; + -o-column-count: 2; + -ms-column-count: 2; + } +} + +@media screen and (max-width: 490px) { + #page-side ul { + column-count: auto; + -moz-column-count: auto; + -webkit-column-count: auto; + -o-column-count: auto; + -ms-column-count: auto; + } +} diff --git a/dev-random2/static/css/theme.css b/dev-random2/static/css/theme.css new file mode 100644 index 0000000..e4cd594 --- /dev/null +++ b/dev-random2/static/css/theme.css @@ -0,0 +1,189 @@ +/* vim: ts=4 sw=4 et: */ + +@import url(normalize.css); + +@-webkit-keyframes fade {from {opacity: 0;} to { opacity: 1;}} +@-moz-keyframes fade {from {opacity: 0;} to { opacity: 1;}} +@-ms-keyframes fade {from {opacity: 0;} to { opacity: 1;}} +@-o-keyframes fade {from {opacity: 0;} to { opacity: 1;}} +@keyframes fade {from {opacity: 0;} to { opacity: 1;}} + + +body { + font-family: "Lucida Grande", "Gargi_1.7", "Garuda", "Jamrul", "Loma", "Malayalam", "Mukti Narrow", sans-serif; + font-size: 16px; + line-height: 1.5em; + color: #444; + background-color: #FAFAFA; + -webkit-animation: fade 600ms 1 ease-in-out; + -moz-animation: fade 600ms 1 ease-in-out; + -ms-animation: fade 600ms 1 ease-in-out; + -o-animation: fade 600ms 1 ease-in-out; + animation: fade 600ms 1 ease-in-out; +} + +h1, h2, h3, +h4, h5, h6, +header .meta { + color: #222; + font-family: "Century Schoolbook L", "Georgia", "Nimbus Roman No9 L", "Norasi", "Rekha", serif; + line-height: 1.1em; +} + +hr { + visibility: hidden; + padding-bottom: 1em; +} + +hr:after, +#page-foot:before { + visibility: visible; + content: '\2042'; + display: block; + text-align: center; +} + +article { + margin-bottom: 4em; +} + +article header h1 { + padding: .1em 0; + margin: 0; +} + +article header .meta { + font-size: .9em; +} + +article header .meta a { text-decoration: none; } + +article:after { + content: '\00A7'; + display: block; + text-align: center; + font-weight: lighter; + font-size: 1.5em; +} + +article:last-of-type:after { + content: ''; +} + +#page-head { + text-align: center; + padding-top: .5em; +} + +#page-head h1 { + font-size: 4em; +} + +#page-head h1 a:hover { + text-decoration: none; +} + +#page-side { + line-height: 1.2em; +} + +#page-side ul { + padding: 0 0 0 1.3em; + margin: .4em 0 .6em .4em; + list-style-type: square; +} + +#page-side li a { + color: #555; +} + +#page-side li.active { + color: firebrick; +} + +#page-side li.active a { + color: #222; +} + +#page-foot { + font-size: .8em; + text-align: center; +} + +#pagination { + display: block; + margin-bottom: 4em; + text-align: center; +} + +#tag-cloud li:hover { + -webkit-transform: rotate(0deg), scale(1.3, 1.3) !important; + -moz-transform: rotate(0deg), scale(1.3, 1.3) !important; + -ms-transform: rotate(0deg), scale(1.3, 1.3) !important; + -o-transform: rotate(0deg), scale(1.3, 1.3) !important; + transform: rotate(0deg), scale(1.3, 1.3) !important; +} + +#tag-cloud a { + text-decoration: none; +} + +h1.small-title { + font-size: 1em; + font-style: italic; + font-weight: normal; +} + +a, a:link, a:visited { + text-decoration: underline; + color: #29476B; +} + +a:active, a:focus { + outline-width: 1px; + outline-style: dotted; +} + +h1 a, h2 a, h3 a, +h4 a, h5 a, h6 a { + color: inherit !important; + text-decoration: none!important; +} + +a.goto { + font-size: .8em; + color: #444; + padding: 0; + margin: 0em .2em; +} + +pre, img { + overflow: auto; + max-width: 95%; +} + +pre { + font-family: monospace; + font-size: 0.95em; + line-height: 1.15em; + background-color: #F5F5F5; + border: 3px solid silver; + overflow: auto; + padding: 0.5em; +} + +@media screen and (max-width: 650px) { + body { + font-size: 15px; + } +} + +@media screen and (max-width: 500px) { + body { + font-size: 14px; + } + + #page-head h1 { + font-size: 2.5em; + } +} diff --git a/dev-random2/static/js/html5shiv.js b/dev-random2/static/js/html5shiv.js new file mode 100644 index 0000000..74c9564 --- /dev/null +++ b/dev-random2/static/js/html5shiv.js @@ -0,0 +1,3 @@ +/*! HTML5 Shiv pre3.5 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed + Uncompressed source: https://github.com/aFarkas/html5shiv */ +(function(a,b){function h(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function i(){var a=l.elements;return typeof a=="string"?a.split(" "):a}function j(a){var b={},c=a.createElement,f=a.createDocumentFragment,g=f();a.createElement=function(a){l.shivMethods||c(a);var f;return b[a]?f=b[a].cloneNode():e.test(a)?f=(b[a]=c(a)).cloneNode():f=c(a),f.canHaveChildren&&!d.test(a)?g.appendChild(f):f},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+i().join().replace(/\w+/g,function(a){return b[a]=c(a),g.createElement(a),'c("'+a+'")'})+");return n}")(l,g)}function k(a){var b;return a.documentShived?a:(l.shivCSS&&!f&&(b=!!h(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),g||(b=!j(a)),b&&(a.documentShived=b),a)}function p(a){var b,c=a.getElementsByTagName("*"),d=c.length,e=RegExp("^(?:"+i().join("|")+")$","i"),f=[];while(d--)b=c[d],e.test(b.nodeName)&&f.push(b.applyElement(q(b)));return f}function q(a){var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(n+":"+a.nodeName);while(d--)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function r(a){var b,c=a.split("{"),d=c.length,e=RegExp("(^|[\\s,>+~])("+i().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),f="$1"+n+"\\:$2";while(d--)b=c[d]=c[d].split("}"),b[b.length-1]=b[b.length-1].replace(e,f),c[d]=b.join("}");return c.join("{")}function s(a){var b=a.length;while(b--)a[b].removeNode()}function t(a){var b,c,d=a.namespaces,e=a.parentWindow;return!o||a.printShived?a:(typeof d[n]=="undefined"&&d.add(n),e.attachEvent("onbeforeprint",function(){var d,e,f,g=a.styleSheets,i=[],j=g.length,k=Array(j);while(j--)k[j]=g[j];while(f=k.pop())if(!f.disabled&&m.test(f.media)){for(d=f.imports,j=0,e=d.length;j<e;j++)k.push(d[j]);try{i.push(f.cssText)}catch(l){}}i=r(i.reverse().join("")),c=p(a),b=h(a,i)}),e.attachEvent("onafterprint",function(){s(c),b.removeNode(!0)}),a.printShived=!0,a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea|object|iframe)$/i,e=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,f,g;(function(){var c=b.createElement("a");c.innerHTML="<xyz></xyz>",f="hidden"in c,f&&typeof injectElementWithStyles=="function"&&injectElementWithStyles("#modernizr{}",function(b){b.hidden=!0,f=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).display=="none"}),g=c.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var l={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:k};a.html5=l,k(b);var m=/^$|\b(?:all|print)\b/,n="html5shiv",o=!g&&function(){var c=b.documentElement;return typeof b.namespaces!="undefined"&&typeof b.parentWindow!="undefined"&&typeof c.applyElement!="undefined"&&typeof c.removeNode!="undefined"&&typeof a.attachEvent!="undefined"}();l.type+=" print",l.shivPrint=t,t(b)})(this,document)
\ No newline at end of file diff --git a/dev-random2/static/js/microTags.js b/dev-random2/static/js/microTags.js new file mode 100644 index 0000000..5de44e3 --- /dev/null +++ b/dev-random2/static/js/microTags.js @@ -0,0 +1,159 @@ + +(function(doc, win, v) { + + /** + * The microTags exception + * + * @class microTags.error + * @constructor + * @param message {String} an error message + * @example + * try { + * var t = new microTags(undefined); + * } + * catch(e) { + * if (e instaceOf micrTags.error) { + * console.debug("Epic fail: " + e.message); + * } + * } + */ + function error(message) { + this.message = "microTags: " + message; + } + error.prototype = Error.prototype; + + /** + * Create a new microTags instance + * + * @class microTags + * @constructor + * @param element {HTMLElement} an element containing tags + * @param options {Object} A JSON hash containing options + */ + function microTags(element, options) { + if (!(element && element.nodeName)) + throw new error("argument #1 must be an HTMLElement !"); + this._el = element; + this._children = element.children; + + this._max_size = 3; + this._min_size = 0.7; + this._max_angle = 10; + this._min_angle = -10; + + if (options != undefined) + this._set_options(options); + + this._max_count = this._get_max_count(); + + self = this; + this.eachTag(function(element, count) { + self._make_inline(element, count); + self._set_size(element, count); + self._set_tilt(element, count); + }); + } + + /** + * the microTags current version + * + * @attribute version {String} + */ + microTags.prototype.version = v; + microTags.version = v; + + + microTags.prototype._set_options = function(options) { + var max_size = options['max-size'], + min_size = options['min-size'], + max_angle = options['max-angle'], + min_angle = options['min-angle']; + + if ((max_size >= 1) && (max_size > min_size)) + this._max_size = max_size; + else + throw error("option `max-size` must be >= 1 and > min-size"); + + if ((min_size > 0) && (min_size < max_size)) + this._min_size = min_size; + else + throw error("option `min-size` must be > 0 and < max-size"); + + if (max_angle > min_angle) { + this._max_angle = max_angle; + this._min_angle = min_angle; + } + else + throw error("option `max-angle` must be > `min-angle`"); + + } + + /** + * Apply a function on each tag + * + * @param [Function] callback: the function to apply + */ + microTags.prototype.eachTag = function(callback) { + var i, child, tag, count; + for (i=0; i < this._children.length; i++) { + child = this._children[i]; + if (child.attributes != undefined) { + window._c = child; + count = parseInt(child.attributes["data-count"].value || "1"); + callback(child, count); + } + } + } + + + microTags.prototype._get_max_count = function() { + var max = 0; + this.eachTag(function(element, count) { + max = (max < count) ? count : max; + }); + return max; + } + + + microTags.prototype._make_inline = function(element, coun) { + element.style['display'] = 'inline-block'; + } + + + microTags.prototype._set_size = function(element, count) { + var size, + max = this._max_size, + min = this._min_size, + max_count = this._max_count; + + size = (count * max / max_count); + size = (size >= min) ? size : min; + element.style['fontSize'] = size + 'em'; + } + + + microTags.prototype._set_tilt = function(element, count) { + var angle, + max = this._max_angle, + min = this._min_angle; + angle = min + (Math.random() * (max - min)); + element.style['transform'] = 'rotate(' + angle + 'deg)'; + element.style['MozTransform'] = 'rotate(' + angle + 'deg)'; + element.style['OTransform'] = 'rotate(' + angle + 'deg)'; + element.style['WebkitTransform'] = 'rotate(' + angle + 'deg)'; + element.style['msTransform'] = 'rotate(' + angle + 'deg)'; + } + + + if (win != undefined) { + win.microTags = microTags; + win.microTags.error = error; + + if (win.define && win.define.call) { + win.define(function() { + return microTags; + }); + } + } + +})(window.document, window, "0.3.2"); diff --git a/dev-random2/static/js/microTags.min.js b/dev-random2/static/js/microTags.min.js new file mode 100644 index 0000000..30015de --- /dev/null +++ b/dev-random2/static/js/microTags.min.js @@ -0,0 +1,18 @@ + +(function(doc,win,v){function error(message){this.message="microTags: "+message;} +error.prototype=Error.prototype;function microTags(element,options){if(!(element&&element.nodeName)) +throw new error("argument #1 must be an HTMLElement !");this._el=element;this._children=element.children;this._max_size=3;this._min_size=0.7;this._max_angle=10;this._min_angle=-10;if(options!=undefined) +this._set_options(options);this._max_count=this._get_max_count();self=this;this.eachTag(function(element,count){self._make_inline(element,count);self._set_size(element,count);self._set_tilt(element,count);});} +microTags.prototype.version=v;microTags.version=v;microTags.prototype._set_options=function(options){var max_size=options['max-size'],min_size=options['min-size'],max_angle=options['max-angle'],min_angle=options['min-angle'];if((max_size>=1)&&(max_size>min_size)) +this._max_size=max_size;else +throw error("option `max-size` must be >= 1 and > min-size");if((min_size>0)&&(min_size<max_size)) +this._min_size=min_size;else +throw error("option `min-size` must be > 0 and < max-size");if(max_angle>min_angle){this._max_angle=max_angle;this._min_angle=min_angle;} +else +throw error("option `max-angle` must be > `min-angle`");} +microTags.prototype.eachTag=function(callback){var i,child,tag,count;for(i=0;i<this._children.length;i++){child=this._children[i];if(child.attributes!=undefined){window._c=child;count=parseInt(child.attributes["data-count"].value||"1");callback(child,count);}}} +microTags.prototype._get_max_count=function(){var max=0;this.eachTag(function(element,count){max=(max<count)?count:max;});return max;} +microTags.prototype._make_inline=function(element,coun){element.style['display']='inline-block';} +microTags.prototype._set_size=function(element,count){var size,max=this._max_size,min=this._min_size,max_count=this._max_count;size=(count*max/max_count);size=(size>=min)?size:min;element.style['fontSize']=size+'em';} +microTags.prototype._set_tilt=function(element,count){var angle,max=this._max_angle,min=this._min_angle;angle=min+(Math.random()*(max-min));element.style['transform']='rotate('+angle+'deg)';element.style['MozTransform']='rotate('+angle+'deg)';element.style['OTransform']='rotate('+angle+'deg)';element.style['WebkitTransform']='rotate('+angle+'deg)';element.style['msTransform']='rotate('+angle+'deg)';} +if(win!=undefined){win.microTags=microTags;win.microTags.error=error;if(win.define&&win.define.call){win.define(function(){return microTags;});}}})(window.document,window,"0.3.2");
\ No newline at end of file |