feat(frontend): replace lazy loading with zibll lazysizes
This commit is contained in:
@@ -1,21 +1,24 @@
|
||||
const themeRoot = typeof window !== 'undefined' && window.aksrtAdminData?.themeUri
|
||||
? String(window.aksrtAdminData.themeUri).replace(/\/$/, '')
|
||||
: ''
|
||||
const defaultThumbnail = themeRoot ? `${themeRoot}/assets/img/thumbnail.svg` : ''
|
||||
|
||||
export const commonSchema = {
|
||||
key: 'global.common',
|
||||
title: '常用功能',
|
||||
icon: 'fas fa-cog',
|
||||
description: '管理站点常用开关、懒加载与备案信息等基础配置。',
|
||||
defaults: {
|
||||
lazyload_enabled: true,
|
||||
lazyload_animation: 'blur',
|
||||
lazyload_placeholder: '',
|
||||
lazyload_blur: true,
|
||||
lazyload_avatar: true,
|
||||
lazyload_content: false,
|
||||
lazyload_comment: true,
|
||||
lazyload_private: true,
|
||||
lazyload_slider: true,
|
||||
lazyload_cover: true,
|
||||
lazyload_other: true,
|
||||
lazyload_widget: true,
|
||||
lazy_posts_thumb: true,
|
||||
lazy_avatar: true,
|
||||
lazy_posts_content: false,
|
||||
lazy_comment: true,
|
||||
lazy_private: true,
|
||||
lazy_sider: true,
|
||||
lazy_cover: true,
|
||||
lazy_other: true,
|
||||
lazy_animation: 'blur',
|
||||
thumbnail: defaultThumbnail,
|
||||
icp_filing: '',
|
||||
police_filing: '',
|
||||
footer_text: '',
|
||||
@@ -26,9 +29,9 @@ export const commonSchema = {
|
||||
title: '性能优化',
|
||||
icon: 'fas fa-tachometer-alt',
|
||||
fields: [
|
||||
{ key: 'lazyload_enabled', label: '图片懒加载', type: 'switch', default: true, help: '开启后页面中的图片将在滚动到可见区域时才加载' },
|
||||
{ key: 'lazy_posts_thumb', label: '文章缩略图懒加载', type: 'switch', default: true, help: '滚动到图像附近时再加载真实图片。' },
|
||||
{
|
||||
key: 'lazyload_animation',
|
||||
key: 'lazy_animation',
|
||||
label: '懒加载动画',
|
||||
type: 'select',
|
||||
default: 'blur',
|
||||
@@ -37,10 +40,8 @@ export const commonSchema = {
|
||||
{ label: '淡入', value: 'fade' },
|
||||
{ label: '缩放', value: 'scale' },
|
||||
],
|
||||
dependsOn: { key: 'lazyload_enabled', value: true },
|
||||
},
|
||||
{ key: 'lazyload_placeholder', label: '预载图', type: 'media', default: '', dependsOn: { key: 'lazyload_enabled', value: true }, help: '自定义占位图,留空使用内置默认' },
|
||||
{ key: 'lazyload_blur', label: '模糊预览', type: 'switch', default: true, dependsOn: { key: 'lazyload_enabled', value: true }, help: '加载前显示低分辨率模糊预览' },
|
||||
{ key: 'thumbnail', label: '懒加载预载图', type: 'media', default: defaultThumbnail, help: '图片加载前显示的占位图。' },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -48,14 +49,13 @@ export const commonSchema = {
|
||||
title: '懒加载范围',
|
||||
icon: 'fas fa-layer-group',
|
||||
fields: [
|
||||
{ key: 'lazyload_avatar', label: '头像懒加载', type: 'switch', default: true, dependsOn: { key: 'lazyload_enabled', value: true } },
|
||||
{ key: 'lazyload_content', label: '文章内容图片懒加载', type: 'switch', default: false, dependsOn: { key: 'lazyload_enabled', value: true } },
|
||||
{ key: 'lazyload_comment', label: '评论内容图片懒加载', type: 'switch', default: true, dependsOn: { key: 'lazyload_enabled', value: true } },
|
||||
{ key: 'lazyload_private', label: '私信聊天图片懒加载', type: 'switch', default: true, dependsOn: { key: 'lazyload_enabled', value: true } },
|
||||
{ key: 'lazyload_slider', label: '幻灯片图片懒加载', type: 'switch', default: true, dependsOn: { key: 'lazyload_enabled', value: true } },
|
||||
{ key: 'lazyload_cover', label: '封面图片懒加载', type: 'switch', default: true, dependsOn: { key: 'lazyload_enabled', value: true } },
|
||||
{ key: 'lazyload_other', label: '其它图片懒加载', type: 'switch', default: true, dependsOn: { key: 'lazyload_enabled', value: true } },
|
||||
{ key: 'lazyload_widget', label: '小工具图片懒加载', type: 'switch', default: true, dependsOn: { key: 'lazyload_enabled', value: true } },
|
||||
{ key: 'lazy_avatar', label: '头像懒加载', type: 'switch', default: true },
|
||||
{ key: 'lazy_posts_content', label: '文章内容图片懒加载', type: 'switch', default: false },
|
||||
{ key: 'lazy_comment', label: '评论内容图片懒加载', type: 'switch', default: true },
|
||||
{ key: 'lazy_private', label: '私信聊天图片懒加载', type: 'switch', default: true },
|
||||
{ key: 'lazy_sider', label: '幻灯片图片懒加载', type: 'switch', default: true },
|
||||
{ key: 'lazy_cover', label: '封面图片懒加载', type: 'switch', default: true },
|
||||
{ key: 'lazy_other', label: '其它图片懒加载', type: 'switch', default: true },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user