OSDN Git Service

t#30021:add repeat on gp
[pettanr/pettanr.git] / app / views / panels / _body.html.erb
1 <div class="pettanr-comic-panel" style="width:<%= panel.width %>px;height:<%= panel.height %>px;border-style: solid;border-width: <%= panel.border %>px;border-color:black; background-color:white;">
2   <% panel.panel_elements.each do |elm| %>
3     <% case elm.class.to_s %>
4     <% when 'PanelPicture' %>
5       <%= tag(:img, elm.opt_img_tag) %>
6     <% when 'SpeechBalloon' %>
7       <% balloon = elm.balloons.first %>
8       <div id="vballoon<%= elm.id -%>" class="pettanr-comic-balloon" style="width:<%= balloon.width -%>px; height:<%= balloon.height -%>px; top:<%= balloon.y -%>px; left:<%= balloon.x -%>px; z-index:<%= elm.z -%>; ">
9         <img src="<%= balloon.system_picture.url -%>" alt="<%= balloon.caption -%>">
10         <% elm.speeches.each do |speech| %>
11           <p style="top:<%= speech.y -%>px; left:<%= speech.x -%>px;width:<%= speech.width -%>px; height:<%= speech.height -%>px;">
12             <span><%= h speech.content -%></span>
13           </p>
14         <% end %>
15       </div>
16     <% when 'GroundColor' %>
17       <div id="ground-color<%= elm.id -%>" class="pettanr-comic-ground-color" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-color:<%= elm.color.name -%>;">
18       
19       </div>
20     <% when 'PanelColor' %>
21       <div id="panel-color<%= elm.id -%>" class="pettanr-comic-panel-color" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-color:#<%= format("%x", elm.code) -%>;">
22       
23       </div>
24     <% when 'GroundPicture' %>
25       <div id="ground-picture<%= elm.id -%>" class="pettanr-comic-ground-picture" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-image: url(<%= full_url elm.picture.url -%>); background-repeat: <%= MagicNumber['ground_picture_repeat_items'][elm.repeat] -%>; background-position: <%= elm.x -%>px, <%= elm.y -%>px;">
26         
27       </div>
28     <% end %>
29   <% end %>
30 </div>