152 lines
5.1 KiB
HTML
152 lines
5.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<!--
|
|
If you are serving your web app in a path other than the root, change the
|
|
href value below to reflect the base path you are serving from.
|
|
|
|
The path provided below has to start and end with a slash "/" in order for
|
|
it to work correctly.
|
|
|
|
For more details:
|
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
|
|
|
|
This is a placeholder for base href that will be replaced by the value of
|
|
the `--base-href` argument provided to `flutter build`.
|
|
-->
|
|
<base href="$FLUTTER_BASE_HREF">
|
|
|
|
<meta charset="UTF-8">
|
|
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
|
<meta name="description" content="A new Flutter project.">
|
|
|
|
<!-- iOS meta tags & icons -->
|
|
<meta name="mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<meta name="apple-mobile-web-app-title" content="z_timeline">
|
|
<link rel="apple-touch-icon" href="icons/Icon-192.png">
|
|
|
|
<!-- Favicon -->
|
|
<link rel="icon" type="image/png" href="favicon.png"/>
|
|
|
|
<title>z_timeline</title>
|
|
<link rel="manifest" href="manifest.json">
|
|
</head>
|
|
<body>
|
|
<!-- Dev-mode fake data: provides window.__zendegi__ so the timeline
|
|
renders standalone without the React parent. Harmless in production
|
|
because React overwrites __zendegi__ before Flutter loads. -->
|
|
<script>
|
|
(function () {
|
|
// Only bootstrap if no bridge exists yet (i.e. not embedded in React)
|
|
if (window.__zendegi__) return;
|
|
|
|
var state = {
|
|
timeline: {
|
|
id: "tl-1",
|
|
title: "My Project",
|
|
groups: [
|
|
{
|
|
id: "g-1",
|
|
title: "Design",
|
|
sortOrder: 0,
|
|
items: [
|
|
{ id: "e-1", title: "Brand identity", start: "2026-01-02", end: "2026-01-08" },
|
|
{ id: "e-2", title: "UI mockups", start: "2026-01-06", end: "2026-01-14" },
|
|
{ id: "e-3", title: "Design review", start: "2026-01-20", end: "2026-01-22" },
|
|
],
|
|
},
|
|
{
|
|
id: "g-2",
|
|
title: "Engineering",
|
|
sortOrder: 1,
|
|
items: [
|
|
{ id: "e-4", title: "API scaffolding", start: "2026-01-05", end: "2026-01-12" },
|
|
{ id: "e-5", title: "Auth flow", start: "2026-01-10", end: "2026-01-18" },
|
|
{ id: "e-6", title: "Dashboard UI", start: "2026-01-15", end: "2026-01-25" },
|
|
],
|
|
},
|
|
{
|
|
id: "g-3",
|
|
title: "Launch",
|
|
sortOrder: 2,
|
|
items: [
|
|
{ id: "e-7", title: "QA testing", start: "2026-01-19", end: "2026-01-26" },
|
|
{ id: "e-8", title: "Beta release", start: "2026-01-24", end: "2026-01-28" },
|
|
{ id: "e-9", title: "Marketing prep", start: "2026-01-08", end: "2026-01-15" },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
selectedItemId: null,
|
|
};
|
|
|
|
var _updateState = null;
|
|
|
|
window.__zendegi__ = {
|
|
getState: function () {
|
|
return JSON.stringify(state);
|
|
},
|
|
|
|
onEvent: function (jsonStr) {
|
|
var event = JSON.parse(jsonStr);
|
|
console.log(event);
|
|
|
|
if (event.type === "entry_moved") {
|
|
var p = event.payload;
|
|
var entry = null;
|
|
var sourceGroup = null;
|
|
|
|
// Find and remove the entry from its current group
|
|
for (var i = 0; i < state.timeline.groups.length; i++) {
|
|
var g = state.timeline.groups[i];
|
|
for (var j = 0; j < g.items.length; j++) {
|
|
if (g.items[j].id === p.entryId) {
|
|
entry = g.items.splice(j, 1)[0];
|
|
sourceGroup = g;
|
|
break;
|
|
}
|
|
}
|
|
if (entry) break;
|
|
}
|
|
|
|
if (entry) {
|
|
// Preserve duration, update start/end
|
|
var oldStart = new Date(entry.start);
|
|
var oldEnd = new Date(entry.end);
|
|
var duration = oldEnd - oldStart;
|
|
var newStart = new Date(p.newStart);
|
|
var newEnd = new Date(newStart.getTime() + duration);
|
|
|
|
entry.start = newStart.toISOString().split("T")[0];
|
|
entry.end = newEnd.toISOString().split("T")[0];
|
|
|
|
// Add to target group
|
|
var targetGroup = state.timeline.groups.find(
|
|
function (g) { return g.id === p.newGroupId; }
|
|
);
|
|
if (targetGroup) {
|
|
targetGroup.items.push(entry);
|
|
}
|
|
|
|
}
|
|
} else if (event.type === "content_height") {
|
|
console.log("[z-timeline dev] content_height:", event.payload.height);
|
|
} else {
|
|
console.log("[z-timeline dev] event:", event);
|
|
}
|
|
},
|
|
|
|
set updateState(callback) {
|
|
_updateState = callback;
|
|
},
|
|
};
|
|
|
|
console.log("[z-timeline dev] Standalone mode — fake data loaded");
|
|
})();
|
|
</script>
|
|
|
|
<script src="flutter_bootstrap.js" async></script>
|
|
</body>
|
|
</html>
|