10 years later #1

Merged
sthag merged 374 commits from development into main 2026-03-07 00:18:59 +01:00
2 changed files with 25 additions and 4 deletions
Showing only changes of commit 8e06f8feb8 - Show all commits

View file

@ -21,8 +21,8 @@ tags:
{% endblock %}
{% block body %}
<button id="addFrame">Add</button>
<div id="space"></div>
<button id="addFrame">Add</button>
{% endblock %}
{%- block script %}
@ -37,13 +37,16 @@ function createNewDiv() {
newDiv.style.position = 'absolute';
newDiv.style.width = '100px';
newDiv.style.height = '100px';
newDiv.style.background = 'red';
newDiv.style.cursor = 'move';
// Add event listeners for dragging
let isDown = false;
let offset = [0, 0];
// Generate a random background color
const randomColor = getRandomColor();
newDiv.style.background = randomColor;
newDiv.addEventListener('mousedown', (event) => {
if (event.button === 0) { // Left mouse button
isDown = true;
@ -111,6 +114,16 @@ function createNewDiv() {
loadData();
}
// Function to generate a random color
function getRandomColor() {
const letters = '0123456789ABCDEF';
let color = '#';
for (let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
// Add event listener to the add space button
addFrameButton.addEventListener('click', createNewDiv);

View file

@ -119,3 +119,11 @@ $module_top_height: 32px;
height: 100%;
background-color: $color-dark;
}
#addFrame {
@extend .io_button;
position: fixed;
top: 8px;
right: 8px;
margin: 0;
}