provide nav_min_opacity which allows the navbar to fade or even vanish until hovered with a value of for instance '0';

This commit is contained in:
friendica 2013-11-03 14:26:42 -08:00
parent 8a75e92020
commit 5ba813397b
4 changed files with 39 additions and 15 deletions

View File

@ -118,21 +118,29 @@ blockquote {
filter:alpha(opacity=100); filter:alpha(opacity=100);
} }
nav {background-image: linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%); nav {
background-image: -o-linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%); background-image: linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%);
background-image: -moz-linear-gradient(bottom,$nav_bg_1 26%, $nav_bg_2 82%); background-image: -o-linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%);
background-image: -webkit-linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%); background-image: -moz-linear-gradient(bottom,$nav_bg_1 26%, $nav_bg_2 82%);
background-image: -ms-linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%); background-image: -webkit-linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%);
background-image: -ms-linear-gradient(bottom, $nav_bg_1 26%, $nav_bg_2 82%);
opacity: $nav_float_min_opacity;
filter:alpha(opacity=$nav_percent_min_opacity);
} }
section {width: $section_width; section {width: $section_width;
} }
nav:hover {background-image: linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%); nav:hover {
background-image: -o-linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%); background-image: linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%);
background-image: -moz-linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%); background-image: -o-linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%);
background-image: -webkit-linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%); background-image: -moz-linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%);
background-image: -ms-linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%); background-image: -webkit-linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%);
background-image: -ms-linear-gradient(bottom, $nav_bg_3 26%, $nav_bg_4 82%);
opacity: 1.0;
filter:alpha(opacity=100);
} }

View File

@ -14,8 +14,9 @@ function theme_content(&$a) {
$radius = get_pconfig(local_user(),'redbasic', 'radius' ); $radius = get_pconfig(local_user(),'redbasic', 'radius' );
$shadow = get_pconfig(local_user(),'redbasic', 'photo_shadow' ); $shadow = get_pconfig(local_user(),'redbasic', 'photo_shadow' );
$section_width=get_pconfig(local_user(),"redbasic","section_width"); $section_width=get_pconfig(local_user(),"redbasic","section_width");
$nav_min_opacity=get_pconfig(local_user(),"redbasic","nav_min_opacity");
return redbasic_form($a, $schema, $nav_colour, $bgcolour, $background_image, $item_colour, $item_opacity, return redbasic_form($a, $schema, $nav_colour, $bgcolour, $background_image, $item_colour, $item_opacity,
$font_size, $font_colour, $radius, $shadow, $section_width); $font_size, $font_colour, $radius, $shadow, $section_width,$nav_min_opacity);
} }
function theme_post(&$a) { function theme_post(&$a) {
@ -33,11 +34,14 @@ function theme_post(&$a) {
set_pconfig(local_user(), 'redbasic', 'radius', $_POST['redbasic_radius']); set_pconfig(local_user(), 'redbasic', 'radius', $_POST['redbasic_radius']);
set_pconfig(local_user(), 'redbasic', 'photo_shadow', $_POST['redbasic_shadow']); set_pconfig(local_user(), 'redbasic', 'photo_shadow', $_POST['redbasic_shadow']);
set_pconfig(local_user(), 'redbasic', 'section_width', $_POST['redbasic_section_width']); set_pconfig(local_user(), 'redbasic', 'section_width', $_POST['redbasic_section_width']);
set_pconfig(local_user(), 'redbasic', 'nav_min_opacity', $_POST['redbasic_nav_min_opacity']);
} }
} }
// FIXME - this really should be an array
function redbasic_form(&$a, $schema, $nav_colour, $bgcolour, $background_image, $item_colour, $item_opacity, function redbasic_form(&$a, $schema, $nav_colour, $bgcolour, $background_image, $item_colour, $item_opacity,
$font_size, $font_colour, $radius, $shadow, $section_width) { $font_size, $font_colour, $radius, $shadow, $section_width,$nav_min_opacity) {
$scheme_choices = array(); $scheme_choices = array();
$scheme_choices["---"] = t("Default"); $scheme_choices["---"] = t("Default");
@ -78,6 +82,7 @@ if(feature_enabled(local_user(),'expert'))
'$radius' => array('redbasic_radius', t('Set radius of corners'), $radius), '$radius' => array('redbasic_radius', t('Set radius of corners'), $radius),
'$shadow' => array('redbasic_shadow', t('Set shadow depth of photos'), $shadow), '$shadow' => array('redbasic_shadow', t('Set shadow depth of photos'), $shadow),
'$section_width' => array('redbasic_section_width',t('Set width of main section'),$section_width), '$section_width' => array('redbasic_section_width',t('Set width of main section'),$section_width),
'$nav_min_opacity' => array('nav_min_opacity',t('Set minimum opacity of nav bar - to hide it'),$nav_min_opacity),
)); ));
return $o; return $o;

View File

@ -22,6 +22,7 @@
$radius = get_pconfig($uid, "redbasic", "radius"); $radius = get_pconfig($uid, "redbasic", "radius");
$shadow = get_pconfig($uid,"redbasic","photo_shadow"); $shadow = get_pconfig($uid,"redbasic","photo_shadow");
$section_width=get_pconfig($uid,"redbasic","section_width"); $section_width=get_pconfig($uid,"redbasic","section_width");
$nav_min_opacity=get_pconfig($uid,'redbasic','nav_min_opacity');
// Now load the scheme. If a value is changed above, we'll keep the settings // Now load the scheme. If a value is changed above, we'll keep the settings
// If not, we'll keep those defined by the schema // If not, we'll keep those defined by the schema
@ -72,7 +73,14 @@
$active_colour = '#FFFFFF'; $active_colour = '#FFFFFF';
if (! $section_width) if (! $section_width)
$section_width="72%"; $section_width="72%";
if($nav_min_opacity === false) {
$nav_float_min_opacity = 1.0;
$nav_percent_min_opacity = 100;
}
else {
$nav_float_min_opacity = (float) $nav_min_opacity;
$nav_percent_min_opacity = (int) 100 * $nav_min_opacity;
}
// Nav colours have nested values, so we have to define the actual variables // Nav colours have nested values, so we have to define the actual variables
@ -117,7 +125,9 @@ $options = array (
'$radius' => $radius, '$radius' => $radius,
'$shadow' => $shadow, '$shadow' => $shadow,
'$active_colour' => $active_colour, '$active_colour' => $active_colour,
'$section_width' => $section_width '$section_width' => $section_width,
'$nav_float_min_opacity' => $nav_float_min_opacity,
'$nav_percent_min_opacity' => $nav_percent_min_opacity
); );
echo str_replace(array_keys($options), array_values($options), $x); echo str_replace(array_keys($options), array_values($options), $x);

View File

@ -14,6 +14,7 @@
{{include file="field_input.tpl" field=$radius}} {{include file="field_input.tpl" field=$radius}}
{{include file="field_input.tpl" field=$shadow}} {{include file="field_input.tpl" field=$shadow}}
{{include file="field_input.tpl" field=$section_width}} {{include file="field_input.tpl" field=$section_width}}
{{include file="field_input.tpl" field=$nav_min_opacity}}
<div class="settings-submit-wrapper"> <div class="settings-submit-wrapper">
<input type="submit" value="{{$submit}}" class="settings-submit" name="redbasic-settings-submit" /> <input type="submit" value="{{$submit}}" class="settings-submit" name="redbasic-settings-submit" />
</div> </div>