|
@@ -4,7 +4,7 @@ window.grendCAD = (function grendCAD() {
|
|
let point, dire
|
|
let point, dire
|
|
|
|
|
|
window.cad = {
|
|
window.cad = {
|
|
- setSign: function(p, d) {
|
|
|
|
|
|
+ setSign: function (p, d) {
|
|
point = p
|
|
point = p
|
|
dire = d
|
|
dire = d
|
|
}
|
|
}
|
|
@@ -24,10 +24,10 @@ window.grendCAD = (function grendCAD() {
|
|
style.innerHTML = `
|
|
style.innerHTML = `
|
|
.cad {
|
|
.cad {
|
|
position: absolute;
|
|
position: absolute;
|
|
- width: 100%;
|
|
|
|
- height: 100%;
|
|
|
|
- top: 0;
|
|
|
|
- right: 10px;
|
|
|
|
|
|
+ width: 108%;
|
|
|
|
+ height: 108%;
|
|
|
|
+ top: -12px;
|
|
|
|
+ right: -12px;
|
|
}
|
|
}
|
|
|
|
|
|
#cad{
|
|
#cad{
|
|
@@ -39,6 +39,15 @@ window.grendCAD = (function grendCAD() {
|
|
opacity: 0;
|
|
opacity: 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @media only screen and (max-width: 600px) {
|
|
|
|
+ .cad {
|
|
|
|
+ width: 138%;
|
|
|
|
+ height: 138%;
|
|
|
|
+ transform: rotate(90deg);
|
|
|
|
+ top: -24px;
|
|
|
|
+ right: -30px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
`
|
|
`
|
|
|
|
|
|
document.documentElement.appendChild(style)
|
|
document.documentElement.appendChild(style)
|
|
@@ -68,7 +77,7 @@ window.grendCAD = (function grendCAD() {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- return function(floor, $parent, signColor, borderColor, borderWidth) {
|
|
|
|
|
|
+ return function (floor, $parent, signColor, borderColor, borderWidth) {
|
|
// if (initFloor) {
|
|
// if (initFloor) {
|
|
// console.log('cache')
|
|
// console.log('cache')
|
|
// return setStyle(signColor, borderColor, borderWidth)
|
|
// return setStyle(signColor, borderColor, borderWidth)
|
|
@@ -76,34 +85,34 @@ window.grendCAD = (function grendCAD() {
|
|
console.log('load')
|
|
console.log('load')
|
|
initFloor = floor
|
|
initFloor = floor
|
|
|
|
|
|
- let $layer = loadDOM($parent)
|
|
|
|
-
|
|
|
|
- $layer.style.visibility = 'hidden'
|
|
|
|
- window.cad = structureCAD({
|
|
|
|
- data: {
|
|
|
|
- block: [],
|
|
|
|
- column: [],
|
|
|
|
- door: [],
|
|
|
|
- hole: [],
|
|
|
|
- segment: [],
|
|
|
|
- "vertex-xy": [],
|
|
|
|
- "vertex-z": [],
|
|
|
|
- },
|
|
|
|
- layer: $layer.querySelector('#cad'),
|
|
|
|
- edit: false
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- setStyle(signColor, borderColor, borderWidth)
|
|
|
|
- cad.hideDire()
|
|
|
|
- cad.hideGauge()
|
|
|
|
-
|
|
|
|
- console.log('loadData')
|
|
|
|
- cad.loadData(initFloor);
|
|
|
|
-
|
|
|
|
- if (point && dire) {
|
|
|
|
- window.cad.setSign(point, dire)
|
|
|
|
- }
|
|
|
|
- $layer.style.visibility = 'visible'
|
|
|
|
|
|
+ let $layer = loadDOM($parent)
|
|
|
|
+
|
|
|
|
+ $layer.style.visibility = 'hidden'
|
|
|
|
+ window.cad = structureCAD({
|
|
|
|
+ data: {
|
|
|
|
+ block: [],
|
|
|
|
+ column: [],
|
|
|
|
+ door: [],
|
|
|
|
+ hole: [],
|
|
|
|
+ segment: [],
|
|
|
|
+ "vertex-xy": [],
|
|
|
|
+ "vertex-z": [],
|
|
|
|
+ },
|
|
|
|
+ layer: $layer.querySelector('#cad'),
|
|
|
|
+ edit: false
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ setStyle(signColor, borderColor, borderWidth)
|
|
|
|
+ cad.hideDire()
|
|
|
|
+ cad.hideGauge()
|
|
|
|
+
|
|
|
|
+ console.log('loadData')
|
|
|
|
+ cad.loadData(initFloor);
|
|
|
|
+
|
|
|
|
+ if (point && dire) {
|
|
|
|
+ window.cad.setSign(point, dire)
|
|
|
|
+ }
|
|
|
|
+ $layer.style.visibility = 'visible'
|
|
|
|
|
|
}
|
|
}
|
|
})();
|
|
})();
|