This commit is contained in:
结发受长生 2019-05-09 23:10:12 +08:00
parent 1a915a94cb
commit f7b8721ec6
23 changed files with 1337 additions and 1395 deletions

View File

@ -63,7 +63,7 @@ deg是旋转的角度 , 正数表示顺时针旋转 , 负数表示逆时针旋
同名函数接受2个参数 , 分别表示在X轴和Y轴上的移动距离 , 正数代表向该轴的正方向移动 , 负数代表向负方向移动 同名函数接受2个参数 , 分别表示在X轴和Y轴上的移动距离 , 正数代表向该轴的正方向移动 , 负数代表向负方向移动
```css ```css
.translate_div { .translate_div {
tranform : translate(100px, 20px); transform : translate(100px, 20px);
} }
``` ```
![translate-x-y](/images/前端杂烩/animation/translate-x-y.png) ![translate-x-y](/images/前端杂烩/animation/translate-x-y.png)

View File

@ -1,5 +1,5 @@
<script> <script>
window.yiliaConfig = { window.themeConfig = {
isHome: <%=is_home()%>, // 是否为首页 isHome: <%=is_home()%>, // 是否为首页
isPost: <%=is_post()%>, // 是否为文章全文页面 isPost: <%=is_post()%>, // 是否为文章全文页面
isArchive: <%=is_archive()%>, // 是否为归档页面 isArchive: <%=is_archive()%>, // 是否为归档页面
@ -7,7 +7,8 @@ window.yiliaConfig = {
isCategory: <%=is_category()%>, // 是否为分类页面 isCategory: <%=is_category()%>, // 是否为分类页面
pageid: <%-page.pageid ? `"${page.pageid}"` : 'undefined'%>, // 页面标识, 用于个性化页面开发 pageid: <%-page.pageid ? `"${page.pageid}"` : 'undefined'%>, // 页面标识, 用于个性化页面开发
toc_hide_index: <%=theme.toc_hide_index%>, // 目录序号 toc_hide_index: <%=theme.toc_hide_index%>, // 目录序号
root: "<%=config.root%>" // 资源根路径 root: "<%=config.root%>", // 资源根路径
pictureCdn: "<%=config.picture_cdn%>" // 图片存储仓库地址
} }
</script> </script>
<%- partial('script') %> <%- partial('script') %>

View File

@ -2839,12 +2839,6 @@
"entities": "^1.1.1" "entities": "^1.1.1"
} }
}, },
"dom101": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/dom101/-/dom101-1.3.0.tgz",
"integrity": "sha1-1/yjBoYkAXG2zxfC6FXWoy+iyck=",
"dev": true
},
"domain-browser": { "domain-browser": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz",

View File

@ -21,7 +21,6 @@
"autoprefixer": "^6.5.1", "autoprefixer": "^6.5.1",
"clean-webpack-plugin": "^0.1.15", "clean-webpack-plugin": "^0.1.15",
"css-loader": "^2.1.1", "css-loader": "^2.1.1",
"dom101": "^1.3.0",
"file-loader": "^3.0.1", "file-loader": "^3.0.1",
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.6.0", "mini-css-extract-plugin": "^0.6.0",

View File

@ -48,8 +48,8 @@
.article-entry{ .article-entry{
line-height: 1.8em; line-height: 1.8em;
padding-right: 7.6923%; padding-right: $articlePadding;
padding-left: 7.6923%; padding-left: $articlePadding;
.post-count { // 字数统计 .post-count { // 字数统计
color: rgb(185, 185, 185); color: rgb(185, 185, 185);
font-size: 14px; font-size: 14px;
@ -61,7 +61,7 @@
} }
} }
img { img {
transition: transform 0.2s ease-out,box-shadow 0.5s ease; transition: transform 0.3s ease-out,box-shadow 0.4s ease;
cursor: zoom-in; cursor: zoom-in;
&:hover { &:hover {
transform: scale(1.05,1.05); transform: scale(1.05,1.05);

View File

@ -86,7 +86,7 @@
.article-header{ .article-header{
border-left: 5px solid #4d4d4d; border-left: 5px solid #4d4d4d;
padding: 30px 0px 15px 25px; padding: 30px 0px 15px 25px;
padding-left: 7.6923%; padding-left: $articlePadding;
} }
.article-meta{ .article-meta{

View File

@ -1,118 +1,118 @@
.wrap-side-operation { .wrap-side-operation {
position: fixed; position: fixed;
right: 40px; right: 40px;
bottom: 50px; bottom: 50px;
z-index: 999; z-index: 999;
font-size: 14px; font-size: 14px;
.icon-plane { .icon-plane {
color: $colorF;
text-shadow: 1px 1px 1px #509eb7;
opacity: 0.7;
font-size: 52px;
line-height: 40px;
width: 40px;
text-align: center;
display: block;
}
}
.mod-side-operation {
width: 40px;
text-align: center;
}
.jump-container:hover .icon-back {
background: rgba(36, 193, 246, 0.9);
}
.jump-container, .toc-container {
position: relative;
cursor: pointer;
width: 40px;
height: 40px;
opacity: .8;
}
.jump-plan-container {
position: absolute;
top: -11px;
left: -4px;
width: 50px;
height: 61px;
overflow: hidden;
.jump-plane {
display: block;
position: absolute;
width: 42px;
height: 66px;
transform: translateY(68px);
left: -2px;
}
}
.mod-side-operation__jump-to-top .icon-back {
transition: 0.3s;
color: $colorF; color: $colorF;
background: #ccc; text-shadow: 1px 1px 1px #509eb7;
transform: rotate(90deg); opacity: 0.7;
font-size: 32px; font-size: 52px;
line-height: 40px; line-height: 40px;
width: 40px; width: 40px;
text-align: center; text-align: center;
display: block; display: block;
&:hover { }
background: #24c1f6; }
color: #24c1f6; .mod-side-operation {
} width: 40px;
text-align: center;
}
.jump-container:hover .icon-back {
background: rgba(36, 193, 246, 0.9);
}
.jump-container, .toc-container {
position: relative;
cursor: pointer;
width: 40px;
height: 40px;
opacity: .8;
}
.jump-plan-container {
position: absolute;
top: -11px;
left: -4px;
width: 50px;
height: 61px;
overflow: hidden;
.jump-plane {
display: block;
position: absolute;
width: 42px;
height: 66px;
transform: translateY(68px);
left: -2px;
}
}
.mod-side-operation__jump-to-top .icon-back {
transition: 0.3s;
color: $colorF;
background: #ccc;
transform: rotate(90deg);
font-size: 32px;
line-height: 40px;
width: 40px;
text-align: center;
display: block;
&:hover {
background: #24c1f6;
color: #24c1f6;
}
} }
.toc-container.tooltip-left{ .toc-container.tooltip-left{
background: $colorC; background: $colorC;
margin-top: 10px; margin-top: 10px;
transition: 0.3s; transition: 0.3s;
&:hover { &:hover {
background: rgba(36, 193, 246, 0.9); background: rgba(36, 193, 246, 0.9);
}
.icon-font {
font-size: 22px;
line-height: 40px;
color: $colorF;
}
.tooltip {
width: 40px;
height: 40px;
top: 0;
left: 0;
}
.tooltip-east .tooltip-content {
min-height: 100px;
text-align: left;
padding: 5px 0 5px 20px;
right: 4.7em;
min-width: 200px;
width: initial;
font-size: 14px;
text-shadow: 1px 1px 1px #398199;
bottom: -10px;
transform-origin: 100% 100%;
transform: translate3d(0, -10px, 0) rotate3d(1, 1, 1, -30deg);
a {
color: $colorF;
} }
.icon-font { &::after {
font-size: 22px; top: initial;
line-height: 40px; bottom: 23px;
color: $colorF;
} }
.tooltip { .toc-article {
width: 40px; max-height: 500px;
height: 40px; overflow-x: hidden;
top: 0; overflow-y: auto;
left: 0;
} }
.tooltip-east .tooltip-content { .toc-article li ol, .toc-article li ul {
min-height: 100px; margin-left: 30px;
text-align: left;
padding: 5px 0 5px 20px;
right: 4.7em;
min-width: 200px;
width: initial;
font-size: 14px;
text-shadow: 1px 1px 1px #398199;
bottom: -10px;
transform-origin: 100% 100%;
transform: translate3d(0, -10px, 0) rotate3d(1, 1, 1, -30deg);
a {
color: $colorF;
}
&::after {
top: initial;
bottom: 23px;
}
.toc-article {
max-height: 500px;
overflow-x: hidden;
overflow-y: auto;
}
.toc-article li ol, .toc-article li ul {
margin-left: 30px;
}
.toc-article li {
white-space: nowrap;
}
} }
.tooltip:hover .tooltip-content { .toc-article li {
bottom: -10px; white-space: nowrap;
transform: translate(0);
} }
}
.tooltip:hover .tooltip-content {
bottom: -10px;
transform: translate(0);
}
} }

View File

@ -6,385 +6,355 @@
//----------------------------------------------------- //-----------------------------------------------------
%animation-basic { %animation-basic {
animation-duration: 0.3s; animation-duration: 0.3s;
animation-fill-mode: both; animation-fill-mode: both;
} }
// fade in/out // fade in/out
//----------------------------------------------------- //-----------------------------------------------------
@mixin animation-fade-in($className: fade, $from: 0) { @mixin animation-fade-in($className: fade, $from: 0) {
$name: str-insert(In, $className, 0); $name: str-insert(In, $className, 0);
.#{$className}-in { .#{$className}-in {
animation-name: $name; animation-name: $name;
@extend %animation-basic; @extend %animation-basic;
} }
@include animation-fade($name: $name, $from: $from); @include animation-fade($name: $name, $from: $from);
} }
@mixin animation-fade-out($className: fade, $to: 0) { @mixin animation-fade-out($className: fade, $to: 0) {
$name: str-insert(Out, $className, 0); $name: str-insert(Out, $className, 0);
.#{$className}-out { .#{$className}-out {
animation-name: $name; animation-name: $name;
@extend %animation-basic; @extend %animation-basic;
} }
@include animation-fade($name: $name, $from: 1, $to: $to); @include animation-fade($name: $name, $from: 1, $to: $to);
} }
// shrink in/out // shrink in/out
//----------------------------------------------------- //-----------------------------------------------------
@mixin animation-shrink-in($className: shrink, $from: 0.815) { @mixin animation-shrink-in($className: shrink, $from: 0.815) {
$name: str-insert(In, $className, 0); $name: str-insert(In, $className, 0);
.#{$className}-in { .#{$className}-in {
animation-name: $name; animation-name: $name;
@extend %animation-basic; @extend %animation-basic;
}
@keyframes #{$name} {
0% {
opacity: 0;
transform: scale($from);
} }
@keyframes #{$name} { 100% {
0% { opacity: 1;
opacity: 0; transform: scale(1);
transform: scale($from);
}
100% {
opacity: 1;
transform: scale(1);
}
} }
}
} }
@mixin animation-shrink-out($className: shrink, $to: 1.185) { @mixin animation-shrink-out($className: shrink, $to: 1.185) {
$name: str-insert(Out, $className, 0); $name: str-insert(Out, $className, 0);
.#{$className}-out { .#{$className}-out {
animation-name: $name; animation-name: $name;
@extend %animation-basic; @extend %animation-basic;
} }
@keyframes #{$name} { @keyframes #{$name} {
0% { 0% {
opacity: 1; opacity: 1;
transform: scale(1); transform: scale(1);
}
100% {
opacity: 0;
transform: scale($to);
}
} }
100% {
opacity: 0;
transform: scale($to);
}
}
} }
// down in/out // down in/out
//----------------------------------------------------- //-----------------------------------------------------
@mixin animation-down-in($className: down, $value: 100%) { @mixin animation-down-in($className: down, $value: 100%) {
$name: str-insert(In, $className, 0); $name: str-insert(In, $className, 0);
.#{$className}-in { .#{$className}-in {
animation-name: $name; animation-name: $name;
@extend %animation-basic; @extend %animation-basic;
} }
@keyframes #{$name} { @keyframes #{$name} {
0% { 0% {
opacity: 0; opacity: 0;
transform: translate(0, $value); transform: translate(0, $value);
}
100% {
opacity: 1;
transform: translate(0, 0);
}
} }
100% {
opacity: 1;
transform: translate(0, 0);
}
}
} }
@mixin animation-down-out($className: down, $value: 100%) { @mixin animation-down-out($className: down, $value: 100%) {
$name: str-insert(Out, $className, 0); $name: str-insert(Out, $className, 0);
.#{$className}-out { .#{$className}-out {
animation-name: $name; animation-name: $name;
@extend %animation-basic; @extend %animation-basic;
} }
@keyframes #{$name} { @keyframes #{$name} {
0% { 0% {
opacity: 1; opacity: 1;
transform: translate(0, 0); transform: translate(0, 0);
}
100% {
opacity: 0;
transform: translate(0, $value);
}
} }
100% {
opacity: 0;
transform: translate(0, $value);
}
}
} }
// up in/out // up in/out
//----------------------------------------------------- //-----------------------------------------------------
@mixin animation-up-in($className: up, $value: -100%) { @mixin animation-up-in($className: up, $value: -100%) {
$name: str-insert(In, $className, 0); $name: str-insert(In, $className, 0);
.#{$className}-in { .#{$className}-in {
animation-name: $name; animation-name: $name;
@extend %animation-basic; @extend %animation-basic;
} }
@keyframes #{$name} { @keyframes #{$name} {
0% { 0% {
opacity: 0; opacity: 0;
transform: translate(0, $value); transform: translate(0, $value);
}
100% {
opacity: 1;
transform: translate(0, 0);
}
} }
100% {
opacity: 1;
transform: translate(0, 0);
}
}
} }
@mixin animation-up-out($className: up, $value: -100%) { @mixin animation-up-out($className: up, $value: -100%) {
$name: str-insert(Out, $className, 0); $name: str-insert(Out, $className, 0);
.#{$className}-out { .#{$className}-out {
animation-name: $name; animation-name: $name;
@extend %animation-basic; @extend %animation-basic;
} }
@keyframes #{$name} { @keyframes #{$name} {
0% { 0% {
opacity: 1; opacity: 1;
transform: translate(0, 0); transform: translate(0, 0);
}
100% {
opacity: 0;
transform: translate(0, $value);
}
} }
100% {
opacity: 0;
transform: translate(0, $value);
}
}
} }
// left in/out // left in/out
//----------------------------------------------------- //-----------------------------------------------------
@mixin animation-left-in($className: left, $value: -100%) { @mixin animation-left-in($className: left, $value: -100%) {
$name: str-insert(In, $className, 0); $name: str-insert(In, $className, 0);
.#{$className}-in { .#{$className}-in {
animation-name: $name; animation-name: $name;
@extend %animation-basic; @extend %animation-basic;
} }
@keyframes #{$name} { @keyframes #{$name} {
0% { 0% {
opacity: 0; opacity: 0;
transform: translate($value, 0); transform: translate($value, 0);
}
100% {
opacity: 1;
transform: translate(0, 0);
}
} }
100% {
opacity: 1;
transform: translate(0, 0);
}
}
} }
@mixin animation-left-out($className: left, $value: -100%) { @mixin animation-left-out($className: left, $value: -100%) {
$name: str-insert(Out, $className, 0); $name: str-insert(Out, $className, 0);
.#{$className}-out { .#{$className}-out {
animation-name: $name; animation-name: $name;
@extend %animation-basic; @extend %animation-basic;
} }
@keyframes #{$name} { @keyframes #{$name} {
0% { 0% {
opacity: 1; opacity: 1;
transform: translate(0, 0); transform: translate(0, 0);
}
100% {
opacity: 0;
transform: translate($value, 0);
}
} }
100% {
opacity: 0;
transform: translate($value, 0);
}
}
} }
// right in/out // right in/out
//----------------------------------------------------- //-----------------------------------------------------
@mixin animation-right-in($className: right, $value: 100%) { @mixin animation-right-in($className: right, $value: 100%) {
$name: str-insert(In, $className, 0); $name: str-insert(In, $className, 0);
.#{$className}-in { .#{$className}-in {
animation-name: $name; animation-name: $name;
@extend %animation-basic; @extend %animation-basic;
} }
@keyframes #{$name} { @keyframes #{$name} {
0% { 0% {
opacity: 0; opacity: 0;
transform: translate($value, 0); transform: translate($value, 0);
}
100% {
opacity: 1;
transform: translate(0, 0);
}
} }
100% {
opacity: 1;
transform: translate(0, 0);
}
}
} }
@mixin animation-right-out($className: right, $value: 100%) { @mixin animation-right-out($className: right, $value: 100%) {
$name: str-insert(Out, $className, 0); $name: str-insert(Out, $className, 0);
.#{$className}-out { .#{$className}-out {
animation-name: $name; animation-name: $name;
@extend %animation-basic; @extend %animation-basic;
} }
@keyframes #{$name} { @keyframes #{$name} {
0% { 0% {
opacity: 1; opacity: 1;
transform: translate(0, 0); transform: translate(0, 0);
}
100% {
opacity: 0;
transform: translate($value, 0);
}
} }
100% {
opacity: 0;
transform: translate($value, 0);
}
}
} }
/*弹性动画*/ /*弹性动画*/
@keyframes leftIn { @keyframes leftIn {
from, 60%, 75%, 90%, to { from, 60%, 75%, 90%, to {
animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
} }
0% { 0% {
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
} }
60% { 60% {
transform: translate3d(358px, 0, 0); transform: translate3d(358px, 0, 0);
} }
75% { 75% {
transform: translate3d(323px, 0, 0); transform: translate3d(323px, 0, 0);
} }
90% { 90% {
transform: translate3d(338px, 0, 0); transform: translate3d(338px, 0, 0);
} }
to { to {
transform: translate3d(333px, 0, 0); transform: translate3d(333px, 0, 0);
} }
} }
%anmLeftIn { %anmLeftIn {
animation-duration: .8s; animation-duration: .8s;
animation-fill-mode: both; animation-fill-mode: both;
animation-name: leftIn; animation-name: leftIn;
} }
@keyframes leftOut { @keyframes leftOut {
from, 60%, 75%, 90%, to { from, 60%, 75%, 90%, to {
animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
} }
0% { 0% {
transform: translate3d(333px, 0, 0); transform: translate3d(333px, 0, 0);
} }
60% { 60% {
transform: translate3d(-25px, 0, 0); transform: translate3d(-25px, 0, 0);
} }
75% { 75% {
transform: translate3d(10px, 0, 0); transform: translate3d(10px, 0, 0);
} }
90% { 90% {
transform: translate3d(-5px, 0, 0); transform: translate3d(-5px, 0, 0);
} }
to { to {
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
} }
} }
%anmLeftOut { %anmLeftOut {
animation-duration: .8s; animation-duration: .8s;
animation-name: leftOut; animation-name: leftOut;
} }
@keyframes smallLeftIn { @keyframes smallLeftIn {
from, 60%, 75%, 90%, to { from, 60%, 75%, 90%, to {
animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
} }
0% {transform: translate3d(0, 0, 0);}
0% { 60% {transform: translate3d(325px, 0, 0);}
transform: translate3d(0, 0, 0); 75% {transform: translate3d(290px, 0, 0);}
} 90% {transform: translate3d(305px, 0, 0);}
to {transform: translate3d(300px, 0, 0);}
60% {
transform: translate3d(325px, 0, 0);
}
75% {
transform: translate3d(290px, 0, 0);
}
90% {
transform: translate3d(305px, 0, 0);
}
to {
transform: translate3d(300px, 0, 0);
}
} }
%anmSmallLeftIn { %anmSmallLeftIn {
animation-duration: .8s; animation-duration: .8s;
animation-fill-mode: both; animation-fill-mode: both;
animation-name: smallLeftIn; animation-name: smallLeftIn;
} }
@keyframes smallleftOut { @keyframes smallleftOut {
from, 60%, 75%, 90%, to { from, 60%, 75%, 90%, to {
animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
} }
0% {transform: translate3d(333px, 0, 0);}
0% { 60% {transform: translate3d(-25px, 0, 0);}
transform: translate3d(333px, 0, 0); 75% {transform: translate3d(10px, 0, 0);}
} 90% {transform: translate3d(-5px, 0, 0);}
to {transform: translate3d(0, 0, 0);}
60% {
transform: translate3d(-25px, 0, 0);
}
75% {
transform: translate3d(10px, 0, 0);
}
90% {
transform: translate3d(-5px, 0, 0);
}
to {
transform: translate3d(0, 0, 0);
}
} }
%anmSmallLeftOut { %anmSmallLeftOut {
animation-duration: .8s; animation-duration: .8s;
animation-fill-mode: both; animation-fill-mode: both;
animation-name: smallleftOut; animation-name: smallleftOut;
} }
// 头像旋转动画 // 头像旋转动画
@keyframes profilepic { @keyframes profilepic {
0% { 0% {
transform: rotate(360deg); transform: rotate(360deg);
} }
100% { 100% {
transform: rotate(0deg); transform: rotate(0deg);
} }
} }
%picRotate { %picRotate {
animation: profilepic 5s linear infinite; animation: profilepic 5s linear infinite;
} }

File diff suppressed because it is too large Load Diff

View File

@ -12,21 +12,21 @@
// 1. Prevent mobile text size adjust after orientation change, without disabling user zoom. // 1. Prevent mobile text size adjust after orientation change, without disabling user zoom.
// 2. Remove the gray background color from tap, default value is inherit // 2. Remove the gray background color from tap, default value is inherit
html { html {
-ms-text-size-adjust: 100%; // 1 -ms-text-size-adjust: 100%; // 1
-webkit-text-size-adjust: 100%; // 1 -webkit-text-size-adjust: 100%; // 1
-webkit-tap-highlight-color: transparent; // 2 -webkit-tap-highlight-color: transparent; // 2
height: 100%; height: 100%;
} }
// 1. Remove default margin // 1. Remove default margin
body { body {
margin: 0; // 1 margin: 0; // 1
font-size: $fontSize; font-size: $fontSize;
font-family: $fontFamily; font-family: $fontFamily;
line-height: $fontLineHeight; line-height: $fontLineHeight;
color: $colorText; color: $colorText;
background-color: $colorBg; background-color: $colorBg;
min-height: 100%; min-height: 100%;
} }
// HTML5 display definitions // HTML5 display definitions
@ -48,7 +48,7 @@ menu,
nav, nav,
section, section,
summary { summary {
display: block; display: block;
} }
// 1. Correct `inline-block` display not defined in IE 9-. // 1. Correct `inline-block` display not defined in IE 9-.
@ -56,14 +56,14 @@ audio,
canvas, canvas,
progress, progress,
video { video {
display: inline-block; // 1 display: inline-block; // 1
} }
// Prevent modern browsers from displaying `audio` without controls. // Prevent modern browsers from displaying `audio` without controls.
// Remove excess height in iOS 5 devices. // Remove excess height in iOS 5 devices.
audio:not([controls]) { audio:not([controls]) {
display: none; display: none;
height: 0; height: 0;
} }
// Add the correct vertical alignment in Chrome, Firefox, and Opera. // Add the correct vertical alignment in Chrome, Firefox, and Opera.
@ -73,9 +73,8 @@ progress {
// Address `[hidden]` styling not present in IE 8/9/10. // Address `[hidden]` styling not present in IE 8/9/10.
// Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. // Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
[hidden], [hidden],template {
template { display: none;
display: none;
} }
// Links // Links
@ -85,13 +84,13 @@ template {
// 2. Improve readability when focused and also mouse hovered in all browsers. // 2. Improve readability when focused and also mouse hovered in all browsers.
a { a {
background: transparent; // 1 background: transparent; // 1
text-decoration: none; text-decoration: none;
color: nth($colorLink, 1); color: nth($colorLink, 1);
&:active { &:active {
outline: 0; // 2 outline: 0; // 2
} }
} }
// Text-level semantics // Text-level semantics
@ -99,46 +98,44 @@ a {
// Address styling not present in IE 8/9/10/11, Safari, and Chrome. // Address styling not present in IE 8/9/10/11, Safari, and Chrome.
abbr[title] { abbr[title] {
border-bottom: 1px dotted; border-bottom: 1px dotted;
} }
// Address style set to `bolder` in Firefox 4+, Safari, and Chrome. // Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
b, b,strong {
strong { font-weight: bold;
font-weight: bold;
} }
// Address styling not present in Safari and Chrome. // Address styling not present in Safari and Chrome.
dfn { dfn {
font-style: italic; font-style: italic;
} }
// Address styling not present in IE 8/9. // Address styling not present in IE 8/9.
mark { mark {
background: #ff0; background: #ff0;
color: #000; color: #000;
} }
// Address inconsistent and variable font size in all browsers. // Address inconsistent and variable font size in all browsers.
small { small {
font-size: 80%; font-size: 80%;
} }
// Prevent `sub` and `sup` affecting `line-height` in all browsers. // Prevent `sub` and `sup` affecting `line-height` in all browsers.
sub, sub,sup {
sup { font-size: 75%;
font-size: 75%; line-height: 0;
line-height: 0; position: relative;
position: relative; vertical-align: baseline;
vertical-align: baseline;
} }
sup { sup {
top: -0.5em; top: -0.5em;
} }
sub { sub {
bottom: -0.25em; bottom: -0.25em;
} }
// Embedded content // Embedded content
@ -146,14 +143,14 @@ sub {
// 1. Remove border when inside `a` element in IE 8/9/10. // 1. Remove border when inside `a` element in IE 8/9/10.
img { img {
border: 0; // 1 border: 0; // 1
vertical-align: middle; vertical-align: middle;
max-width: 100%; max-width: 100%;
} }
// Correct overflow not hidden in IE 9/10/11. // Correct overflow not hidden in IE 9/10/11.
svg:not(:root) { svg:not(:root) {
overflow: hidden; overflow: hidden;
} }
// Grouping content // Grouping content
@ -162,10 +159,10 @@ svg:not(:root) {
// 1. Contain overflow in all browsers. // 1. Contain overflow in all browsers.
// 2. Improve readability of pre-formatted text in all browsers. // 2. Improve readability of pre-formatted text in all browsers.
pre { pre {
overflow: auto; // 1 overflow: auto; // 1
white-space: pre; // 2 white-space: pre; // 2
white-space: pre-wrap; // 2 white-space: pre-wrap; // 2
word-wrap: break-word; // 2 word-wrap: break-word; // 2
} }
// 1. Address odd `em`-unit font size rendering in all browsers. // 1. Address odd `em`-unit font size rendering in all browsers.
@ -173,8 +170,8 @@ code,
kbd, kbd,
pre, pre,
samp { samp {
font-family: monospace, monospace; // 1 font-family: monospace, monospace; // 1
font-size: 1em; // 2 font-size: 1em; // 2
} }
// Forms // Forms
@ -184,7 +181,7 @@ samp {
// styling of `select`, unless a `border` property is set. // styling of `select`, unless a `border` property is set.
// 1. Correct color not being inherited. // 1. Correct color not being inherited.
// Known issue: affects color of disabled elements. // Known issue: affects color of disabled elements.
// 2. Correct font properties not being inherited. // 2. Correct font properties not being inherited.
// 3. Address margins set differently in Firefox 4+, Safari, and Chrome. // 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
button, button,
@ -192,10 +189,10 @@ input,
optgroup, optgroup,
select, select,
textarea { textarea {
color: inherit; // 1 color: inherit; // 1
font: inherit; // 2 font: inherit; // 2
margin: 0; // 3 margin: 0; // 3
vertical-align: middle; vertical-align: middle;
} }
// Show the overflow in IE. // Show the overflow in IE.
@ -204,47 +201,46 @@ textarea {
button, button,
input, // 1 input, // 1
select { // 2 select { // 2
overflow: visible; overflow: visible;
} }
// Address inconsistent `text-transform` inheritance for `button` and `select`. // Address inconsistent `text-transform` inheritance for `button` and `select`.
// All other form control elements do not inherit `text-transform` values. // All other form control elements do not inherit `text-transform` values.
// Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. // Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
// Correct `select` style inheritance in Firefox. // Correct `select` style inheritance in Firefox.
button, button,select {
select { text-transform: none;
text-transform: none;
} }
// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` // 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
// and `video` controls. // and `video` controls.
// 2. Correct inability to style clickable `input` types in iOS. // 2. Correct inability to style clickable `input` types in iOS.
// 3. Improve usability and consistency of cursor style between image-type // 3. Improve usability and consistency of cursor style between image-type
// `input` and others. // `input` and others.
button, button,
html input[type="button"], // 1 html input[type="button"], // 1
input[type="reset"], input[type="reset"],
input[type="submit"] { input[type="submit"] {
-webkit-appearance: button; // 2 -webkit-appearance: button; // 2
cursor: pointer; // 3 cursor: pointer; // 3
} }
// Re-set default cursor for disabled elements. // Re-set default cursor for disabled elements.
[disabled] { [disabled] {
cursor: default; cursor: default;
} }
// Remove inner padding and border in Firefox 4+. // Remove inner padding and border in Firefox 4+.
button::-moz-focus-inner, button::-moz-focus-inner,
input::-moz-focus-inner { input::-moz-focus-inner {
border: 0; border: 0;
padding: 0; padding: 0;
} }
// 1. Address Firefox 4+ setting `line-height` on `input` using `!important` in // 1. Address Firefox 4+ setting `line-height` on `input` using `!important` in
// the UA stylesheet. // the UA stylesheet.
input { input {
line-height: normal; // 1 line-height: normal; // 1
} }
// It's recommended that you don't attempt to style these elements. // It's recommended that you don't attempt to style these elements.
@ -254,8 +250,8 @@ input {
// 2. Remove excess padding in IE 8/9/10. // 2. Remove excess padding in IE 8/9/10.
input[type="checkbox"], input[type="checkbox"],
input[type="radio"] { input[type="radio"] {
box-sizing: border-box; // 1 box-sizing: border-box; // 1
padding: 0; // 2 padding: 0; // 2
} }
// Fix the cursor style for Chrome's increment/decrement buttons. For certain // Fix the cursor style for Chrome's increment/decrement buttons. For certain
@ -263,15 +259,15 @@ input[type="radio"] {
// decrement button to change from `default` to `text`. // decrement button to change from `default` to `text`.
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { input[type="number"]::-webkit-outer-spin-button {
height: auto; height: auto;
} }
// 1. Address `appearance` set to `searchfield` in Safari and Chrome. // 1. Address `appearance` set to `searchfield` in Safari and Chrome.
// 2. Address `box-sizing` set to `border-box` in Safari and Chrome // 2. Address `box-sizing` set to `border-box` in Safari and Chrome
// (include `-moz` to future-proof). // (include `-moz` to future-proof).
input[type="search"] { input[type="search"] {
-webkit-appearance: textfield; // 1 -webkit-appearance: textfield; // 1
box-sizing: border-box; box-sizing: border-box;
} }
// Remove inner padding and search cancel button in Safari and Chrome on OS X. // Remove inner padding and search cancel button in Safari and Chrome on OS X.
@ -279,34 +275,34 @@ input[type="search"] {
// padding (and `textfield` appearance). // padding (and `textfield` appearance).
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none; -webkit-appearance: none;
} }
// Define consistent border, margin, and padding. // Define consistent border, margin, and padding.
fieldset { fieldset {
border: 1px solid #c0c0c0; border: 1px solid #c0c0c0;
margin: 0 2px; margin: 0 2px;
padding: 0.35em 0.625em 0.75em; padding: 0.35em 0.625em 0.75em;
} }
// 1. Correct `color` not being inherited in IE 8/9/10/11. // 1. Correct `color` not being inherited in IE 8/9/10/11.
// 2. Remove padding so people aren't caught out if they zero out fieldsets. // 2. Remove padding so people aren't caught out if they zero out fieldsets.
legend { legend {
border: 0; // 1 border: 0; // 1
padding: 0; // 2 padding: 0; // 2
} }
// 1. Remove default vertical scrollbar in IE 8/9/10/11. // 1. Remove default vertical scrollbar in IE 8/9/10/11.
textarea { textarea {
overflow: auto; // 1 overflow: auto; // 1
resize: vertical; resize: vertical;
vertical-align: top; vertical-align: top;
} }
// Don't inherit the `font-weight` (applied by a rule above). // Don't inherit the `font-weight` (applied by a rule above).
// NOTE: the default cannot safely be changed in Chrome and Safari on OS X. // NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
optgroup { optgroup {
font-weight: bold; font-weight: bold;
} }
// webkit focus outline // webkit focus outline
@ -314,19 +310,18 @@ input,
select, select,
textarea, textarea,
button { button {
outline: 0; outline: 0;
} }
// Android input focus 消除高亮外框 // Android input focus 消除高亮外框
textarea, textarea,input {
input { -webkit-user-modify: read-write-plaintext-only;
-webkit-user-modify: read-write-plaintext-only;
} }
// ie10 clear & password // ie10 clear & password
input::-ms-clear, input::-ms-clear,
input::-ms-reveal { input::-ms-reveal {
display: none; display: none;
} }
// 表单placeholder样式 // 表单placeholder样式
@ -334,85 +329,84 @@ input::-ms-reveal {
// Firefox 19+ // Firefox 19+
input::-moz-placeholder, input::-moz-placeholder,
textarea::-moz-placeholder { textarea::-moz-placeholder {
color: $colorPlaceholder; color: $colorPlaceholder;
} }
// Internet Explorer 10+ // Internet Explorer 10+
input:-ms-input-placeholder, input:-ms-input-placeholder,
textarea:-ms-input-placeholder { textarea:-ms-input-placeholder {
color: $colorPlaceholder; color: $colorPlaceholder;
} }
// Safari and Chrome // Safari and Chrome
input::-webkit-input-placeholder, input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder { textarea::-webkit-input-placeholder {
color: $colorPlaceholder; color: $colorPlaceholder;
} }
// 如不支持placeholder添加class 或者 设置提示的placeholder // 如不支持placeholder添加class 或者 设置提示的placeholder
.placeholder{ .placeholder{
color: $colorPlaceholder; color: $colorPlaceholder;
} }
// Tables // Tables
//----------------------------------------------------- //-----------------------------------------------------
// Remove most spacing between table cells. // Remove most spacing between table cells.
table { table {
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
} }
td, td,th {
th { padding: 0;
padding: 0;
} }
// 根据使用习惯对normalize上进行补充 // 根据使用习惯对normalize上进行补充
//----------------------------------------------------- //-----------------------------------------------------
h1, h2, h3, h4, h5, h6, p, figure, form, blockquote { h1, h2, h3, h4, h5, h6, p, figure, form, blockquote {
margin: 0; margin: 0;
} }
// ul ol dl // ul ol dl
ul, ol, li, dl, dd { ul, ol, li, dl, dd {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
ul, ol { ul, ol {
list-style: none outside none; list-style: none outside none;
} }
// hn // hn
h1, h2, h3 { h1, h2, h3 {
line-height: 2; line-height: 2;
font-weight: normal; font-weight: normal;
} }
h1 { h1 {
font-size: 18px; font-size: 18px;
} }
h2 { h2 {
font-size: 16px; font-size: 16px;
} }
h3 { h3 {
font-size: 14px; font-size: 14px;
} }
// icon // icon
i { i {
font-style: normal; font-style: normal;
} }
// 所有元素为border-box // 所有元素为border-box
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
// 清除子元素浮动 // 清除子元素浮动
.clearfix { .clearfix {
@extend %clearfix; @extend %clearfix;
} }

View File

@ -9,21 +9,13 @@
position: relative; position: relative;
overflow: hidden; overflow: hidden;
background: #88acdb; background: #88acdb;
-webkit-transition: all 0.2s ease-in;
transition: all 0.2s ease-in; transition: all 0.2s ease-in;
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-pack: center;
-webkit-box-align: center;
text-align: center; text-align: center;
} }
.header-author { .header-author {
text-align: center; text-align: center;
margin: 0.67em 0; margin: 0.67em 0;
font-size: 30px; font-size: 30px;
-webkit-transition: 0.3s;
-moz-transition: 0.3s;
-ms-transition: 0.3s;
transition: 0.3s; transition: 0.3s;
} }
.header-subtitle { .header-subtitle {

View File

@ -44,12 +44,8 @@ html, body, #container {
padding: 5px 20px; padding: 5px 20px;
} }
} }
&.show { &.show .header-menu.tools-nav{
.header-menu{ display: block;
&.tools-nav {
display: block;
}
}
} }
} }
@ -159,7 +155,7 @@ html, body, #container {
width: auto; width: auto;
height: 30px; height: 30px;
margin-top: -5px; margin-top: -5px;
position: ralative; position: relative;
.article-date{ .article-date{
font-size: 12px; font-size: 12px;
border-radius: 0; border-radius: 0;
@ -257,9 +253,9 @@ html, body, #container {
padding: 10px; padding: 10px;
.archive-year-wrap{ .archive-year-wrap{
position: relative; position: relative;
padding: 0 0 0 0; padding: 0;
a{ a{
padding: 0 0 0 0; padding: 0;
} }
} }
.article-meta{ .article-meta{

View File

@ -1,51 +1,51 @@
.page-reward { .page-reward {
margin: 60px 0; margin: 60px 0;
text-align: center; text-align: center;
.page-reward-btn { .page-reward-btn {
position: relative; position: relative;
display: inline-block; display: inline-block;
width: 56px; width: 56px;
height: 56px; height: 56px;
line-height: 56px; line-height: 56px;
font-size: 20px; font-size: 20px;
color: $colorF; color: $colorF;
background: #f44336; background: #f44336;
border-radius: 50%; border-radius: 50%;
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12); box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
-webkit-transition: .4s ease-in-out; -webkit-transition: .4s ease-in-out;
transition: .4s ease-in-out; transition: .4s ease-in-out;
&:hover, &:active { &:hover, &:active {
box-shadow: 0 6px 12px rgba(0,0,0,0.2),0 4px 15px rgba(0,0,0,0.2); box-shadow: 0 6px 12px rgba(0,0,0,0.2),0 4px 15px rgba(0,0,0,0.2);
}
.tooltip-item {
display: block;
width: 56px;
height: 56px;
}
} }
.reward-box { .tooltip-item {
display: flex; display: block;
justify-content: space-around; width: 56px;
height: 56px;
} }
.reward-p { }
color: $colorF; .reward-box {
font-weight: bold; display: flex;
text-shadow: 1px 1px 1px #45b9e0; justify-content: space-around;
.icon { }
margin: 0 10px; .reward-p {
color: #ddd; color: $colorF;
} font-weight: bold;
} text-shadow: 1px 1px 1px #45b9e0;
.reward-type { .icon {
font-size: 16px; margin: 0 10px;
display: block; color: #ddd;
color: #4d4d4d;
margin: 20px 0 0 0;
}
.reward-img {
width: 130px;
height: 130px;
border: 6px solid $colorBorder;
border-radius: 3px;
} }
}
.reward-type {
font-size: 16px;
display: block;
color: #4d4d4d;
margin: 20px 0 0 0;
}
.reward-img {
width: 130px;
height: 130px;
border: 6px solid $colorBorder;
border-radius: 3px;
}
} }

View File

@ -2,106 +2,106 @@
min-height: 20px; min-height: 20px;
} }
.share-btn { .share-btn {
float: right; float: right;
position: relative; position: relative;
} }
.share-icons { .share-icons {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
a { a {
border: 1px solid $colorBorder; border: 1px solid $colorBorder;
border-radius: 50%; border-radius: 50%;
display: -moz-inline-stack; display: -moz-inline-stack;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
zoom: 1; zoom: 1;
margin: 10px; margin: 10px;
-webkit-transition: 0.3s; -webkit-transition: 0.3s;
transition: 0.3s; transition: 0.3s;
text-align: center; text-align: center;
color: $colorF; color: $colorF;
opacity: 0.7; opacity: 0.7;
width: 28px; width: 28px;
height: 28px; height: 28px;
line-height: 26px; line-height: 26px;
text-shadow: 1px 1px 1px #509eb7; text-shadow: 1px 1px 1px #509eb7;
&:active { &:active {
color: $colorF; color: $colorF;
}
&:hover {
transform: scale(1.2);
}
&.share-outer {
border: none;
color: $colorF;
background: #4d4d4d;
text-shadow: none;
}
} }
&:hover {
transform: scale(1.2);
}
&.share-outer {
border: none;
color: $colorF;
background: #4d4d4d;
text-shadow: none;
}
}
} }
.page-modal { .page-modal {
//display: none; //display: none;
position: fixed; position: fixed;
top: 24%; top: 24%;
left: 50%; left: 50%;
z-index: 1001; z-index: 1001;
padding: 20px; padding: 20px;
text-align: center; text-align: center;
color: #727272; color: #727272;
background: $colorBg; background: $colorBg;
border-radius: 4px; border-radius: 4px;
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12); box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
opacity: 0; opacity: 0;
transform: translate(-50%, -200%); transform: translate(-50%, -200%);
p { p {
margin-bottom: 10px; margin-bottom: 10px;
} }
&.ready { &.ready {
visibility: hidden; visibility: hidden;
display: block; display: block;
transform: translate(-50%, -100%); transform: translate(-50%, -100%);
transition: .3s; transition: .3s;
} }
&.in { &.in {
visibility: visible; visibility: visible;
opacity: 1; opacity: 1;
transform: translate(-50%, 0); transform: translate(-50%, 0);
} }
.close { .close {
position: absolute; position: absolute;
right: 10px; right: 10px;
top: 10px; top: 10px;
color: rgba(0, 0, 0, .2); color: rgba(0, 0, 0, .2);
font-size: 16px; font-size: 16px;
line-height: 20px; line-height: 20px;
&:hover, &:active { &:hover, &:active {
color: rgba(0, 0, 0, .4); color: rgba(0, 0, 0, .4);
}
} }
}
} }
.mask { .mask {
visibility: hidden; visibility: hidden;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
bottom: 0; bottom: 0;
z-index: 1000; z-index: 1000;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #000; background: #000;
opacity: 0; opacity: 0;
filter: alpha(opacity=0); filter: alpha(opacity=0);
pointer-events: none; pointer-events: none;
-webkit-transition: .3s ease-in-out; -webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out; transition: .3s ease-in-out;
&.in { &.in {
visibility: visible; visibility: visible;
pointer-events: auto; pointer-events: auto;
opacity: .3; opacity: .3;
} }
} }

View File

@ -1,150 +1,150 @@
#header .header-nav{ #header .header-nav{
width: 100%; width: 100%;
position: absolute; position: absolute;
transition: transform .3s ease-in; transition: transform .3s ease-in;
.social { .social {
margin-top: 10px; margin-top: 10px;
text-align: center; text-align: center;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
a { a {
border-radius:50%; border-radius:50%;
display:inline-block; display:inline-block;
vertical-align:middle; vertical-align:middle;
*vertical-align:auto; *vertical-align:auto;
zoom:1; zoom:1;
*display:inline; *display:inline;
margin:0 8px 15px 8px; margin:0 8px 15px 8px;
transition:0.3s; transition:0.3s;
text-align: center; text-align: center;
color: #fff; color: #fff;
opacity: 0.7; opacity: 0.7;
width: 28px; width: 28px;
height: 28px; height: 28px;
line-height: 26px; line-height: 26px;
&:hover { &:hover {
opacity:1 opacity:1
} }
}
a.weibo {
background: #aaaaff;
border:1px solid #aaaaff;
&:hover {
border:1px solid #aaaaff;
}
}
a.segmentfault {
background: #009a61;
border:1px solid #009a61;
&:hover {
border:1px solid #009a61;
}
}
a.rss {
background: #ef7522;
border:1px solid #ef7522;
&:hover {
border:1px solid #cf5d0f;
}
}
a.github {
background: #afb6ca;
border:1px solid #afb6ca;
&:hover {
border:1px solid #909ab6;
}
}
a.facebook {
background: #3b5998;
border:1px solid #3b5998;
&:hover {
border:1px solid #2d4373;
}
}
a.google {
background: #c83d20;
border:1px solid #c83d20;
&:hover {
border:1px solid #9c3019;
}
}
a.twitter {
background: #55cff8;
border:1px solid #55cff8;
&:hover {
border:1px solid #24c1f6;
}
}
a.linkedin {
background: #005a87;
border:1px solid #005a87;
&:hover {
border:1px solid #006b98;
}
}
a.acfun {
background: #fd4c5d;
border:1px solid #fd4c5d;
&:hover {
border:1px solid #fd4c5d;
}
}
a.bilibili {
background: #e15280;
border:1px solid #e15280;
&:hover {
border:1px solid #e15280;
}
}
a.zhihu {
background: #0078d8;
border:1px solid #0078d8;
&:hover {
border:1px solid #0078d8;
}
}
a.douban {
background: #06c611;
border:1px solid #06c611;
&:hover {
border:1px solid #06c611;
}
}
a.mail {
background: #005a87;
border:1px solid #005a87;
&:hover {
border:1px solid #006b98;
}
}
a.jianshu {
background: #ff5722;
border:1px solid #ff5722;
&:hover {
border:1px solid #ff5722;
}
}
a.weixin {
background: #4caf50;
border:1px solid #4caf50;
&:hover {
border:1px solid #4caf50;
}
}
a.qq {
background: #34baad;
border:1px solid #34baad;
&:hover {
border:1px solid #34baad;
}
}
a.psn {
background: #086ef6;
border:1px solid #086ef6;
&:hover {
border:1px solid #086ef6;
}
}
} }
a.weibo {
background: #aaaaff;
border:1px solid #aaaaff;
&:hover {
border:1px solid #aaaaff;
}
}
a.segmentfault {
background: #009a61;
border:1px solid #009a61;
&:hover {
border:1px solid #009a61;
}
}
a.rss {
background: #ef7522;
border:1px solid #ef7522;
&:hover {
border:1px solid #cf5d0f;
}
}
a.github {
background: #afb6ca;
border:1px solid #afb6ca;
&:hover {
border:1px solid #909ab6;
}
}
a.facebook {
background: #3b5998;
border:1px solid #3b5998;
&:hover {
border:1px solid #2d4373;
}
}
a.google {
background: #c83d20;
border:1px solid #c83d20;
&:hover {
border:1px solid #9c3019;
}
}
a.twitter {
background: #55cff8;
border:1px solid #55cff8;
&:hover {
border:1px solid #24c1f6;
}
}
a.linkedin {
background: #005a87;
border:1px solid #005a87;
&:hover {
border:1px solid #006b98;
}
}
a.acfun {
background: #fd4c5d;
border:1px solid #fd4c5d;
&:hover {
border:1px solid #fd4c5d;
}
}
a.bilibili {
background: #e15280;
border:1px solid #e15280;
&:hover {
border:1px solid #e15280;
}
}
a.zhihu {
background: #0078d8;
border:1px solid #0078d8;
&:hover {
border:1px solid #0078d8;
}
}
a.douban {
background: #06c611;
border:1px solid #06c611;
&:hover {
border:1px solid #06c611;
}
}
a.mail {
background: #005a87;
border:1px solid #005a87;
&:hover {
border:1px solid #006b98;
}
}
a.jianshu {
background: #ff5722;
border:1px solid #ff5722;
&:hover {
border:1px solid #ff5722;
}
}
a.weixin {
background: #4caf50;
border:1px solid #4caf50;
&:hover {
border:1px solid #4caf50;
}
}
a.qq {
background: #34baad;
border:1px solid #34baad;
&:hover {
border:1px solid #34baad;
}
}
a.psn {
background: #086ef6;
border:1px solid #086ef6;
&:hover {
border:1px solid #086ef6;
}
}
}
} }

View File

@ -103,7 +103,7 @@
.archive-article-date { .archive-article-date {
color: $color9; color: $color9;
margin-right: 7.6923%; margin-right: $articlePadding;
float: right; float: right;
transition: color 0.3s; transition: color 0.3s;
&:hover { &:hover {

View File

@ -1,218 +1,218 @@
.tooltip-left { .tooltip-left {
.tooltip { .tooltip {
position: absolute; position: absolute;
z-index: 999; z-index: 999;
cursor: pointer; cursor: pointer;
width: 28px; width: 28px;
height: 28px; height: 28px;
top: -10px; top: -10px;
right: 10px; right: 10px;
&:hover { &:hover {
a.share-outer { a.share-outer {
background: #24c1f6; background: #24c1f6;
} }
}
} }
}
/* Trigger item */ /* Trigger item */
@-webkit-keyframes pulse { @-webkit-keyframes pulse {
from { -webkit-transform: scale3d(0.5,0.5,1); } from { -webkit-transform: scale3d(0.5,0.5,1); }
to { -webkit-transform: scale3d(1,1,1); } to { -webkit-transform: scale3d(1,1,1); }
} }
@keyframes pulse { @keyframes pulse {
from { -webkit-transform: scale3d(0.5,0.5,1); transform: scale3d(0.5,0.5,1); } from { -webkit-transform: scale3d(0.5,0.5,1); transform: scale3d(0.5,0.5,1); }
to { -webkit-transform: scale3d(1,1,1); transform: scale3d(1,1,1); } to { -webkit-transform: scale3d(1,1,1); transform: scale3d(1,1,1); }
} }
/* Tooltip */ /* Tooltip */
.tooltip-content { .tooltip-content {
position: absolute; position: absolute;
background: rgba(36,193,246,0.9); background: rgba(36,193,246,0.9);
z-index: 9999; z-index: 9999;
width: 200px; width: 200px;
bottom: 50%; bottom: 50%;
margin-bottom: -10px; margin-bottom: -10px;
border-radius: 20px; border-radius: 20px;
font-size: 1.1em; font-size: 1.1em;
text-align: center; text-align: center;
color: #fff; color: #fff;
opacity: 0; opacity: 0;
cursor: default; cursor: default;
pointer-events: none; pointer-events: none;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-webkit-transition: opacity 0.3s, -webkit-transform 0.3s; -webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
transition: opacity 0.3s, transform 0.3s; transition: opacity 0.3s, transform 0.3s;
} }
.tooltip-west .tooltip-content { .tooltip-west .tooltip-content {
left: 3.5em; left: 3.5em;
-webkit-transform-origin: -2em 50%; -webkit-transform-origin: -2em 50%;
transform-origin: -2em 50%; transform-origin: -2em 50%;
-webkit-transform: translate3d(0,50%,0) rotate3d(1,1,1,30deg); -webkit-transform: translate3d(0,50%,0) rotate3d(1,1,1,30deg);
transform: translate3d(0,50%,0) rotate3d(1,1,1,30deg); transform: translate3d(0,50%,0) rotate3d(1,1,1,30deg);
} }
.tooltip-east .tooltip-content { .tooltip-east .tooltip-content {
right: 3.5em; right: 3.5em;
-webkit-transform-origin: calc(100% + 2em) 50%; -webkit-transform-origin: calc(100% + 2em) 50%;
transform-origin: calc(100% + 2em) 50%; transform-origin: calc(100% + 2em) 50%;
-webkit-transform: translate3d(0,50%,0) rotate3d(1,1,1,-30deg); -webkit-transform: translate3d(0,50%,0) rotate3d(1,1,1,-30deg);
transform: translate3d(0,50%,0) rotate3d(1,1,1,-30deg); transform: translate3d(0,50%,0) rotate3d(1,1,1,-30deg);
} }
.tooltip:hover .tooltip-content { .tooltip:hover .tooltip-content {
opacity: 1; opacity: 1;
-webkit-transform: translate3d(0,50%,0) rotate3d(0,0,0,0); -webkit-transform: translate3d(0,50%,0) rotate3d(0,0,0,0);
transform: translate3d(0,50%,0) rotate3d(0,0,0,0); transform: translate3d(0,50%,0) rotate3d(0,0,0,0);
pointer-events: auto; pointer-events: auto;
} }
/* Gap "bridge" and arrow */ /* Gap "bridge" and arrow */
.tooltip-content::before, .tooltip-content::before,
.tooltip-content::after { .tooltip-content::after {
content: ''; content: '';
position: absolute; position: absolute;
} }
.tooltip-content::before { .tooltip-content::before {
height: 100%; height: 100%;
width: 3em; width: 3em;
} }
.tooltip-content::after { .tooltip-content::after {
width: 2em; width: 2em;
height: 2em; height: 2em;
top: 50%; top: 50%;
margin: -1em 0 0; margin: -1em 0 0;
background: url(./img/tooltip.svg) no-repeat center center; background: url(./img/tooltip.svg) no-repeat center center;
background-size: 100%; background-size: 100%;
} }
.tooltip-west .tooltip-content::before, .tooltip-west .tooltip-content::before,
.tooltip-west .tooltip-content::after { .tooltip-west .tooltip-content::after {
right: 99%; /* because of FF, otherwise we have a gap */ right: 99%; /* because of FF, otherwise we have a gap */
} }
.tooltip-east .tooltip-content::before, .tooltip-east .tooltip-content::before,
.tooltip-east .tooltip-content::after { .tooltip-east .tooltip-content::after {
left: 99%; /* because of FF, otherwise we have a gap */ left: 99%; /* because of FF, otherwise we have a gap */
} }
.tooltip-east .tooltip-content::after { .tooltip-east .tooltip-content::after {
-webkit-transform: scale3d(-1,1,1); -webkit-transform: scale3d(-1,1,1);
transform: scale3d(-1,1,1); transform: scale3d(-1,1,1);
} }
} }
.tooltip-top { .tooltip-top {
.tooltip { .tooltip {
display: inline; display: inline;
position: relative; position: relative;
z-index: 999; z-index: 999;
} }
/* Gap filler */ /* Gap filler */
.tooltip::after { .tooltip::after {
content: ''; content: '';
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 20px; height: 20px;
bottom: 100%; bottom: 100%;
left: 50%; left: 50%;
pointer-events: none; pointer-events: none;
-webkit-transform: translateX(-50%); -webkit-transform: translateX(-50%);
transform: translateX(-50%); transform: translateX(-50%);
} }
.tooltip:hover::after { .tooltip:hover::after {
pointer-events: auto; pointer-events: auto;
} }
/* Tooltip */ /* Tooltip */
.tooltip-content { .tooltip-content {
position: absolute; position: absolute;
z-index: 9999; z-index: 9999;
width: 370px; width: 370px;
left: 50%; left: 50%;
bottom: 100%; bottom: 100%;
font-size: 20px; font-size: 20px;
line-height: 1.4; line-height: 1.4;
text-align: center; text-align: center;
font-weight: 400; font-weight: 400;
color: #4d4d4d; color: #4d4d4d;
background: transparent; background: transparent;
opacity: 0; opacity: 0;
margin: 0 0 -10px -185px; margin: 0 0 -10px -185px;
cursor: default; cursor: default;
pointer-events: none; pointer-events: none;
font-family: 'Satisfy', cursive; font-family: 'Satisfy', cursive;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-webkit-transition: opacity 0.3s 0.3s; -webkit-transition: opacity 0.3s 0.3s;
transition: opacity 0.3s 0.3s; transition: opacity 0.3s 0.3s;
padding-bottom: 80px; padding-bottom: 80px;
} }
.tooltip:hover .tooltip-content { .tooltip:hover .tooltip-content {
opacity: 1; opacity: 1;
pointer-events: auto; pointer-events: auto;
-webkit-transition-delay: 0s; -webkit-transition-delay: 0s;
transition-delay: 0s; transition-delay: 0s;
} }
.tooltip-content span { .tooltip-content span {
display: block; display: block;
} }
.tooltip-text { .tooltip-text {
border-bottom: 10px solid #4d4d4d; border-bottom: 10px solid #4d4d4d;
overflow: hidden; overflow: hidden;
-webkit-transform: scale3d(0,1,1); -webkit-transform: scale3d(0,1,1);
transform: scale3d(0,1,1); transform: scale3d(0,1,1);
-webkit-transition: -webkit-transform 0.3s 0.3s; -webkit-transition: -webkit-transform 0.3s 0.3s;
transition: transform 0.3s 0.3s; transition: transform 0.3s 0.3s;
} }
.tooltip:hover .tooltip-text { .tooltip:hover .tooltip-text {
-webkit-transition-delay: 0s; -webkit-transition-delay: 0s;
transition-delay: 0s; transition-delay: 0s;
-webkit-transform: scale3d(1,1,1); -webkit-transform: scale3d(1,1,1);
transform: scale3d(1,1,1); transform: scale3d(1,1,1);
} }
.tooltip-inner { .tooltip-inner {
background: rgba(36,193,246,0.9); background: rgba(36,193,246,0.9);
padding: 40px; padding: 40px;
-webkit-transform: translate3d(0,100%,0); -webkit-transform: translate3d(0,100%,0);
transform: translate3d(0,100%,0); transform: translate3d(0,100%,0);
-webkit-transition: -webkit-transform 0.3s; -webkit-transition: -webkit-transform 0.3s;
transition: transform 0.3s; transition: transform 0.3s;
} }
.tooltip:hover .tooltip-inner { .tooltip:hover .tooltip-inner {
-webkit-transition-delay: 0.3s; -webkit-transition-delay: 0.3s;
transition-delay: 0.3s; transition-delay: 0.3s;
-webkit-transform: translate3d(0,0,0); -webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0); transform: translate3d(0,0,0);
} }
/* Arrow */ /* Arrow */
.tooltip-content::after { .tooltip-content::after {
content: ''; content: '';
left: 50%; left: 50%;
border: solid transparent; border: solid transparent;
height: 0; height: 0;
width: 0; width: 0;
position: absolute; position: absolute;
pointer-events: none; pointer-events: none;
border-color: transparent; border-color: transparent;
border-top-color: #4d4d4d; border-top-color: #4d4d4d;
border-width: 10px; border-width: 10px;
margin-left: -10px; margin-left: -10px;
} }
} }

View File

@ -9,7 +9,7 @@ function init() {
} }
// 目录序号 // 目录序号
if (yiliaConfig && yiliaConfig.toc_hide_index) { if (window.themeConfig && window.themeConfig.toc_hide_index) {
let $a = document.querySelectorAll('.toc-number') let $a = document.querySelectorAll('.toc-number')
Array.prototype.forEach.call($a, function($em){ Array.prototype.forEach.call($a, function($em){
$em.style.display = 'none' $em.style.display = 'none'

View File

@ -15,12 +15,12 @@ Util.addLoadEvent(function() {
Aside.init() Aside.init()
}) })
const commentConfig = require("../config/comment.json") const commentConfig = require("../config/comment.json")
if(window.yiliaConfig.isPost && commentConfig.valine.enable) { if(window.themeConfig.isPost && commentConfig.valine.enable) {
// 文章详情页面, 并且启用了评论, 则加载评论相关代码 // 文章详情页面, 并且启用了评论, 则加载评论相关代码
import(/* webpackChunkName: "comment" */ './comment') import(/* webpackChunkName: "comment" */ './comment')
} }
if(window.yiliaConfig.pageid === 'PhotoWall') { if(window.themeConfig.pageid === 'PhotoWall') {
// 自定义的照片墙页面 // 自定义的照片墙页面
import(/* webpackChunkName: "photo-wall" */ './photo-wall') import(/* webpackChunkName: "photo-wall" */ './photo-wall')
} }

View File

@ -1,6 +1,3 @@
import addClass from 'dom101/add-class'
import removeClass from 'dom101/remove-class'
import after from 'dom101/after'
// 浏览器判断 // 浏览器判断
import Browser from './browser' import Browser from './browser'
// fix hexo 不支持的配置 // fix hexo 不支持的配置
@ -14,11 +11,11 @@ function isPathMatch(path, href) {
} }
function tabActive() { function tabActive() {
let $tabs = document.querySelectorAll('.js-header-menu li a') let tabs = document.querySelectorAll('.js-header-menu li a')
let path = window.location.pathname let path = window.location.pathname
Array.prototype.forEach.call($tabs, function($tab, i){ Array.prototype.forEach.call(tabs, function(tab, i){
if (isPathMatch(path, $tab.getAttribute('href'))) { if (isPathMatch(path, tab.getAttribute('href'))) {
addClass($tab, 'active') tab.classList.add('active')
} }
}) })
} }
@ -49,8 +46,13 @@ function scrollStop($dom, top, limit, zIndex, diff) {
if (nowTop - limit <= diff) { if (nowTop - limit <= diff) {
let $newDom = $dom.$newDom let $newDom = $dom.$newDom
if (!$newDom) { if (!$newDom) {
$newDom = $dom.cloneNode(true) $newDom = $dom.cloneNode(true)
after($dom, $newDom) let parentNode = $dom.parentNode
if(parentNode.lastChild == $dom){ // 将新生成的节点插入到当前节点之后
parentNode.appendChild($newDom)
}else{
parentNode.insertBefore($newDom, $dom.nextSibling)
}
$dom.$newDom = $newDom $dom.$newDom = $newDom
$newDom.style.position = 'fixed' $newDom.style.position = 'fixed'
$newDom.style.top = (limit || nowTop) + 'px' $newDom.style.top = (limit || nowTop) + 'px'
@ -88,14 +90,12 @@ function bindScroll() {
handleScroll() handleScroll()
} }
function init() { (function () {
if (Browser.versions.mobile && window.screen.width < 800) { if (Browser.versions.mobile && window.screen.width < 800) {
tabActive() tabActive()
bindScroll() bindScroll()
} }
} })()
init();
Util.addLoadEvent(function() { Util.addLoadEvent(function() {
Fix.init() Fix.init()

View File

@ -1,5 +1,3 @@
import addClass from 'dom101/add-class'
import removeClass from 'dom101/remove-class'
import QRious from 'qrious' import QRious from 'qrious'
function generate(url, opts) { function generate(url, opts) {
@ -13,26 +11,24 @@ function generate(url, opts) {
var qrcodeInit = false var qrcodeInit = false
function showWX() { function showWX() {
let $wx = document.querySelector('.js-wx-box') let wx = document.querySelector('.js-wx-box')
let $mask = document.querySelector('.mask') let mask = document.querySelector('.mask')
if(!qrcodeInit) { if(!qrcodeInit) {
new QRious({ new QRious({
element: document.querySelector('.qrcode-canvas'), element: document.querySelector('.qrcode-canvas'),
value: location.href value: location.href
}); })
qrcodeInit = true qrcodeInit = true
} }
addClass($wx, 'in') wx.classList.add('in', 'ready')
addClass($wx, 'ready') mask.classList.add('in')
addClass($mask, 'in')
} }
function hideWX() { function hideWX() {
let $wx = document.querySelector('.js-wx-box') let wx = document.querySelector('.js-wx-box')
let $mask = document.querySelector('.mask') let mask = document.querySelector('.mask')
removeClass($wx, 'in') wx.classList.remove('in', 'ready')
removeClass($wx, 'ready') mask.classList.remove('in')
removeClass($mask, 'in')
} }
function handleClick(type, opts) { function handleClick(type, opts) {

View File

@ -86,7 +86,7 @@ new Vue({
}, },
filters: { filters: {
urlformat: (str) => { urlformat: (str) => {
return (window.yiliaConfig && window.yiliaConfig.root) ? window.yiliaConfig.root + str : '/' + str; return (window.themeConfig && window.themeConfig.root) ? window.themeConfig.root + str : '/' + str;
} }
}, },
watch: { watch: {
@ -101,7 +101,7 @@ new Vue({
} }
}, },
mounted () { mounted () {
axios.get(window.yiliaConfig.root + 'content.json?t=' + (+ new Date())) axios.get(window.themeConfig.root + 'content.json?t=' + (+ new Date()))
.then((res)=>{ .then((res)=>{
this.items = res.data this.items = res.data
}).catch((err) => { }).catch((err) => {

View File

@ -36,6 +36,6 @@ function init() {
} }
// export default { init } // export default { init }
if(!window.yiliaConfig.pageid) { // 非个性化页面的普通文章 if(!window.themeConfig.pageid) { // 非个性化页面的普通文章
Util.addLoadEvent(init) Util.addLoadEvent(init)
} }