diff --git a/assets/less/mio/classes/header.less b/assets/less/mio/classes/header.less index a3d88213..da9c4516 100644 --- a/assets/less/mio/classes/header.less +++ b/assets/less/mio/classes/header.less @@ -2,90 +2,233 @@ .header { display: flex; - margin: 4px 0; + align-items: center; + padding: 2px 0; @media (max-width: @mio-header-mobile) { flex-direction: column; - align-items: center; } - &__logo { - flex-grow: 0; - flex-shrink: 0; - - &__link { - color: inherit; - text-decoration: none; - cursor: pointer; - display: block; - } - - &__image { - vertical-align: bottom; - - @media (max-width: @mio-header-mobile) { - max-width: 200px; - max-height: 100px; - margin-bottom: 4px; - } - } - } - - &__menu { - flex-grow: 1; - flex-shrink: 1; - display: flex; - align-items: flex-start; - justify-content: flex-end; - - @media (max-width: @mio-header-mobile) { + @media (max-width: @mio-header-mobile) { + &__icons { + display: flex; + justify-content: space-between; width: 100%; } } - &__user { - border: 1px solid #9475b2; - display: inline-block; + &__icon { + display: none; + cursor: pointer; + width: 40px; + height: 40px; - &__content { - margin: 2px; - display: flex; + &--menu { + background-image: url('https://static.flash.moe/images/mobile-menu.png'); + background-size: 40px; + } + + @media (max-width: @mio-header-mobile) { + display: block; + } + } + + &__logo { + flex: 0 0 auto; + color: inherit; + text-decoration: none; + cursor: pointer; + display: block; + background: url('https://static.flash.moe/images/imouto-transparent.png') no-repeat center / cover; + width: 60px; + height: 60px; + font-size: 0; + + @media (max-width: @mio-header-mobile) { + width: 40px; + height: 40px; + } + } + + &__menu { + flex: 1 1 auto; + margin: 0 6px; + font-family: @mio-font-heading; + list-style: none; + display: flex; + + @media (max-width: @mio-header-mobile) { + display: none; + font-size: 1.6em; + line-height: 1.5em; + } + + &-toggle { + display: none; + + &:checked ~ .header__menu { + display: block; + } + } + + @media (max-width: @mio-header-mobile) { + width: 100%; + + &__item { + background: #c2affe; + + &:not(:last-child) { + border-bottom: 1px solid #9475b2; + } + } + + &__link { + width: 100%; + display: block; + padding: 4px 8px; + color: inherit; + text-decoration: none; + } + } + + @media (min-width: @mio-header-mobile) { + &__item { + text-align: center; + transition: background-color .2s; + + &:hover { + background-color: #c2affe; + + .header__submenu { + transform: scaleY(1); + } + } + } + + &__link { + font-size: 1.2em; + color: inherit; + text-decoration: none; + display: block; + padding: 6px 4px; + min-width: 100px; + cursor: pointer; + } + } + } + + &__submenu { + list-style: none; + display: block; + + @media (max-width: @mio-header-mobile) { + &__link { + padding: 2px 16px; + display: block; + width: 100%; + color: inherit; + text-decoration: none; + } + } + + @media (min-width: @mio-header-mobile) { + position: absolute; // floating + transform: scaleY(0); + transform-origin: center top 0; + background: #c2affe; + overflow: hidden; + z-index: 100; + text-align: left; + box-shadow: 0 1px 2px #9475b2; + transition: transform .2s; + + &:hover { + transform: scaleY(1); + } + + &__link { + color: inherit; + text-decoration: none; + display: block; + padding: 2px 6px; + min-width: 100px; + } + } + } + + &__user { + flex: 0 0 auto; + display: flex; + flex-direction: row-reverse; + order: 3; + + @media (max-width: @mio-header-mobile) { + display: none; + } + + &-toggle { + display: none; + + &:checked ~ .header__user { + display: flex; + } } &__avatar { width: 60px; height: 60px; - } - - &__links { - text-align: right; - list-style: none; - margin: 0 2px; - line-height: 1.5em; - - &__container { - flex-grow: 1; - } @media (max-width: @mio-header-mobile) { - font-size: 1.5em; + display: none; } } - &__link { + &__info { + padding: 1px; + margin-right: 4px; + display: flex; + flex-direction: column; + align-items: flex-end; + justify-content: center; + } + + &__name { color: inherit; + font-size: 1.4em; + line-height: 1.4em; + font-family: @mio-font-heading; text-decoration: none; display: block; - min-width: 70px; + display: inline-flex; + align-items: flex-end; + justify-content: right; &:hover { text-decoration: underline; } } - @media (max-width: @mio-header-mobile) { - width: 100%; - margin: 0; + &__actions { + display: flex; + flex-wrap: wrap; + justify-content: right; + list-style: none; + max-width: 100px; + font-size: .9em; + line-height: 1.4em; + } + + &__action { + padding-left: 6px; + } + + &__link { + color: inherit; + text-decoration: none; + + &:hover { + text-decoration: underline; + } } } } diff --git a/assets/less/mio/classes/input/button.less b/assets/less/mio/classes/input/button.less index d907b104..3c147a4d 100644 --- a/assets/less/mio/classes/input/button.less +++ b/assets/less/mio/classes/input/button.less @@ -27,11 +27,11 @@ } &:hover { - background-color: #A586c3; + background-color: #a586c3; } &:active { - background-color: #8364a1; + background-color: #c2affe; } } } diff --git a/views/mio/_layout/header.twig b/views/mio/_layout/header.twig new file mode 100644 index 00000000..b98ce37b --- /dev/null +++ b/views/mio/_layout/header.twig @@ -0,0 +1,86 @@ + diff --git a/views/mio/changelog/change.twig b/views/mio/changelog/change.twig index 7f6be163..84185511 100644 --- a/views/mio/changelog/change.twig +++ b/views/mio/changelog/change.twig @@ -1,5 +1,4 @@ {% extends '@mio/changelog/master.twig' %} -{% from '@mio/macros.twig' import navigation %} {% from '@mio/_layout/comments.twig' import comments_section %} {% set is_valid = change|length > 0 %} @@ -105,6 +104,4 @@ {{ comments_section(comments, comments_category, current_user|default(null), comments_perms) }} {% endif %} - - {{ navigation(mio_navigation) }} {% endblock %} diff --git a/views/mio/changelog/index.twig b/views/mio/changelog/index.twig index 24bba7a0..28dcfbc8 100644 --- a/views/mio/changelog/index.twig +++ b/views/mio/changelog/index.twig @@ -1,5 +1,5 @@ {% extends '@mio/changelog/master.twig' %} -{% from '@mio/macros.twig' import navigation, pagination %} +{% from '@mio/macros.twig' import pagination %} {% from '@mio/changelog/macros.twig' import changelog_listing %} {% from '@mio/_layout/comments.twig' import comments_section %} @@ -46,6 +46,4 @@ {{ comments_section(comments, comments_category, current_user|default(null), comments_perms) }} {% endif %} - - {{ navigation(mio_navigation) }} {% endblock %} diff --git a/views/mio/errors/master.twig b/views/mio/errors/master.twig index 5f7e5e42..40188094 100644 --- a/views/mio/errors/master.twig +++ b/views/mio/errors/master.twig @@ -1,5 +1,4 @@ {% extends '@mio/master.twig' %} -{% from '@mio/macros.twig' import navigation %} {% block content %}