| 1 |
<?php |
| 2 |
|
| 3 |
namespace ResponsiveMenu\Mappers; |
| 4 |
|
| 5 |
class ScssButtonMapper extends ScssMapper |
| 6 |
{ |
| 7 |
|
| 8 |
public function map() |
| 9 |
{ |
| 10 |
$hamburger_css_dir = dirname(dirname(dirname(__FILE__))) . '/public/scss/hamburgers/hamburgers.scss'; |
| 11 |
$no_animation = $this->options['button_click_animation'] == 'off' ? '$hamburger-types: ();' : ''; |
| 12 |
|
| 13 |
$css = <<<CSS |
| 14 |
|
| 15 |
@media screen and ( max-width: {$this->options['breakpoint']}px ) { |
| 16 |
|
| 17 |
\$hamburger-layer-height: {$this->options['button_line_height']}px; |
| 18 |
\$hamburger-layer-spacing: {$this->options['button_line_margin']}px; |
| 19 |
\$hamburger-layer-color: {$this->options['button_line_colour']}; |
| 20 |
\$hamburger-layer-width: {$this->options['button_line_width']}px; |
| 21 |
\$hamburger-hover-opacity: 1; |
| 22 |
{$no_animation} |
| 23 |
|
| 24 |
@import "{$hamburger_css_dir}"; |
| 25 |
|
| 26 |
.responsive-menu-button { |
| 27 |
width: {$this->options['button_width']}px; |
| 28 |
height: {$this->options['button_height']}px; |
| 29 |
@if '{$this->options['button_transparent_background']}' == 'off' { |
| 30 |
background: {$this->options['button_background_colour']}; |
| 31 |
&:hover { |
| 32 |
background: {$this->options['button_background_colour_hover']}; |
| 33 |
} |
| 34 |
} |
| 35 |
position: {$this->options['button_position_type']}; |
| 36 |
top: {$this->options['button_top']}px; |
| 37 |
{$this->options['button_left_or_right']}: {$this->options['button_distance_from_side']}%; |
| 38 |
.responsive-menu-box { |
| 39 |
color: {$this->options['button_line_colour']}; |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
.responsive-menu-label { |
| 44 |
color: {$this->options['button_text_colour']}; |
| 45 |
font-size: {$this->options['button_font_size']}px; |
| 46 |
line-height: {$this->options['button_title_line_height']}px; |
| 47 |
@if '{$this->options['button_font']}' != '' { |
| 48 |
font-family: '{$this->options['button_font']}'; |
| 49 |
} |
| 50 |
} |
| 51 |
|
| 52 |
#responsive-menu-button { |
| 53 |
display: inline-block; |
| 54 |
transition: transform {$this->options['animation_speed']}s, background-color {$this->options['transition_speed']}s; |
| 55 |
} |
| 56 |
} |
| 57 |
CSS; |
| 58 |
|
| 59 |
return $this->compiler->compile($css); |
| 60 |
|
| 61 |
} |
| 62 |
|
| 63 |
} |
| 64 |
|