Skip to content

Commit

Permalink
feat(profile): now profile can be sticky
Browse files Browse the repository at this point in the history
  • Loading branch information
LolipopJ committed Jul 18, 2021
1 parent 455bc01 commit 19cefd3
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ float_button_theme: default
read_progress_color: default
# Blog post banner theme ('default' or 'clean')
post_banner_theme: default
# Stick profile info
profile_sticky: false

# ========== Search ========== #
algolia_search:
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/base-profile.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="profile">
<div class="profile <%- theme.profile_sticky ? 'profile-sticky' : '' %>">
<img class="profile-avatar" alt="avatar" src= <%- url_for(theme.avatar) %> />
<div class="profile-name"><%- theme.author || config.author %></div>
<% if(theme.signature && theme.signature.length !== 0) { %>
Expand Down
2 changes: 1 addition & 1 deletion source/css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion source/css/style.css.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/scss/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ body {
z-index: 100;
position: relative;
background-color: $body-background-color;
overflow-x: hidden;
}

.wrapper {
Expand Down Expand Up @@ -51,7 +50,6 @@ body {
align-items: flex-start;
justify-content: center;
width: 100%;
overflow: hidden;
transition: all 0.5s ease-out 0s;
opacity: 1;
transform: translate3d(0, 0, 0);
Expand Down
4 changes: 4 additions & 0 deletions src/scss/_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@
}

// profile
.profile-avatar {
box-shadow: 0 0 2px 0 #181818;
}

.profile-name {
color: #ddd;
}
Expand Down
2 changes: 1 addition & 1 deletion src/scss/_partial/_index-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
.abstract-post-meta {
display: flex;
justify-content: space-between;
padding: 0.5rem 0 0 0;
margin-top: 0.5rem;
font-family: $feature-font-family;
color: $abstract-post-meta-color;
height: 1.5rem;
Expand Down
6 changes: 5 additions & 1 deletion src/scss/_partial/_partial/_profile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
order: 0;
vertical-align: top;
flex-shrink: 0;
margin: 4px 0 0 0;
width: $profile-width;
font: 1rem $feature-font-family;
* {
Expand All @@ -17,6 +16,11 @@
}
}

.profile.profile-sticky {
position: sticky;
top: $header-height;
}

.profile-avatar {
display: block;
border-radius: 1rem;
Expand Down

0 comments on commit 19cefd3

Please sign in to comment.