| @ -1,7 +1,10 @@ | |||
| import * as riot from 'riot'; | |||
| import TinyOnePage from './src/TinyOnePage.riot'; | |||
| import TinyOnePageHeightAnimate from './src/TinyOnePageHeightAnimate.js'; | |||
| riot.register('tiny-one-page', TinyOnePage); | |||
| // adding component with animate object | |||
| riot.mount('tiny-one-page'); | |||
| riot.mount('tiny-one-page', { | |||
| 'animate': new TinyOnePageHeightAnimate() | |||
| }); | |||
| @ -1,155 +1 @@ | |||
| /** | |||
| * variables | |||
| * | |||
| */ | |||
| /** | |||
| * default elements | |||
| * | |||
| */ | |||
| body { | |||
| color: #000; | |||
| background-color: #000084; | |||
| font-family: "PxPlus IBM VGA8", sans-serif; | |||
| font-style: normal; | |||
| font-size: 1.2rem; | |||
| } | |||
| *:first-letter { | |||
| color: #fefe5b; | |||
| } | |||
| a { | |||
| color: #000; | |||
| text-decoration: none; | |||
| } | |||
| /** | |||
| * navigation | |||
| * | |||
| * | |||
| */ | |||
| .navbar { | |||
| position: fixed; | |||
| top: 0; | |||
| left: 0; | |||
| width: 100%; | |||
| text-align: center; | |||
| background-color: #bbbbbb; | |||
| } | |||
| .navbar ul { | |||
| list-style: none; | |||
| margin: 0; | |||
| padding: 0.6em 0.8em; | |||
| } | |||
| .navbar ul li { | |||
| display: inline-block; | |||
| } | |||
| .navbar ul li a { | |||
| display: inline-block; | |||
| padding: 0.1em; | |||
| } | |||
| .navbar ul li a:hover { | |||
| background-color: #008106; | |||
| } | |||
| .navbar ul li.current a { | |||
| background-color: #008106; | |||
| } | |||
| /** | |||
| * | |||
| * | |||
| */ | |||
| main { | |||
| max-width: 960px; | |||
| margin: 2em auto 0; | |||
| } | |||
| /** | |||
| * footer | |||
| * | |||
| * | |||
| */ | |||
| footer { | |||
| text-align: center; | |||
| font-size: 3rem; | |||
| width: 100%; | |||
| background: #000; | |||
| padding: 0.8em 0; | |||
| } | |||
| footer i { | |||
| color: #fff !important; | |||
| } | |||
| /** | |||
| * section | |||
| * | |||
| * | |||
| */ | |||
| .section { | |||
| padding: 4em; | |||
| margin: 1em 0; | |||
| line-height: 1.8; | |||
| background-color: #bbbbbb; | |||
| } | |||
| /** | |||
| * icons | |||
| * | |||
| * | |||
| */ | |||
| [class^=icon-tiny], | |||
| [class*=" icon-tiny"] { | |||
| font-family: "PxPlus IBM VGA8", sans-serif !important; | |||
| font-style: normal; | |||
| color: #fefe5b; | |||
| } | |||
| /** | |||
| * tiny-tiny-hamburger | |||
| * | |||
| * | |||
| */ | |||
| .tiny-one-page__inner { | |||
| padding: 4px 8px 5px; | |||
| } | |||
| .tiny-one-page__modal { | |||
| height: auto; | |||
| max-height: 0; | |||
| overflow: hidden; | |||
| transition: max-height 0.2s; | |||
| } | |||
| .tiny-one-page__button { | |||
| -webkit-appearance: none; | |||
| -moz-appearance: none; | |||
| appearance: none; | |||
| border: none; | |||
| background: transparent; | |||
| padding: 0.3em 0.5em; | |||
| } | |||
| .tiny-one-page__button:hover { | |||
| cursor: pointer; | |||
| outline: none; | |||
| background-color: #bbbbbb; | |||
| } | |||
| .tiny-one-page__button:focus { | |||
| outline: none; | |||
| } | |||
| @font-face{font-family:PxPlus IBM VGA8;src:url(/fonts/PxPlus_IBM_VGA8.eot?6487324f1ac4377e882c9af6ce96da0f);src:url(/fonts/PxPlus_IBM_VGA8.eot?6487324f1ac4377e882c9af6ce96da0f?#iefix) format("embedded-opentype"),url(/fonts/PxPlus_IBM_VGA8.woff2?28087632ed5e0851a1ec27def2b1e73f) format("woff2"),url(/fonts/PxPlus_IBM_VGA8.woff?5f9b12f2cef3f405002438fafa0e41a6) format("woff"),url(/fonts/PxPlus_IBM_VGA8.ttf?8fa23fdc4e2cff030f42999bc1ede4b2) format("truetype"),url(/fonts/PxPlus_IBM_VGA8.svg?3000c157212c66cf53ad18f0d7b7a12f#PxPlus_IBM_VGA8) format("svg");font-weight:400;font-style:normal}body{color:#fff;background-color:#000084;font-family:PxPlus IBM VGA8,sans-serif;font-style:normal;font-size:1.2rem}a{text-decoration:none}.navbar{padding:10px;background-color:#bbb}@media (min-width:768px){.navbar{padding:0}}.navbar ul{list-style:none;padding:10px;margin:0;border:1px solid #000}@media (min-width:768px){.navbar ul{margin:0 0 0 10px;padding:0;border:none}}.navbar ul li{display:block;line-height:20px}@media (min-width:768px){.navbar ul li{display:inline-block}}.navbar ul li a{display:block;padding:4px 10px;color:#fff}@media (min-width:768px){.navbar ul li a{display:inline-block}}.navbar ul li.current a,.navbar ul li a:hover{color:#fff;background-color:#000}main{max-width:600px;margin:2em auto 0}footer{text-align:center;font-size:3rem;width:100%;background:#000;padding:.8em 0}footer i{color:#fff!important}.section{padding:50px .8em;line-height:1.5}@media (min-width:768px){.section{padding:50px 0}}[class*=" icon-tiny"],[class^=icon-tiny]{font-family:PxPlus IBM VGA8,sans-serif!important;font-style:normal;color:#fefe5b}.icon-tiny-one-page-open:after{content:"\2630"}.icon-tiny-one-page-close:after{content:"\2A2F"}.tiny-one-page__modal{position:fixed;top:0;left:0;width:100%;z-index:99;height:auto;max-height:0;overflow:hidden;transition:max-height .2s}@media (min-width:768px){.tiny-one-page__modal{max-height:none!important}}.tiny-one-page__button{position:fixed;top:0;right:0;font-size:1.8rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;padding:.7em .8em;z-index:100}.tiny-one-page__button:focus,.tiny-one-page__button:hover{outline:none}.tiny-one-page__button:hover{cursor:pointer}@media (min-width:768px){.tiny-one-page__button{display:none}} | |||
| @ -1,30 +0,0 @@ | |||
| .navbar { | |||
| position: fixed; | |||
| width: 100%; | |||
| text-align: center; | |||
| background-color: white; | |||
| } | |||
| .navbar li { | |||
| display: inline-block; | |||
| margin: 0 0.3em; | |||
| } | |||
| .navbar li a { | |||
| display: block; | |||
| transition: all 0.1s ease-in-out; | |||
| } | |||
| .navbar li a:hover { | |||
| transform: scale(1.3); | |||
| } | |||
| .navbar li.current a { | |||
| transform: scale(1.3); | |||
| } | |||
| .section { | |||
| padding: 6em; | |||
| line-height: 1.8; | |||
| } | |||
| @ -0,0 +1,11 @@ | |||
| @font-face { | |||
| font-family: 'PxPlus IBM VGA8'; | |||
| src: url('PxPlus_IBM_VGA8.eot'); | |||
| src: url('PxPlus_IBM_VGA8.eot?#iefix') format('embedded-opentype'), | |||
| url('PxPlus_IBM_VGA8.woff2') format('woff2'), | |||
| url('PxPlus_IBM_VGA8.woff') format('woff'), | |||
| url('PxPlus_IBM_VGA8.ttf') format('truetype'), | |||
| url('PxPlus_IBM_VGA8.svg#PxPlus_IBM_VGA8') format('svg'); | |||
| font-weight: normal; | |||
| font-style: normal; | |||
| } | |||
| @ -0,0 +1,69 @@ | |||
| /** | |||
| * TinyHamburgerAnimate | |||
| * | |||
| * Class for new Animation Classes for TinyHamburger. Prepare-Functions will be called | |||
| * to change styles. All Prepare-Functions are called in the same function from | |||
| * TinyHamburger.riot | |||
| * | |||
| * @author Björn Hase | |||
| * @license http://opensource.org/licenses/MIT The MIT License | |||
| * @link https://gitlab.tentakelfabrik.de/tentakelfabrik/tiny-components/tiny-hamburger GitLab Repository | |||
| */ | |||
| export default class TinyOnePageAnimate | |||
| { | |||
| /** | |||
| * | |||
| * | |||
| */ | |||
| constructor() | |||
| { | |||
| } | |||
| /** | |||
| * setting component to interact with | |||
| * | |||
| * @param {object} component | |||
| */ | |||
| setComponent(component) | |||
| { | |||
| this.component = component; | |||
| } | |||
| /** | |||
| * get Styles | |||
| * | |||
| * @return {string} | |||
| */ | |||
| getStyles() | |||
| { | |||
| return null; | |||
| } | |||
| /** | |||
| * | |||
| * | |||
| */ | |||
| prepareMounted() | |||
| { | |||
| } | |||
| /** | |||
| * | |||
| * | |||
| */ | |||
| prepareOpen() | |||
| { | |||
| } | |||
| /** | |||
| * | |||
| * | |||
| */ | |||
| prepareClose() | |||
| { | |||
| } | |||
| } | |||
| @ -0,0 +1,52 @@ | |||
| import TinyOnePageAnimate from './TinyOnePageAnimate'; | |||
| /** | |||
| * TinyHamburgerLeftAnimate | |||
| * | |||
| * Animation for a Panel that slides left in Screen | |||
| * | |||
| * @author Björn Hase | |||
| * @license http://opensource.org/licenses/MIT The MIT License | |||
| * @link https://gitlab.tentakelfabrik.de/tentakelfabrik/tiny-components/tiny-hamburger GitLab Repository | |||
| */ | |||
| export default class TinyOnePageHeightAnimate extends TinyOnePageAnimate | |||
| { | |||
| /** | |||
| * | |||
| * | |||
| */ | |||
| constructor() | |||
| { | |||
| super(); | |||
| this.maxHeight = 0; | |||
| } | |||
| /** | |||
| * set max-height | |||
| * | |||
| * @return {string} | |||
| */ | |||
| getStyles() | |||
| { | |||
| return 'max-height:' + this.maxHeight + 'px'; | |||
| } | |||
| /** | |||
| * set height of content | |||
| * | |||
| */ | |||
| prepareOpen() | |||
| { | |||
| this.maxHeight = this.component.$('.tiny-one-page__inner') | |||
| .getBoundingClientRect().height; | |||
| } | |||
| /** | |||
| * set height to 0 | |||
| * | |||
| */ | |||
| prepareClose() | |||
| { | |||
| this.maxHeight = 0; | |||
| } | |||
| } | |||
| @ -0,0 +1,11 @@ | |||
| @font-face { | |||
| font-family: 'PxPlus IBM VGA8'; | |||
| src: url('PxPlus_IBM_VGA8.eot'); | |||
| src: url('PxPlus_IBM_VGA8.eot?#iefix') format('embedded-opentype'), | |||
| url('PxPlus_IBM_VGA8.woff2') format('woff2'), | |||
| url('PxPlus_IBM_VGA8.woff') format('woff'), | |||
| url('PxPlus_IBM_VGA8.ttf') format('truetype'), | |||
| url('PxPlus_IBM_VGA8.svg#PxPlus_IBM_VGA8') format('svg'); | |||
| font-weight: normal; | |||
| font-style: normal; | |||
| } | |||