Skip to content

Commit

Permalink
refactor: refactor css
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Sketon committed Sep 21, 2024
1 parent 0189d13 commit f162fbe
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 170 deletions.
66 changes: 32 additions & 34 deletions layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,39 @@
<div style="width: 100%; overflow: hidden">
<div class="footer-line"></div>
</div>
<div class="outer">
<div id="footer-info">
<% if (theme.copyright) { %>
<%- render(theme.copyright, 'pug'); %>
<% } %>
<div id="footer-info">
<% if (theme.copyright) { %>
<%- render(theme.copyright, 'pug'); %>
<% } %>
<div>
<span class="icon-copyright"></span>
<%= theme.footer.since %>-<%= date(new Date(), 'YYYY') %>
<span class="footer-info-sep"></span>
<%= config.author || config.title %>
</div>
<% if (theme.footer.powered) { %>
<div>
<span class="icon-copyright"></span>
<%= theme.footer.since %>-<%= date(new Date(), 'YYYY') %>
<span class="footer-info-sep"></span>
<%= config.author || config.title %>
<%= __('powered_by') %>&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>&nbsp;
Theme.<a href="https://github.com/D-Sketon/hexo-theme-reimu" target="_blank">Reimu</a>
</div>
<% if (theme.footer.powered) { %>
<div>
<%= __('powered_by') %>&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>&nbsp;
Theme.<a href="https://github.com/D-Sketon/hexo-theme-reimu" target="_blank">Reimu</a>
</div>
<% } %>
<% if (theme.footer.count) { %>
<div>
<span class="icon-brush"></span>
<%= totalcount(site) %>
&nbsp;|&nbsp;
<span class="icon-coffee"></span>
<%= totalmin2read(site) %>
</div>
<% } %>
<% if (theme.footer.busuanzi) { %>
<div>
<span class="icon-eye"></span>
<span id="busuanzi_container_site_pv"><%= __('busuanzi.pv') %>&nbsp;<span id="busuanzi_value_site_pv"></span></span>
&nbsp;|&nbsp;
<span class="icon-user"></span>
<span id="busuanzi_container_site_uv"><%= __('busuanzi.uv') %>&nbsp;<span id="busuanzi_value_site_uv"></span></span>
</div>
<% } %>
</div>
<% } %>
<% if (theme.footer.count) { %>
<div>
<span class="icon-brush"></span>
<%= totalcount(site) %>
&nbsp;|&nbsp;
<span class="icon-coffee"></span>
<%= totalmin2read(site) %>
</div>
<% } %>
<% if (theme.footer.busuanzi) { %>
<div>
<span class="icon-eye"></span>
<span id="busuanzi_container_site_pv"><%= __('busuanzi.pv') %>&nbsp;<span id="busuanzi_value_site_pv"></span></span>
&nbsp;|&nbsp;
<span class="icon-user"></span>
<span id="busuanzi_container_site_uv"><%= __('busuanzi.uv') %>&nbsp;<span id="busuanzi_value_site_uv"></span></span>
</div>
<% } %>
</div>
</footer>
48 changes: 23 additions & 25 deletions layout/_partial/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -39,33 +39,31 @@
<img fetchpriority="high" src="<%- url_for(theme.banner, {relative: false}) %>" alt="<%= post.title %>">
<% } %>
<% } %>
<div id="header-outer" class="outer">
<div id="header-title" class="inner">
<div id="logo-wrap">
<% if (post.type == '404') { %>
<a href="/" id="logo">
<h1><%= __("not_found.title") %></h1>
<div id="header-outer">
<div id="header-title">
<% if (post.type == '404') { %>
<a href="/" id="logo">
<h1><%= __("not_found.title") %></h1>
</a>
<% } else { %>
<% var title;
if (is_archive()) {
title = __('archives');
} else if (is_category()) {
title = __('categories');
} else if (is_tag()) {
title = __('tags');
} else if (post.title) {
title = post.title;
} else {
title = config.title;
} %>
<% if (title) { %>
<a href="<%- url_for() %>" id="logo">
<h1><%= title %></h1>
</a>
<% } else { %>
<% var title;
if (is_archive()) {
title = __('archives');
} else if (is_category()) {
title = __('categories');
} else if (is_tag()) {
title = __('tags');
} else if (post.title) {
title = post.title;
} else {
title = config.title;
} %>
<% if (title) { %>
<a href="<%- url_for() %>" id="logo">
<h1><%= title %></h1>
</a>
<% } %>
<% } %>
</div>
<% } %>
<% if (post.type == 404) { %>
<h2 id="subtitle-wrap">
<a href="/" id="subtitle"><%= __("not_found.subtitle") %></a>
Expand Down
2 changes: 1 addition & 1 deletion layout/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div id="container">
<div id="wrap">
<%- partial('_partial/header', {post: page}, {cache: false}) %>
<div id="content" class="outer">
<div id="content">
<% if (theme.sidebar === 'left') { %>
<%- partial('_partial/sidebar', null) %>
<% } %>
Expand Down
6 changes: 0 additions & 6 deletions source/css/_partial/footer.styl
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#footer
background: linear-gradient(to top, var(--color-footer-background) 50%, transparent)
display: flex
justify-content: center
flex-direction: column
margin-top: auto
padding: 40px 0 20px
color: var(--grey-9)

Expand Down Expand Up @@ -31,8 +27,6 @@
#footer-info
line-height: line-height
font-size: 0.85em
width: 100%
margin: 0

div
margin: 5px 0
Expand Down
21 changes: 3 additions & 18 deletions source/css/_partial/header.styl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
height: 100%
position: relative
max-width: 100%
margin: 0

[data-theme="dark"]
#header-nav:hover
Expand Down Expand Up @@ -55,56 +54,47 @@
font-family: font-title
font-weight: 700
text-align: center
height: logo-size
position: absolute
top: 50%
left: 0
margin-top: logo-size * -0.5
margin: logo-size * -0.5 2.5% 0
width: 95%

$logo-text
text-decoration: none
color: #fff
text-shadow: 0 0 5px rgba(0, 0, 0, 0.5)

#logo
@extend $logo-text
font-size: logo-size
font-weight: 700
line-height: logo-size
letter-spacing: 2px
display: inline-block
width: 80%
transform: translateY(-20%)
text-shadow: 0 0.2rem 0.3rem rgba(0,0,0,.5);

@media mg-large
width: 90%
font-size: 35px

@media mq-tablet
width: 95%
font-size: 30px

@media mq-mobile
width: 100%
font-size: 30px

#subtitle
@extend $logo-text
font-size: subtitle-size
font-weight: 400
line-height: subtitle-size
letter-spacing: 1px
text-shadow: 0 0 5px rgba(0, 0, 0, 0.5)

@media mg-large
font-size: 15px

@media mq-tablet
width: 95%
font-size: 14px

@media mq-mobile
width: 100%
font-size: 13px

#subtitle-wrap
Expand All @@ -113,14 +103,12 @@ $logo-text
#main-nav
display: flex
align-items: center
margin-left: -15px

$nav-link
color: var(--red-0)
opacity: 0.8
text-decoration: none
transition: opacity 0.2s
display: block
padding: 20px 15px

$nav-link-wrap
Expand All @@ -145,7 +133,6 @@ $nav-link-wrap
width: font-size
height: font-size
padding: 20px 15px
position: relative
if reimu_cursor
cursor: var(--cursor-pointer)
else
Expand All @@ -166,7 +153,6 @@ $nav-link-wrap

.main-nav-link
@extend $nav-link
font-weight: 400
letter-spacing: 1px

.main-nav-icon
Expand All @@ -188,7 +174,6 @@ $nav-link-wrap
#sub-nav
display: flex
align-items: center
margin-right: -15px

#nav-sun-btn:before, #nav-moon-btn:before
font-weight: 700
3 changes: 2 additions & 1 deletion source/css/_partial/sidebar.styl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
@media mg-large
display: none
@media mq-large
column(sidebar-column)
width: 23%
margin: 0 1%
height: inherit

[data-theme="dark"] .sidebar-wrap
Expand Down
20 changes: 0 additions & 20 deletions source/css/_util/grid.styl

This file was deleted.

9 changes: 0 additions & 9 deletions source/css/_variables.styl
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,6 @@ reimu_cursor = hexo-config("reimu_cursor")
block-margin = 50px
article-padding = 20px
mobile-nav-width = 280px
main-column = 9
sidebar-column = 3

_sidebar-column = sidebar-column

// Grids
column-width = 80px
gutter-width = 20px
columns = main-column + _sidebar-column

// Media queries
mq-mobile = "screen and (max-width: 479px)"
Expand Down
Loading

0 comments on commit f162fbe

Please sign in to comment.