个人卡片添加作者打招呼

This commit is contained in:
1152958806@qq.com 2023-07-09 13:48:21 +08:00
parent 92d3de4ba4
commit 51b4a73d06
5 changed files with 42 additions and 5 deletions

View File

@ -399,6 +399,12 @@ spec:
profileDesc: profileDesc:
socialMedia: socialMedia:
children: children:
- $formkit: text
name: helloText
label: 作者打招呼
placeholder: 请填写作者打招呼
value: 🤖️ 数码科技爱好者, 🔍 分享与热心帮助, 🏠 智能家居小能手, 🔨 设计开发一条龙, 🤝 专修交互与设计, 🏃 脚踏实地行动派, 🧱 团队小组发动机, 💢 壮汉人狠话不多
help: 注意格式 (🤖️ 数码科技爱好者, 🔍 分享与热心帮助 以逗号隔开
- $formkit: text - $formkit: text
name: profileName name: profileName
label: 卡片名称 label: 卡片名称

View File

@ -5,6 +5,7 @@ var heo_musicFirst = false;
var heo_musicPlaying = false; var heo_musicPlaying = false;
let heo_keyboard = false; let heo_keyboard = false;
let heo_intype = false; let heo_intype = false;
let lastSayHello = "";
// 私有函数 // 私有函数
var heo = { var heo = {
// 检测显示模式 // 检测显示模式
@ -474,6 +475,16 @@ var heo = {
$htmlDom.toggle('hide-aside') $htmlDom.toggle('hide-aside')
}, },
changeSayHelloText: function() {
const e = GLOBAL_CONFIG.helloText.length == 0 ? ["🤖️ 数码科技爱好者", "🔍 分享与热心帮助", "🏠 智能家居小能手", "🔨 设计开发一条龙", "🤝 专修交互与设计", "🏃 脚踏实地行动派", "🧱 团队小组发动机", "💢 壮汉人狠话不多"] : GLOBAL_CONFIG.helloText
, t = document.getElementById("author-info__sayhi");
let o = e[Math.floor(Math.random() * e.length)];
for (; o === lastSayHello; )
o = e[Math.floor(Math.random() * e.length)];
t.textContent = o,
lastSayHello = o
},
//初始化console图标 //初始化console图标
initConsoleState: function() { initConsoleState: function() {

View File

@ -2099,10 +2099,17 @@ blockquote footer cite::before {
} }
#aside-content .card-info img { #aside-content .card-info img {
width: 110px; width: 28px;
height: 110px; right: 24px;
border-radius: 70px; top: 20px;
border-radius: 500px;
transition: all 0.5s ease 0s; transition: all 0.5s ease 0s;
position: absolute;
}
.author-info__top-group {
display: flex;
height: 28px;
} }
#aside-content .card-info .author-info__name { #aside-content .card-info .author-info__name {
@ -10302,6 +10309,14 @@ div#author-info__sayhi {
padding: 2px 8px; padding: 2px 8px;
border-radius: 12px; border-radius: 12px;
width: fit-content; width: fit-content;
cursor: pointer;
-webkit-user-select: none;
transition: 0.3s;
}
div#author-info__sayhi:hover {
background: var(--heo-card-bg);
color: var(--heo-fontcolor);
} }
#aside-content .card-info .author-info__name { #aside-content .card-info .author-info__name {
@ -10311,7 +10326,7 @@ div#author-info__sayhi {
font-size: 28px; font-size: 28px;
line-height: 1.1; line-height: 1.1;
margin-top: 0.8rem; margin-top: 0.8rem;
margin-bottom: 1rem; margin-bottom: 0.4rem;
} }
/* 作者卡片背景 */ /* 作者卡片背景 */

View File

@ -174,6 +174,7 @@
allPlaylist: [[${theme.config.tool.nav_music.all_playlist}]], allPlaylist: [[${theme.config.tool.nav_music.all_playlist}]],
navMusicEnable:[[${theme.config.tool.nav_music.nav_musicEnable}]], navMusicEnable:[[${theme.config.tool.nav_music.nav_musicEnable}]],
isMusic: [[${ htmlType == 'music'}]], isMusic: [[${ htmlType == 'music'}]],
helloText: [[${#strings.listSplit(theme.config.sidebar.profile.helloText, ',')}]],
source: { source: {
jQuery: 'https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js', jQuery: 'https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js',
justifiedGallery: { justifiedGallery: {

View File

@ -6,7 +6,11 @@
<!-- 描述信息 --> <!-- 描述信息 -->
<div class="card-content"> <div class="card-content">
<div class="card-info-avatar is-center"> <div class="card-info-avatar is-center">
<div class="author-info__sayhi" id="author-info__sayhi">你好啊!我是</div> <div class="author-info__top-group">
<div class="author-info__sayhi" id="author-info__sayhi" onclick="heo.changeSayHelloText()">你好啊!我是</div>
<img class="avatar-img entered loaded"
th:src="@{${#strings.isEmpty(site.logo) ? '/assets/images/hao-logo.jpg' : site.logo}}">
</div>
<div class="author-info__name" <div class="author-info__name"
th:if="${#strings.isEmpty(theme.config.sidebar.profile.profileName)}" th:if="${#strings.isEmpty(theme.config.sidebar.profile.profileName)}"
th:text="${site.title}"></div> th:text="${site.title}"></div>