-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathtemplate.php
212 lines (180 loc) · 5.43 KB
/
template.php
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<script>
if ( /[?&]receiver/i.test( window.location.search ) ) {
document.documentElement.classList.add( 'receiver' );
}
</script>
<?php wp_head(); ?>
<style>
ul#wp-admin-bar-root-default li.slide-button {
margin: 0 5px;
}
ul#wp-admin-bar-root-default li.slide-button > button {
border-radius: 3px;
line-height: 24px;
border: none;
padding: 0 5px;
background: #fff;
font-weight: bold;
}
#wpadminbar {
opacity: 0.5;
transition: opacity 0.5s ease;
}
#wpadminbar:hover {
opacity: 1;
}
.print-pdf #wpadminbar,
.receiver #wpadminbar {
display: none;
}
figure.alignleft {
float: left;
margin-right: 1em;
}
figure.alignright {
float: right;
margin-left: 1em;
}
.wp-block-embed.alignleft {
width: auto;
max-width: none;
}
/* Remove margin for admin bar. */
html {
margin-top: 0 !important;
}
.presentation-contain html,
.presentation-contain body {
background: #000;
}
.reveal .slides {
text-align: inherit;
justify-content: center;
display: flex;
flex-direction: column;
}
.print-pdf .slides {
display: block;
}
.print-pdf .pdf-page {
justify-content: center;
display: flex;
flex-direction: column;
}
.pdf-page,
.presentation-contain .slides {
overflow: hidden;
padding: 28.125px 50px;
box-sizing: border-box;
}
.reveal .slides .pdf-page > section {
position: static !important;
z-index: 1;
width: 100% !important;
}
.presentation-contain .slides > section {
left: 50px;
right: 50px;
width: auto;
}
.receiver .reveal .slides *,
.receiver .reveal .backgrounds * {
pointer-events: none;
}
.reveal .controls,
.reveal .progress {
color: currentColor;
}
.wp-block-slide-slide img,
.wp-block-slide-slide video,
.wp-block-slide-slide iframe {
max-width: 100%;
max-height: 100%;
}
.wp-block-media-text {
/* Maybe table? */
display: flex;
}
.wp-block-media-text.has-media-on-the-right {
flex-direction: row-reverse;
}
.wp-block-media-text__media,
.wp-block-media-text__content {
flex-basis: 50%;
}
html:not( .presentation-contain ) .alignfull {
width: 100vw;
left: 50%;
position: relative;
transform: translate(-50%, 0);
max-width: none;
max-height: 100vh;
}
.reveal[data-background-transition="none"] .slide-background {
transition: none;
}
/* Dynamic */
.reveal {
color: <?php echo sanitize_hex_color( get_post_meta( get_the_ID(), 'presentation-color', true ) ) ?: '#000'; ?>;
font-size: <?php echo (int) get_post_meta( get_the_ID(), 'presentation-font-size', true ) ?: 42; ?>px;
font-family: <?php echo esc_html( get_post_meta( get_the_ID(), 'presentation-font-family', true ) ) ?: 'Helvetica, sans-serif'; ?>;
}
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
font-family: <?php echo esc_html( get_post_meta( get_the_ID(), 'presentation-font-family-heading', true ) ) ?: 'inherit'; ?>;
font-weight: <?php echo esc_html( get_post_meta( get_the_ID(), 'presentation-font-weight-heading', true ) ) ?: 'inherit'; ?>;
}
/* Extra specificity to override reveal background. */
.reveal .slide-background {
background-color: <?php echo sanitize_hex_color( get_post_meta( get_the_ID(), 'presentation-background-color', true ) ) ?: '#fff'; ?>;
background-image: <?php echo esc_html( get_post_meta( get_the_ID(), 'presentation-background-gradient', true ) ) ?: 'none'; ?>;
}
/* If a background color is set, disable the global gradient. */
.reveal .slide-background[style*="background-color"] {
background-image: none;
}
.reveal .slide-background .slide-background-content {
background-image: url("<?php echo esc_html( get_post_meta( get_the_ID(), 'presentation-background-url', true ) ) ?: 'none'; ?>");
background-position: <?php echo esc_html( get_post_meta( get_the_ID(), 'presentation-background-position', true ) ) ?: '50% 50%'; ?>;
opacity: <?php echo (int) get_post_meta( get_the_ID(), 'presentation-background-opacity', true ) / 100 ?: 1; ?>;
}
.reveal .slides section.wp-block-slide-slide {
top: auto !important;
padding-top: <?php echo esc_html( get_post_meta( get_the_ID(), 'presentation-vertical-padding', true ) ) ?: '0.2em'; ?> !important;
padding-bottom: <?php echo esc_html( get_post_meta( get_the_ID(), 'presentation-vertical-padding', true ) ) ?: '0.2em'; ?> !important;
padding-left: <?php echo esc_html( get_post_meta( get_the_ID(), 'presentation-horizontal-padding', true ) ) ?: '0.2em'; ?> !important;
padding-right: <?php echo esc_html( get_post_meta( get_the_ID(), 'presentation-horizontal-padding', true ) ) ?: '0.2em'; ?> !important;
}
.presentation-contain .alignfull {
margin: 0 calc( -50px - <?php echo esc_html( get_post_meta( get_the_ID(), 'presentation-horizontal-padding', true ) ) ?: '0.2em'; ?> );
max-width: none;
}
.reveal .slides > section,
.reveal .slides > section > section {
padding: <?php echo esc_html( get_post_meta( get_the_ID(), 'presentation-vertical-padding', true ) ) ?: '0.2em'; ?> 0;
}
</style>
<style>
<?php
// Allow quotes.
echo str_replace( '<', '', get_post_meta( get_the_ID(), 'presentation-css', true ) );
?>
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<?php the_content(); ?>
</div>
</div>
<?php wp_footer(); ?>
</body>
</html>