Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release new version #268

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions layout/_partial/first-screen.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ const { enable: sc_enable, links: sc_links } = theme?.social_contact || {}

<div class="bottom-placeholder border-box">
<% if (sc_enable === true) { %>
<div class="sc-icon-list">
<div class="sc-icon-list border-box">
<!-- fontawesome icons -->
<% for (const key in sc_links) { %>
<% if(sc_links[key]) { %>
<%
Expand All @@ -48,8 +49,8 @@ const { enable: sc_enable, links: sc_links } = theme?.social_contact || {}
%>
<div class="tooltip sc-icon-item <%= isImg ? 'tooltip-img clear' : ''%>"
data-tooltip-content="<%= __(key) %>"
data-tooltip-img-name="<%= key %>"
<%= isImg ? 'data-tooltip-img-url='+ link +'' : '' %>
<%= isImg ? 'data-tooltip-img-name='+ key +'' : '' %>
<%= isImg ? 'data-tooltip-img-url='+ link +'' : '' %>
>
<% if(key === 'email') { %>
<a href="mailto:<%- link %>">
Expand All @@ -67,6 +68,31 @@ const { enable: sc_enable, links: sc_links } = theme?.social_contact || {}
</div>
<% } %>
<% } %>

<!-- custom svg icons -->
<% for (const icon in theme?.icons) { %>
<% if(theme.icons[icon]) { %>
<%
const custom_tmpl = theme.icons[icon].link.split('|').map(x => x.trim())
let custom_is_img = false
let custom_link = theme.icons[icon].link
const custom_svg = theme.icons[icon].svg
if (custom_tmpl.length > 1) {
custom_link = custom_tmpl[1]
custom_is_img = custom_tmpl[0] === 'img'
}
%>
<div class="tooltip border-box sc-icon-item <%= icon %> <%= custom_is_img ? 'tooltip-img clear' : ''%>"
data-tooltip-content="<%= __(icon) %>"
<%= custom_is_img ? 'data-tooltip-img-name='+ icon +'' : '' %>
<%= custom_is_img ? 'data-tooltip-img-url='+ custom_link +'' : '' %>
>
<% if(!custom_is_img) { %><a target="_blank" href="<%- custom_link %>"><% } %>
<%- custom_svg %>
<% if(!custom_is_img) { %></a><% } %>
</div>
<% } %>
<% } %>
</div>
<% } %>
</div>
Expand Down
13 changes: 9 additions & 4 deletions scripts/use-source-data.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global hexo */

hexo.on('generateBefore', function () {
if (hexo.locals.get) {
const data = hexo.locals.get('data')
Expand All @@ -8,13 +10,16 @@ hexo.on('generateBefore', function () {
hexo.theme.config = data._config
} else if (data.keep) {
hexo.theme.config = data.keep
} else if (data._keep) {
hexo.theme.config = data._keep
}

// friends link file handle
if (data.links || data.link) {
hexo.theme.config.links = data.links || data.link
if (data.links) {
hexo.theme.config.links = data.links
}

// custom social contact icon handle
if (data.icons) {
hexo.theme.config.icons = data.icons
}
}
}
Expand Down
36 changes: 29 additions & 7 deletions source/css/layout/_partial/first-screen.styl
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,42 @@ $first-screen-img = $temp-img ? $temp-img : '/images/bg.svg'
.sc-icon-list {
display flex
justify-content center
box-sizing border-box
font-size var(--first-screen-icon-size)


+keep-tablet() {
font-size calc(var(--first-screen-icon-size) * 0.9)
}

.sc-icon-item {
display flex
align-items center
margin 0 1rem
cursor pointer

i {
color var(--text-color-3)
font-size var(--first-screen-icon-size)
}

svg {
width var(--first-screen-icon-size)
height var(--first-screen-icon-size)

path {
fill var(--text-color-3)
}
}


+keep-tablet() {
i {
font-size calc(var(--first-screen-icon-size) * 0.9)
}

svg {
width calc(var(--first-screen-icon-size) * 0.9)
height calc(var(--first-screen-icon-size) * 0.9)
}
}

a {
display flex !important
align-items center !important
}
}
}
Expand Down