Changeset 2175315
- Timestamp:
- 10/17/2019 09:30:19 PM (6 years ago)
- Location:
- slide/trunk
- Files:
-
- 5 edited
-
index.js (modified) (7 diffs)
-
index.php (modified) (2 diffs)
-
readme.md (modified) (2 diffs)
-
register.php (modified) (1 diff)
-
template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
slide/trunk/index.js
r2175288 r2175315 32 32 const fontSizeKey = 'presentation-font-size'; 33 33 const fontFamilyKey = 'presentation-font-family'; 34 const fontFamilyUrlKey = 'presentation-font-url-family'; 34 const fontFamilyUrlKey = 'presentation-font-family-url'; 35 const fontFamilyHeadingKey = 'presentation-font-family-heading'; 36 const fontFamilyHeadingUrlKey = 'presentation-font-family-heading-url'; 35 37 const transitionKey = 'presentation-transition'; 36 38 const transitionSpeedKey = 'presentation-transition-speed'; … … 134 136 `@import url("${meta[fontFamilyUrlKey]}")` 135 137 ), 138 !!meta[fontFamilyHeadingKey] && e( 139 'style', 140 null, 141 (meta[fontFamilyHeadingUrlKey] ? `@import url("${meta[fontFamilyHeadingUrlKey]}");` : '') + 142 `${cssPrefix} section h1, ${cssPrefix} section h2, ${cssPrefix} section h3, ${cssPrefix} section h4, ${cssPrefix} section h5, ${cssPrefix} section h6 { font-family: ${meta[fontFamilyHeadingKey]} }` 143 ), 136 144 e( 137 145 PluginDocumentSettingPanel, 138 146 { 139 147 name: 'slide-font', 140 title: __(' Font', 'slide'),148 title: __('Base Font', 'slide'), 141 149 icon: 'text' 142 150 }, … … 152 160 label: __('Font Family', 'slide'), 153 161 value: meta[fontFamilyKey], 154 onChange: (value) => updateMeta(value, fontFamilyKey) 162 onChange: (value, fontUrl) => { 163 editPost({ 164 meta: { 165 [fontFamilyKey]: value, 166 [fontFamilyUrlKey]: fontUrl 167 } 168 }); 169 } 155 170 }), 156 171 e(ColorPicker, { … … 159 174 color: meta[colorKey], 160 175 onChangeComplete: (value) => updateMeta(value.hex, colorKey) 176 }) 177 ), 178 e( 179 PluginDocumentSettingPanel, 180 { 181 name: 'slide-heading-font', 182 title: __('Heading Font', 'slide'), 183 icon: 'text' 184 }, 185 e(FontPicker, { 186 label: __('Font Family', 'slide'), 187 value: meta[fontFamilyHeadingKey], 188 onChange: (value, fontUrl) => { 189 editPost({ 190 meta: { 191 [fontFamilyHeadingKey]: value, 192 [fontFamilyHeadingUrlKey]: fontUrl 193 } 194 }); 195 } 161 196 }) 162 197 ), … … 651 686 element: { createElement: e }, 652 687 components: { BaseControl }, 653 compose: { withInstanceId }, 654 data: { select, dispatch } 688 compose: { withInstanceId } 655 689 }) => { 656 const fontFamilyUrlKey = 'presentation-font-url-family';657 690 const googleFonts = { 658 691 'Abril Fatface': { weight: ['400'] }, … … 720 753 } 721 754 722 onChange(value); 723 dispatch('core/editor').editPost({ 724 meta: { 725 [fontFamilyUrlKey]: url 726 } 727 }); 755 onChange(value, url); 728 756 }; 729 757 … … 740 768 'select', 741 769 { 742 id,743 770 className: 'components-select-control__input components-select-control__input--coblocks-fontfamily', 744 771 onChange: onChangeValue, -
slide/trunk/index.php
r2175288 r2175315 5 5 * Plugin URI: https://wordpress.org/plugins/slide/ 6 6 * Description: Allows you to create presentations with the block editor. 7 * Version: 0.0. 87 * Version: 0.0.9 8 8 * Author: Ella van Durpe 9 9 * Author URI: https://ellavandurpe.com … … 145 145 } 146 146 147 $heading_font_url = get_post_meta( get_the_ID(), 'presentation-font-family-heading-url', true ); 148 149 if ( $heading_font_url ) { 150 wp_enqueue_style( 151 'slide-heading-font', 152 $heading_font_url, 153 array() 154 ); 155 } 156 147 157 wp_enqueue_style( 148 158 'slide-common', -
slide/trunk/readme.md
r2175288 r2175315 6 6 Requires PHP: 5.6 7 7 Tested up to: 5.3 8 Stable tag: 0.0. 88 Stable tag: 0.0.9 9 9 License: GPL-2.0-or-later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 20 20 * Creates a custom post type "Presentation", which will render as a presentation on the front end using [Reveal.js](https://revealjs.com). 21 21 * Enables the block editor with a "Slide" block, which can be used as a container for each slide in the presentation. 22 * Currently the styling options are limited, but you can add your own CSS rules. 23 * You import a font by adding e.g. `@import url('https://fonts.googleapis.com/css?family=...');` above any other rules. 24 * You can also set a background color for individual slides! 22 * You can add background colors, gradients, and images for the whole presentation, but also per slide. 23 * You can select a font, color, and size. 24 * If that's not enough, you can always add some custom CSS! 25 * You can import a custom font by adding `@import url('https://fonts.googleapis.com/css?family=...');` above any other rules in the CSS input field. 25 26 * It's possible to include some notes with every slide. 26 * More options coming soon!27 * A lot more options coming soon! -
slide/trunk/register.php
r2175288 r2175315 62 62 'font-family', 63 63 'font-family-url', 64 'font-family-heading', 65 'font-family-heading-url', 64 66 'transition', 65 67 'transition-speed', -
slide/trunk/template.php
r2174760 r2175315 44 44 font-size: <?php echo get_post_meta( get_the_ID(), 'presentation-font-size', true ) ?: '42'; ?>px; 45 45 font-family: <?php echo get_post_meta( get_the_ID(), 'presentation-font-family', true ) ?: 'Helvetica, sans-serif'; ?>; 46 } 47 48 .reveal h1, 49 .reveal h2, 50 .reveal h3, 51 .reveal h4, 52 .reveal h5, 53 .reveal h6 { 54 font-family: <?php echo get_post_meta( get_the_ID(), 'presentation-font-family-heading', true ) ?: 'Helvetica, sans-serif'; ?>; 46 55 } 47 56
Note: See TracChangeset
for help on using the changeset viewer.