aboutsummaryrefslogtreecommitdiff
path: root/src/web/component
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/component')
-rw-r--r--src/web/component/image/index.css0
-rw-r--r--src/web/component/image/index.html2
-rw-r--r--src/web/component/image/index.js1
-rw-r--r--src/web/component/image/root.zig8
-rw-r--r--src/web/component/navigation/index.css66
-rw-r--r--src/web/component/navigation/index.html11
-rw-r--r--src/web/component/navigation/index.js11
-rw-r--r--src/web/component/navigation/root.zig8
-rw-r--r--src/web/component/root.zig7
-rw-r--r--src/web/component/timeline/index.css18
-rw-r--r--src/web/component/timeline/index.html2
-rw-r--r--src/web/component/timeline/index.js96
-rw-r--r--src/web/component/timeline/root.zig8
13 files changed, 0 insertions, 238 deletions
diff --git a/src/web/component/image/index.css b/src/web/component/image/index.css
deleted file mode 100644
index e69de29..0000000
--- a/src/web/component/image/index.css
+++ /dev/null
diff --git a/src/web/component/image/index.html b/src/web/component/image/index.html
deleted file mode 100644
index 918c5df..0000000
--- a/src/web/component/image/index.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<div id="image">
-</div>
diff --git a/src/web/component/image/index.js b/src/web/component/image/index.js
deleted file mode 100644
index d88023d..0000000
--- a/src/web/component/image/index.js
+++ /dev/null
@@ -1 +0,0 @@
-console.log(Z.by_selector('div'));
diff --git a/src/web/component/image/root.zig b/src/web/component/image/root.zig
deleted file mode 100644
index 7c8ec77..0000000
--- a/src/web/component/image/root.zig
+++ /dev/null
@@ -1,8 +0,0 @@
-const z = @import("z");
-
-pub const component: z.Component = .{
- .name = .image,
- .body = @embedFile("index.html"),
- .style = @embedFile("index.css"),
- .script = @embedFile("index.js"),
-};
diff --git a/src/web/component/navigation/index.css b/src/web/component/navigation/index.css
deleted file mode 100644
index 836e3b5..0000000
--- a/src/web/component/navigation/index.css
+++ /dev/null
@@ -1,66 +0,0 @@
-#toggle {
- --radius-open: 200px;
-
- position: absolute;
- right: 10px;
- bottom: 10px;
- width: 45px;
- height: 45px;
- border-radius: 100%;
- background: red;
- z-index: 500;
- cursor: pointer;
- text-align: center;
- align-content: center;
- transition:
- border-radius 0.1s ease,
- right 0.1s ease,
- bottom 0.1s ease,
- width 0.1s ease,
- height 0.1s ease;
-
- .bi {
- baseline-shift: -2px;
- }
-
- .items {
- position: relative;
- top: 0px;
- left: 0px;
- right: 0px;
- bottom: 0px;
- }
-
- .item {
- display: none;
- width: 45px;
- height: 45px;
- border-radius: 100%;
- background: blue;
- position: absolute;
- right: calc(cos(18deg * var(--index)) * var(--radius-open));
- bottom: calc(sin(18deg * var(--index)) * var(--radius-open));
- font-size: calc(var(--index) * 1px);
- }
-
- .item {
- --index: sibling-index();
- }
-}
-
-#toggle.open {
- width: var(--radius-open);
- height: var(--radius-open);
- bottom: 0px;
- right: 0px;
- border-radius: 0px;
- border-top-left-radius: 250px;
-
- .bi {
- display: none;
- }
-
- .item {
- display: block;
- }
-}
diff --git a/src/web/component/navigation/index.html b/src/web/component/navigation/index.html
deleted file mode 100644
index b3b5ce0..0000000
--- a/src/web/component/navigation/index.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<div id="toggle">
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-three-dots-vertical" viewBox="0 0 16 16">
- <path d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
- </svg>
- <div class="items">
- <div class="item"></div>
- <div class="item"></div>
- <div class="item"></div>
- <div class="item"></div>
- </div>
-</div>
diff --git a/src/web/component/navigation/index.js b/src/web/component/navigation/index.js
deleted file mode 100644
index 2c996a0..0000000
--- a/src/web/component/navigation/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-
-const toggle = Z.by_id('toggle');
-
-toggle.onclick = (event) => {
- toggle.classList.toggle('open');
- event.stopPropagation();
-};
-
-document.addEventListener('click', () => {
- toggle.classList.remove('open');
-});
diff --git a/src/web/component/navigation/root.zig b/src/web/component/navigation/root.zig
deleted file mode 100644
index 919cddb..0000000
--- a/src/web/component/navigation/root.zig
+++ /dev/null
@@ -1,8 +0,0 @@
-const z = @import("z");
-
-pub const component: z.Component = .{
- .name = .navigation,
- .body = @embedFile("index.html"),
- .style = @embedFile("index.css"),
- .script = @embedFile("index.js"),
-};
diff --git a/src/web/component/root.zig b/src/web/component/root.zig
deleted file mode 100644
index ba2f565..0000000
--- a/src/web/component/root.zig
+++ /dev/null
@@ -1,7 +0,0 @@
-const z = @import("z");
-
-pub const components: []const z.Component = &.{
- @import("image/root.zig").component,
- @import("timeline/root.zig").component,
- @import("navigation/root.zig").component,
-};
diff --git a/src/web/component/timeline/index.css b/src/web/component/timeline/index.css
deleted file mode 100644
index 6d58f59..0000000
--- a/src/web/component/timeline/index.css
+++ /dev/null
@@ -1,18 +0,0 @@
-#container {
- width: 100%;
- display: inline-grid;
- gap: 0px;
- overflow-y: auto;
-}
-
-.image {
- text-align: center;
- align-content: center;
- font-weight: bold;
- font-size: 0.5em;
- overflow: hidden;
-}
-
-#container.tiling .image {
- aspect-ratio: 1 / 1 !important;
-}
diff --git a/src/web/component/timeline/index.html b/src/web/component/timeline/index.html
deleted file mode 100644
index 41d4617..0000000
--- a/src/web/component/timeline/index.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<div id="container">
-</div>
diff --git a/src/web/component/timeline/index.js b/src/web/component/timeline/index.js
deleted file mode 100644
index 81322c6..0000000
--- a/src/web/component/timeline/index.js
+++ /dev/null
@@ -1,96 +0,0 @@
-const container = Z.by_id('container');
-
-function getRandomColor() {
- var letters = '0123456789ABCDEF';
- var color = '#';
- for (var i = 0; i < 6; i++) {
- color += letters[Math.floor(Math.random() * 16)];
- }
- return color;
-}
-
-for (let i = 0; i < 10000; ++i) {
- container.appendChild(Z.native('div', {
- innerText: i,
- className: 'image',
- style: {
- background: getRandomColor(),
- aspectRatio: '1 / ' + (Math.random() + 0.5),
- },
- }));
-}
-
-const zoom = new (class {
- constructor() {
- this.committed = 5;
- container.style.gridTemplateColumns = `repeat(5, 1fr)`;
- container.classList.toggle('tiling', this.committed != 1);
- this.por = { x: 0, y: 0 };
- this.eor = null;
- this.y_offset = 0;
- this.distance = 0;
- }
-
- update(distance, point) {
- const scale = distance / this.distance;
- const x = point.x - this.por.x;
- container.style.transform = `translate(${x}px, 0px) scale(${scale})`;
- }
-
- set reference({ point, distance }) {
- const rect = container.getClientRects()[0];
-
- this.por = { x: point.x, y: point.y - rect.y };
- container.style.transformOrigin = `${this.por.x}px ${this.por.y}px`;
- this.eor = Z.document.shadowRoot.elementFromPoint(point.x, point.y);
-
- const box_rect = this.eor.getBoundingClientRect();
- this.y_offset = box_rect.y;
-
- this.distance = distance;
- }
-
- commit(distance) {
- const scale = distance / this.distance;
- this.committed = Math.round(Math.min(Math.max(this.committed / scale, 1), 20));
- container.style.gridTemplateColumns = `repeat(${this.committed}, 1fr)`;
- container.classList.toggle('tiling', this.committed != 1);
- container.style.transform = 'scale(1)';
-
- const rect = this.eor.getBoundingClientRect();
-
- Z.document.scrollBy({
- top: rect.y - this.y_offset,
- behavior: 'instant',
- });
- }
-
- increase_line_by(n) {
- this.committed = Math.min(Math.max(this.committed + n, 1), 20);
- container.style.gridTemplateColumns = `repeat(${this.committed}, 1fr)`;
- container.classList.toggle('tiling', this.committed != 1);
- container.style.transform = 'scale(1)';
- }
-});
-
-Z.document.onwheel = (event) => {
- if (!event.ctrlKey) {
- return;
- }
- event.preventDefault();
- zoom.increase_line_by(event.wheelDeltaY / 120);
-};
-
-const pinch = new Pinch(Z.document);
-
-pinch.onstart = (event) => {
- zoom.reference = event;
-};
-
-pinch.onpinch = (event) => {
- zoom.update(event.distance, event.point);
-};
-
-pinch.onfinish = (event) => {
- zoom.commit(event.distance);
-};
diff --git a/src/web/component/timeline/root.zig b/src/web/component/timeline/root.zig
deleted file mode 100644
index 9faa40e..0000000
--- a/src/web/component/timeline/root.zig
+++ /dev/null
@@ -1,8 +0,0 @@
-const z = @import("z");
-
-pub const component: z.Component = .{
- .name = .timeline,
- .body = @embedFile("index.html"),
- .style = @embedFile("index.css"),
- .script = @embedFile("index.js"),
-};