lensfrex 1 year ago
parent 595c6f160d
commit 3f492952d8
Signed by: lensfrex
GPG Key ID: 947ADABD8533C476
  1. 2
      layout/includes/_partials/button.pug
  2. 2
      layout/includes/_partials/header.pug
  3. 18
      layout/includes/_partials/post_list/paginator.pug
  4. 6
      layout/includes/_partials/post_list/post_list.pug
  5. 3
      source/css/_partials/index.styl
  6. 36
      source/css/_partials/post_list/paginator.styl
  7. 2
      source/css/_partials/post_list/post_item.styl
  8. 2
      source/css/common.styl

@ -1,4 +1,4 @@
mixin button (target_href, active, text) mixin button_menu (target_href, active, text)
.button-component .button-component
.button-container .button-container
a.button-anchor( a.button-anchor(

@ -7,4 +7,4 @@ include ./button.pug
- var targetPath = target.substr(1) - var targetPath = target.substr(1)
- var currPath = page.path - var currPath = page.path
- var active = (!is_home() && targetPath === '') ? false : currPath.startsWith(targetPath) - var active = (!is_home() && targetPath === '') ? false : currPath.startsWith(targetPath)
+button(target, active, name) +button_menu(target, active, name)

@ -0,0 +1,18 @@
mixin paginator_button(prev, disabled, link)
.paginator-button-component
a.button-anchor(
href= disabled ? undefined : link
class= disabled ? 'disabled' : ''
)
span.button-text
= prev ? '<' : '>'
.paginator
.left
span= page.current + ' / ' + page.total
.right
.paginator-btn-box
- const is_first = page.prev == 0
- const is_last = page.next == 0
+paginator_button(true, is_first, url_for(page.prev_link))
+paginator_button(false, is_last, url_for(page.next_link))

@ -15,5 +15,7 @@ include post_item.pug
- const content = (post.more !== undefined) ? post.more : post.content - const content = (post.more !== undefined) ? post.more : post.content
- const strip = strip_html(content).substr(0, MAX_SUMMARY_LENGTH) - const strip = strip_html(content).substr(0, MAX_SUMMARY_LENGTH)
- summary = strip.length < MAX_SUMMARY_LENGTH ? strip : strip + '...' - summary = strip.length < MAX_SUMMARY_LENGTH ? strip : strip + '...'
+post_item(post.title, post.cover, post_date, trim(summary), post_time, url_for(post.path)) +post_item(post.title, post.cover, post_date, trim(summary), post_time, post.path)
- }) - })
include paginator.pug

@ -16,7 +16,8 @@
width: 100% width: 100%
// overflow-y: scroll // overflow-y: scroll
overflow-x: hidden overflow-x: hidden
justify-content: space-between
.right-content .right-content
width: 24% width: 24%
position: sticky position: sticky

@ -0,0 +1,36 @@
.paginator
display: flex
flex-direction: row
justify-content: space-between
align-items: center
padding: 10px 10px
user-select: none
.left
font-size: 18px
font-weight: bold
.right
.paginator-btn-box
display: flex
flex-direction: row
justify-content: center
gap: 24px
.paginator-button-component
.button-anchor
width: 64px
height: 32px
display: flex
align-items: center
justify-content: center
text-decoration: none
font-size: 20px
transition: all 0.2s linear 0s
background-color: rgb(180, 175, 154)
color: rgb(74, 71, 62)
cursor: default
&:hover:not(.disabled)
background-color: rgb(74, 71, 62)
color: $light
.button-anchor.disabled
background-color: rgb(200, 195, 174)
color: rgb(91, 91, 82)
cursor: not-allowed

@ -8,7 +8,7 @@
transition: all 0.2s linear 0s transition: all 0.2s linear 0s
padding: 8px 8px padding: 8px 8px
margin: 4px 4px margin: 4px 4px
min-height: 128px; min-height: 144px;
&:hover &:hover
background-color: $light background-color: $light
.no-cover .no-cover

@ -46,7 +46,7 @@ span::selection
&::-webkit-scrollbar-button &::-webkit-scrollbar-button
border-radius: 10px; border-radius: 10px;
border-spacing: 10px; border-spacing: 10px;
background-color: rgb(74 71 62); background-color: rgb(74, 71, 62);
width: 10px; width: 10px;
height: 10px; height: 10px;
&::-webkit-scrollbar-corner &::-webkit-scrollbar-corner

Loading…
Cancel
Save