c80_map 0.1.0.21 → 0.1.0.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcb8746dde69d4b6043844a01ce922cb062248f9
4
- data.tar.gz: 2bf3bc0a45fd86b392866e00ad49333ecc89e501
3
+ metadata.gz: 3be2ba4e2ab8645392a50803e3ab11ab62095888
4
+ data.tar.gz: 3a75282e3a1c15bbd126478cd236ece64a9f1e6d
5
5
  SHA512:
6
- metadata.gz: 900258b0e3a6e3f5114d2f49c305581c795556d0f0d1ab99886de6e5a852504f181aea56ea49b5b42524dc50e0f8596351651bb91878d4998a697405ba2df089
7
- data.tar.gz: 3f1599de655b824421c61f561a69fda53562859bc414736cd3238af8bbec160c42784b2a57c1851f0d4c8ddf8f111a67b662866a8195a88279811d6948fcb0e8
6
+ metadata.gz: 27aa0c100ea5bdb44ea474c16a2242c2e6446f28eb45235b1a39f685bd40b2a67b0e000b457a6d32a30357e2b96520dd0c920e7afdf1f52f5b53c6aa49f06296
7
+ data.tar.gz: 6b21b26eacf7bbe165641e8504a9c1191768c4b366b982a3dd8e5ae051a8de3e116b60de83cd1d4b0a3251371bbe1b8ba56c3487eb3f67746b3ef498146b0153
@@ -1,6 +1,7 @@
1
1
  #= require ./svg_elements/helper.js
2
2
  #= require ./svg_elements/polygon.js
3
3
  #= require ./svg_elements/area_label.js
4
+ #= require ./svg_elements/building_label.js
4
5
 
5
6
  #= require_directory ./events
6
7
  #= require_directory ./map_objects
@@ -216,6 +216,10 @@ function Building() {
216
216
  _polygon.building = _this;
217
217
 
218
218
  _this._calcBBox();
219
+
220
+ // подпись над зданием - сколько свободных площадей
221
+ _this._label = new BuildingLabel(options, _map);
222
+
219
223
  };
220
224
 
221
225
  _this.enter = function () {
@@ -1132,7 +1132,19 @@ var clog = function () {
1132
1132
  self.data = data["updated_locations_json"];
1133
1133
  });
1134
1134
 
1135
- }
1135
+ };
1136
+
1137
+ self.show_free_areas_hint = function () {
1138
+ // рисуем в слое #svg_overlay,
1139
+ // а т.к. находимся в режиме просмотра карты,
1140
+ // этот слой пуст, можно им пока воспользоваться
1141
+
1142
+
1143
+
1144
+ };
1145
+ self.hide_free_areas_hint = function () {
1146
+
1147
+ };
1136
1148
 
1137
1149
  };
1138
1150
 
@@ -96,6 +96,9 @@ function StateController() {
96
96
  _map.save_button_klass.show();
97
97
  _map.save_button_klass.check_and_enable();
98
98
 
99
+ // скроем подсказки - сколько свободных площадей где есть
100
+ _map.hide_free_areas_hint();
101
+
99
102
  break;
100
103
 
101
104
  // перешли в состояние
@@ -153,6 +156,9 @@ function StateController() {
153
156
  _map.save_button_klass.hide();
154
157
  }
155
158
 
159
+ // покажем подсказки - сколько свободных площадей где есть
160
+ _map.show_free_areas_hint();
161
+
156
162
  break;
157
163
 
158
164
  // перешли в состояние рисования полигона
@@ -213,6 +219,9 @@ function StateController() {
213
219
 
214
220
  _this.mzoom_buttons.css('opacity', '1');
215
221
 
222
+ // скроем подсказки - сколько свободных площадей где есть
223
+ _map.hide_free_areas_hint();
224
+
216
225
  break;
217
226
 
218
227
  // редактируем, находясь в здании
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ var BuildingLabel = function (options, link_to_map) {
4
+
5
+ if ( options.building_hash != undefined &&
6
+ typeof options.building_hash.id != 'undefined' &&
7
+ options.building_hash.props.free_areas_count != 0
8
+ ) {
9
+
10
+ this._x = options.coords[0];
11
+ this._y = options.coords[1];
12
+ this._map = link_to_map;
13
+
14
+ var center_for_cicrle_x = this._x;
15
+ var center_for_cicrle_y = this._y - 100;
16
+
17
+ // создадим узел, который будет помещён в дерево и будет виден пользователю
18
+ this._g = document.createElementNS('http://www.w3.org/2000/svg', 'g');
19
+ this._g.setAttribute("class","free_areas_label");
20
+
21
+ this._bg_pulse = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
22
+ this._bg_pulse.setAttribute("cx",center_for_cicrle_x);
23
+ this._bg_pulse.setAttribute("cy",center_for_cicrle_y);
24
+ this._bg_pulse.setAttribute("r", 40);
25
+ this._bg_pulse.setAttribute("class","pulse");
26
+
27
+ this._bg_pulse2 = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
28
+ this._bg_pulse2.setAttribute("cx",center_for_cicrle_x);
29
+ this._bg_pulse2.setAttribute("cy",center_for_cicrle_y);
30
+ this._bg_pulse2.setAttribute("r", 40);
31
+ this._bg_pulse2.setAttribute("class","pulse2");
32
+
33
+ this._bg_circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
34
+ this._bg_circle.setAttribute("cx",center_for_cicrle_x);
35
+ this._bg_circle.setAttribute("cy",center_for_cicrle_y);
36
+ this._bg_circle.setAttribute("r",40);
37
+ this._bg_circle.setAttribute("class","circle");
38
+
39
+ this._text_element_ns = document.createElementNS('http://www.w3.org/2000/svg', 'text');
40
+ this._text_element_ns.setAttribute('x', center_for_cicrle_x);
41
+ this._text_element_ns.setAttribute('y', center_for_cicrle_y);
42
+ this._text_element_ns.setAttribute('class', 'text');
43
+ this._text_element_ns.textContent = options.building_hash.props.free_areas_count;
44
+
45
+ this._aLine = document.createElementNS('http://www.w3.org/2000/svg', 'line');
46
+ this._aLine.setAttribute('x1', this._x);
47
+ this._aLine.setAttribute('y1', this._y);
48
+ this._aLine.setAttribute('x2', center_for_cicrle_x);
49
+ this._aLine.setAttribute('y2', center_for_cicrle_y);
50
+ this._aLine.setAttribute('stroke', '#39BD5F');
51
+ this._aLine.setAttribute('stroke-width', '2');
52
+
53
+
54
+ // цепляем НЕ в #svg_overlay (об этом нам говорит is_overlay = false аргумент)
55
+ this._map.addNodeToSvg(this._g, false);
56
+
57
+ this._g.appendChild(this._aLine);
58
+ this._g.appendChild(this._bg_pulse);
59
+ this._g.appendChild(this._bg_pulse2);
60
+ this._g.appendChild(this._bg_circle);
61
+ this._g.appendChild(this._text_element_ns);
62
+
63
+ }
64
+
65
+ };
@@ -0,0 +1,116 @@
1
+
2
+ g.free_areas_label {
3
+
4
+ > * {
5
+ transform-origin: 50% 50%;
6
+ transform: matrix(1, 0, 0, 1, 0, 0);
7
+ display: block;
8
+
9
+ &.text {
10
+ font-size: 40px;
11
+ font-weight: bold;
12
+ fill: #ffffff;
13
+ transform: translateY(12px) translateX(-12px);
14
+ text-shadow: 0 0 1px rgba(0, 0, 0, 0.58);
15
+ }
16
+
17
+ &.pulse {
18
+
19
+ animation: pulseAnimation 3s infinite;
20
+ transition: all 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
21
+ -webkit-transition: all 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
22
+ -moz-transition: all 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
23
+
24
+ fill: rgba(57, 189, 95, 0.39);
25
+ -webkit-animation-duration: 3s;
26
+ -moz-animation-duration: 3s;
27
+ animation-duration: 3s;
28
+
29
+ }
30
+
31
+ &.pulse2 {
32
+
33
+ animation: pulseAnimation 3s 0.75s infinite;
34
+ transition: all 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
35
+ -webkit-transition: all 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
36
+ -moz-transition: all 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
37
+
38
+ fill: rgba(57, 189, 95, 0.69);
39
+
40
+ -webkit-animation-duration: 2s;
41
+ -moz-animation-duration: 2s;
42
+ animation-duration: 2s;
43
+
44
+ }
45
+
46
+ &.circle {
47
+ fill: rgba(57, 189, 95, 0.53);
48
+ }
49
+
50
+ &.line {
51
+ stroke: rgba(57, 189, 95, 0.99);
52
+ stroke-width: 1px;
53
+ }
54
+
55
+ }
56
+
57
+ }
58
+
59
+ @-webkit-keyframes pulseAnimation {
60
+ 0% {
61
+ -webkit-transform: scale(1);
62
+ opacity: 0
63
+ }
64
+ 20% {
65
+ opacity: 1
66
+ }
67
+ 75% {
68
+ -webkit-transform: scale(1.5);
69
+ opacity: 0
70
+ }
71
+ 100% {
72
+ opacity: 0
73
+ }
74
+ }
75
+
76
+ @-moz-keyframes pulseAnimation {
77
+ 0% {
78
+ -moz-transform: scale(1);
79
+ opacity: 0
80
+ }
81
+ 20% {
82
+ opacity: 1
83
+ }
84
+ 75% {
85
+ -moz-transform: scale(1.5);
86
+ opacity: 0
87
+ }
88
+ 100% {
89
+ opacity: 0
90
+ }
91
+ }
92
+
93
+ @keyframes pulseAnimation {
94
+ 0% {
95
+ -webkit-transform: scale(1);
96
+ -moz-transform: scale(1);
97
+ -ms-transform: scale(1);
98
+ -o-transform: scale(1);
99
+ transform: scale(1);
100
+ opacity: 0
101
+ }
102
+ 20% {
103
+ opacity: 1
104
+ }
105
+ 75% {
106
+ -webkit-transform: scale(1.5);
107
+ -moz-transform: scale(1.5);
108
+ -ms-transform: scale(1.5);
109
+ -o-transform: scale(1.5);
110
+ transform: scale(1.5);
111
+ opacity: 0
112
+ }
113
+ 100% {
114
+ opacity: 0
115
+ }
116
+ }
@@ -57,7 +57,8 @@ module C80Map
57
57
  desc: self.desc,
58
58
  column_step: self.column_step,
59
59
  communications: self.communications,
60
- price: self.price_string
60
+ price: self.price_string,
61
+ free_areas_count: self.free_areas_count # NOTE: free_areas_count находися в Rent::Building проекта vorsa
61
62
  }
62
63
  }
63
64
  res
@@ -1,3 +1,3 @@
1
1
  module C80Map
2
- VERSION = "0.1.0.21"
2
+ VERSION = "0.1.0.22"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: c80_map
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.21
4
+ version: 0.1.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - C80609A
@@ -90,6 +90,7 @@ files:
90
90
  - app/assets/javascripts/src/utils/opacity_buttons_utils.js
91
91
  - app/assets/javascripts/src/utils/utils.js
92
92
  - app/assets/javascripts/svg_elements/area_label.js
93
+ - app/assets/javascripts/svg_elements/building_label.js
93
94
  - app/assets/javascripts/svg_elements/helper.js
94
95
  - app/assets/javascripts/svg_elements/polygon.js
95
96
  - app/assets/javascripts/view/save_preloader.js
@@ -97,6 +98,7 @@ files:
97
98
  - app/assets/stylesheets/map.scss
98
99
  - app/assets/stylesheets/view/buttons/area_order_button.scss
99
100
  - app/assets/stylesheets/view/buttons/button_back_to_map.scss
101
+ - app/assets/stylesheets/view/elems/free_areas_label.scss
100
102
  - app/assets/stylesheets/view/modal_window.scss
101
103
  - app/assets/stylesheets/view/save_preloader.scss
102
104
  - app/controllers/c80_map/application_controller.rb