Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
canarddu38 authored Apr 8, 2024
1 parent ee82868 commit 8aeae2c
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 4 deletions.
48 changes: 45 additions & 3 deletions docs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,35 @@ const Controls = {
},
};

function editChild(property, value, subProperty="", increase=0, pixel=false) {
var element = document.getElementById(currentID).children[0];
if (element) {
if(increase > 0) {
if(subProperty!=""){
element[property][subProperty] += value;
} else {
element[property] += value;
}
}
else if(increase < 0) {
if(subProperty!=""){
element[property][subProperty] -= value;
} else {
element[property] -= value;
}
}
else if(increase == 0){
if(subProperty!=""){
element[property][subProperty] = value;
} else {
element[property] = value;
}
}
} else {
console.error("Element with ID '" + elementId + "' not found.");
}
}

function edit(property, value, subProperty="", increase=0, pixel=false) {
var element = document.getElementById(currentID);
if (element) {
Expand Down Expand Up @@ -123,14 +152,27 @@ function setPercentMode2(e) {
inputElem.value = Math.round(inputElem.value/100*320);
}
}

function hideCustomEdits() {
var editFields = document.getElementsById("customEdit");
for(i=0; i < editFields.children.length) {

}
function loadEdit(type) {
var editFields = document.getElementsById("control_editor");

var editFields = document.getElementsById("customEdit");



if(!type in Controls) {
alert("Invalid control type");
return;
}


switch(type) {
case "Text":

break;
}

// displays GeneralAttributes

Expand Down
7 changes: 6 additions & 1 deletion docs/studio.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ <h1>d3m0n App Studio</h1>


</div>
<div style="width: 100%;" id="customEdit">
<!-- document.getElementById("Text_y6j9df").children[0].innerText -->
<div style="width: 90%; display: block; overflow: hidden;">content:<input style="float: right; width: 50%;" type="text" id="edit-content" value="" onchange="editChild('innerText', document.getElementById('edit-content').value, '', 0)" /></div>

</div>

</div>
<div style="width: 60%; flex-direction: row; display: flex;">
Expand All @@ -111,7 +116,7 @@ <h1>d3m0n App Studio</h1>
</div>


</div>
</div

<button id="addElement" onclick="createDraggableElement('Text')">Add Draggable Element</button>
<button id="build">Build</button>
Expand Down

0 comments on commit 8aeae2c

Please sign in to comment.