@require "common/variables.styl"; @require "./common/animated.styl"; // 组件间隔 $component-interspace = 30px; .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') == true) { padding-right: $sidebar-width + $component-interspace; .main-content-right { position: absolute; right: 0; width: $sidebar-width; box-sizing: border-box; } } .main-content-left { position: relative; 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; right: ((100% - $main-content-width) / 4); bottom: $component-interspace; border-radius: 2px; padding: 2px 6px; color: var(--frist-text-color); background: var(--border-color); cursor: pointer; button { color: var(--frist-text-color); i { font-size: 1.2em; } } } */ .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; padding: 2px; width: 32px; height: 30px; border-radius: 5px; font-size: 0.9em; display: flex; align-items: center; justify-content: center; background: var(--background-color); if (hexo-config('magic.enable') == true) { magic-style(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 { padding-top: $header-shrink-height; .page-top { height: $header-shrink-height; } .sidebar-tools { top: $header-shrink-height + $component-interspace !important; } .sidebar-toc { top: $header-shrink-height + $component-interspace !important; } } @media screen and (max-width: $media-max-width) { .main-content { width: $main-content-width * 1.2 !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); } //.sidebar-toc { // right: 2% !important; //} .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); } }