💥 TRENDING: Changeset/ - Full Archive

Changeset 2175315


Ignore:
Timestamp:
10/17/2019 09:30:19 PM (6 years ago)
Author:
iseulde
Message:

v0.0.9

Location:
slide/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • slide/trunk/index.js

    r2175288 r2175315  
    3232  const fontSizeKey = 'presentation-font-size';
    3333  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';
    3537  const transitionKey = 'presentation-transition';
    3638  const transitionSpeedKey = 'presentation-transition-speed';
     
    134136          `@import url("${meta[fontFamilyUrlKey]}")`
    135137        ),
     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        ),
    136144        e(
    137145          PluginDocumentSettingPanel,
    138146          {
    139147            name: 'slide-font',
    140             title: __('Font', 'slide'),
     148            title: __('Base Font', 'slide'),
    141149            icon: 'text'
    142150          },
     
    152160            label: __('Font Family', 'slide'),
    153161            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            }
    155170          }),
    156171          e(ColorPicker, {
     
    159174            color: meta[colorKey],
    160175            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            }
    161196          })
    162197        ),
     
    651686    element: { createElement: e },
    652687    components: { BaseControl },
    653     compose: { withInstanceId },
    654     data: { select, dispatch }
     688    compose: { withInstanceId }
    655689  }) => {
    656     const fontFamilyUrlKey = 'presentation-font-url-family';
    657690    const googleFonts = {
    658691      'Abril Fatface': { weight: ['400'] },
     
    720753        }
    721754
    722         onChange(value);
    723         dispatch('core/editor').editPost({
    724           meta: {
    725             [fontFamilyUrlKey]: url
    726           }
    727         });
     755        onChange(value, url);
    728756      };
    729757
     
    740768            'select',
    741769            {
    742               id,
    743770              className: 'components-select-control__input components-select-control__input--coblocks-fontfamily',
    744771              onChange: onChangeValue,
  • slide/trunk/index.php

    r2175288 r2175315  
    55 * Plugin URI:  https://wordpress.org/plugins/slide/
    66 * Description: Allows you to create presentations with the block editor.
    7  * Version:     0.0.8
     7 * Version:     0.0.9
    88 * Author:      Ella van Durpe
    99 * Author URI:  https://ellavandurpe.com
     
    145145    }
    146146
     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
    147157    wp_enqueue_style(
    148158        'slide-common',
  • slide/trunk/readme.md

    r2175288 r2175315  
    66    Requires PHP:      5.6
    77    Tested up to:      5.3
    8     Stable tag:        0.0.8
     8    Stable tag:        0.0.9
    99    License:           GPL-2.0-or-later
    1010    License URI:       http://www.gnu.org/licenses/gpl-2.0.html
     
    2020* Creates a custom post type "Presentation", which will render as a presentation on the front end using [Reveal.js](https://revealjs.com).
    2121* 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.
    2526* 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  
    6262    'font-family',
    6363    'font-family-url',
     64    'font-family-heading',
     65    'font-family-heading-url',
    6466    'transition',
    6567    'transition-speed',
  • slide/trunk/template.php

    r2174760 r2175315  
    4444            font-size: <?php echo get_post_meta( get_the_ID(), 'presentation-font-size', true ) ?: '42'; ?>px;
    4545            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'; ?>;
    4655        }
    4756
Note: See TracChangeset for help on using the changeset viewer.