diff --git a/STARTERKIT/color/base.png b/STARTERKIT/color/base.png new file mode 100644 index 0000000000000000000000000000000000000000..58cc088a49e9259fefc2282f1795a5450f884065 Binary files /dev/null and b/STARTERKIT/color/base.png differ diff --git a/STARTERKIT/color/color.inc b/STARTERKIT/color/color.inc new file mode 100644 index 0000000000000000000000000000000000000000..d55bb2eee8d48f3b8934521ab6da247ed00bfb07 --- /dev/null +++ b/STARTERKIT/color/color.inc @@ -0,0 +1,132 @@ + array('logo' => theme_get_setting('logo', 'STARTERKIT'))), 'setting'); + +$info = array( + // Available colors and color labels used in theme. + 'fields' => array( + 'top' => t('Header top'), + 'bottom' => t('Header bottom'), + 'bg' => t('Main background'), + 'sidebar' => t('Sidebar background'), + 'sidebarborders' => t('Sidebar borders'), + 'footer' => t('Footer background'), + 'titleslogan' => t('Title and slogan'), + 'text' => t('Text color'), + 'link' => t('Link color'), + ), + // Pre-defined color schemes. + 'schemes' => array( + 'default' => array( + 'title' => t('Blue Lagoon (default)'), + 'colors' => array( + 'top' => '#0779bf', + 'bottom' => '#48a9e4', + 'bg' => '#ffffff', + 'sidebar' => '#f6f6f2', + 'sidebarborders' => '#f9f9f9', + 'footer' => '#292929', + 'titleslogan' => '#fffeff', + 'text' => '#3b3b3b', + 'link' => '#0071B3', + ), + ), + 'firehouse' => array( + 'title' => t('Firehouse'), + 'colors' => array( + 'top' => '#cd2d2d', + 'bottom' => '#cf3535', + 'bg' => '#ffffff', + 'sidebar' => '#f1f4f0', + 'sidebarborders' => '#ededed', + 'footer' => '#1f1d1c', + 'titleslogan' => '#fffeff', + 'text' => '#3b3b3b', + 'link' => '#d6121f', + ), + ), + 'ice' => array( + 'title' => t('Ice'), + 'colors' => array( + 'top' => '#d0d0d0', + 'bottom' => '#c2c4c5', + 'bg' => '#ffffff', + 'sidebar' => '#ffffff', + 'sidebarborders' => '#cccccc', + 'footer' => '#24272c', + 'titleslogan' => '#000000', + 'text' => '#4a4a4a', + 'link' => '#019dbf', + ), + ), + 'plum' => array( + 'title' => t('Plum'), + 'colors' => array( + 'top' => '#4c1c58', + 'bottom' => '#593662', + 'bg' => '#fffdf7', + 'sidebar' => '#edede7', + 'sidebarborders' => '#e7e7e7', + 'footer' => '#2c2c28', + 'titleslogan' => '#ffffff', + 'text' => '#301313', + 'link' => '#9d408d', + ), + ), + 'slate' => array( + 'title' => t('Slate'), + 'colors' => array( + 'top' => '#4a4a4a', + 'bottom' => '#4e4e4e', + 'bg' => '#ffffff', + 'sidebar' => '#ffffff', + 'sidebarborders' => '#d0d0d0', + 'footer' => '#161617', + 'titleslogan' => '#ffffff', + 'text' => '#3b3b3b', + 'link' => '#0073b6', + ), + ), + ), + + // CSS files (excluding @import) to rewrite with new color scheme. + 'css' => array( + 'css/colors.css', + ), + + // Files to copy. + 'copy' => array( + 'logo.png', + ), + + // Gradient definitions. + 'gradients' => array( + array( + // (x, y, width, height). + 'dimension' => array(0, 0, 0, 0), + // Direction of gradient ('vertical' or 'horizontal'). + 'direction' => 'vertical', + // Keys of colors to use for the gradient. + 'colors' => array('top', 'bottom'), + ), + ), + + // Color areas to fill (x, y, width, height). + 'fill' => array(), + + // Coordinates of all the theme slices (x, y, width, height) + // with their filename as used in the stylesheet. + 'slices' => array(), + + // Reference color used for blending. Matches the base.png's colors. + 'blend_target' => '#ffffff', + + // Preview files. + 'preview_css' => 'color/preview.css', + 'preview_js' => 'color/preview.js', + 'preview_html' => 'color/preview.html', + + // Base file for image generation. + 'base_image' => 'color/base.png', +); diff --git a/STARTERKIT/color/preview.css b/STARTERKIT/color/preview.css new file mode 100644 index 0000000000000000000000000000000000000000..48a4a83346bec7c92623cb1b27bdec283418a228 --- /dev/null +++ b/STARTERKIT/color/preview.css @@ -0,0 +1,200 @@ + +/* ---------- Color form ----------- */ +#color_scheme_form #palette .form-item { + width: 25em; +} +#color_scheme_form #palette .form-item label { + width: 15em; +} + +/* ---------- Preview Styles ----------- */ + +html.js #preview { + clear: both; + float: none !important; +} +#preview { + background-color: #fff; + font-family: Georgia, "Times New Roman", Times, serif; + font-size: 14px; + line-height: 1.5; + overflow: hidden; + word-wrap: break-word; + margin-bottom: 10px; +} +#preview-header { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + position: relative; +} +#preview-logo { + float: left; + padding: 15px 15px 15px 10px; +} +#preview-site-name { + color: #686868; + font-weight: normal; + font-size: 1.821em; + line-height: 1; + margin-bottom: 30px; + margin-left: 15px; + padding-top: 34px; +} +#preview-main-menu { + clear: both; + padding: 0 15px 3px; +} +#preview-main-menu-links a { + color: #d9d9d9; + padding: 0.6em 1em 0.4em; +} +#preview-main-menu-links { + font-size: 0.929em; + margin: 0; + padding: 0; +} +#preview-main-menu-links a { + color: #333; + background: #ccc; + background: rgba(255, 255, 255, 0.7); + text-shadow: 0 1px #eee; + -khtml-border-radius-topleft: 8px; + -moz-border-radius-topleft: 8px; + -webkit-border-top-left-radius: 8px; + border-top-left-radius: 8px; + -khtml-border-radius-topright: 8px; + -moz-border-radius-topright: 8px; + -webkit-border-top-right-radius: 8px; + border-top-right-radius: 8px; +} +#preview-main-menu-links a:hover, +#preview-main-menu-links a:focus { + background: #fff; + background: rgba(255, 255, 255, 0.95); +} +#preview-main-menu-links a:active { + background: #b3b3b3; + background: rgba(255, 255, 255, 1); +} +#preview-main-menu-links li a.active { + border-bottom: none; +} +#preview-main-menu-links li { + display: inline; + list-style-type: none; + padding: 0.6em 0 0.4em; +} +#preview-sidebar, +#preview-content { + display: inline; + float: left; + position: relative; +} +#preview-sidebar { + margin-left: 15px; + width: 210px; +} +#preview-content { + margin-left: 30px; + width: 26.5em; +} +#preview-sidebar .preview-block { + border: 1px solid; + margin: 20px 0; + padding: 15px 20px; +} +#preview-sidebar h2 { + border-bottom: 1px solid #d6d6d6; + font-size: 1.071em; + font-weight: normal; + line-height: 1.2; + margin: 0 0 0.5em; + padding-bottom: 5px; + text-shadow: 0 1px 0 #fff; +} +#preview .preview-block .preview-content { + margin-top: 1em; +} +#preview .preview-block-menu .preview-content, +#preview .preview-block-menu .preview-content ul { + margin-top: 0; +} +#preview-main { + margin-bottom: 40px; + margin-top: 20px; +} +#preview-page-title { + font-size: 2em; + font-weight: normal; + line-height: 1; + margin: 1em 0 0.5em; +} +#preview-footer-wrapper { + color: #c0c0c0; + color: rgba(255, 255, 255, 0.65); + display: block !important; + font-size: 0.857em; + padding: 20px 20px 25px; +} +#preview-footer-wrapper a { + color: #fcfcfc; + color: rgba(255, 255, 255, 0.8); +} +#preview-footer-wrapper a:hover, +#preview-footer-wrapper a:focus { + color: #fefefe; + color: rgba(255, 255, 255, 0.95); + text-decoration: underline; +} +#preview-footer-wrapper .preview-footer-column { + display: inline; + float: left; + padding: 0 10px; + position: relative; + width: 220px; +} +#preview-footer-wrapper .preview-block { + border: 1px solid #444; + border-color: rgba(255, 255, 255, 0.1); + margin: 20px 0; + padding: 10px; +} +#preview-footer-columns .preview-block-menu { + border: none; + margin: 0; + padding: 0; +} +#preview-footer-columns h2 { + border-bottom: 1px solid #555; + border-color: rgba(255, 255, 255, 0.15); + font-size: 1em; + margin-bottom: 0; + padding-bottom: 3px; + text-transform: uppercase; +} +#preview-footer-columns .preview-content { + margin-top: 0; +} +#preview-footer-columns .preview-content ul { + margin-left: 0; + padding-left: 0; +} +#preview-footer-columns .preview-content li { + list-style: none; + list-style-image: none; + margin: 0; + padding: 0; +} +#preview-footer-columns .preview-content li a { + border-bottom: 1px solid #555; + border-color: rgba(255, 255, 255, 0.15); + display: block; + line-height: 1.2; + padding: 0.8em 2px 0.8em 20px; + text-indent: -15px; +} +#preview-footer-columns .preview-content li a:hover, +#preview-footer-columns .preview-content li a:focus { + background-color: #1f1f21; + background-color: rgba(255, 255, 255, 0.05); + text-decoration: none; +} diff --git a/STARTERKIT/color/preview.html b/STARTERKIT/color/preview.html new file mode 100644 index 0000000000000000000000000000000000000000..04614fc9a945da3a07155476b19d31222f8c2abb --- /dev/null +++ b/STARTERKIT/color/preview.html @@ -0,0 +1,65 @@ +
+ +
+ +
STARTERKIT
+ +
+ +
+
+
+

Etiam est risus

+
+ Maecenas id porttitor Ut enim ad minim veniam, quis nostrudfelis. + Laboris nisi ut aliquip ex ea. +
+
+
+
+

Lorem ipsum dolor

+
+
+ Sit amet, consectetur adipisicing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis + nostrud exercitation ullamco laboris nisi ut aliquip ex ea + commodo consequat. Maecenas id porttitor Ut enim ad minim veniam, quis nostr udfelis. +
+
+
+
+ + + +
diff --git a/STARTERKIT/color/preview.js b/STARTERKIT/color/preview.js new file mode 100644 index 0000000000000000000000000000000000000000..b40bcf7dcae1af32a3030664132863e6331c6414 --- /dev/null +++ b/STARTERKIT/color/preview.js @@ -0,0 +1,39 @@ + +(function ($) { + Drupal.color = { + logoChanged: false, + callback: function(context, settings, form, farb, height, width) { + // Change the logo to be the real one. + if (!this.logoChanged) { + $('#preview #preview-logo img').attr('src', Drupal.settings.color.logo); + this.logoChanged = true; + } + // Remove the logo if the setting is toggled off. + if (Drupal.settings.color.logo == null) { + $('div').remove('#preview-logo'); + } + + // Solid background. + $('#preview', form).css('backgroundColor', $('#palette input[name="palette[bg]"]', form).val()); + + // Text preview. + $('#preview #preview-main h2, #preview .preview-content', form).css('color', $('#palette input[name="palette[text]"]', form).val()); + $('#preview #preview-content a', form).css('color', $('#palette input[name="palette[link]"]', form).val()); + + // Sidebar block. + $('#preview #preview-sidebar #preview-block', form).css('background-color', $('#palette input[name="palette[sidebar]"]', form).val()); + $('#preview #preview-sidebar #preview-block', form).css('border-color', $('#palette input[name="palette[sidebarborders]"]', form).val()); + + // Footer wrapper background. + $('#preview #preview-footer-wrapper', form).css('background-color', $('#palette input[name="palette[footer]"]', form).val()); + + // CSS3 Gradients. + var gradient_start = $('#palette input[name="palette[top]"]', form).val(); + var gradient_end = $('#palette input[name="palette[bottom]"]', form).val(); + + $('#preview #preview-header', form).attr('style', "background-color: " + gradient_start + "; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(" + gradient_start + "), to(" + gradient_end + ")); background-image: -moz-linear-gradient(-90deg, " + gradient_start + ", " + gradient_end + ");"); + + $('#preview #preview-site-name', form).css('color', $('#palette input[name="palette[titleslogan]"]', form).val()); + } + }; +})(jQuery); diff --git a/STARTERKIT/color/preview.png b/STARTERKIT/color/preview.png new file mode 100644 index 0000000000000000000000000000000000000000..58cc088a49e9259fefc2282f1795a5450f884065 Binary files /dev/null and b/STARTERKIT/color/preview.png differ diff --git a/template.php b/template.php index b4e4a0a7da657dc7a21906048bb99b1bff3150b1..4b9abb24cb4998502cb6170e742d5bdfbec390f8 100644 --- a/template.php +++ b/template.php @@ -184,6 +184,10 @@ function zen_preprocess_html(&$variables, $hook) { * The name of the template being rendered ("html" in this case.) */ function zen_process_html(&$variables, $hook) { + // Hook into color.module. + if (module_exists('color')) { + _color_html_alter($variables); + } // Flatten out html_attributes. $variables['html_attributes'] = drupal_attributes($variables['html_attributes_array']); } @@ -233,6 +237,16 @@ function zen_preprocess_page(&$variables, $hook) { } } +/** + * Override or insert variables into the page template. + */ +function zen_process_page(&$variables, $hook) { + // Hook into color.module. + if (module_exists('color')) { + _color_page_alter($variables); + } +} + /** * Override or insert variables into the maintenance page template. *