You are here

function beautytips_define_beautytips_styles in BeautyTips 8

Same name and namespace in other branches
  1. 6.2 beautytips.module \beautytips_define_beautytips_styles()
  2. 7.2 beautytips.module \beautytips_define_beautytips_styles()

Implements hook_define_beautytips_styles().

File

./beautytips.module, line 128
Provides API for adding beautytips to pages.

Code

function beautytips_define_beautytips_styles() {
  $styles['default'] = \Drupal::config('beautytips.basic')
    ->get('beautytips_defaults');

  // Cleanup any problems with defaults.
  if (count((array) $styles['default'])) {
    foreach ($styles['default'] as &$value) {
      if (!is_array($value)) {
        $value = ctype_digit($value) || is_int($value) ? (int) $value : Html::escape($value);
      }
      else {
        if (count($value)) {
          foreach ($value as &$sub_value) {
            $sub_value = Html::escape($sub_value);
          }
        }
      }
    }
  }
  $styles['plain'] = [];
  $styles['netflix'] = [
    'positions' => [
      'right',
      'left',
    ],
    'fill' => '#FFF',
    'padding' => 5,
    'shadow' => TRUE,
    'shadowBlur' => 12,
    'strokeStyle' => '#B9090B',
    'spikeLength' => 50,
    'spikeGirth' => 60,
    'cornerRadius' => 10,
    'centerPointY' => 0.1,
    'overlap' => -8,
    'cssStyles' => [
      'fontSize' => '12px',
      'fontFamily' => 'arial,helvetica,sans-serif',
    ],
  ];
  $styles['facebook'] = [
    'fill' => '#F7F7F7',
    'padding' => 8,
    'strokeStyle' => '#B7B7B7',
    'cornerRadius' => 0,
    'cssStyles' => [
      'fontFamily' => '"lucida grande",tahoma,verdana,arial,sans-serif',
      'fontSize' => '11px',
    ],
  ];
  $styles['transparent'] = [
    'fill' => 'rgba(0, 0, 0, .8)',
    'padding' => 20,
    'strokeStyle' => '#CC0',
    'strokeWidth' => 3,
    'spikeLength' => 40,
    'spikeGirth' => 40,
    'cornerRadius' => 40,
    'cssStyles' => [
      'color' => '#FFF',
      'fontWeight' => 'bold',
    ],
  ];
  $styles['big-green'] = [
    'fill' => '#00FF4E',
    'padding' => 20,
    'strokeWidth' => 0,
    'spikeLength' => 40,
    'spikeGirth' => 40,
    'cornerRadius' => 15,
    'cssStyles' => [
      'fontFamily' => '"lucida grande",tahoma,verdana,arial,sans-serif',
      'fontSize' => '14px',
    ],
  ];
  $styles['google-maps'] = [
    'positions' => [
      'top',
      'bottom',
    ],
    'fill' => '#FFF',
    'padding' => 15,
    'strokeStyle' => '#ABABAB',
    'strokeWidth' => 1,
    'spikeLength' => 65,
    'spikeGirth' => 40,
    'cornerRadius' => 25,
    'centerPointX' => 0.9,
    'cssStyles' => [],
  ];
  $styles['hulu'] = [
    'fill' => '#F4F4F4',
    'strokeStyle' => '#666666',
    'spikeLength' => 20,
    'spikeGirth' => 10,
    'width' => 350,
    'overlap' => 0,
    'centerPointY' => 1,
    'cornerRadius' => 0,
    'cssStyles' => [
      'fontFamily' => '"Lucida Grande",Helvetica,Arial,Verdana,sans-serif',
      'fontSize' => '12px',
      'padding' => '10px 14px',
    ],
    'shadow' => TRUE,
    'shadowColor' => 'rgba(0,0,0,.5)',
    'shadowBlur' => 8,
    'shadowOffsetX' => 4,
    'shadowOffsetY' => 4,
  ];
  return $styles;
}