modified: func.js
modified: index.js modified: object.js modified: public/lib/fn.js modified: public/lib/inter.js modified: views/admin/objects/object_creation.ejs modified: views/admin/objects/object_edit.ejs modified: views/admin/objects/object_groups.ejs modified: views/header.ejs modified: views/load.ejs modified: views/main.ejs modified: views/project.ejs modified: views/static/start.ejs
This commit is contained in:
@ -23,19 +23,29 @@
|
||||
</style>
|
||||
|
||||
<form action="#" class="nobj">
|
||||
<div>
|
||||
<style>
|
||||
#img_prev_div:hover{
|
||||
border: 1px solid black;
|
||||
border-radius: 0.5vw;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<div id="img_file_div" >
|
||||
<div class="img_preview">
|
||||
<label for="img_file">макс. размер 2мб</label><br>
|
||||
<input type="file" id="img_file" onchange="previewFile()" accept="image/*" value="" maxlength="1"><br>
|
||||
|
||||
<input hidden type="file" id="img_file" onchange="previewFile()" accept="image/*" value="" maxlength="1"><br>
|
||||
</div>
|
||||
<div style="width: 200px; height: 200px;">
|
||||
<img src="" id="img_prev" height="100" alt="предпросмотр картинки">
|
||||
<div id="img_prev_div" style="width: 200px; height: 200px;" onclick="document.getElementById('img_file').click();">
|
||||
<img src="" id="img_prev" height="100" alt="выбрать изображение">
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="obj_color_check">
|
||||
<label for="obj_color_check">можно менять цвет</label>
|
||||
</div>
|
||||
</div>
|
||||
<textarea id="nobj_description" cols="30" rows="5" placeholder="описание товара"></textarea>
|
||||
<div>
|
||||
<div id="object_edit_type" style="text-align: right;">creation</div>
|
||||
<div id="object_edit_type" style="display: flex;justify-content: space-between;"><div>creation</div></div>
|
||||
<div class="nobj_options">
|
||||
<input type="text" id="nobj_name" placeholder="название товара">
|
||||
<input type="submit" onclick="create_obj()" id="obj_apply_btn" value="создать товар">
|
||||
@ -91,15 +101,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
function set_obj_edit_params(img = "",name = "",description="",height = 100,width = 100,cost = 0,gid = 0){
|
||||
function set_obj_edit_params(img = "",name = "",description="",height = 100,width = 100,cost = 0,gid = 0, id = null){
|
||||
if(img ==""&&name ==""&&description == ""){
|
||||
document.getElementById("object_edit_type").innerText = "добавление";
|
||||
document.getElementById("obj_apply_btn").value = "добавить товар";
|
||||
document.getElementById("obj_apply_btn").setAttribute("onclick","create_obj()");
|
||||
}else {
|
||||
document.getElementById("object_edit_type").innerText = "редактирование";
|
||||
let del_btn = document.createElement("button");
|
||||
del_btn.setAttribute("onclick",`obj_del(${id})`);
|
||||
del_btn.innerText = "удалить объект";
|
||||
document.getElementById("object_edit_type").append(del_btn);
|
||||
document.getElementById("obj_apply_btn").value = "сохранить";
|
||||
document.getElementById("obj_apply_btn").setAttribute("onclick","save_edited_obj()");
|
||||
document.getElementById("obj_apply_btn").setAttribute("onclick",`save_edited_obj(${id})`);
|
||||
// document.getElementById("group_select").selectedIndex = document.getElementById("group_select").options[`obj_group_${gid}`].index;
|
||||
gids = [parseInt(gid)]
|
||||
console.log(gid);
|
||||
@ -148,14 +162,21 @@
|
||||
|
||||
function new_obj(cost,name,img,height,width,description,callback){
|
||||
let gid = gids[0];
|
||||
if(name!=""){
|
||||
$.post( "/admin/objects/new", { cost:cost,name:name,img:img,desc:description,height:height,width:width,gid:gid})
|
||||
.done(function( res ) {
|
||||
// if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
// }
|
||||
callback(res);
|
||||
});
|
||||
if(gid != null){
|
||||
if(name!=""){
|
||||
$.post( "/admin/objects/new", { cost:cost,name:name,img:img,desc:description,height:height,width:width,gid:gid})
|
||||
.done(function( res ) {
|
||||
// if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
// }
|
||||
callback(res);
|
||||
});
|
||||
}
|
||||
}
|
||||
else{
|
||||
alert("группа не выбранна")
|
||||
let res = {out:"bad"}
|
||||
callback(res);
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,7 +187,7 @@
|
||||
let width = document.getElementById("obj_width").value;
|
||||
var img = document.querySelector('#img_prev').src;
|
||||
var cost = document.getElementById("obj_cost").value;
|
||||
name = name.replace(" ","$");
|
||||
name = name.replaceAll(" ","$");
|
||||
if(name != ""){
|
||||
if (img != "http://n0rsrv2:3002/admin"){
|
||||
document.getElementById("obj_resp").innerHTML = "добавление товара";
|
||||
@ -174,15 +195,18 @@
|
||||
if(res["out"] == "bad" && res["err"] == "name"){
|
||||
document.getElementById("obj_resp").innerHTML = "товар уже существует";
|
||||
}
|
||||
else if (res["out"] == "bad" ){
|
||||
document.getElementById("obj_resp").innerHTML = "ошибка при добавлении товара";
|
||||
}
|
||||
else if(res["out"] == "good"){
|
||||
document.getElementById("obj_resp").innerHTML = "товар добавлен";
|
||||
setTimeout(()=>{
|
||||
edit_get_objs();
|
||||
},1000)
|
||||
setTimeout(()=>{
|
||||
document.getElementById("obj_resp").innerHTML = "";
|
||||
},3000)
|
||||
}
|
||||
setTimeout(()=>{
|
||||
document.getElementById("obj_resp").innerHTML = "";
|
||||
},3000)
|
||||
});
|
||||
}
|
||||
else{
|
||||
|
@ -38,19 +38,21 @@
|
||||
<div id="objs_in_group"></div>
|
||||
</div>
|
||||
|
||||
<div class="cmenu" id="object_edit_menu">
|
||||
<button onclick="obj_del()">удалить объект</button>
|
||||
<button onclick="set_edit()">редактирование объекта</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// load_groups(()=>{
|
||||
// edit_get_objs();
|
||||
// });
|
||||
|
||||
function set_edit(){
|
||||
let menu = document.getElementById("object_edit_menu");
|
||||
set_obj_edit_params(menu.getAttribute("obj_img"),menu.getAttribute("obj_name").split("/")[0],menu.getAttribute("obj_description"),menu.getAttribute("obj_height"),menu.getAttribute("obj_width"),menu.getAttribute("obj_cost"),menu.getAttribute("obj_gid"));
|
||||
function set_edit(id){
|
||||
let menu = document.getElementById(`object_${id}`);
|
||||
set_obj_edit_params(menu.getAttribute("src"),
|
||||
menu.getAttribute("name").split("/")[0],
|
||||
menu.getAttribute("description"),
|
||||
menu.getAttribute("height"),
|
||||
menu.getAttribute("width"),
|
||||
menu.getAttribute("cost"),
|
||||
menu.getAttribute("gid"),
|
||||
menu.getAttribute("obj_id"));
|
||||
}
|
||||
|
||||
function edit_get_objs(by_name){
|
||||
@ -68,17 +70,23 @@
|
||||
}
|
||||
|
||||
function gids_change(){
|
||||
let last = gids.at(-1)
|
||||
gids = [last];
|
||||
edit_get_objs();
|
||||
if (typeof gids[0] == 'undefined'){
|
||||
gids = []
|
||||
edit_get_objs();
|
||||
}
|
||||
else{
|
||||
let last = gids.at(-1)
|
||||
gids = [last];
|
||||
edit_get_objs();
|
||||
}
|
||||
hide_menus();
|
||||
}
|
||||
|
||||
function obj_del(){
|
||||
function obj_del(id){
|
||||
// let select = document.getElementById("group_select");
|
||||
let menu = document.getElementById("object_edit_menu");
|
||||
if (confirm(`вы точно хотите удалить ${menu.getAttribute("obj_name").split("/")[0]}?`)){
|
||||
$.post( "/admin/objects/delete", { id:menu.getAttribute(`obj_id`),})
|
||||
let menu = document.getElementById(`object_${id}`);
|
||||
if (confirm(`вы точно хотите удалить ${menu.getAttribute("name").split("/")[0]}?`)){
|
||||
$.post( "/admin/objects/delete", { id:id,})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
edit_get_objs();
|
||||
@ -87,9 +95,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
function save_edited_obj(){
|
||||
function save_edited_obj(id){
|
||||
let gid = gids[0];
|
||||
let menu = document.getElementById("object_edit_menu");
|
||||
let menu = document.getElementById(`object_${id}`);
|
||||
let attributes = ["name","description","img","height","width","cost"];
|
||||
let cur_atts = {
|
||||
name : document.getElementById("nobj_name").value,
|
||||
@ -116,16 +124,16 @@
|
||||
}
|
||||
});
|
||||
function check_change(element){
|
||||
if(element == "name" && cur_atts[element] != menu.getAttribute(`obj_${element}`).split("/")[0]){
|
||||
if(element == "name" && cur_atts[element] != menu.getAttribute(`${element}`).split("/")[0]){
|
||||
changes[element] = cur_atts[element];
|
||||
}
|
||||
else if (element != "name" && cur_atts[element] != menu.getAttribute(`obj_${element}`)){
|
||||
else if (element != "name" && cur_atts[element] != menu.getAttribute(`${element}`)){
|
||||
changes[element] = cur_atts[element];
|
||||
}
|
||||
}
|
||||
function make_obj_save(){
|
||||
load_group(gid,(group_db)=>{
|
||||
if(changes["name"]) changes["name"] = (changes["name"]+"/g/"+group_db["name"].replace(" ","$"));
|
||||
if(changes["name"]) changes["name"] = (changes["name"]+"/g/"+group_db["name"].replaceAll(" ","$"));
|
||||
document.getElementById("obj_resp").innerHTML = "сохранение товара";
|
||||
$.post( "/admin/objects/edit", { id:menu.getAttribute(`obj_id`),changes:JSON.stringify(changes),gid:gid})
|
||||
.done(function( res ) {
|
||||
@ -178,7 +186,7 @@
|
||||
else{
|
||||
let name = ask("название");
|
||||
if(name != "")[
|
||||
$.post( "/admin/objects/find", { name:name.replace(" ","$")})
|
||||
$.post( "/admin/objects/find", { name:name.replaceAll(" ","$")})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
@ -194,11 +202,12 @@
|
||||
let obj = document.createElement('div');
|
||||
let name_text = document.createElement('div');
|
||||
let img_elm = document.createElement('img');
|
||||
obj.title = `название:${value["name"].split("/")[0].replace("$"," ")}\nцена:${value["cost"]}\nширена:${value["width"]}\nвысота${value["height"]}\nописание:${value["description"]}`;
|
||||
obj.id = "object_menu";
|
||||
obj.title = `название:${value["name"].split("/")[0].replaceAll("$"," ")}\nцена:${value["cost"]}\nширина:${value["width"]}\nвысота${value["height"]}\nописание:${value["description"]}`;
|
||||
obj.id = `object_${value["id"]}`;
|
||||
obj.setAttribute("onclick",`set_edit(${value["id"]})`)
|
||||
obj.classList.add(value["name"]);
|
||||
obj.classList.add("object");
|
||||
obj.setAttribute("name",value["name"].split("/")[0].replace("$"," "))
|
||||
obj.setAttribute("name",value["name"].split("/")[0].replaceAll("$"," "))
|
||||
obj.setAttribute("description",value["description"])
|
||||
obj.setAttribute("src",img)
|
||||
obj.setAttribute("height",value["height"])
|
||||
@ -206,12 +215,12 @@
|
||||
obj.setAttribute("obj_id",value["id"])
|
||||
obj.setAttribute("cost",value["cost"])
|
||||
obj.setAttribute("gid",value["gid"])
|
||||
name_text.innerText = value["name"].split("/")[0].replace("$"," ");
|
||||
name_text.innerText = value["name"].split("/")[0].replaceAll("$"," ");
|
||||
img_elm.src = img;
|
||||
obj.append(img_elm)
|
||||
obj.append(name_text)
|
||||
obj_list.append(obj)
|
||||
|
||||
console.log("obj");
|
||||
// console.log("obj");
|
||||
}
|
||||
</script>
|
@ -4,13 +4,19 @@
|
||||
/* height: 5vh; */
|
||||
margin: auto 0px;
|
||||
}
|
||||
#obj_group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.obj_group{
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
<div id="obj_group">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<h1>группы товаров</h1>
|
||||
<div style="display: block;">
|
||||
<h1>группы товаров</h1>
|
||||
<button onclick="create_new_part()">доб. раздел</button>
|
||||
</div>
|
||||
<style>
|
||||
.group_drop{
|
||||
width: 15vw;
|
||||
@ -47,24 +53,9 @@
|
||||
<script>
|
||||
// load_groups();
|
||||
function delete_group(gid,pid) {
|
||||
let select = document.getElementById("group_select");
|
||||
if(confirm(`вы уверены вы хотите удалить группу ${document.getElementById("obj_group_"+gid).innerText}`) == true){
|
||||
let name = document.getElementById("obj_group_"+gid).getAttribute("group_name");
|
||||
if(confirm(`вы уверены вы хотите удалить группу ${name}`) == true){
|
||||
$.post( "/admin/groups/delete", { gid:gid,pid:pid})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
// load_groups();
|
||||
edit_get_objs();
|
||||
hide_menus();
|
||||
alert(`группа удалена`)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function create_new_group(pid) {
|
||||
let group_name = ask("название группы");
|
||||
if(group_name != ""){
|
||||
$.post( "/admin/groups/new", { name:group_name.replace(" ","$"),pid:pid})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
@ -73,8 +64,44 @@
|
||||
hide_menus();
|
||||
setTimeout(()=>{
|
||||
parts_load();
|
||||
alert(`группа ${group_name.replace(" ","$")} создана`)
|
||||
},200)
|
||||
alert(`группа ${name} удалена`)
|
||||
},500)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function create_new_group(pid) {
|
||||
let group_name = ask("название группы");
|
||||
if(group_name != null && group_name != ""){
|
||||
$.post( "/admin/groups/new", { name:group_name.replaceAll(" ","$"),pid:pid})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
// load_groups();
|
||||
edit_get_objs();
|
||||
hide_menus();
|
||||
setTimeout(()=>{
|
||||
parts_load();
|
||||
alert(`группа ${group_name.replaceAll(" ","$")} создана`)
|
||||
},500)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function create_new_part() {
|
||||
let part_name = ask("название раздела");
|
||||
if(part_name != null && part_name != ""){
|
||||
$.post( "/admin/parts/new", { name:part_name.replaceAll(" ","$")})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
// load_groups();
|
||||
hide_menus();
|
||||
setTimeout(()=>{
|
||||
parts_load();
|
||||
alert(`раздел ${part_name.replaceAll(" ","$")} создан`)
|
||||
},500)
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -92,12 +119,13 @@
|
||||
part_drop.src = "/img/drop.png";
|
||||
part_drop.alt = "\/";
|
||||
|
||||
part_text.innerText = `${value["name"]}`;
|
||||
part_text.innerText = `${value["name"].replaceAll("$", " ")}`;
|
||||
|
||||
part.id = `group_drop-${value["id"]}`;
|
||||
part.classList.add("menu_btn")
|
||||
part.classList.add("group_drop")
|
||||
part.setAttribute("groups",`${value["groups"]}`)
|
||||
part.setAttribute("count",`${value["count"]}`)
|
||||
part.setAttribute("pid",`${value["id"]}`)
|
||||
|
||||
part.append(part_text);
|
||||
|
@ -112,6 +112,13 @@
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
#top_panel_center button{
|
||||
border-radius: 0.5vw;
|
||||
}
|
||||
#top_panel_center :hover{
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
|
||||
<header id="top_panel">
|
||||
@ -119,11 +126,11 @@
|
||||
<div id="proj_top_panel">
|
||||
<div id="top_panel_left" class="tpanel"></div>
|
||||
<div id="top_panel_center" class="tpanel">
|
||||
<button onclick="goto('/main')">Мои проекты</button>
|
||||
<button onclick="goto('/tamp')">Шаблоны</button>
|
||||
<button onclick="goto('/gallery')">Галерея</button>
|
||||
<button onclick="goto('/faq')">FAQ</button>
|
||||
<button onclick="goto('/help')">Связаться с поддержкой</button>
|
||||
<button id="page_btn_main" onclick="goto('/main')">Мои проекты</button>
|
||||
<button id="page_btn_tamp" onclick="goto('/tamp')">Шаблоны</button>
|
||||
<button id="page_btn_gallery" onclick="goto('/gallery')">Галерея</button>
|
||||
<button id="page_btn_faq" onclick="goto('/faq')">FAQ</button>
|
||||
<button id="page_btn_help" onclick="goto('/help')">Связаться с поддержкой</button>
|
||||
|
||||
</div>
|
||||
<div id="top_panel_right_main" class="tpanel top_panel_right">
|
||||
@ -152,14 +159,27 @@
|
||||
|
||||
let menu = document.getElementById("top_panel_center");
|
||||
if (res["admin"] == true){
|
||||
menu.innerHTML += `<button onclick='goto("/admin")'>админ. панель</button><br>`;
|
||||
menu.innerHTML += `<button id="page_btn_admin" onclick='goto("/admin")'>Админ. панель</button><br>`;
|
||||
}
|
||||
// menu.innerHTML += "<button onclick='logout();'>выйти</button><br>";
|
||||
document.URL.split("puzzle.n0r.su/").at(-1)
|
||||
switch (document.URL.split("puzzle.n0r.su/").at(-1)) {
|
||||
case ("main"):
|
||||
document.getElementById("page_btn_main").style.border = "1px solid black";
|
||||
break;
|
||||
case ("admin"):document.getElementById("page_btn_admin").style.border = "1px solid black";break;
|
||||
case ("admin/objects"):document.getElementById("page_btn_admin").style.border = "1px solid black";break;
|
||||
case ("admin/users"):document.getElementById("page_btn_admin").style.border = "1px solid black";break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
onscroll = (e)=>{
|
||||
hide_menus();
|
||||
}
|
||||
console.log("asd");
|
||||
|
||||
// onscroll = (e)=>{
|
||||
// hide_menus();
|
||||
// }
|
||||
onresize = (e)=>{
|
||||
hide_menus();
|
||||
}
|
||||
@ -210,27 +230,27 @@
|
||||
open_menu();
|
||||
|
||||
}
|
||||
else if(e.target.id == "object_menu"){
|
||||
hide_menus();
|
||||
let menu = document.getElementById("object_edit_menu");
|
||||
let obj = e.target;
|
||||
menu.setAttribute("obj_img",obj.getAttribute("src"));
|
||||
menu.setAttribute("obj_name",obj.getAttribute("name"));
|
||||
menu.setAttribute("obj_description",obj.getAttribute("description"));
|
||||
menu.setAttribute("obj_height",obj.getAttribute("height"));
|
||||
menu.setAttribute("obj_width",obj.getAttribute("width"));
|
||||
menu.setAttribute("obj_id",obj.getAttribute("obj_id"));
|
||||
menu.setAttribute("obj_cost",obj.getAttribute("cost"))
|
||||
menu.setAttribute("obj_gid",obj.getAttribute("gid"))
|
||||
menu.style.display = 'block';
|
||||
// menu.style = `top:${e.target.getBoundingClientRect().top+27}px;left:${e.target.getBoundingClientRect().left-13}px`;
|
||||
menu.style = `top:${e.target.getBoundingClientRect().top + 40}px;left:${e.target.getBoundingClientRect().left - 5}px`;
|
||||
// menu.onmouseleave = () => menu.style.display = 'none';
|
||||
// menu.innerHTML = "<p>Option1</p><p>Option2</p><p>Option3</p><p>Option4</p>"
|
||||
// document.body.appendChild(menu)
|
||||
open_menu();
|
||||
// else if(e.target.id == "object_menu"){
|
||||
// hide_menus();
|
||||
// let menu = document.getElementById("object_edit_menu");
|
||||
// let obj = e.target;
|
||||
// menu.setAttribute("obj_img",obj.getAttribute("src"));
|
||||
// menu.setAttribute("obj_name",obj.getAttribute("name"));
|
||||
// menu.setAttribute("obj_description",obj.getAttribute("description"));
|
||||
// menu.setAttribute("obj_height",obj.getAttribute("height"));
|
||||
// menu.setAttribute("obj_width",obj.getAttribute("width"));
|
||||
// menu.setAttribute("obj_id",obj.getAttribute("obj_id"));
|
||||
// menu.setAttribute("obj_cost",obj.getAttribute("cost"))
|
||||
// menu.setAttribute("obj_gid",obj.getAttribute("gid"))
|
||||
// menu.style.display = 'block';
|
||||
// // menu.style = `top:${e.target.getBoundingClientRect().top+27}px;left:${e.target.getBoundingClientRect().left-13}px`;
|
||||
// menu.style = `top:${e.target.getBoundingClientRect().top + 40}px;left:${e.target.getBoundingClientRect().left - 5}px`;
|
||||
// // menu.onmouseleave = () => menu.style.display = 'none';
|
||||
// // menu.innerHTML = "<p>Option1</p><p>Option2</p><p>Option3</p><p>Option4</p>"
|
||||
// // document.body.appendChild(menu)
|
||||
// open_menu();
|
||||
|
||||
}
|
||||
// }
|
||||
else if(e.target.id == "proj_cost"){
|
||||
hide_menus();
|
||||
document.getElementById("cost_list").style = `margin-top:2.5vw;left:${e.target.getBoundingClientRect().left}px`;
|
||||
@ -242,12 +262,12 @@
|
||||
document.getElementById("group").innerHTML = "";
|
||||
|
||||
// console.log(e.target.getAttribute("groups").split(","));
|
||||
document.getElementById("group").style = `margin-top:2.5vw;left:${e.target.getBoundingClientRect().left}px;width: 14vw;padding: 0.45vw;display:block;`;
|
||||
document.getElementById("group").style = `margin-top:2.9vw;left:${e.target.getBoundingClientRect().left}px;width: 14vw;padding: 0.45vw;display:block;padding-bottom: 0.7vw;`;
|
||||
console.log("group");
|
||||
open_menu();
|
||||
|
||||
if (document.URL == "https://puzzle.n0r.su/admin/objects"){
|
||||
load_groups(()=>{},e.target.getAttribute("groups").split(","),true)
|
||||
if(e.target.getAttribute("count") != 0)load_groups(()=>{},e.target.getAttribute("groups").split(","),true)
|
||||
let groups = document.getElementById("group");
|
||||
let new_grp_btn = document.createElement("button");
|
||||
new_grp_btn.setAttribute("onclick",`create_new_group(${e.target.getAttribute("pid")})`);
|
||||
@ -256,7 +276,7 @@
|
||||
groups.append(new_grp_btn)
|
||||
}
|
||||
else{
|
||||
load_groups(()=>{},e.target.getAttribute("groups").split(","))
|
||||
if(e.target.getAttribute("count") != 0)load_groups(()=>{},e.target.getAttribute("groups").split(","))
|
||||
}
|
||||
// hide_menus();
|
||||
// let menu = document.getElementById("object_edit_menu");
|
||||
|
@ -4,12 +4,13 @@
|
||||
<style>
|
||||
#load_div{
|
||||
width: 100vw;
|
||||
height: 99vh;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
z-index: 10000;
|
||||
background-color: white;
|
||||
transition: background-color 1s;
|
||||
top: 0;
|
||||
}
|
||||
#load_logo{
|
||||
width: 12vw;
|
||||
@ -96,5 +97,5 @@
|
||||
if(page_state != "loaded"){
|
||||
document.getElementById("load_help").style.display = "block";
|
||||
}
|
||||
},2000)
|
||||
},7000)
|
||||
</script>
|
@ -7,6 +7,7 @@
|
||||
border-radius: 10px;
|
||||
width: 290px;
|
||||
box-shadow: 0px 4px 4px 0px #00000040;
|
||||
cursor: pointer;
|
||||
}
|
||||
.proj, .new_proj{
|
||||
border: 0px;
|
||||
@ -28,6 +29,9 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.p_props img{
|
||||
cursor: pointer;
|
||||
}
|
||||
.main h1{
|
||||
/* font-size: --main-font-size; */
|
||||
font-weight: 100;
|
||||
|
@ -10,13 +10,14 @@
|
||||
text-align: center;
|
||||
margin: auto;
|
||||
z-index: 10;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
#drags{
|
||||
position: absolute;
|
||||
margin: auto;
|
||||
}
|
||||
#drags img{
|
||||
.spawn{
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
@ -304,10 +305,6 @@
|
||||
catch{alert("объкт не выбран")}
|
||||
}
|
||||
|
||||
function gids_change(){
|
||||
group_drop();
|
||||
}
|
||||
|
||||
function group_drop(){
|
||||
let e = document.getElementById("group_drop")
|
||||
setTimeout(()=>{
|
||||
@ -340,12 +337,14 @@
|
||||
part_drop.src = "/img/drop.png";
|
||||
part_drop.alt = "\/";
|
||||
|
||||
part_text.innerText = `${value["name"]}`;
|
||||
part_text.innerText = `${value["name"].replaceAll("$", " ")}`;
|
||||
|
||||
part.id = `group_drop-${value["id"]}`;
|
||||
part.classList.add("menu_btn")
|
||||
part.classList.add("group_drop")
|
||||
part.setAttribute("groups",`${value["groups"]}`)
|
||||
part.setAttribute("count",`${value["count"]}`)
|
||||
part.setAttribute("pid",`${value["id"]}`)
|
||||
|
||||
part.append(part_text);
|
||||
part.append(part_drop);
|
||||
|
@ -44,7 +44,6 @@
|
||||
margin: 0px;
|
||||
}
|
||||
*{
|
||||
touch-action: none;
|
||||
user-select: none;
|
||||
font: "Circe Rounded";
|
||||
font-size: var(--main-font-size);
|
||||
@ -56,6 +55,10 @@
|
||||
--main-font-size: 12px;
|
||||
}
|
||||
}
|
||||
.obj_group input{
|
||||
width: 1vw;
|
||||
height: 1vw;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
Reference in New Issue
Block a user