1 class Pettanr.Views.GroundColor.Element extends Backbone.View
\r
3 className: 'pettanr-comic-ground-color'
\r
5 initialize: (options) ->
\r
6 @element = options.element
\r
12 style: Pettanr.to_style(@style(@spot))
\r
18 if @element.get('xy')
\r
24 if @element.get('wh')
\r
30 if @element.get('orientation') == 0
\r
36 if @element.get('orientation') == 0
\r
42 if @element.get('orientation') == 0
\r
48 if @element.get('orientation') == 0
\r
53 style: (spot = null, opacity = 20) ->
\r
55 position: 'absolute',
\r
56 'z-index': @element.get('z'),
\r
57 top: Pettanr.to_s(@div_y()) + '%',
\r
58 left: Pettanr.to_s(@div_x()) + '%',
\r
59 width: Pettanr.to_s(@div_width()) + '%',
\r
60 height: Pettanr.to_s(@div_height()) + '%',
\r
61 'background-color': '#' + ('000000' + Pettanr.to_s(@element.get('code'))).slice(-6)
\r
63 @merge_opacity(r, opacity) if spot and spot != @element
\r