diff --git a/_config.yml b/_config.yml index 333f044a7d7..cfd71f216cb 100644 --- a/_config.yml +++ b/_config.yml @@ -117,6 +117,17 @@ google_analytics_tracking_id: UA-57927901-1 # Facebook Like facebook_like: true +# Liquid template compressor +compress_html: + clippings: [] + comments: [] + endings: [] + ignore: + envs: [] + blanklines: true + profile: false + startings: [] + social: visible: false facebook: diff --git a/sass/custom/_component_page.scss b/sass/custom/_component_page.scss new file mode 100644 index 00000000000..a0cb1d53718 --- /dev/null +++ b/sass/custom/_component_page.scss @@ -0,0 +1,249 @@ +#components-page{ + .component-search{ + margin-bottom: 24px; + + input{ + width: 100%; + padding: 10px; + + background-color: #fefefe; + border-radius: 2px; + border: 1px solid; + border-color: #7c7c7c #c3c3c3 #ddd; + } + } +} + +@media only screen and (max-width: $lap-end) { + #components-page { + .filter-button-group { + margin-bottom: 16px; + + .btn { + display: inline-block; + margin-right: 8px; + margin-bottom: 8px; + + &.current { + background-color: #3A5561; + background-image: linear-gradient(to bottom, #3A5561,#3F6B7D); + } + } + } + } +} + +@media only screen and (min-width: $desk-start) { + #components-page { + .filter-button-group { + .featured { + margin: 12px 0; + } + + .added_in_current_version { + margin-top: 12px; + } + + .added_two_versions_ago { + margin-bottom: 12px; + } + + .btn { + display: block; + background: 0; + color: black; + box-shadow: none; + text-shadow: none; + padding: 2px; + + &.current { + font-weight: bold; + } + } + } + } +} + +// styles for the cards +.hass-option-cards { + display: -ms-flexbox; + display: -webkit-box; + display: -webkit-flexbox; + display: -webkit-flex; + display: flex; + + flex-direction: row; + flex-wrap: wrap; + justify-content: flex-start; + align-items: flex-start; + margin: -4px; // grid trick, has to match option-card's margin + + p.note{ + width: 100%; + } + + .option-card { + flex: 0 0 auto; + width: 210px; + height: 142px; + display: inline-block; + background-color: #fefefe; + margin: 4px; + border-radius: 2px; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); + padding: 8px; + text-align: center; + text-decoration: none; + + .img-container { + height: 50px; + margin: 8px 0; + font: 0/0 a; + + &:before { /* create a full-height inline block pseudo=element */ + content: ' '; + display: inline-block; + vertical-align: middle; /* vertical alignment of the inline element */ + height: 100%; + } + + img { + max-width: 100%; + max-height: 50px; + box-shadow: none; + border: none; + vertical-align: middle; + } + } + + .title { + text-decoration: none; + font-size: 18px; + color: #000; + line-height: 1.3em; + height: 2.6em; + } + + .category { + font-size: 14px; + color: #AAA; + } + } + + // fade-in animation + &.show-items .option-card{ + opacity:0; + -webkit-animation:new-item-animation .2s linear forwards; + -o-animation:new-item-animation .2s linear forwards; + animation:new-item-animation .2s linear forwards; + } + + // fade-out animation + &.remove-items .option-card{ + -webkit-animation:removed-item-animation .2s cubic-bezier(.55,-0.04,.91,.94) forwards; + -o-animation:removed-item-animation .2s cubic-bezier(.55,-0.04,.91,.94) forwards; + animation:removed-item-animation .2s cubic-bezier(.55,-0.04,.91,.94) forwards + } +} + +// animations for fade-in and fade-out effects of option-cards +@keyframes new-item-animation { + from { + opacity:0; + -webkit-transform:scale(0); + -ms-transform:scale(0); + -o-transform:scale(0); + transform:scale(0) + } + to { + opacity:1; + -webkit-transform:scale(1); + -ms-transform:scale(1); + -o-transform:scale(1); + transform:scale(1) + } +} +@-webkit-keyframes new-item-animation { + from { + opacity:0; + -webkit-transform:scale(0); + transform:scale(0) + } + to { + opacity:1; + -webkit-transform:scale(1); + transform:scale(1) + } +} +@-o-keyframes new-item-animation { + from { + opacity:0; + -o-transform:scale(0); + transform:scale(0) + } + to { + opacity:1; + -o-transform:scale(1); + transform:scale(1) + } +} + +// space blocker animation +@keyframes openspace { + to { + height:auto + } +} + +@-webkit-keyframes openspace { + to { + height:auto + } +} +@-o-keyframes openspace { + to { + height:auto + } +} + +// removal animation +@keyframes removed-item-animation { + from { + opacity:1; + -webkit-transform:scale(1); + -ms-transform:scale(1); + -o-transform:scale(1); + transform:scale(1) + } + to { + -webkit-transform:scale(0); + -ms-transform:scale(0); + -o-transform:scale(0); + transform:scale(0); + opacity:0 + } +} +@-webkit-keyframes removed-item-animation { + from { + opacity:1; + -webkit-transform:scale(1); + transform:scale(1) + } + to { + -webkit-transform:scale(0); + transform:scale(0); + opacity:0 + } +} +@-o-keyframes removed-item-animation { + from { + opacity:1; + -o-transform:scale(1); + transform:scale(1) + } + to { + -o-transform:scale(0); + transform:scale(0); + opacity:0 + } +} \ No newline at end of file diff --git a/sass/custom/_paulus.scss b/sass/custom/_paulus.scss index a0467c869e6..651eacf82b6 100644 --- a/sass/custom/_paulus.scss +++ b/sass/custom/_paulus.scss @@ -306,147 +306,6 @@ p.note { } } -#components-page { - .isotope-item { - z-index: 2; - } - .isotope-hidden.isotope-item { - pointer-events: none; - z-index: 1; - } - .isotope, - .isotope .isotope-item { - -webkit-transition-duration: 0.8s; - -moz-transition-duration: 0.8s; - transition-duration: 0.8s; - } - .isotope { - -webkit-transition-property: height, width; - -moz-transition-property: height, width; - transition-property: height, width; - } - .isotope .isotope-item { - -webkit-transition-property: -webkit-transform, opacity; - -moz-transition-property: -moz-transform, opacity; - transition-property: transform, opacity; - } - - - .component-search{ - margin-bottom: 24px; - - input{ - width: 100%; - padding: 10px; - - background-color: #fefefe; - border-radius: 2px; - border: 1px solid; - border-color: #7c7c7c #c3c3c3 #ddd; - } - } -} - -@media only screen and (max-width: $lap-end) { - #components-page { - .filter-button-group { - margin-bottom: 16px; - - .btn { - display: inline-block; - margin-right: 8px; - margin-bottom: 8px; - - &.current { - background-color: #3A5561; - background-image: linear-gradient(to bottom, #3A5561,#3F6B7D); - } - } - } - } -} - -@media only screen and (min-width: $desk-start) { - #components-page { - .filter-button-group { - .featured { - margin: 12px 0; - } - - .added_in_current_version { - margin-top: 12px; - } - - .added_two_versions_ago { - margin-bottom: 12px; - } - - .btn { - display: block; - background: 0; - color: black; - box-shadow: none; - text-shadow: none; - padding: 2px; - - &.current { - font-weight: bold; - } - } - } - } -} - -.hass-option-cards { - .option-card { - display: inline-block; - width: 202px; - height: 142px; - background-color: #fefefe; - margin-right: 4px; - margin-bottom: 8px; - border-radius: 2px; - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); - padding: 8px; - text-align: center; - text-decoration: none; - - .img-container { - height: 50px; - margin: 8px 0; - font: 0/0 a; - - &:before { /* create a full-height inline block pseudo=element */ - content: ' '; - display: inline-block; - vertical-align: middle; /* vertical alignment of the inline element */ - height: 100%; - } - - img { - max-width: 100%; - max-height: 50px; - box-shadow: none; - border: none; - vertical-align: middle; - } - } - - .title { - text-decoration: none; - font-size: 18px; - color: #000; - line-height: 1.3em; - height: 2.6em; - } - - .category { - font-size: 14px; - color: #AAA; - } - } -} - .aside-module { .section { margin-bottom: 16px; diff --git a/sass/screen.scss b/sass/screen.scss index c3145e5c4c7..5fed2c748de 100644 --- a/sass/screen.scss +++ b/sass/screen.scss @@ -1,3 +1,4 @@ @import 'oscailte/oscailte'; @import 'custom/paulus'; +@import 'custom/component_page'; @import 'custom/syntax'; diff --git a/source/_layouts/compress.html b/source/_layouts/compress.html new file mode 100644 index 00000000000..8248010b4a8 --- /dev/null +++ b/source/_layouts/compress.html @@ -0,0 +1,10 @@ +--- +# Jekyll layout that compresses HTML +# v3.0.2 +# http://jch.penibelst.de/ +# © 2014–2015 Anatol Broder +# MIT License +--- + +{% capture _LINE_FEED %} +{% endcapture %}{% if site.compress_html.ignore.envs contains jekyll.environment %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% assign _profile = site.compress_html.profile %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd p rt rp optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% for _element in site.compress_html.startings %}{% capture _start %}<{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _start %}{% endfor %}{% if _profile and site.compress_html.startings %}{% assign _profile_startings = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.comments == "all" %}{% assign _comments = "" | split: " " %}{% else %}{% assign _comments = site.compress_html.comments %}{% endif %}{% if _comments.size == 2 %}{% capture _comment_befores %}.{{ _content }}{% endcapture %}{% assign _comment_befores = _comment_befores | split: _comments.first %}{% for _comment_before in _comment_befores %}{% if forloop.first %}{% continue %}{% endif %}{% capture _comment_outside %}{% if _carry %}{{ _comments.first }}{% endif %}{{ _comment_before }}{% endcapture %}{% capture _comment %}{% unless _carry %}{{ _comments.first }}{% endunless %}{{ _comment_outside | split: _comments.last | first }}{% if _comment_outside contains _comments.last %}{{ _comments.last }}{% assign _carry = false %}{% else %}{% assign _carry = true %}{% endif %}{% endcapture %}{% assign _content = _content | remove_first: _comment %}{% endfor %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% assign _pre_befores = _content | split: "
" %}{% assign _pres_after = "" %}{% if _pres.size != 0 %}{% if site.compress_html.blanklines %}{% assign _lines = _pres.last | split: _LINE_FEED %}{% capture _pres_after %}{% for _line in _lines %}{% assign _trimmed = _line | split: " " | join: " " %}{% if _trimmed != empty or forloop.last %}{% unless forloop.first %}{{ _LINE_FEED }}{% endunless %}{{ _line }}{% endif %}{% endfor %}{% endcapture %}{% else %}{% assign _pres_after = _pres.last | split: " " | join: " " %}{% endif %}{% endif %}{% capture _content %}{{ _content }}{% if _pre_before contains "" %}
{% endif %}{% unless _pre_before contains "" and _pres.size == 1 %}{{ _pres_after }}{% endunless %}{% endcapture %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = "
Step | Bytes |
raw | {{ content | size }}{% if _profile_endings %} |
endings | {{ _profile_endings }}{% endif %}{% if _profile_startings %} |
startings | {{ _profile_startings }}{% endif %}{% if _profile_comments %} |
comments | {{ _profile_comments }}{% endif %}{% if _profile_collapse %} |
collapse | {{ _profile_collapse }}{% endif %}{% if _profile_clippings %} |
clippings | {{ _profile_clippings }}{% endif %} |