mirror of
https://github.com/KivotosRailway/website.git
synced 2026-11-03 19:07:56 +09:00
Add solitude
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
- const authorinfo = site.data.about.authorinfo
|
||||
|
||||
if authorinfo
|
||||
.author-info
|
||||
.author-tag-left
|
||||
each tag in authorinfo.leftTags
|
||||
span.author-tag= tag
|
||||
.author-img
|
||||
img(src=authorinfo.image)
|
||||
.author-tag-right
|
||||
each tag in authorinfo.rightTags
|
||||
span.author-tag= tag
|
||||
.author-title= site.data.about.title
|
||||
@@ -0,0 +1,39 @@
|
||||
- award = site.data.about.award
|
||||
|
||||
- var sum = 0
|
||||
if site.data.about.rewardList
|
||||
.author-content
|
||||
.author-content-item.single.reward
|
||||
.author-content-item-tips= _p('award.thanks')
|
||||
span.author-content-item-title= _p('award.title')
|
||||
.author-content-item-description
|
||||
!= award.description
|
||||
.reward-list-all
|
||||
each reward in site.data.about.rewardList
|
||||
- sum += reward.money
|
||||
.reward-list-item
|
||||
.reward-list-item-name= reward.name
|
||||
.reward-list-bottom-group
|
||||
.reward-list-item-money(style=(reward.vip ? "background: var(--efu-vip);color: var(--efu-white)" : ""))
|
||||
if reward.icon
|
||||
i.solitude(class=reward.icon)
|
||||
| ¥ #{reward.money}
|
||||
time.datatime.reward-list-item-time(datetime=moment(reward.time).format())
|
||||
if theme.post.award.enable
|
||||
.post-reward
|
||||
.post-reward(onclick="AddRewardMask()")
|
||||
.reward-button(title=_p('award.tipping'))
|
||||
i.solitude.st-hand-heart-fill
|
||||
= _p('award.tipping')
|
||||
.reward-main
|
||||
ul.reward-all
|
||||
span.reward-title= theme.post.award.title
|
||||
ul.reward-group
|
||||
- var rewards = theme.post.award.list
|
||||
each reward in rewards
|
||||
li.reward-item
|
||||
a(href=url_for(reward.url))
|
||||
img.post-qr-code-img(alt=reward.name, src=reward.qcode, style="border-color:" + reward.color)
|
||||
.post-qr-code-desc= reward.name
|
||||
.reward-list-tips
|
||||
p= award.tips.replace('{sum}', sum.toFixed(2))
|
||||
@@ -0,0 +1,39 @@
|
||||
- const contentinfo = site.data.about.contentinfo
|
||||
|
||||
if contentinfo
|
||||
.author-content
|
||||
.author-content-item.myInfoAndSayHello
|
||||
.title1= contentinfo.sup
|
||||
.title2
|
||||
span.inline-word= contentinfo.name
|
||||
.title1= contentinfo.title
|
||||
.aboutsiteTips.author-content-item
|
||||
.author-content-item-tips= contentinfo.tip
|
||||
h2
|
||||
span.inline-word!= contentinfo.slogan
|
||||
.mask
|
||||
each item,index in contentinfo.mask
|
||||
if index === 0
|
||||
span.first-tips(data-show='')= item
|
||||
else if index === contentinfo.mask.length - 1
|
||||
span(data-up='')= item
|
||||
else
|
||||
span= item
|
||||
|
||||
script.
|
||||
var pursuitInterval = null;
|
||||
pursuitInterval = setInterval(function () {
|
||||
const show = document.querySelector('span[data-show]')
|
||||
const next = show.nextElementSibling || document.querySelector('.first-tips')
|
||||
const up = document.querySelector('span[data-up]')
|
||||
if (up) {
|
||||
up.removeAttribute('data-up')
|
||||
}
|
||||
show.removeAttribute('data-show')
|
||||
show.setAttribute('data-up', '')
|
||||
next.setAttribute('data-show', '')
|
||||
}, 2000)
|
||||
|
||||
document.addEventListener('pjax:send', function () {
|
||||
clearInterval(pursuitInterval);
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
- var game1 = site.data.about.game1
|
||||
- var game2 = site.data.about.game2
|
||||
|
||||
if game1 || game2
|
||||
.author-content
|
||||
if game1
|
||||
.author-content-item.game-apex(style=`background: url(${game1.img}) no-repeat top; background-size: cover;`)
|
||||
.card-content
|
||||
.author-content-item-tips= game1.title
|
||||
span.author-content-item-title= game1.subtitle
|
||||
.content-bottom
|
||||
.tips= game1.tips_left
|
||||
.tips= game1.tips_right
|
||||
if game2
|
||||
.author-content-item.game-jl(style=`background: url(${game2.img}) no-repeat top; background-size: cover;`)
|
||||
.card-content
|
||||
.author-content-item-tips= game2.title
|
||||
span.author-content-item-title= game2.subtitle
|
||||
.content-bottom
|
||||
.tips= game2.tips_left
|
||||
.tips= game2.tips_right
|
||||
|
||||
if site.data.about.likes
|
||||
- const likes = site.data.about.likes
|
||||
.author-content
|
||||
each like in likes
|
||||
.author-content-item(class=like.type, style=`background: url(${like.bg}) no-repeat center;`)
|
||||
.card-content
|
||||
.author-content-item-tips= like.tips
|
||||
span.author-content-item-title= like.title
|
||||
.content-bottom
|
||||
.tips= like.subtips
|
||||
if like.button
|
||||
.banner-button-group
|
||||
a.banner-button(href=url_for(like.button_link))
|
||||
i.solitude.st-right-btn-fill
|
||||
span.banner-button-text= like.button_text
|
||||
@@ -0,0 +1,22 @@
|
||||
- const motto = site.data.about.motto
|
||||
- const expertise = site.data.about.expertise
|
||||
|
||||
if motto || expertise
|
||||
.author-content
|
||||
if motto
|
||||
.author-content-item.maxim
|
||||
.author-content-item-tips= motto.title
|
||||
span.maxim-title
|
||||
span= motto.prefix
|
||||
span= motto.content
|
||||
if expertise
|
||||
.author-content-item.buff
|
||||
.card-content
|
||||
.author-content-item-tips= expertise.title
|
||||
span.buff-title
|
||||
span
|
||||
| #{expertise.prefix}
|
||||
span.inline-word= expertise.specialist
|
||||
span
|
||||
| #{expertise.content}
|
||||
span.inline-word= expertise.level
|
||||
@@ -0,0 +1,89 @@
|
||||
- var tj = site.data.about.tj
|
||||
- var oneself = site.data.about.oneself
|
||||
|
||||
if tj || oneself
|
||||
.author-content
|
||||
if tj
|
||||
.about-statistic.author-content-item(style=`background: url(${tj.img});`)
|
||||
.card-content
|
||||
.author-content-item-tips=_p('about.other.tj.tip')
|
||||
span.author-content-item-title=_p('about.other.tj.title')
|
||||
#statistic
|
||||
.post-tips
|
||||
= _p('about.other.tj.post_tip')
|
||||
case tj.provider
|
||||
when '51la'
|
||||
a(href="https://v6.51.la/") 51la网站统计
|
||||
when 'baidu'
|
||||
a(href="https://tongji.baidu.com/") 百度统计
|
||||
if tj.button
|
||||
.banner-button-group
|
||||
a.banner-button(href=url_for(tj.button_link))
|
||||
i.solitude.st-right-btn-fill
|
||||
span.banner-button-text= tj.button_text
|
||||
|
||||
case tj.provider
|
||||
when '51la'
|
||||
script.
|
||||
fetch("#{tj.url}")
|
||||
.then(res => res.text())
|
||||
.then(data => {
|
||||
const title = ["最近活跃", "今日人数", "今日访问", "昨日人数", "昨日访问", "本月访问", "总访问量"];
|
||||
let num = data.match(/(<\/span><span>).*?(\/span><\/p>)/g);
|
||||
num = num.map(el => {
|
||||
let val = el.replace(/(<\/span><span>)/g, "");
|
||||
return val.replace(/(<\/span><\/p>)/g, "");
|
||||
});
|
||||
const s = document.getElementById("statistic");
|
||||
let html = '';
|
||||
for (let i = 0; i < num.length; i++) {
|
||||
if (i === 0 || i === num.length - 1) continue;
|
||||
html += `<div><span>${title[i]}</span><span id="${title[i]}">${num[i]}</span></div>`;
|
||||
}
|
||||
s.innerHTML = html;
|
||||
});
|
||||
when 'baidu'
|
||||
script.
|
||||
fetch("#{tj.url}")
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
const title = {"today_uv": "今日人数", "today_pv": "今日访问", "yesterday_uv": "昨日人数", "yesterday_pv": "昨日访问", "last_month_pv": "最近月访问", "last_year_pv": "最近年访问"};
|
||||
|
||||
let s = document.getElementById("statistic");
|
||||
|
||||
for (let key in data) {
|
||||
if (data.hasOwnProperty(key) && title[key]) {
|
||||
s.innerHTML += `<div><span>${title[key]}</span><span id="${key}">${data[key]}</span></div>`;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if oneself
|
||||
style.
|
||||
:root {
|
||||
--site-about-oneself-map--light: url(#{oneself.map.light});
|
||||
--site-about-oneself-map--dark: url(#{oneself.map.dark});
|
||||
}
|
||||
.author-content-item-group.column.mapAndInfo
|
||||
.author-content-item.map.single
|
||||
span.map-title=_p('about.other.oneself.map_title') + oneself.location
|
||||
.author-content-item.selfInfo.single
|
||||
div
|
||||
span.selfInfo-title=_p('about.other.oneself.info_title1')
|
||||
span.selfInfo-content(style="color: #43a6c6;")= oneself.birthYear
|
||||
div
|
||||
span.selfInfo-title= oneself.university
|
||||
span.selfInfo-content(style="color: #c69043;")= oneself.major
|
||||
div
|
||||
span.selfInfo-title=_p('about.other.oneself.info_title2')
|
||||
span.selfInfo-content(style="color: #b04fe6;")= oneself.occupation
|
||||
|
||||
- var cause = site.data.about.cause
|
||||
|
||||
if cause
|
||||
.author-content
|
||||
.create-site-post.author-content-item.single
|
||||
.author-content-item-tips= cause.tip
|
||||
span.author-content-item-title= cause.title
|
||||
!= cause.content
|
||||
@@ -0,0 +1,17 @@
|
||||
- const personalities = site.data.about.personalities
|
||||
|
||||
if personalities
|
||||
.author-content
|
||||
.author-content-item.personalities
|
||||
.author-content-item-tips= personalities.tips
|
||||
span.author-content-item-title= personalities.title
|
||||
.title2(style=`color:${personalities.color}`)= personalities.type
|
||||
.image
|
||||
img.nolazyload(src=personalities.image)
|
||||
.post-tips
|
||||
= _p('about.personalities.tip1') + ' '
|
||||
a(href='https://www.16personalities.com/')= personalities.linkText + ' '
|
||||
= _p('about.personalities.tip2') + ' '
|
||||
a(href=personalities.typeLink)= personalities.typeName
|
||||
.author-content-item.myphoto
|
||||
img.author-content-img(src=personalities.myphoto, alt="my photo")
|
||||
@@ -0,0 +1,42 @@
|
||||
- var skills = site.data.about.skills
|
||||
- var careers = site.data.about.careers
|
||||
|
||||
if skills || careers
|
||||
.author-content
|
||||
if skills
|
||||
.author-content-item.skills
|
||||
.card-content
|
||||
.author-content-item-tips= skills.title
|
||||
span.author-content-item-title= skills.subtitle
|
||||
.skills-style-group
|
||||
.tags-group-all
|
||||
.tags-group-wrapper
|
||||
each i in [1,2]
|
||||
- var pair = []
|
||||
each tag, index in skills.tags
|
||||
- pair.push(tag)
|
||||
if pair.length === 2 || index === skills.tags.length - 1
|
||||
.tags-group-icon-pair
|
||||
each item in pair
|
||||
.tags-group-icon(style=`background:${item.color}`)
|
||||
img(src=item.icon, title=item.title)
|
||||
- pair = []
|
||||
.skills-list
|
||||
each tag in skills.tags
|
||||
.skill-info
|
||||
.skill-icon(style=`background:${tag.color}`)
|
||||
img(src=tag.icon, title=tag.title)
|
||||
.skill-name
|
||||
span= tag.title
|
||||
.etc ...
|
||||
if careers
|
||||
.author-content-item.careers
|
||||
.card-content
|
||||
.author-content-item-tips= careers.title
|
||||
span.author-content-item-title= careers.subtitle
|
||||
.careers-group
|
||||
each item in careers.items
|
||||
.careers-item
|
||||
.circle(style=`background:${item.color}`)
|
||||
.name= `${item.school}, ${item.major}`
|
||||
img.author-content-img(src=careers.image, alt=careers.title)
|
||||
@@ -0,0 +1,48 @@
|
||||
- var tenyear = site.data.about.tenyear
|
||||
if tenyear
|
||||
.author-content#tenyear
|
||||
.create-site-post.author-content-item.single
|
||||
.author-content-item-tips=tenyear.tips
|
||||
.author-content-item-title=tenyear.title
|
||||
p=tenyear.text
|
||||
.tenyear-timeline
|
||||
.progress
|
||||
.past-time
|
||||
.percentage-label
|
||||
.time-labels
|
||||
.start-time#tenyear-start-time= tenyear.start
|
||||
.end-time#tenyear-end-time= tenyear.end
|
||||
|
||||
script.
|
||||
function parseDateString(e) {
|
||||
return e.replace(/年|月/g, '-').replace(/日/g, '');
|
||||
}
|
||||
|
||||
function tenYear() {
|
||||
let progressElement = document.querySelector(".progress");
|
||||
let pastTimeElement = document.querySelector(".past-time");
|
||||
let percentageLabelElement = document.querySelector(".percentage-label");
|
||||
let startTimeElement = document.getElementById("tenyear-start-time");
|
||||
let endTimeElement = document.getElementById("tenyear-end-time");
|
||||
|
||||
let startTime = new Date(parseDateString(startTimeElement.textContent)).getTime();
|
||||
let endTime = new Date(parseDateString(endTimeElement.textContent)).getTime();
|
||||
|
||||
function updateProgress() {
|
||||
let currentTime = new Date().getTime();
|
||||
let progress = ((currentTime - startTime) / (endTime - startTime) * 100);
|
||||
let progressPercentage = progress <= 100 ? progress + "%" : "100%";
|
||||
|
||||
pastTimeElement.style.setProperty("--past-time-percentage", progress + "%");
|
||||
progressElement.style.setProperty("--progress-percentage", progressPercentage);
|
||||
if(progress > 5){
|
||||
percentageLabelElement.textContent = `${progress.toFixed(0)}%`;
|
||||
percentageLabelElement.style.left = `calc(${progress}% - 35px)`;
|
||||
}
|
||||
}
|
||||
|
||||
percentageLabelElement.style.visibility = "visible";
|
||||
updateProgress();
|
||||
}
|
||||
|
||||
document.getElementById("tenyear") && tenYear() && window.Pjax.on('complete', tenYear)
|
||||
Reference in New Issue
Block a user