diff --git a/packages/client/public/styles/common/base.less b/packages/client/public/styles/common/base.less index 788f2cf..0eab4ae 100644 --- a/packages/client/public/styles/common/base.less +++ b/packages/client/public/styles/common/base.less @@ -95,75 +95,3 @@ hr { background-color: @gray; background-image: repeating-linear-gradient(-45deg, @white, @white 4px, transparent 4px, transparent 8px); } - -.container { - min-height: 100vh; - transition: transform .3s; - - &.slide-left { - transform: translateX(-180px); - box-shadow: 2px 0 6px rgba(0, 0, 0, .2); - overflow: hidden; - } -} - -.mobile-menu { - display: none; - position: fixed; - right: 0; - top: 0; - width: 180px; - min-height: 100vh; - overflow: hidden; - background-color: rgba(lighten(@theme-color, 80%), .1); - transform: translate3d(180px, 0, 0); - transition: transform .3s; - - &.open { - transform: translate3d(0, 0, 0); - } - - @media @screen { - display: block; - } -} - -.layout { - margin: 0 auto; - width: @global-body-width; - - @media @screen { - width: 100%; - } -} - -.main { - display: flex; - padding: 20px 10px; - min-height: 600px; - box-sizing: border-box; - .layout(); - - @media @screen { - padding: 10px 0; - } - - & > .content { - flex: 3; - border-radius: 4px; - background: @white; - - @media @screen { - flex: 1; - } - } - - & > .asider { - flex: 1; - margin-left: 20px; - - @media @screen { - display: none; - } - } -} diff --git a/packages/client/public/styles/includes/footer.less b/packages/client/public/styles/includes/footer.less index ab5e9c2..ab2528f 100644 --- a/packages/client/public/styles/includes/footer.less +++ b/packages/client/public/styles/includes/footer.less @@ -61,6 +61,7 @@ } .copy { + font-size: @font-size-small; background: rgba(@theme-color, .1); p { diff --git a/packages/client/public/styles/includes/header.less b/packages/client/public/styles/includes/header.less index 7bba569..0ea136a 100644 --- a/packages/client/public/styles/includes/header.less +++ b/packages/client/public/styles/includes/header.less @@ -1,5 +1,5 @@ .header { - height: 55px; + height: 50px; box-shadow: 0 1px 4px rgba(0, 0, 0, .1); background-color: @white; @@ -13,8 +13,8 @@ } .logo { - flex: 0 0 55px; - .size(55px); + flex: 0 0 50px; + .size(50px); } .search { @@ -77,9 +77,8 @@ .avatar { display: inline-block; - .size(40px); - vertical-align: middle; + .size(40px); img { border-radius: 50%; @@ -95,7 +94,7 @@ .drop-menus { display: none; position: absolute; - top: 55px; + top: 50px; left: 50%; width: 120px; color: @white; diff --git a/packages/client/public/styles/index.less b/packages/client/public/styles/index.less index 0c7f575..0b1a81a 100644 --- a/packages/client/public/styles/index.less +++ b/packages/client/public/styles/index.less @@ -9,6 +9,7 @@ @import './includes/header.less'; @import './includes/footer.less'; @import './includes/aider.less'; +@import './pages/layout.less'; @import './pages/topic.less'; // @import './pages/user.less' // @import './pages/reply.less'; diff --git a/packages/client/public/styles/pages/layout.less b/packages/client/public/styles/pages/layout.less new file mode 100644 index 0000000..bc0c30b --- /dev/null +++ b/packages/client/public/styles/pages/layout.less @@ -0,0 +1,94 @@ +.container { + min-height: 100vh; + transition: transform .3s; + + &.slide-left { + transform: translateX(-180px); + box-shadow: 2px 0 6px rgba(0, 0, 0, .2); + overflow: hidden; + } +} + +.mobile-menu { + display: none; + position: fixed; + right: 0; + top: 0; + width: 180px; + min-height: 100vh; + overflow: hidden; + background-color: rgba(lighten(@theme-color, 80%), .1); + transform: translate3d(180px, 0, 0); + transition: transform .3s; + + &.open { + transform: translate3d(0, 0, 0); + } + + @media @screen { + display: block; + } + + .account { + display: block; + padding-top: 20px; + text-align: center; + + & > .divider { + margin: 0 10px; + } + + .avatar { + .size(40px); + + img { + border-radius: 50%; + } + } + } + + ul.menu { + text-align: center; + } +} + +.layout { + margin: 0 auto; + width: @global-body-width; + + @media @screen { + width: 100%; + } +} + +.main { + display: flex; + padding: 20px 10px; + min-height: 600px; + box-sizing: border-box; + .layout(); + + @media @screen { + padding: 0; + border-top: 1px solid @gray-light; + } + + & > .content { + flex: 3; + border-radius: 4px; + background: @white; + + @media @screen { + flex: 1; + } + } + + & > .asider { + flex: 1; + margin-left: 20px; + + @media @screen { + display: none; + } + } +} diff --git a/packages/client/views/includes/footer.pug b/packages/client/views/includes/footer.pug index 0944270..167f594 100644 --- a/packages/client/views/includes/footer.pug +++ b/packages/client/views/includes/footer.pug @@ -4,32 +4,32 @@ .title span.mints.mints-home span Mints. - p.copyright 蜀ICP备17043710号-1 + p.copyright 蜀ICP备18037778号-1 .contact span 联系我们: - a.mints.mints-github(href="") + a.mints.mints-github(href="https://github.com/mintsweet/practice", target="_blank") ul.about li .title About .links - a(href="") 关于本站 - a(href="") 反馈与建议 - a(href="") 加入我们 + a(href="https://docs.mintsweet.cn/", target="_blank") 关于本站 + a(href="https://github.com/mintsweet/practice/issues", target="_blank") 反馈与建议 + a(href="https://github.com/mintsweet/practice/pulls", target="_blank") 加入我们 li .title 开发者 .links - a(href="") 开发者指南 - a(href="") API + a(href="https://docs.mintsweet.cn/#/codespecification", target="_blank") 开发者指南 + a(href="https://docs.mintsweet.cn/#/API", target="_blank") API li .title 客户端 .links - a(href="") APP + a(href="https://github.com/mintsweet/practice/blob/master/packages/mobile/README.md") APP .mobile-link - a(href="") 关于本站 + a(href="https://docs.mintsweet.cn/", target="_blank") 关于本站 span.divider · a(href="https://github.com/mintsweet/practice", target="_blank") 源码 span.divider · - a(href="") 反馈与建议 + a(href="https://github.com/mintsweet/practice/issues", target="_blank") 反馈与建议 .copy .layout p © 2019 All Rights Reserved diff --git a/packages/client/views/layout.pug b/packages/client/views/layout.pug index 3aaa4bb..c2da59e 100644 --- a/packages/client/views/layout.pug +++ b/packages/client/views/layout.pug @@ -20,3 +20,20 @@ html block footer include ./includes/footer.pug .mobile-menu + if user + a.account(href=`/user/${user.id}`) + .avatar + img(src=user.avatar) + .nickname #{user.nickname} + else if config.ALLOW_SIGNUP + .account + a(href="/signin") 登录 + span.divider | + a(href="/signup") 注册 + else + .account + a(href="/auth/github") 使用 GitHub 登录 + ul.menu + each item in config.menus + li + a(href=item.url, target=`${item.url.indexOf('http') === 0 ? '_blank' : '_self'}`) #{item.name}