Expand page templates and configure page visibility
@@ -2,7 +2,7 @@
|
||||
position: fixed;
|
||||
inset: 0 0 0 auto;
|
||||
margin: 0;
|
||||
width: min(100%, 39rem);
|
||||
width: min(100%, clamp(45rem, 80vw, 78rem));
|
||||
max-width: none;
|
||||
height: 100dvh;
|
||||
max-height: none;
|
||||
@@ -33,7 +33,9 @@
|
||||
.page-template-content h3:focus { outline: none; }
|
||||
.page-template-back { margin-bottom: 1.15rem; }
|
||||
.page-template-groups, .page-template-pages { display: grid; gap: .75rem; }
|
||||
.page-template-groups { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
|
||||
.page-template-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
.page-template-detail { display: grid; gap: clamp(1rem, 3vw, 2rem); align-items: start; }
|
||||
.page-template-card {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
@@ -46,7 +48,6 @@
|
||||
border-radius: .7rem;
|
||||
text-align: start;
|
||||
}
|
||||
.page-template-groups .page-template-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: stretch; }
|
||||
.page-template-card:hover, .page-template-card:focus-visible { border-color: var(--accent); }
|
||||
.page-template-card-copy { display: grid; align-content: center; gap: .24rem; padding: clamp(.65rem, 2vw, 1rem); }
|
||||
.page-template-card-copy small { line-height: 1.5; color: var(--muted); }
|
||||
@@ -54,7 +55,10 @@
|
||||
.page-template-image img { width: 100%; height: auto; transition: transform 180ms ease; }
|
||||
.page-template-card:hover img, .page-template-card:focus-visible img { transform: scale(1.035); }
|
||||
.page-template-preview-link { margin-block: .8rem 1.2rem; }
|
||||
@media (min-width: 49rem) {
|
||||
.page-template-detail { grid-template-columns: minmax(0, 1.8fr) minmax(17rem, 1fr); }
|
||||
.page-template-detail .form-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
@media (max-width: 30rem) {
|
||||
.page-template-groups .page-template-card { grid-template-columns: 1fr; }
|
||||
.page-template-pages { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
@@ -114,3 +114,59 @@
|
||||
.template-ledger article { gap: .4rem; }
|
||||
.template-steps { gap: .8rem; }
|
||||
}
|
||||
|
||||
.theme-vantage {
|
||||
--white: #121b20;
|
||||
--paper: #1b272d;
|
||||
--ink: #eef4f1;
|
||||
--muted: #bdcdc8;
|
||||
--line: #53676b;
|
||||
--accent: #bfe971;
|
||||
--accent-deep: #d7ffa0;
|
||||
--accent-light: #2e4233;
|
||||
}
|
||||
.theme-vantage .hero {
|
||||
background: radial-gradient(ellipse at 82% 35%, #243b39, transparent 65%),
|
||||
radial-gradient(circle, #4b6959 1px, transparent 1.4px) 0 0 / 18px 18px, var(--white);
|
||||
}
|
||||
.theme-vantage .hero-copy { background: #121b20; padding-block: 1rem; }
|
||||
.theme-vantage .app-frame { border: 1px solid #618076; border-radius: .2rem; background: #263738; box-shadow: 8px 8px 0 #172e26; }
|
||||
.theme-vantage .app-frame img, .theme-vantage .button { border-radius: .2rem; }
|
||||
.theme-vantage .button-primary, .theme-vantage .button-primary:hover { color: #172318; }
|
||||
.theme-vantage .button-outline { border-color: #7d9b8e; color: var(--ink); }
|
||||
.theme-vantage .button-outline:hover { background: var(--paper); }
|
||||
|
||||
.theme-ribbon {
|
||||
--white: #fffdfb;
|
||||
--paper: #f0eaf8;
|
||||
--ink: #2d2546;
|
||||
--muted: #5a516e;
|
||||
--line: #d9cce8;
|
||||
--accent: #633ab1;
|
||||
--accent-deep: #4d268e;
|
||||
--accent-light: #ebdfff;
|
||||
}
|
||||
.theme-ribbon .hero { background: radial-gradient(ellipse at 88% 24%, #d9c5f3, transparent 60%), #f5eff9; }
|
||||
.theme-ribbon .app-frame { border-color: #b9a1db; border-radius: clamp(1.4rem, 4vw, 3rem); background: #fffafc; box-shadow: 0 22px 65px -31px #68489b83; }
|
||||
.theme-ribbon .app-frame img { border-radius: 1rem; object-fit: cover; }
|
||||
.theme-ribbon .button { border-radius: 2rem; }
|
||||
.theme-ribbon .button-outline { border-color: #ac99c8; background: var(--white); }
|
||||
.theme-ribbon .studio-split img { border-radius: 1.4rem; border: 1px solid var(--line); }
|
||||
|
||||
.theme-furrow {
|
||||
--white: #fdf9ee;
|
||||
--paper: #f1e9d5;
|
||||
--ink: #262b1c;
|
||||
--muted: #5a5847;
|
||||
--line: #c9bd9f;
|
||||
--accent: #325335;
|
||||
--accent-deep: #233a27;
|
||||
--accent-light: #e3ecd9;
|
||||
}
|
||||
.theme-furrow .hero { background: linear-gradient(115deg, #f7f0dd, #eee2c5); }
|
||||
.theme-furrow .hero-copy { border-inline-start: .3rem solid #b67e28; padding-inline-start: clamp(1rem, 2.6vw, 2.2rem); }
|
||||
.theme-furrow :is(h1, h2) { font-family: 'Noto Serif CJK SC', 'Songti SC', Georgia, serif; }
|
||||
.theme-furrow .app-frame { border: 1px solid #9f946f; border-radius: .3rem; background: #fff8e7; box-shadow: 9px 9px 0 #c6ae7d56; }
|
||||
.theme-furrow .app-frame img { border-radius: .15rem; }
|
||||
.theme-furrow .button { border-radius: .2rem; }
|
||||
.theme-furrow .button-outline { border-color: #908764; background: var(--white); }
|
||||
|
||||
@@ -262,7 +262,7 @@ progress { width: 100%; height: .8rem; accent-color: var(--accent); }
|
||||
.contact-panel { display: flex; flex-wrap: wrap; gap: 1.4rem 3rem; align-items: center; }
|
||||
.contact-panel img { width: 10rem; border: 1px solid var(--line); }
|
||||
.resource-box { max-width: 46rem; }
|
||||
.faq { max-width: 62rem; border-top: 1px solid var(--line); }
|
||||
.faq { border-top: 1px solid var(--line); }
|
||||
.faq details { border-bottom: 1px solid var(--line); }
|
||||
.faq summary { cursor: pointer; padding: 1.05rem 2.5rem 1.05rem 0; min-height: 48px; position: relative; list-style: none; font-weight: 630; }
|
||||
.faq summary::-webkit-details-marker { display: none; }
|
||||
@@ -479,6 +479,7 @@ progress { width: 100%; height: .8rem; accent-color: var(--accent); }
|
||||
}
|
||||
.hero h1 .hero-heading-primary { color: inherit; }
|
||||
.studio-accent { display: block; }
|
||||
[data-studio-editing] .hero:has(> [data-studio-hero-content][hidden]):not(:has(> .hero-directory-slot)) { display: none; }
|
||||
[data-studio-editing] [contenteditable], [data-studio-editing] [data-studio-action],
|
||||
[data-studio-editing] [data-studio-navigation] a, [data-studio-editing] [data-studio-hero-image] {
|
||||
outline: 1px dashed #7896d5;
|
||||
|
||||
@@ -306,8 +306,7 @@ jQuery(function ($) {
|
||||
const $alignTools = $elementTools.find('[data-element-align]');
|
||||
const alignments = ['left', 'center', 'right'];
|
||||
const alignmentClasses = alignments.map((value) => 'studio-align-' + value);
|
||||
const heroOrOptional = '[data-studio-field="accent"], [data-studio-field="lead"], [data-studio-part="lead"], [data-studio-action], [data-studio-nav-index]';
|
||||
const canvasFields = heroOrOptional + ', [data-studio-field="heading"], [data-studio-part="title"]';
|
||||
const canvasFields = '[data-studio-field="heading"], [data-studio-field="accent"], [data-studio-field="lead"], [data-studio-part="title"], [data-studio-part="lead"], [data-studio-action], [data-studio-nav-index]';
|
||||
const bodyElements = 'a, article, blockquote, details, div, dl, dt, dd, figure, h1, h2, h3, h4, h5, h6, hr, li, ol, p, pre, progress, table, ul';
|
||||
const mediaTargets = '[data-studio-hero-image], [data-studio-part="body"] img, [data-studio-part="body"] audio, [data-studio-part="body"] video';
|
||||
const $handle = $studio.find('[data-media-handle]');
|
||||
@@ -359,7 +358,7 @@ jQuery(function ($) {
|
||||
const $moduleForm = $moduleDialog.find('form');
|
||||
const moduleInput = (name) => $moduleForm.find('[name="' + name + '"]');
|
||||
let editedModule;
|
||||
let deletedModules = [];
|
||||
let deletedSections = [];
|
||||
const propertyInput = (name) => $propertyForm.find('[name="' + name + '"]');
|
||||
const pageInput = (name) => $settings.find('[name="' + name + '"]');
|
||||
const settingsSnapshot = () => $settings.serializeArray()
|
||||
@@ -402,7 +401,7 @@ jQuery(function ($) {
|
||||
if (feedChanged) edit.feed = feed;
|
||||
return [edit];
|
||||
});
|
||||
return [...edits, ...deletedModules];
|
||||
return [...edits, ...deletedSections];
|
||||
}
|
||||
|
||||
$settings.on('studio:sync', () => pageInput('canvas_sections').val(JSON.stringify(sectionChanges())));
|
||||
@@ -514,6 +513,15 @@ jQuery(function ($) {
|
||||
}
|
||||
|
||||
function bindPage($doc) {
|
||||
const visibilityTargets = {header: '.masthead', hero: '[data-studio-hero-content], .page-photo-credit', footer: '.site-footer'};
|
||||
for (const [area, selector] of Object.entries(visibilityTargets)) {
|
||||
const $input = pageInput('show_' + area);
|
||||
const $target = $doc.find(selector);
|
||||
$input.on('change.canvas', () => {
|
||||
selectElement(null);
|
||||
$target.prop('hidden', $input.val() === '0');
|
||||
});
|
||||
}
|
||||
const labels = {name: '页面名称', heading: '首屏标题', accent: '标题第二行', lead: '首屏简介'};
|
||||
$doc.find('[data-studio-field]').each(function () {
|
||||
const field = this.dataset.studioField;
|
||||
@@ -622,6 +630,20 @@ jQuery(function ($) {
|
||||
return $navContent.find('[data-studio-nav-index="' + (index + 1) + '"]').get(0);
|
||||
});
|
||||
$navInput.on('input.canvas', syncNavigation);
|
||||
heroControls.set('remove-section-links', (key) => {
|
||||
const anchor = '#' + key;
|
||||
$navInput.val(navLines().filter((line) => {
|
||||
const separator = line.indexOf('|');
|
||||
return separator < 0 || line.slice(separator + 1).trim() !== anchor;
|
||||
}).join('\n'));
|
||||
syncNavigation();
|
||||
for (const index of [1, 2]) {
|
||||
const $url = pageInput('url' + index);
|
||||
if ($url.val().trim() !== anchor) continue;
|
||||
pageInput('label' + index).val('');
|
||||
$url.val('').trigger('input');
|
||||
}
|
||||
});
|
||||
heroControls.set('navigation', () => {
|
||||
openProperties('本页目录', {quicklinks: $navInput.val()}, ({quicklinks}) => {
|
||||
$navInput.val(quicklinks);
|
||||
@@ -832,7 +854,10 @@ jQuery(function ($) {
|
||||
const aligned = dynamic ? null : alignmentTarget(node);
|
||||
syncAlignmentButtons(aligned);
|
||||
$elementTools.find('[data-element-copy]').prop('hidden', !canCopy);
|
||||
$elementTools.find('[data-element-delete]').prop('hidden', !dynamic && !inBody && !selectedMedia && !node.matches(heroOrOptional));
|
||||
const deleteLabel = node.dataset.studioField === 'heading' ? '删除首屏'
|
||||
: node.dataset.studioPart === 'title' ? '删除区块' : '删除';
|
||||
$elementTools.find('[data-element-delete]').attr({'aria-label': deleteLabel, title: deleteLabel})
|
||||
.prop('hidden', !dynamic && !inBody && !selectedMedia && !node.matches(canvasFields));
|
||||
$elementTools.find('[data-element-properties]').prop('hidden', !hasProperties);
|
||||
if (target) showMediaWidth(currentMediaWidth(target));
|
||||
selectionObserver?.observe(target || aligned || node);
|
||||
@@ -848,6 +873,15 @@ jQuery(function ($) {
|
||||
return;
|
||||
}
|
||||
const {studioField, studioAction, studioNavIndex} = node.dataset;
|
||||
if (!copy && studioField === 'heading') {
|
||||
pageInput('show_hero').val('0').trigger('change');
|
||||
$studio.find('[data-canvas-status]').text('首屏已移除,可在页面设置中恢复。');
|
||||
return;
|
||||
}
|
||||
if (!copy && node.dataset.studioPart === 'title') {
|
||||
changeModule(sections.find((section) => section.node === node.closest('[data-studio-section]')), false);
|
||||
return;
|
||||
}
|
||||
const inBody = node.closest('[data-studio-part="body"]') !== null;
|
||||
selectElement(null);
|
||||
if (inBody) {
|
||||
@@ -958,9 +992,10 @@ jQuery(function ($) {
|
||||
function removeSection(section) {
|
||||
if (section.node.contains(activeBody)) selectBody(null);
|
||||
if (section.node.contains(selectedElement)) selectElement(null);
|
||||
if (section.version !== null) deletedModules.push({key: section.key, version: section.version, delete: true});
|
||||
if (section.version !== null) deletedSections.push({key: section.key, version: section.version, delete: true});
|
||||
section.node.remove();
|
||||
sections = sections.filter((entry) => entry !== section);
|
||||
heroControls.get('remove-section-links')(section.key);
|
||||
section.$pending?.remove();
|
||||
$pending.prop('hidden', !$pending.children().length);
|
||||
}
|
||||
@@ -989,9 +1024,9 @@ jQuery(function ($) {
|
||||
function changeModule(section, copy) {
|
||||
if (!section) return;
|
||||
if (!copy) {
|
||||
if (window.confirm('删除此模块?保存页面后生效。')) {
|
||||
if (window.confirm('删除此区块?保存页面后生效。')) {
|
||||
removeSection(section);
|
||||
$studio.find('[data-canvas-status]').text('模块已移除,保存页面后生效。');
|
||||
$studio.find('[data-canvas-status]').text('区块已移除,保存页面后生效。');
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1178,7 +1213,7 @@ jQuery(function ($) {
|
||||
selectElement(null);
|
||||
$pending.empty().prop('hidden', true);
|
||||
sections = [];
|
||||
deletedModules = [];
|
||||
deletedSections = [];
|
||||
$doc.find('[data-studio-section]').each((_, section) => registerSection(section));
|
||||
|
||||
$doc.on('focusin.canvas', '[contenteditable]', function () {
|
||||
|
||||