-
Notifications
You must be signed in to change notification settings - Fork 1
/
theme.rb
136 lines (111 loc) · 4.07 KB
/
theme.rb
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
@lightning_talk_proc_name = "lightning-nyankosakana"
@lightning_talk_as_large_as_possible = false
include_theme("lightning-talk-toolkit")
include_theme("title-on-image-toolkit")
match(Slide) do |slides|
slides.each do |slide|
if slide.lightning_talk?
slide.lightning_talk
elsif slide.title_on_image? and slide["enable-title-on-image"] == "true"
slide.headline.padding_top = @space
slide.headline.padding_bottom = @space
params = {}
slide.title_on_image(params)
end
end
end
@font_family = find_font_family("ubuntu") || @font_family
@monospace_font_family = find_font_family("ubuntu mono") || @monospace_font_family
base_color = "#ffde00"
base_dark_color = "#ff8c00" # darkorange
base_dark_background_color = "#c1d2f4"
base_background_color = "#ffffff"
set_graffiti_color("#{base_color}99")
set_graffiti_line_width(30)
set_progress_foreground(base_color)
set_progress_background(base_background_color)
@default_item1_mark_color = base_color
@default_item1_mark_type = "circle"
@default_item2_mark_color = base_color
@default_item2_mark_type = "circle"
@default_item3_mark_color = base_color
@default_item3_mark_type = "circle"
@default_enum_item1_mark_color = base_color
@default_enum_item1_mark_type = "circle"
@default_enum_item2_mark_color = base_color
@default_enum_item2_mark_type = "circle"
@default_description_item1_mark_color = base_color
@default_description_item1_mark_type = "circle"
@default_block_quote_item1_mark_color = base_color
@default_block_quote_item1_mark_type = "circle"
@description_term_line_color = base_color
@default_emphasis_color = base_dark_color
@preformatted_frame_color = base_color
@preformatted_fill_color = base_background_color
@block_quote_frame_color = base_color
@block_quote_fill_color = base_background_color
@table_frame_color = base_color
@table_fill_color = base_background_color
@table_body_frame_color = base_color
@table_body_fill_color = base_background_color
@table_head_frame_color = base_color
@table_head_fill_color = base_dark_background_color
add_image_path("rabbit-images")
@image_slide_number_image ||= "mini-nyanko.png"
@image_timer_image ||= "mini-sakana.png"
@image_slide_number_start_flag_color = base_color
@image_slide_number_goal_flag_color = base_dark_background_color
@image_slide_number_text_color = "black"
@block_quote_open_quote_image = "open-quote-sakana.png"
@block_quote_close_quote_image = "close-quote-sakana.png"
@block_quote_frame_width = 0
@block_quote_fill_color = "#fff0"
@block_quote_padding_left = 0
@block_quote_padding_right = 0
@block_quote_padding_top = 0
@block_quote_padding_bottom = 0
@block_quote_image_background_alpha = 0.3
@block_quote_image_frame = true
@margin_bottom = canvas.height * 0.05
include_theme("default")
match(TitleSlide, "*") do |elements|
elements.horizontal_centering = false
elements.align = :right
end
match(TitleSlide, Title) do |titles|
titles.padding_bottom = @space * 2
titles.align = :left
end
match(TitleSlide, Subtitle) do |titles|
titles.align = :left
end
match(Slide, HeadLine) do |heads|
name = "head-line"
heads.delete_post_draw_proc_by_name(name)
heads.horizontal_centering = true
end
match(Slide, Body) do |bodies|
bodies.vertical_centering = true
bodies.each do |body|
next if body.elements.all? {|element| element.is_a?(Image)}
next if body.elements.any? {|element| element.is_a?(BlockQuote)}
next if body.elements.any? {|element| element.is_a?(PreformattedBlock)}
next if body.elements.any? {|element| element.is_a?(Table)}
body.margin_left = canvas.width * 0.05
body.margin_right = canvas.width * 0.05
end
end
match("**", BlockQuote) do |quotes|
quotes.each do |quote|
first_element = quote.elements.first
next unless first_element.is_a?(Paragraph)
first_element.indent = first_element.prop_get("size")
end
end
@slide_logo_image ||= "nyankosakana.png"
include_theme("slide-logo")
@icon_images = ["nyankosakana.png"]
include_theme("icon")
@slide_footer_info_left_text ||= canvas.title.gsub(/\n/, '')
@slide_footer_info_right_text ||= "Powered by Rabbit #{Rabbit::VERSION}"
include_theme("slide-footer-info")