modified: public/lib/inter.js

modified:   views/project.ejs
    changed:
        cost elements css;
        calculator width
This commit is contained in:
n0rdye 2023-11-17 13:56:28 +00:00
parent fdff3ff2f8
commit 0a9bbd60c2
2 changed files with 19 additions and 5 deletions

View File

@ -190,7 +190,7 @@ function calc_total(start = false){
let obj_cost_div = document.createElement("li");
obj_cost_div.innerHTML =
`<div style="display:flex;"> ` +
`<div id='obj_cost_name' style='font-size:calc(var(--main-font-size)/1);'>${key.split("~g~")[0].replaceAll("$"," ")}`+
`<div id='obj_cost_name'>${key.split("~g~")[0].replaceAll("$"," ")}`+
`<div id='obj_cost_count'>&nbsp${Object.keys(value).length}X</div> </div>`+
`</div>`+
`<div id='obj_cost'>${parseInt(parseInt(objs_store[key]["cost"]) * Object.keys(value).length)}</div>`;
@ -202,7 +202,7 @@ function calc_total(start = false){
// return total;
objs["total"] = total;
document.getElementById("proj_cost_text").innerText = `стоимость: ${total} руб.`;
document.getElementById("proj_cost_text").innerText = `Стоимость: ${total} руб.`;
}
function load(objss){
@ -242,8 +242,12 @@ function load(objss){
function reload(save = false){
// objs = JSON.parse($.cookie("objs"));
// console.log(objs);
// objs = objs.sort();
document.getElementById("drags").innerHTML = "";
let cro = cur_obj;
load(objs);
cur_obj = cro;
obj_selection();
if(save){save(()=>{},false)}
}

View File

@ -147,7 +147,7 @@
</div>
<div id="cost_div" style="display: flex;width: 15vw;justify-content: space-between;">
<button id="proj_cost" class="menu_btn" style="width: 100%;z-index: 3;">
<div id="proj_cost_text" style="pointer-events: none;">Расчет стоимости</div>
<div id="proj_cost_text" style="pointer-events: none;font-size:calc(var(--main-font-size)/1.2);">Стоимость</div>
<img src="/img/drop.png" style="width: 1vw;height: 0.5vw;pointer-events: none;" alt="\/">
</button>
<style>
@ -165,6 +165,15 @@
width: 14vw;
padding: 0.45vw;
}
#cost_list #obj_cost_name{
font-size:calc(var(--main-font-size)/1.3);
}
#cost_list #obj_cost_count{
font-size:calc(var(--main-font-size)/1.3);
}
#cost_list #obj_cost{
font-size:calc(var(--main-font-size)/1.3);
}
</style>
<ul id="cost_list" class="cmenu">
</ul>
@ -320,7 +329,7 @@
}
function img_download(){
msg("добавить на фото стоимость?",{type:"ask",res:(out)=>{
msg("добавить на фото Стоимость?",{type:"ask",res:(out)=>{
let wait_msg = msg("делаем фото",{type:"wait"})
proj_img((src)=>{
msg("изображение проекта готово",{time:3})
@ -342,7 +351,7 @@
if(cost == true){
width += document.getElementById("proj_cost").getBoundingClientRect().width;
document.getElementById("drags").append(document.getElementById("cost_div"));
document.getElementById("cost_div").style.marginLeft = `${parseInt(document.getElementById("wall").style.width) + 4}px`;
document.getElementById("cost_div").style.marginLeft = `${parseInt(document.getElementById("wall").style.width) + 1}px`;
document.getElementById("cost_list").style.display = "block";
}
html2canvas(document.getElementById("drags"),{
@ -465,6 +474,7 @@
}
}
// console.log(objs[obj.classList[0]][obj.getAttribute("id")]);
reload();
}
function obj_del(){