Merge pull request #15 from Snarl3908/custom
feat: 首页打字机动画完全可配置,TypeWriteList 为空或注释时不再渲染标签和动画
This commit is contained in:
commit
cce2791c3f
@ -8,5 +8,7 @@ import "./MainHeader.less";
|
|||||||
<img src="/assets/images/lazy-loading.webp" data-vh-lz-src={SITE_INFO.Avatar} alt="avatar" />
|
<img src="/assets/images/lazy-loading.webp" data-vh-lz-src={SITE_INFO.Avatar} alt="avatar" />
|
||||||
</div>
|
</div>
|
||||||
<h3 class="auther">{SITE_INFO.Author || "-"}</h3>
|
<h3 class="auther">{SITE_INFO.Author || "-"}</h3>
|
||||||
|
{Array.isArray(SITE_INFO.TypeWriteList) && SITE_INFO.TypeWriteList.length > 0 && (
|
||||||
<p class="desc"></p>
|
<p class="desc"></p>
|
||||||
</div>
|
)}
|
||||||
|
</div>
|
||||||
@ -73,7 +73,7 @@ import "@/styles/ArticleBase.less";
|
|||||||
</main>
|
</main>
|
||||||
<footer>
|
<footer>
|
||||||
<!-- 打赏组件 -->
|
<!-- 打赏组件 -->
|
||||||
<Reward />
|
{SITE_CONFIG.Reward && (SITE_CONFIG.Reward.AliPay || SITE_CONFIG.Reward.WeChat) && <Reward />}
|
||||||
<!-- 版权©️信息 -->
|
<!-- 版权©️信息 -->
|
||||||
<Copyright site={Site} id={post.data.id} title={post.data.title} sitename={Title} time={fmtTime(post.data.date, "YYYY-MM-DD A")} auther={Author} />
|
<Copyright site={Site} id={post.data.id} title={post.data.title} sitename={Title} time={fmtTime(post.data.date, "YYYY-MM-DD A")} auther={Author} />
|
||||||
<!-- 底部谷歌广告 -->
|
<!-- 底部谷歌广告 -->
|
||||||
|
|||||||
@ -80,7 +80,7 @@ const indexInit = async (only: boolean = true) => {
|
|||||||
// Han Analytics 统计
|
// Han Analytics 统计
|
||||||
HanAnalyticsInit();
|
HanAnalyticsInit();
|
||||||
// 打字效果
|
// 打字效果
|
||||||
only && TypeWriteInit();
|
only && Array.isArray(SITE_INFO.TypeWriteList) && SITE_INFO.TypeWriteList.length > 0 && TypeWriteInit();
|
||||||
// 泡泡🫧效果
|
// 泡泡🫧效果
|
||||||
PaoPaoInit();
|
PaoPaoInit();
|
||||||
// 预加载搜索数据
|
// 预加载搜索数据
|
||||||
|
|||||||
@ -3,6 +3,8 @@ export default () => {
|
|||||||
const writeDom = document.querySelector('.header-main>.desc');
|
const writeDom = document.querySelector('.header-main>.desc');
|
||||||
if (!writeDom) return;
|
if (!writeDom) return;
|
||||||
const TypeWriteList = SITE_INFO.TypeWriteList;
|
const TypeWriteList = SITE_INFO.TypeWriteList;
|
||||||
|
// 如果 TypeWriteList 不是数组或没有内容则不执行动画
|
||||||
|
if (!Array.isArray(TypeWriteList) || TypeWriteList.length === 0) return;
|
||||||
let TypeWriteListIndex = 0;
|
let TypeWriteListIndex = 0;
|
||||||
let index = 0;
|
let index = 0;
|
||||||
let isDeleting = false;
|
let isDeleting = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user