Brand new design

This commit is contained in:
nanxiaobei 2019-06-11 03:55:54 +08:00
parent f91e48e026
commit 6d586ae220

View File

@ -1,16 +1,21 @@
/* /*
* Paper * Paper
* A simple, clean, flexible Hugo theme. * A simple, clean, flexible Hugo theme
* https://github.com/nanxiaobei/hugo-paper
* Designed by MR.LEE (https://mrlee.me/) * Designed by MR.LEE (https://mrlee.me/)
* Updated in 2019.6.10 * Updated in 2019.6.11
*/ */
/* Variables /* Variables
-------------------------------------------------- */ -------------------------------------------------- */
:root { :root {
--gap: 24px;
--header-height: 64px;
--footer-height: 60px;
--primary: rgba(0, 0, 0, 0.88); --primary: rgba(0, 0, 0, 0.88);
--secondary: rgba(0, 0, 0, 0.64); --secondary: rgba(0, 0, 0, 0.56);
--tertiary: rgba(0, 0, 0, 0.16); --tertiary: rgba(0, 0, 0, 0.16);
--background: linear-gradient(120deg, #f0efee, #efeee6, #edeceb, #ebded7, #e0d5cf);
} }
/* Reset /* Reset
-------------------------------------------------- */ -------------------------------------------------- */
@ -104,29 +109,29 @@ img {
/* Header /* Header
-------------------------------------------------- */ -------------------------------------------------- */
.header { .header {
height: 64px; height: var(--header-height);
} }
.header .wrap { .header .wrap {
display: flex; display: flex;
max-width: calc(1024px + 24px * 2); max-width: calc(1024px + var(--gap) * 2);
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
.logo a, .logo a,
.menu-toggle { .menu-toggle {
padding-left: 24px; padding-left: var(--gap);
padding-right: 24px; padding-right: var(--gap);
} }
.logo a { .logo a {
display: block; display: block;
font-size: 24px; font-size: 24px;
font-weight: 700; font-weight: 700;
line-height: 64px; line-height: var(--header-height);
} }
.menu-toggle { .menu-toggle {
position: relative; position: relative;
width: 68px; width: 68px;
height: 64px; height: var(--header-height);
margin-left: auto; margin-left: auto;
outline: 0; outline: 0;
} }
@ -148,60 +153,64 @@ img {
transform: translate3d(-50%, 5px, 0); transform: translate3d(-50%, 5px, 0);
} }
.no-scroll .header { .blur .header {
position: fixed; position: fixed;
z-index: 10; z-index: 20;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
background: #fff;
} }
.no-scroll .logo { .blur .menu-toggle::before {
display: none;
}
.no-scroll .menu-toggle::before {
transform: translate3d(-50%, -1px, 0) rotateZ(135deg); transform: translate3d(-50%, -1px, 0) rotateZ(135deg);
} }
.no-scroll .menu-toggle::after { .blur .menu-toggle::after {
transform: translate3d(-50%, -1px, 0) rotateZ(-135deg); transform: translate3d(-50%, -1px, 0) rotateZ(-135deg);
} }
.no-scroll .menu { .blur .menu {
display: flex; top: 0;
} }
.no-scroll .main { .blur .logo,
margin-top: 64px; .blur .main,
.blur .footer {
filter: blur(32px);
}
.blur .main {
margin-top: var(--header-height);
} }
.menu { .menu {
display: none;
position: fixed; position: fixed;
z-index: 10; z-index: 10;
top: 64px; top: -100vh;
bottom: 0;
left: 0; left: 0;
right: 0; display: flex;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
padding-bottom: 180px; width: 100vw;
height: 100vh;
padding-bottom: var(--header-height);
text-align: center; text-align: center;
background: #fff; background: rgba(255, 255, 255, 0.4);
list-style: none; list-style: none;
} }
.menu li + li {
margin-top: 12px;
}
.menu a { .menu a {
font-size: 48px; font-size: 48px;
line-height: 80px;
}
/* Body
-------------------------------------------------- */
.list {
background: var(--background);
} }
/* Main /* Main
-------------------------------------------------- */ -------------------------------------------------- */
.main { .main {
position: relative; position: relative;
min-height: calc(100vh - 64px - 60px); min-height: calc(100vh - var(--header-height) - var(--footer-height));
max-width: calc(640px + 24px * 2); max-width: calc(640px + var(--gap) * 2);
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
padding: 24px; padding: var(--gap);
} }
.page-header { .page-header {
margin-top: 8px; margin-top: 8px;
@ -219,7 +228,7 @@ img {
font-size: 13px; font-size: 13px;
line-height: 34px; line-height: 34px;
background: var(--primary); background: var(--primary);
border-radius: 34px; border-radius: calc(34px / 2);
} }
.pagination .prev { .pagination .prev {
padding-left: 16px; padding-left: 16px;
@ -238,7 +247,7 @@ img {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
height: 320px; height: 320px;
margin-bottom: 64px; margin-bottom: var(--header-height);
overflow: hidden; overflow: hidden;
} }
.first-entry .entry-header h2 { .first-entry .entry-header h2 {
@ -247,7 +256,7 @@ img {
.first-entry .entry-content { .first-entry .entry-content {
max-height: 81px; max-height: 81px;
margin-top: 12px; margin-top: 12px;
margin-bottom: 20px; margin-bottom: 18px;
font-size: 16px; font-size: 16px;
overflow: hidden; overflow: hidden;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
@ -260,14 +269,14 @@ img {
} }
.post-entry { .post-entry {
position: relative; position: relative;
margin-bottom: 24px; margin-bottom: var(--gap);
padding: 24px; padding: var(--gap);
box-shadow: 0 8px 80px rgba(0, 0, 0, 0.1); background: #fff;
box-shadow: 0 12px 0 -4px rgba(255, 255, 255, 0.4);
border-radius: 8px; border-radius: 8px;
transition: box-shadow 0.2s;
overflow: hidden; overflow: hidden;
transition: box-shadow 0.2s;
} }
.post-entry:active { .post-entry:active {
transform: scale(0.96); transform: scale(0.96);
transition: transform 0.1s; transition: transform 0.1s;
@ -277,13 +286,15 @@ img {
} }
.entry-content { .entry-content {
margin-top: 8px; margin-top: 8px;
margin-bottom: 14px; margin-bottom: 12px;
color: var(--secondary); color: var(--secondary);
font-size: 14px; font-size: 14px;
line-height: 1.7; line-height: 1.7;
} }
.entry-footer { .entry-footer {
color: var(--secondary);
font-size: 12px; font-size: 12px;
font-weight: 500;
letter-spacing: 0.5px; letter-spacing: 0.5px;
} }
.entry-link { .entry-link {
@ -300,25 +311,26 @@ img {
margin-bottom: 40px; margin-bottom: 40px;
} }
.post-title { .post-title {
margin-bottom: 10px; margin-bottom: 12px;
font-size: 40px; font-size: 40px;
transform: translateX(-1px); transform: translateX(-1px);
} }
.post-meta { .post-meta {
color: var(--secondary); color: var(--secondary);
font-size: 14px; font-size: 14px;
font-weight: 500;
letter-spacing: 0.5px; letter-spacing: 0.5px;
} }
.post-content { .post-content {
font-size: 18px; font-size: 18px;
line-height: 1.9; line-height: 1.8;
} }
.post-content h1 { .post-content h1 {
margin-top: 48px; margin-top: 40px;
margin-bottom: 40px; margin-bottom: 32px;
} }
.post-content h2 { .post-content h2 {
margin-top: 40px; margin-top: 32px;
margin-bottom: 24px; margin-bottom: 24px;
} }
.post-content h3, .post-content h3,
@ -349,6 +361,12 @@ img {
.post-content a { .post-content a {
box-shadow: 0 1px 0 var(--primary); box-shadow: 0 1px 0 var(--primary);
} }
.post-content a code {
margin-left: 0;
margin-right: 0;
border-radius: 0;
box-shadow: 0 -1px 0 var(--primary) inset;
}
.post-content del { .post-content del {
text-decoration: none; text-decoration: none;
background: linear-gradient(to right, var(--primary) 100%, transparent 0) 0 50% / 1px 1px repeat-x; background: linear-gradient(to right, var(--primary) 100%, transparent 0) 0 50% / 1px 1px repeat-x;
@ -357,7 +375,7 @@ img {
.post-content ul, .post-content ul,
.post-content ol, .post-content ol,
.post-content dl { .post-content dl {
margin-bottom: 24px; margin-bottom: var(--gap);
} }
.post-content pre, .post-content pre,
.post-content table { .post-content table {
@ -419,16 +437,18 @@ img {
.post-content code { .post-content code {
margin-left: 4px; margin-left: 4px;
margin-right: 4px; margin-right: 4px;
padding: 4px; padding: 4px 6px;
font-family: Menlo, Monaco, 'Courier New', Courier, monospace; font-family: Menlo, Monaco, 'Courier New', Courier, monospace;
font-size: 0.8em; font-size: 0.8em;
white-space: pre-wrap; white-space: pre-wrap;
background: #f8f8f8; background: #f7f7f8;
border-radius: 2px;
} }
.post-content .highlight { .post-content .highlight {
margin-bottom: 32px; margin-bottom: 32px;
background: #f8f8f8; background: #f7f7f8;
border-radius: 2px;
overflow-x: auto; overflow-x: auto;
} }
.post-content .highlight table, .post-content .highlight table,
@ -452,6 +472,7 @@ img {
} }
.post-content .highlight table td:last-child pre code { .post-content .highlight table td:last-child pre code {
padding-left: 0; padding-left: 0;
overflow: hidden;
} }
.post-content .highlight .ln { .post-content .highlight .ln {
margin-right: 16px; margin-right: 16px;
@ -459,7 +480,7 @@ img {
} }
.post-content blockquote { .post-content blockquote {
margin: 0 0 0 -24px; margin: 0 0 0 calc(var(--gap) * -1);
padding: 0 0 0 21px; padding: 0 0 0 21px;
font-style: italic; font-style: italic;
border-left: 3px solid var(--primary); border-left: 3px solid var(--primary);
@ -475,7 +496,7 @@ img {
.post-content hr::before { .post-content hr::before {
content: '...'; content: '...';
display: inline-block; display: inline-block;
color: var(--primary); color: var(--secondary);
font-size: 32px; font-size: 32px;
letter-spacing: 20px; letter-spacing: 20px;
transform: translate(10px, -40px); transform: translate(10px, -40px);
@ -499,7 +520,7 @@ img {
color: var(--secondary); color: var(--secondary);
font-size: 14px; font-size: 14px;
line-height: 32px; line-height: 32px;
background: #f8f8f8; background: #f7f7f8;
border-radius: 2px; border-radius: 2px;
} }
.post-tags a:hover { .post-tags a:hover {
@ -508,10 +529,10 @@ img {
/* Footer /* Footer
-------------------------------------------------- */ -------------------------------------------------- */
.footer { .footer {
max-width: calc(640px + 24px * 2); max-width: calc(640px + var(--gap) * 2);
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
padding: calc((60px - 24px) / 2) 24px; padding: calc((var(--footer-height) - var(--gap)) / 2) var(--gap);
color: var(--secondary); color: var(--secondary);
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;