added grid

This commit is contained in:
2023-06-30 18:53:15 +05:00
parent de5879069b
commit c81c42df77
8 changed files with 156 additions and 53 deletions

BIN
public/img/bg1red.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -115,6 +115,26 @@ function logout(redirect = true) {
}
}
function ask() {
let name = prompt("please enter project name");
if(name != "" && name != " "){
return name;
}
}
function wall_size_change(type){
let wall = document.getElementsByClassName("wall")[0];
let scroll;
if(type != null && type == "x") {
scroll = document.getElementById("wall_x");
wall.style.width = `${scroll.value * 200}px`;
}
if(type != null && type == "y") {
scroll = document.getElementById("wall_y");
wall.style.height = `${scroll.value * 200}px`;
}
}
function goto_proj(name){
$.post( "/proj/"+name, { name:hostname })
.done(function( res ) {

View File

@ -56,15 +56,22 @@ function load_proj(){
load_local(JSON.parse(res["body"]));
drag_start();
}
else if(res["out"] == "bad proj"){
console.log("bad");
save(()=>{
goto("/proj/"+proj_name);
});
}
})
}
function save(){
function save(callback){
// console.log(objs);
$.post( "/save_proj", {proj:JSON.stringify(objs),name:proj_name})
.done(function( res ) {
if(res["out"] == "good"){
console.log("good");
if(callback) callback(res);
}
})
}