@require "common/variables.styl"; @require "./common/animated.styl"; .page-template { padding-top: $header-height; position: relative; .page-top { position: fixed; top: 0; width: 100%; height: $header-height; z-index: $z-index-5; box-sizing: border-box; transition(); } .page-middle { width: 100%; display: flex; justify-content: center; padding: $component-interspace 0; .main-content { width: $main-content-width; height: 100%; position: relative; box-sizing: border-box; if (hexo-config('magic.enable') && hexo-config('magic.sidebar.enable')) { if (hexo-config('magic.sidebar.position') == left) { padding-left: $sidebar-width + $component-interspace; } else { padding-right: $sidebar-width + $component-interspace; } .main-content-right { position: absolute; if (hexo-config('magic.sidebar.position') == left) { left: 0; } else { right: 0; } width: $sidebar-width; box-sizing: border-box; } } .main-content-left { position: relative; if (hexo-config('magic.sidebar.position') == left) { float: right; } else { float: left; } width: 100%; box-sizing: border-box; } } .sidebar-tools { position: fixed; top: $header-height + $component-interspace; if (hexo-config('side_tools.position') == left) { left: ((100% - $main-content-width) / 4); } else { right: ((100% - $main-content-width) / 4); } transition(); } .scroll-to-top { display: none; position: fixed; if (hexo-config('back2top.position') == left) { left: ((100% - $main-content-width) / 4); } else { right: ((100% - $main-content-width) / 4); } bottom: $component-interspace; li { cursor: pointer; width: $tool-button-width; height: $tool-button-width; border-radius: 5px; font-size: 1em; display: flex; align-items: center; justify-content: center; background: var(--background-color); if (hexo-config('magic.enable') == true) { magic-style(1.1, 1.1); } else { border: 1px solid var(--third-text-color); } &:hover { transition(); color: var(--background-color); background: var(--primary-color); } } } } .page-bottom { width: 100%; } } .page-top-shrink { transition(); padding-top: $header-shrink-height; .page-top { height: $header-shrink-height; } .sidebar-tools { top: $header-shrink-height + $component-interspace !important; } } @media screen and (max-width: $media-max-width) { .page-template { padding-top: $header-height - 10px !important; } .page-top { height: $header-height - 10px !important; } .main-content { width: 80% !important; } .sidebar-tools { if (hexo-config('side_tools.position') == left) { left: 2% !important; transform-origin: left top; } else { right: 2% !important; transform-origin: right top; } transform: scale(0.8); } .scroll-to-top { if (hexo-config('back2top.position') == left) { left: 2% !important; transform-origin: left bottom; } else { right: 2% !important; transform-origin: right bottom; } transform: scale(0.8); } } @media screen and (max-width: $media-max-width-mobile) { .page-template { padding-top: $header-height - 20px !important; } .page-top { height: $header-height - 20px !important; } .main-content { width: 90% !important; } }