diff --git a/app/assets/stylesheets/space-frontend.scss b/app/assets/stylesheets/space-frontend.scss index e070390..389eee1 100644 --- a/app/assets/stylesheets/space-frontend.scss +++ b/app/assets/stylesheets/space-frontend.scss @@ -3,14 +3,30 @@ // space-box .overlay { position: absolute; + display: flex; + align-items: center; + justify-content: center; } .s-space.show-space .selection-box-label.absolute-center{ display: none; } +.fa.fa-map-marker{ + font-size: 8vw; +} +.anchor{ + position: absolute; + left: 20%; + width: 0; + height: 0; + border-style: solid; + border-width: 1em 1em 0 1em; + border-color: #2196f3 transparent transparent transparent; +} .s-space.show-space .selection-box-label.absolute-center.active{ display: block; position: absolute; bottom: 110%; + bottom: calc(100% + 0.8em); left: 0%; background: #2196F3; color: white; @@ -31,4 +47,28 @@ // overflow: hidden; transform: translate(-50%, -50%); } +} +.w-ad-banner__pager-wrap.w-ad-banner__page--active .w-ad-banner__pager.external { + display: none; +} +.w-ad-banner__pager-wrap.w-ad-banner__page--active.active .w-ad-banner__pager.external { + display: table; + width: 100%; +} +.w-ad-banner__pager.external img { + display: inline-block; + width: 100%; +} +.bundle-button{ + padding-bottom: 1em; + display: flex; + flex-wrap: wrap; + justify-content: center; +} +.fa.fa-times{ + background: #e4225d; + color: white; + padding: 0.2em; + float: right; + cursor: pointer; } \ No newline at end of file diff --git a/app/assets/stylesheets/spaces.scss b/app/assets/stylesheets/spaces.scss index 2012eb6..84cc434 100644 --- a/app/assets/stylesheets/spaces.scss +++ b/app/assets/stylesheets/spaces.scss @@ -360,15 +360,31 @@ width: 2px; height: 2px; cursor: pointer; - - .selection-box-label { - box-sizing: border-box; - font-family: $main-font; - min-width: calc(100% + 4px); - color: $white; - background-color: rgba($main-color, 0.9); - padding: 5px 8px; - white-space: nowrap; + display: flex; + align-items: center; + justify-content: center; + .selection-box-label.absolute-center{ + display: none; + } + .anchor{ + position: absolute; + left: 20%; + width: 0; + height: 0; + border-style: solid; + border-width: 1em 1em 0 1em; + border-color: #2196f3 transparent transparent transparent; + } + .s-space.show-space .selection-box-label.absolute-center.active{ + display: block; + position: absolute; + bottom: 110%; + bottom: calc(100% + 0.8em); + left: 0%; + background: #2196F3; + color: white; + width: 100%; + padding: 0.2em; } } @@ -461,4 +477,28 @@ ul#layout-canvas { .floor-unit-title { text-align: center; +} +.w-ad-banner__pager-wrap.w-ad-banner__page--active .w-ad-banner__pager.external { + display: none; +} +.w-ad-banner__pager-wrap.w-ad-banner__page--active.active .w-ad-banner__pager.external { + display: table; + width: 100%; +} +.w-ad-banner__pager.external img { + display: inline-block; + width: 100%; +} +.bundle-button{ + padding-bottom: 1em; + display: flex; + flex-wrap: wrap; + justify-content: center; +} +.fa.fa-times{ + background: #e4225d; + color: white; + padding: 0.2em; + float: right; + cursor: pointer; } \ No newline at end of file diff --git a/app/controllers/spaces_controller.rb b/app/controllers/spaces_controller.rb index 58208e2..5c84388 100644 --- a/app/controllers/spaces_controller.rb +++ b/app/controllers/spaces_controller.rb @@ -34,8 +34,11 @@ class SpacesController < ApplicationController floor = Floor.where(:uid => params[:uid]).first rescue nil thumb_image = (!floor.frontend_image.thumb.url.nil? ? floor.frontend_image.thumb.url : "/assets/default-floor.jpg") image = (!floor.frontend_image.mobile.url.nil? ? floor.frontend_image.mobile.url : "#") - page = Page.where(:page_id => params[:page_id]).first - + page = Page.where(:page_id => params[:page_id]).first + site = Site.first + hover_color = (site.orbit_bar_submenu_background_color rescue nil) || 'null' + bg_color = (site.orbit_bar_background_color rescue nil) || 'null' + block_color = hex2rgba((site.orbit_bar_submenu_background_color rescue nil),0.3) || 'null' { "floor-title" => floor.title, "floor-frontend-image-thumb" => thumb_image, @@ -44,7 +47,11 @@ class SpacesController < ApplicationController "building-back-link" => "/" + I18n.locale.to_s + page.url, "floor-layout" => floor.layout, "floor-id" => floor.id.to_s, - "page-id" => page.page_id + "page-id" => page.page_id, + "hover_color" => hover_color, + "bg_color" => bg_color, + "block_color" => block_color, + "style_label" => style_label(bg_color,site.orbit_bar_text_color) } end @@ -88,12 +95,20 @@ class SpacesController < ApplicationController page = Page.where(:page_id => params[:page_id]).first layout = unit.layout.nil? ? "
" : unit.layout backlink = unit.floor.layout.nil? ? "/" + I18n.locale.to_s + page.url : "/" + I18n.locale.to_s + page.url + "/#{unit.floor.to_param}" + site = Site.first + hover_color = (site.orbit_bar_submenu_background_color rescue nil) || 'null' + bg_color = (site.orbit_bar_background_color rescue nil) || 'null' + block_color = hex2rgba((site.orbit_bar_submenu_background_color rescue nil),0.3) || 'null' { "unit-title" => unit.title, "floor-back-link" => backlink, "unit-layout" => layout, "unit-id" => unit.id.to_s, - "page-id" => page.page_id + "page-id" => page.page_id, + "hover_color" => hover_color, + "bg_color" => bg_color, + "block_color" => block_color, + "style_label" => style_label(bg_color,site.orbit_bar_text_color) } end @@ -111,10 +126,39 @@ class SpacesController < ApplicationController { "unit-images" => images, "extras" => { - "unit-title" => unit.title + "unit-title" => unit.title, + "content" => unit.content || '' } } end + + private + def hex2rgba(my_hex,percent=1) + if my_hex + if my_hex[0] == '#' + my_hex = my_hex[1..-1] + end + rgb = my_hex.split(//).each_slice(my_hex.length/3).map{|v| v.join.to_i(16)} + "rgba(#{rgb[0]},#{rgb[1]},#{rgb[2]},#{percent})" + else + nil + end + end + def style_label(color1,color2) + if color1 + "" + else + "" + end + end end diff --git a/modules/space/show.html.erb b/modules/space/show.html.erb index db27d77..c3ce324 100644 --- a/modules/space/show.html.erb +++ b/modules/space/show.html.erb @@ -17,11 +17,13 @@
+{{style_label}} \ No newline at end of file diff --git a/modules/space/showcase.html.erb b/modules/space/showcase.html.erb index 7ddfb9b..d022198 100644 --- a/modules/space/showcase.html.erb +++ b/modules/space/showcase.html.erb @@ -1,29 +1,3 @@ -

{{unit-title}}

@@ -57,4 +31,7 @@
+
+ {{content}} +
\ No newline at end of file diff --git a/modules/space/unit.html.erb b/modules/space/unit.html.erb index d444b7e..9e9c230 100644 --- a/modules/space/unit.html.erb +++ b/modules/space/unit.html.erb @@ -12,12 +12,13 @@
- +{{style_label}} \ No newline at end of file