2024-08-15 22:41:12 +02:00
|
|
|
---
|
|
|
|
|
title: Drag
|
|
|
|
|
tags:
|
2025-06-19 16:21:09 +02:00
|
|
|
- ui
|
2024-08-15 22:41:12 +02:00
|
|
|
---
|
|
|
|
|
{% set pageId = page.fileSlug %}
|
|
|
|
|
|
2025-06-23 22:31:18 +02:00
|
|
|
{% extends "hippie/_app_frame.njk" %}
|
2024-08-15 22:41:12 +02:00
|
|
|
|
|
|
|
|
{% block body %}
|
2025-06-19 16:45:20 +02:00
|
|
|
<header class="io pos_fix pin_top pin_right pin_left">
|
|
|
|
|
<button data-action="add">Add</button>
|
|
|
|
|
</header>
|
2024-08-15 22:49:11 +02:00
|
|
|
<div id="space"></div>
|
2025-06-23 22:31:18 +02:00
|
|
|
<div>
|
|
|
|
|
<div id="test">
|
|
|
|
|
<div class="body_frame">
|
|
|
|
|
{{ io.frameHeader('title-bar') }}
|
|
|
|
|
<main></main>
|
|
|
|
|
{{ io.frameFooter('mode-bar') }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-08-15 22:41:12 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{%- block script %}
|
2025-05-15 20:00:51 +02:00
|
|
|
<script src="{{ pageBase }}js/_ui.js"></script>
|
2024-08-15 23:06:21 +02:00
|
|
|
<script>
|
|
|
|
|
// Get the space element
|
|
|
|
|
const space = document.getElementById('space');
|
2025-05-15 20:00:51 +02:00
|
|
|
const add = document.querySelector('[data-action=add]');
|
2025-06-23 22:31:18 +02:00
|
|
|
const test = document.getElementById('test');
|
2024-08-15 23:06:21 +02:00
|
|
|
|
|
|
|
|
// Add event listener to the add space button
|
2025-05-15 20:00:51 +02:00
|
|
|
add.addEventListener('click', () => {
|
2024-08-15 23:06:21 +02:00
|
|
|
const newDiv = new NewDiv(100, 100, 100, 100, getRandomColor());
|
|
|
|
|
newDiv.createDiv();
|
|
|
|
|
newDiv.appendToFrame(space);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Create a new NewDiv instance
|
2025-06-23 22:31:18 +02:00
|
|
|
const newDiv = new NewDiv(100, 100, 200, 200, '#000');
|
2024-08-15 23:06:21 +02:00
|
|
|
newDiv.createDiv();
|
2025-04-12 14:25:55 +02:00
|
|
|
newDiv.appendToFrame(space);
|
2025-06-23 22:31:18 +02:00
|
|
|
|
|
|
|
|
const explorer = new NewDiv(256, 128, 800, 600, '#fff', test);
|
|
|
|
|
explorer.createDiv();
|
|
|
|
|
explorer.appendToFrame(space);
|
2024-08-15 23:06:21 +02:00
|
|
|
</script>
|
2024-08-15 22:41:12 +02:00
|
|
|
{% endblock %}
|