diff --git a/src/assets/styles/element-variables.scss b/src/assets/styles/element-variables.scss index 1615ff2..4d270e1 100644 --- a/src/assets/styles/element-variables.scss +++ b/src/assets/styles/element-variables.scss @@ -4,7 +4,7 @@ **/ /* theme color */ -$--color-primary: #1890ff; +$--color-primary: #f8414d; $--color-success: #13ce66; $--color-warning: #ffba00; $--color-danger: #ff4949; @@ -20,7 +20,7 @@ $--border-color-lighter: #e6ebf5; $--table-border: 1px solid #dfe6ec; /* icon font path, required */ -$--font-path: '~element-ui/lib/theme-chalk/fonts'; +$--font-path: "~element-ui/lib/theme-chalk/fonts"; @import "~element-ui/packages/theme-chalk/src/index"; diff --git a/src/assets/styles/font.css b/src/assets/styles/font.css new file mode 100644 index 0000000..5d24f1c --- /dev/null +++ b/src/assets/styles/font.css @@ -0,0 +1,8 @@ +@font-face { + font-family: "Alibaba-PuHuiTi-Bold"; + src: url("http://www.jichuanglanhai.com/demo/taicang-file/fonts/Alibaba-PuHuiTi-Bold.otf"); +} +@font-face { + font-family: "Alibaba-PuHuiTi-Regular"; + src: url("http://www.jichuanglanhai.com/demo/taicang-file/fonts/Alibaba-PuHuiTi-Regular.otf"); +} \ No newline at end of file diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 2f3b9ef..032748a 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -1,16 +1,18 @@ -@import './variables.scss'; -@import './mixin.scss'; -@import './transition.scss'; -@import './element-ui.scss'; -@import './sidebar.scss'; -@import './btn.scss'; +@import "./font.css"; +@import "./variables.scss"; +@import "./mixin.scss"; +@import "./transition.scss"; +@import "./element-ui.scss"; +@import "./sidebar.scss"; +@import "./btn.scss"; body { height: 100%; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; - font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; + font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, + Microsoft YaHei, Arial, sans-serif; } label { @@ -104,7 +106,8 @@ aside { display: block; line-height: 32px; font-size: 16px; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, + Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; color: #2c3e50; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -122,6 +125,8 @@ aside { //main-container全局样式 .app-container { padding: 20px; + height: 100%; + width: 100%; } .components-container { @@ -134,7 +139,7 @@ aside { } .text-center { - text-align: center + text-align: center; } .sub-navbar { @@ -145,7 +150,13 @@ aside { text-align: right; padding-right: 20px; transition: 600ms ease position; - background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%); + background: linear-gradient( + 90deg, + rgba(32, 182, 249, 1) 0%, + rgba(32, 182, 249, 1) 0%, + rgba(33, 120, 241, 1) 100%, + rgba(33, 120, 241, 1) 100% + ); .subtitle { font-size: 20px; diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss index abe5b63..1c3b750 100644 --- a/src/assets/styles/sidebar.scss +++ b/src/assets/styles/sidebar.scss @@ -1,35 +1,35 @@ #app { - .main-container { height: 100%; - transition: margin-left .28s; + transition: margin-left 0.28s; margin-left: $base-sidebar-width; position: relative; } .sidebarHide { - margin-left: 0!important; + margin-left: 0 !important; } .sidebar-container { - -webkit-transition: width .28s; + -webkit-transition: width 0.28s; transition: width 0.28s; width: $base-sidebar-width !important; background-color: $base-menu-background; height: 100%; - position: fixed; + // position: fixed; font-size: 0px; top: 0; bottom: 0; left: 0; z-index: 1001; overflow: hidden; - -webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35); - box-shadow: 2px 0 6px rgba(0,21,41,.35); + -webkit-box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35); + box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35); // reset element-ui css .horizontal-collapse-transition { - transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out; + transition: 0s width ease-in-out, 0s padding-left ease-in-out, + 0s padding-right ease-in-out; } .scrollbar-wrapper { @@ -70,7 +70,8 @@ width: 100% !important; } - .el-menu-item, .el-submenu__title { + .el-menu-item, + .el-submenu__title { overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; @@ -88,7 +89,7 @@ color: $base-menu-color-active !important; } - & .nest-menu .el-submenu>.el-submenu__title, + & .nest-menu .el-submenu > .el-submenu__title, & .el-submenu .el-menu-item { min-width: $base-sidebar-width !important; @@ -97,7 +98,7 @@ } } - & .theme-dark .nest-menu .el-submenu>.el-submenu__title, + & .theme-dark .nest-menu .el-submenu > .el-submenu__title, & .theme-dark .el-submenu .el-menu-item { background-color: $base-sub-menu-background !important; @@ -132,20 +133,19 @@ .el-submenu { overflow: hidden; - &>.el-submenu__title { + & > .el-submenu__title { padding: 0 !important; .svg-icon { margin-left: 20px; } - } } .el-menu--collapse { .el-submenu { - &>.el-submenu__title { - &>span { + & > .el-submenu__title { + & > span { height: 0; width: 0; overflow: hidden; @@ -168,7 +168,7 @@ } .sidebar-container { - transition: transform .28s; + transition: transform 0.28s; width: $base-sidebar-width !important; } @@ -182,7 +182,6 @@ } .withoutAnimation { - .main-container, .sidebar-container { transition: none; @@ -192,13 +191,13 @@ // when menu collapsed .el-menu--vertical { - &>.el-menu { + & > .el-menu { .svg-icon { margin-right: 16px; } } - .nest-menu .el-submenu>.el-submenu__title, + .nest-menu .el-submenu > .el-submenu__title, .el-menu-item { &:hover { // you can use $subMenuHover @@ -207,7 +206,7 @@ } // the scroll bar appears when the subMenu is too long - >.el-menu--popup { + > .el-menu--popup { max-height: 100vh; overflow-y: auto; diff --git a/src/layout/components/MyHead/index.vue b/src/layout/components/MyHead/index.vue new file mode 100644 index 0000000..b4f4d6c --- /dev/null +++ b/src/layout/components/MyHead/index.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/src/layout/components/index.js b/src/layout/components/index.js index 104bd3a..487ea0c 100644 --- a/src/layout/components/index.js +++ b/src/layout/components/index.js @@ -3,3 +3,4 @@ export { default as Navbar } from './Navbar' export { default as Settings } from './Settings' export { default as Sidebar } from './Sidebar/index.vue' export { default as TagsView } from './TagsView/index.vue' +export { default as MyHead } from './MyHead' diff --git a/src/layout/index.vue b/src/layout/index.vue index 8f1c3ad..5891d08 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -1,112 +1,160 @@ diff --git a/src/settings.js b/src/settings.js index 6a0b09f..7a21511 100644 --- a/src/settings.js +++ b/src/settings.js @@ -2,7 +2,7 @@ module.exports = { /** * 侧边栏主题 深色主题theme-dark,浅色主题theme-light */ - sideTheme: 'theme-dark', + sideTheme: "theme-dark", /** * 是否系统布局配置 @@ -22,12 +22,12 @@ module.exports = { /** * 是否固定头部 */ - fixedHeader: false, + fixedHeader: true, /** * 是否显示logo */ - sidebarLogo: true, + sidebarLogo: false, /** * 是否显示动态标题 @@ -40,5 +40,5 @@ module.exports = { * The default is only used in the production env * If you want to also use it in dev, you can pass ['production', 'development'] */ - errorLog: 'production' -} + errorLog: "production", +};