diff --git a/less/main.less b/less/main.less new file mode 100644 index 0000000..c7c55b5 --- /dev/null +++ b/less/main.less @@ -0,0 +1,580 @@ +/* + Raconteur template stylesheet + + Adapted from the Mere Anarchy stylesheet. + +*/ + +@import url(http://fonts.googleapis.com/css?family=Noto+Serif:400,700,400italic); + +// Definitions + +// 1. Typography + +// 1.1 Font Stacks +@body-font: 'Noto Serif', serif; +@header-font: 'Noto Serif', serif; +@cursive-font: 'Noto Serif', serif; + +// 1.2 Font Sizing + +html { font-size: 14pt; } // Everything is relative to this + +@body-size: 1rem; +@header-size: 2.5rem; +@title-size: 3rem; + +// Colours + +@text-colour: rgba(0,0,0,0.9); +@anchor-colour: #D29506; +@option-colour: #125D79; + +@button-background: #FF9800; +@button-colour: #EDEDDE; + +// Backgrounds + +@text-bg: #fafafa; +@title-bg: #FF9800; // Orange +@body-bg: #78909C; // Blue grey + +// Mixins + +.fade-in() { + animation: fadeIn 500ms ease-in-out; + -webkit-animation: fadeIn 500ms ease-in-out; + //-moz-animation: fadeIn 500ms; + a { + animation: fadeInA 500ms ease-in-out; + -webkit-animation: fadeInA 500ms ease-in-out; + } + +} + +.material_shadow() { + box-shadow: 1px 1px 1px 1px rgba(0,0,0,0.25), + 1px 0px 2px 0px rgba(0,0,0,0.10); +} + +.material_colors(@bg) { + background: @bg; + border-bottom: 1px solid darken(@bg, 10%); + border-right: 1px solid darken(@bg, 10%); +} + +.material() { + .material_colors(@text-bg); + .material_shadow(); +} + +/* Basic element styling */ + +body { + background: @body-bg; + font-family: @body-font; + font-size: @body-size; + line-height: 1.6em; + background-attachment: fixed; + overflow-y: scroll; + color: @text-colour; +} + +h1 { + font-family: @cursive-font; + font-size: @header-size; + letter-spacing: 2px; + margin: 1em 0; + text-align: center; + font-weight: normal; +} + +p { + margin: 0; + -webkit-transition: text-indent 0.25s ease; + transition: text-indent 0.25s ease; + +} + +#content { + + p { + text-indent: 2rem; + line-height: 1.6rem; + } + + h1 { + line-height: 2rem; + } + + h1 + p { + text-indent: 0; + } +} + +/* Basic structure */ +#page { + margin: 0 auto; + position: relative; +} + +#mid_panel { + margin: 0 10.5rem; +} + +/* The title block */ +#title, #title .label, #content, .tools { + border-radius: 2px; +} +#title { + max-width: 28em; + margin: 2.2rem auto 1.1rem auto; + padding: 2.6rem; + cursor: pointer; /* Until we click to start. */ + border-radius: 0.5rem; + .material_shadow(); + .material_colors(@title-bg); +} +#title .label { + .material(); + overflow: hidden; + padding: 1.5rem; + margin: auto; + max-width: 18rem; + position: relative; +} + +#title h1 { + font-family: @header-font; + font-size: @title-size; + line-height: 1em; + font-weight: normal; + padding: 0; + border-bottom: none; + margin: 1rem 0; +} +#title h2 { + font-size: 1.5em; + font-weight: normal; + text-align: center; + font-family: @cursive-font; + margin: 1.1em 0 0 0; +} +#title h3 { + font-size: 1.0em; + font-weight: normal; + text-align: center; + margin: 1.1em 0 0 0; +} + +#title .click_message { + display: none; + left: 0; + right: 0; + bottom: 0; + position: absolute; + font-size: 0.9em; + font-style: italic; + text-align: center; +} +#title .noscript_message { + left: 0; + right: 0; + bottom: 0; + position: absolute; + font-size: 0.9em; + font-style: italic; + text-align: center; +} + +/* Main content */ +#content_wrapper { + .material(); + max-width: 28em; + position: relative; + margin: 0.6em auto 1.1em auto; + padding: 2.8em; + display: none; /* Shown by Javascript */ + overflow: auto; + border-radius: 0.2rem; +} + +span.drop + p { + text-indent: -0.4em; +} + +hr { + border: none; + background-color: rgba(128,128,128,0.5); + margin: -1px 0 -1px -2.8em; + width: 1em; + height: 1px; + float: left; // Stops hr elements from interfering with text flow. + .fade-in(); + display: none; + + p + & { + // Stops hr elements from "stacking" with one another. + display: block; + } + +} + +#content h1 +p, #content h1 + img + p { + text-indent: 0; +} + +#content h1 + p:first-line, +#content h1 + img + p:first-line { + font-weight: normal; + font-style: italic; +} +#content h1 + p:first-letter, +#content h1 + img + p:first-letter { + display: block; + width: 1rem; + height: 1rem; + position: relative; + float: left; + font-weight: normal; + font-style: italic; + font-size: 2rem; + margin-right: -.1rem; +} + +ul { + margin: 0; + padding: 0 0 0 1em; +} +ul.options { + padding: 0; + margin-top: 0.5em; + margin-bottom: 0.7em; + list-style-type: none; + border-radius: 4px; +} +ul.options li { + border-bottom: 1px solid rgba(255,255,255,0.3); + padding: 0.5em; + text-align: center; + + a { + color: @option-colour; + transition: color 0.2s ease-in; + + &:hover { + color: lighten(@option-colour, 10%); + } + } + + &:hover{ + @hover-colour: lighten(spin(@option-colour, -40), 50%); + background: + linear-gradient(to right, fade(@hover-colour, 0%)0%, + fade(@hover-colour, 80%) 50%, + fade(@hover-colour, 0%) 100%); + cursor: pointer; + } +} + +ul.options li:last-child { + border-bottom: none; +} + + +h1:first-child { + margin-top: 0; +} +a { + color: @anchor-colour; + text-decoration: none; + border-bottom: 1px solid transparent; + transition: color 0.1s ease-in; +} +a.raw { + padding-right: 14px; + background: transparent url("../img/external_link.png") no-repeat right 4px; +} +a:hover { + color: lighten(@anchor-colour, 10%); +} + +img.float_right { + float: right; + margin: 1.1em 0 1.1em 1.1em; +} +img.float_left { + float: left; + margin: 1.1em 1.1em 1.1em 0; +} + +#toolbar { + display: none; +} + +#tools_wrapper { + position: fixed; + width: 100%; + max-width: 56em; + top: 2.2em; + left: 0; + right: 0; + margin: 0 auto; + display: none; /* Shown by Javascript */ +} +.tools { + padding: 0.6em; + width: 9rem; + .material(); +} +.tools p { + font-size: 0.95em; + line-height: 1.5em; +} +.tools.left { + float: left; + left: 0.4em; +} +.tools.right { + float: right; + right: 0.4em; +} + +.tools h1 { + font-size: 1.5rem; + font-weight: normal; + padding-bottom: 0; + margin-bottom: 0; +} +.buttons { + padding-top: 0.6em; + margin-top: 0.6em; + border-top: 1px solid #321; + text-align: center; +} +.buttons button { + font-size: 0.8em; + background: @button-background; + color: @button-colour; + border: 1px rgba(0,0,0,0.2) solid; + padding: 0.3em 1.0em; + cursor: pointer; + border-radius: 2px; + box-shadow: rgba(0,0,0,0.4) 0px 0px 2px 0px; + + &:hover { + background: lighten(@button-background, 20%); + } + + &[disabled], &[disabled]:hover { + background: darken(@button-background, 20%); + color: @button-background;; + cursor: default; + } + + & + button { + margin-left: 0.3rem; + } + +} + +#legal { + max-width: 33em; + margin: 1em auto 0 auto; + padding-bottom: 2.2em; + display: none; /* Shown by Javascript */ + + p { + font-size: 0.7rem; + line-height: 1.3rem; + margin-bottom: 0.5rem; + color: #d0d0d0; + + & + p { + text-indent: 0; + } + } + +} + +#character { + font-size: 0.9rem; + line-height: 1.4em; +} +#qualities .quality, #character_text { + position: relative; + clear: both; + overflow: hidden; + margin: 0 -0.25em; + padding: 0 0.25em; +} +#character_text { + margin-bottom: 0.6em; +} +#character_text_content { + position: relative; + z-index: 100; +} +#qualities span { + position: relative; + z-index: 100; + display: block; +} +#qualities span.name { + float: left; +} +#qualities span.value { + float: right; +} + +/* Styles for specific quality groups */ + +#g_inventory{ + .qualities_in_group { + + div { + + .name { + width: 100%; + } + + .value { + width: 90%; + } + + } + + } +} + +.highlight { + background: rgba(255, 255, 255, 0.75); + position: absolute; + left: -4px; + right: -4px; + top: 0; + bottom: 0; +} +#qualities h2 { + margin: 0.5em 0 0.25em 0; + font-size: 1.5rem; + font-weight: normal; + font-family: @header-font; + border-bottom: 1px solid rgba(0,0,0,0.5); + text-align: left; +} + +.progress_bar { + position: relative; + left: -2em; + margin: 0; +} +.progress_bar_track { + z-index: 100; + background: rgba(0,0,0,0.1); + height: 0.75em; + width: 26.6em; + clear: both; +} +.progress_bar_color { + background: @title-bg; + width: 0; + height: 0.75em; +} +.progress_bar span { + z-index: 100; +} +.progress_bar .name { + font-weight: normal; +} +.progress_bar .value { + float: right; +} +.progress_bar .left_label { + float: left; +} +.progress_bar .right_label { + float: right; +} +#content_library, #ui_library { + display: none; +} +#menu { + display: none; +} + +#info_panel p { + font-style: italic; + font-size: 0.8rem; + margin-bottom: 0.8rem; + + & + p { + text-indent: 0; + } +} + +/* Animate newly inserted DOM elements within content */ + +/* "Why don't we just use opacity?" + "Because opacity, creates massive jank and this doesn't. Browsers!" +*/ + +@keyframes fadeIn { + from { + color: rgba(0,0,0,0); + } + to { + color: rgba(0,0,0,1); + } +} + +@-webkit-keyframes fadeIn { + from { + color: rgba(0,0,0,0); + } + to { + color: rgba(0,0,0,1); + } +} + +@keyframes fadeInA { + 0% { + color: transparentize(@anchor-colour, 1); + } + 100% { + color: transparentize(@anchor-colour, 0); + } +} + +@-webkit-keyframes fadeInA { + from { + color: transparentize(@anchor-colour, 1); + } + to { + color: transparentize(@anchor-colour, 0); + } +} + +@keyframes fadeInS { + 0% { + color: transparentize(@option-colour, 1); + } + 100% { + color: @option-colour; + } +} + +@-webkit-keyframes fadeInS { + from { + color: transparentize(@option-colour, 1); + } + to { + color: @option-colour; + } +} + +.fade { + .fade-in(); +} + +@import "mobile.less"; \ No newline at end of file diff --git a/less/mobile.less b/less/mobile.less new file mode 100644 index 0000000..0cfa8bd --- /dev/null +++ b/less/mobile.less @@ -0,0 +1,154 @@ +@media screen and (max-width: 715px) { + + body { + margin: 0; + line-height: 1.5rem; + -webkit-text-size-adjust: none; + } + + /* Structure */ + #page { + padding-top: 1.9em; + margin: 0.5em; + } + #mid_panel { + margin: 0; + } + + /* Title */ + #title { + margin-top: 20px; + padding: 1.0em 0.5em; + box-shadow: none; + max-width: 100%; + h1 { + font-size: 3rem; + line-height: 4rem; + } + } + #title .label { + font-size: 0.65em; + max-width: 80%; + padding: 2.0em; + box-shadow: none; + } + + /* Side panels */ + #tools_wrapper { + position: static; + } + .tools { + background: @text-bg; + position: relative; + width: auto; + box-shadow: none; + } + #character_panel { + display: none; + } + #info_panel { + display: none; + } + #tools_wrapper { + display: block; + } + + /* Main content */ + #content_wrapper { + width: auto; + padding: 2.0em; + border-radius: 0; + } + #content { + font-size: 16px; + line-height: 1.5em; + + h1 { + margin-bottom: 1rem; + } + } + + /* Toolbar and menu */ + #toolbar { + position: fixed; + z-index: 300; + left: 0; + right: 0; + top: 0; + height: 36px; + padding: 8px; + overflow: hidden; + .material(); + } + #toolbar h1 { + float: left; + font-weight: normal; + font-size: 22px; + margin: 8px 0 0 0; + padding: 0 10px; + color: #fc6; + } + #toolbar .nav { + float: right; + margin: 0; + } + + .icon-menu { + width: 1.5rem; + height: 1.5rem; + } + + .menubars { + fill: #a0a0a0; + } + + + #menu { + display: none; + position: fixed; + top: 52px; + left: 0; + right: 0; + font-size: 16px; + background: #f0f0dd; + z-index: 200; + list-style-type: none; + padding: 10px 0 0 0; + margin: 0; + + +} + + #menu-button { + position: relative; + display: block; + .material_shadow(); + .material_colors(@title-bg); + width: 3rem; + font-size: 1rem; + padding: 0.2rem; + border-radius: 2px; + text-align: center; + color: black; + + &:hover { + background: lighten(@title-bg, 20%); + } + + &:active { + background: lighten(@title-bg, 20%); + box-shadow: none; + } + } + +#menu li { + border-bottom: 1px solid rgba(0,0,0,0.25); + +} + +#menu a { + display: block; + padding: 10px 20px; +} + +} \ No newline at end of file