Skip to content

Commit

Permalink
🎈 perf: 优化移动端间距
Browse files Browse the repository at this point in the history
  • Loading branch information
白云苍狗 committed Oct 11, 2022
1 parent d6f486c commit 1610e5d
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package/hexo-theme-async/layout/_partial/main.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<%- content %>

<div class="trm-divider trm-mb-40"></div>
<div class="trm-divider footer-divider"></div>

<!-- footer -->
<%- partial('./footer') %>
Expand Down
6 changes: 3 additions & 3 deletions package/hexo-theme-async/layout/_partial/page/about.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<% if(theme.about.introduction) { %>
<div class="row trm-mb-20 trm-scroll-animation" data-scroll data-scroll-offset="40">
<div class="col-lg-12">
<h5 class="trm-mb-40 trm-title-with-divider">
<h5 class="trm-title-with-divider">
<%- __('title.author') %>
<span data-number="0<%- ++index %>"></span>
</h5>
Expand All @@ -26,7 +26,7 @@
<% if(theme.about.introduction) { %>
<div class="row trm-mb-20 trm-scroll-animation" data-scroll data-scroll-offset="40">
<div class="col-lg-12">
<h5 class="trm-mb-40 trm-title-with-divider">
<h5 class="trm-title-with-divider">
<%- __('title.blog') %>
<span data-number="0<%- ++index %>"></span>
</h5>
Expand All @@ -40,7 +40,7 @@
<% if(theme.about.introduction) { %>
<div class="row trm-mb-20 trm-scroll-animation" data-scroll data-scroll-offset="40">
<div class="col-lg-12">
<h5 class="trm-mb-40 trm-title-with-divider">
<h5 class="trm-title-with-divider">
<%- __('title.privacy') %>
<span data-number="0<%- ++index %>"></span>
</h5>
Expand Down
2 changes: 1 addition & 1 deletion package/hexo-theme-async/layout/_partial/page/archive.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div class="row">
<div class="col-lg-12">
<!-- title -->
<h5 class="trm-mb-40 trm-title-with-divider">
<h5 class="trm-title-with-divider">
<% if(page.archive){ %>
<%- page.year ? page.year : __('title.all_archives') %>
<% } else if (is_category()){ %>
Expand Down
2 changes: 1 addition & 1 deletion package/hexo-theme-async/layout/_partial/page/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="row">
<div class="col-lg-12">
<!-- title -->
<h5 class="trm-mb-40 trm-title-with-divider">
<h5 class="trm-title-with-divider">
<%-__('title.new_publish')%>
<span data-number="01"></span>
</h5>
Expand Down
4 changes: 2 additions & 2 deletions package/hexo-theme-async/layout/_partial/page/links.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<div class="row trm-mb-20">
<div class="col-lg-12">
<h5 class="trm-mb-40 trm-title-with-divider"><%-__('site.title')%><span data-number="01"></span></h5>
<h5 class="trm-title-with-divider"><%-__('site.title')%><span data-number="01"></span></h5>
</div>
<div class="col-lg-12">
<div class="trm-service-icon-box trm-scroll-animation trm-active-el" data-scroll="" data-scroll-offset="40">
Expand All @@ -27,7 +27,7 @@
<% if(Array.isArray(theme.links)){ %>
<div class="row trm-mb-20">
<div class="col-lg-12">
<h5 class="trm-mb-40 trm-title-with-divider">
<h5 class="trm-title-with-divider">
<%-__('title.links')%>
<span data-number="02"></span>
</h5>
Expand Down
2 changes: 1 addition & 1 deletion package/hexo-theme-async/layout/_partial/page/project.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<% theme.projects.forEach((item,index)=>{ %>
<div class="row">
<div class="col-lg-12">
<h5 class="trm-mb-40 trm-title-with-divider"><%- item.title %><span data-number="<%- index+1 %>"></span></h5>
<h5 class="trm-title-with-divider"><%- item.title %><span data-number="<%- index+1 %>"></span></h5>
</div>
<% item.children.forEach((project,index)=>{ %>
<div class="<%- !page.single_column ? 'col-lg-6':'col-lg-4' %>">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="row">
<div class="col-lg-12">
<!-- title -->
<h5 class="trm-mb-40 trm-title-with-divider">
<h5 class="trm-title-with-divider">
<%- __('title.other_articles') %>
<span data-number="02"></span>
</h5>
Expand Down
4 changes: 2 additions & 2 deletions package/hexo-theme-async/layout/_widget/comment.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<% } else { %>
<div class="row trm-scroll-animation comment-container" data-scroll data-scroll-offset="50">
<div class="col-lg-12">
<h5 class="trm-mb-40 trm-title-with-divider">
<h5 class="trm-title-with-divider">
<%-__('title.comment')%>
<span data-number="03"></span>
</h5>
Expand All @@ -29,7 +29,7 @@
<% } else { %>
<div class="row trm-scroll-animation comment-container" data-scroll data-scroll-offset="50">
<div class="col-lg-12">
<h5 class="trm-mb-40 trm-title-with-divider">
<h5 class="trm-title-with-divider">
<%-__('title.comment')%>
<span data-number="03"></span>
</h5>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,12 @@
padding : 0 0 40px;
}
}
}

@media(max-width:768px) {
.trm-app-frame {
.trm-content {
margin-top: 20px;
}
}
}
6 changes: 0 additions & 6 deletions package/hexo-theme-async/source/css/_components/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,6 @@ html {
margin-top: 40px
}

.trm-divider {
height : 1px;
border-bottom: var(--border-dotted, dotted 2px rgba(225, 225, 235, 0.9));
width : 100%
}

.trm-just-img {
width : 100%;
border-radius: 5px
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
margin : 0;
display : flex;
justify-content: center;
margin-bottom : 40px;
margin-bottom : var(--card-bottom-card);

&:first-child {
margin-left: 0;
Expand Down
17 changes: 14 additions & 3 deletions package/hexo-theme-async/source/css/_components/title-divider.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.trm-title-with-divider {
display : flex;
align-items: center;
white-space: nowrap;
display : flex;
align-items : center;
white-space : nowrap;
margin-bottom: var(--card-bottom-card);

span {
position : relative;
Expand All @@ -27,4 +28,14 @@
right : -35px;
}
}
}

.trm-divider {
height : 1px;
border-bottom: var(--border-dotted, dotted 2px rgba(225, 225, 235, 0.9));
width : 100%;

&.footer-divider {
margin-bottom: var(--card-bottom-card);
}
}
14 changes: 13 additions & 1 deletion package/hexo-theme-async/source/css/_variables/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,16 @@
:root {
.dark()
}
} */
} */

@media(max-width:768px) {
:root {
--card-padding : 20px;
--card-bottom-card : 20px;
--card-border-radius: 6px;

blockquote:before {
top: 0;
}
}
}

0 comments on commit 1610e5d

Please sign in to comment.