Blame view
js/homepage.js
7.83 KB
670b6d6f8
![]() |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
// 0: 3DView 1: Geometry 2: Esitamte 3: Next 4: pillar 5: balcony 6: roof 7: zoom scale var btn3D, btn3DText; var btnGeometry, btnGeometryText; var btnEsitamte, btnEsitamteText; var btnPillar, btnPillarText; var btnBalcony, btnBalconyText; var btnRoof, btnRoofText; var btnScaleZoom, btnScaleZoomText; var aroundRect, objectLine; var btnzoomIn, btnzoomOut; var M_TOP = 15; var M_LEFT = 50; var btnPosList = [ [ 0, 0, 200, 50 ], [ 200, 0, 200, 50 ], [ 400, 0, 200, 50 ], [ 600, 0, 200, 50 ], [ 0, 50, 100, 100 ], [ 0, 150, 100, 95 ], [ 0, 245, 100, 110 ], [ 1019.45, 727.2, 259.6, 102.6 ] ]; // object to control // 0: 3DView 1: Geometry 2: Esitamte 3: Next 4: pillar 5: balcony 6: roof 7: zoom scale // x; y; widht; heigth function drawHomepage(){ drawLineAround(); draw3DViewMenu(); drawGeometryMenu(); drawEsitamteMenu(); drawPillarMenu(); drawBalconyMenu(); drawRoofMenu(); drawScaleZoomMenu(); } function drawLineAround(){ // Draw 3DView button if(aroundRect) stage.removeChild(aroundRect); aroundRect = new createjs.Shape(); aroundRect.graphics.setStrokeStyle(padding).beginStroke('#FF7117').drawRect(0, 0, 1279, 959); aroundRect.x = 0; aroundRect.y = 0; stage.addChild(aroundRect); // Draw object line if(objectLine) stage.removeChild(objectLine); objectLine = new createjs.Shape(); objectLine.graphics.setStrokeStyle(2).beginStroke('#FF7117').moveTo(0, 830).lineTo(1280, 830).endStroke(); stage.addChild(objectLine); } function draw3DViewMenu(){ // Draw 3DView button if(btn3D) stage.removeChild(btn3D); btn3D = new createjs.Shape(); btn3D.graphics.setStrokeStyle(padding).beginStroke('#FF7117').beginFill('#FFA500').drawRect(0, 0, btnPosList[0][2], btnPosList[0][3]); btn3D.x = btnPosList[0][0]; btn3D.y = btnPosList[0][1]; btn3D.addEventListener("click", view3d); //btn3D.on('click', incTransitionState ); stage.addChild(btn3D); if (btn3DText) stage.removeChild(btn3DText); btn3DText = new createjs.Text("3DVIEW", "20px Arial", "#FFFFFF"); btn3DText.x = btnPosList[0][0] + M_LEFT; btn3DText.y = btnPosList[0][1] + M_TOP; btn3DText.addEventListener("click", view3d); stage.addChild(btn3DText); } function drawGeometryMenu(){ // Draw 3DView button if(btnGeometry) stage.removeChild(btnGeometry); btnGeometry = new createjs.Shape(); btnGeometry.graphics.setStrokeStyle(padding).beginStroke('#FF7117').beginFill('#FFA500').drawRect(0, 0, btnPosList[1][2], btnPosList[1][3]); btnGeometry.x = btnPosList[1][0]; btnGeometry.y = btnPosList[1][1]; stage.addChild(btnGeometry); if (btnGeometryText) stage.removeChild(btnGeometryText); btnGeometryText = new createjs.Text("図形作成", "20px Arial", "#FFFFFF"); btnGeometryText.x = btnPosList[1][0] + M_LEFT; btnGeometryText.y = btnPosList[1][1] + M_TOP; stage.addChild(btnGeometryText); } function drawEsitamteMenu(){ // Draw 3DView button if(btnEsitamte) stage.removeChild(btnEsitamte); btnEsitamte = new createjs.Shape(); btnEsitamte.graphics.setStrokeStyle(padding).beginStroke('#FF7117').beginFill('#FFA500').drawRect(0, 0, btnPosList[2][2], btnPosList[2][3]); btnEsitamte.x = btnPosList[2][0]; btnEsitamte.y = btnPosList[2][1]; btnEsitamte.addEventListener("click", estimate); stage.addChild(btnEsitamte); if (btnEsitamteText) stage.removeChild(btnEsitamteText); btnEsitamteText = new createjs.Text("データ保存", "20px Arial", "#FFFFFF"); btnEsitamteText.x = btnPosList[2][0] + M_LEFT; btnEsitamteText.y = btnPosList[2][1] + M_TOP; btnEsitamteText.addEventListener("click", estimate); stage.addChild(btnEsitamteText); } function drawPillarMenu(){ // Draw 3DView button if(btnPillar) stage.removeChild(btnPillar); btnPillar = new createjs.Shape(); btnPillar.graphics.setStrokeStyle(padding).beginStroke('#FF7117').beginFill('#FFA500').drawRect(0, 0, btnPosList[4][2], btnPosList[4][3]); btnPillar.x = btnPosList[4][0]; btnPillar.y = btnPosList[4][1]; stage.addChild(btnPillar); if (btnPillarText) stage.removeChild(btnPillarText); btnPillarText = new createjs.Text("柱", "20px Arial", "#FFFFFF"); btnPillarText.x = btnPosList[4][0] + 40; btnPillarText.y = btnPosList[4][1] + 40; stage.addChild(btnPillarText); } function drawBalconyMenu(){ // Draw 3DView button if(btnBalcony) stage.removeChild(btnBalcony); btnBalcony = new createjs.Shape(); btnBalcony.graphics.setStrokeStyle(padding).beginStroke('#FF7117').beginFill('#FFA500').drawRect(0, 0, btnPosList[5][2], btnPosList[5][3]); btnBalcony.x = btnPosList[5][0]; btnBalcony.y = btnPosList[5][1]; stage.addChild(btnBalcony); if (btnBalconyText) stage.removeChild(btnBalconyText); btnBalconyText = new createjs.Text("ベランダ", "20px Arial", "#FFFFFF"); btnBalconyText.x = btnPosList[5][0] + 10; btnBalconyText.y = btnPosList[5][1] + 40; stage.addChild(btnBalconyText); } function drawRoofMenu(){ // Draw 3DView button if(btnRoof) stage.removeChild(btnRoof); btnRoof = new createjs.Shape(); btnRoof.graphics.setStrokeStyle(padding).beginStroke('#FF7117').beginFill('#FFA500').drawRect(0, 0, btnPosList[6][2], btnPosList[6][3]); btnRoof.x = btnPosList[6][0]; btnRoof.y = btnPosList[6][1]; btnRoof.addEventListener("click", roof); stage.addChild(btnRoof); if (btnRoofText) stage.removeChild(btnRoofText); btnRoofText = new createjs.Text("屋根", "20px Arial", "#FFFFFF"); btnRoofText.x = btnPosList[6][0] + 30; btnRoofText.y = btnPosList[6][1] + 40; btnRoofText.addEventListener("click", roof); stage.addChild(btnRoofText); } function drawScaleZoomMenu(){ // Draw 3DView button if(btnScaleZoom) stage.removeChild(btnScaleZoom); btnScaleZoom = new createjs.Shape(); btnScaleZoom.graphics.setStrokeStyle(padding).beginStroke('#994c1b').beginFill('#994c1b').drawRect(0, 0, btnPosList[7][2], btnPosList[7][3]); btnScaleZoom.x = btnPosList[7][0]; btnScaleZoom.y = btnPosList[7][1]; //btnScaleZoom.addEventListener("click", viewScaleZoom); //btnScaleZoom.on('click', incTransitionState ); stage.addChild(btnScaleZoom); if (btnScaleZoomText) stage.removeChild(btnScaleZoomText); btnScaleZoomText = new createjs.Text("拡大縮小", "20px Arial", "#FFFFFF"); btnScaleZoomText.x = btnPosList[7][0] + 80; btnScaleZoomText.y = btnPosList[7][1] + 10; stage.addChild(btnScaleZoomText); // Draw zoom in button + if(btnzoomIn) stage.removeChild(btnzoomIn); btnzoomIn = new createjs.Shape(); btnzoomIn.graphics.beginStroke("#ffffff").beginFill("#ffffff").drawCircle(0, 0, 20); btnzoomIn.graphics.setStrokeStyle(2).beginStroke("#9b4a24").moveTo(btnzoomIn.x - 17, btnzoomIn.y).lineTo(btnzoomIn.x + 17, btnzoomIn.y).moveTo(btnzoomIn.x, btnzoomIn.y - 10).lineTo(btnzoomIn.x, btnzoomIn.y + 10).endStroke; btnzoomIn.x = 1115.25; btnzoomIn.y = 788; btnzoomIn.cursor = "pointer"; stage.addChild(btnzoomIn); // Draw zoom out button - if(btnzoomOut) stage.removeChild(btnzoomOut); btnzoomOut = new createjs.Shape(); btnzoomOut.graphics.beginStroke("#ffffff").beginFill("#ffffff").drawCircle(0, 0, 20); btnzoomOut.graphics.setStrokeStyle(2).beginStroke("#9b4a24").moveTo(btnzoomOut.x - 17, btnzoomOut.y).lineTo(btnzoomOut.x + 17, btnzoomOut.y).endStroke; btnzoomOut.x = 1175; btnzoomOut.y = 788; btnzoomOut.cursor = "pointer"; stage.addChild(btnzoomOut); } |