diff --git a/bs-config.cjs b/bs-config.cjs index 7552e52..feb78fc 100644 --- a/bs-config.cjs +++ b/bs-config.cjs @@ -13,7 +13,7 @@ module.exports = { "tasks/index.html", "tasks/*/index.html", "tasks/*/docs/*.template.html", - // output.html excluded: generated by save flow, reload would wipe editor state + "tasks/*/docs/*.output.html", "tasks/*/editor.html", "assets/**/*", "public/**/*" diff --git a/src/editor/editor-core.js b/src/editor/editor-core.js index d6a5ddd..c03fc1e 100644 --- a/src/editor/editor-core.js +++ b/src/editor/editor-core.js @@ -59,6 +59,10 @@ window.EditorCore = (function () { _wireButton('btn-reset', () => opts.onReset(_currentPage + 1)); } + // Disconnect browser-sync to prevent auto-reload. + // Editors maintain DOM state — reload would wipe unsaved changes. + _disconnectBrowserSync(); + // Load worksheet, then optionally load data.json _loadWorksheet(_config.filePath, opts.onReady, opts.onDataLoaded); @@ -240,6 +244,18 @@ window.EditorCore = (function () { // ---- Helpers ---- + function _disconnectBrowserSync() { + function tryDisconnect() { + if (window.___browserSync___) { + window.___browserSync___.socket.close(); + } + } + // Browser-sync client may connect after our script runs + tryDisconnect(); + setTimeout(tryDisconnect, 500); + setTimeout(tryDisconnect, 2000); + } + function _wireButton(id, handler) { const btn = document.getElementById(id); if (btn) btn.addEventListener('click', handler); diff --git a/tasks/asteroid-splitting/docs/asteroid-splitting-1.data.json b/tasks/asteroid-splitting/docs/asteroid-splitting-1.data.json index 0b3f48a..a2f572a 100644 --- a/tasks/asteroid-splitting/docs/asteroid-splitting-1.data.json +++ b/tasks/asteroid-splitting/docs/asteroid-splitting-1.data.json @@ -5,7 +5,7 @@ "sections": [ { "index": 0, - "scale": 1.15, + "scale": 1.25, "rotate": 0 }, { @@ -35,7 +35,7 @@ }, { "index": 2, - "scale": 0.85, + "scale": 0.65, "rotate": 0 } ]