Commit 82df4539 authored by Lily Yan's avatar Lily Yan
Browse files

ISTWCMS-3365 Make image look good for all size screen

parent 829cd0f8
<?php
/**
* @file
* uw_virtual_site_homepage.features.inc
......@@ -30,15 +29,15 @@ function uw_virtual_site_homepage_views_api($module = NULL, $api = NULL) {
function uw_virtual_site_homepage_image_default_styles() {
$styles = array();
// Exported image style: uw_homepage_banners.
$styles['uw_homepage_banners'] = array(
'label' => 'Homepage banners',
// Exported image style: uw_homepage_banners_large.
$styles['uw_homepage_banners_large'] = array(
'label' => 'Homepage banners large',
'effects' => array(
5 => array(
'name' => 'focal_point_scale_and_crop',
'data' => array(
'width' => 380,
'height' => 320,
'width' => 1024,
'height' => 400,
'focal_point_advanced' => array(
'shift_x' => '',
'shift_y' => '',
......@@ -49,14 +48,14 @@ function uw_virtual_site_homepage_image_default_styles() {
),
);
// Exported image style: uw_homepage_banners_large.
$styles['uw_homepage_banners_large'] = array(
'label' => 'Homepage banners large',
// Exported image style: uw_homepage_banners_medium.
$styles['uw_homepage_banners_medium'] = array(
'label' => 'Homepage banners medium',
'effects' => array(
3 => array(
'name' => 'focal_point_scale_and_crop',
'data' => array(
'width' => 1000,
'width' => 769,
'height' => 400,
'focal_point_advanced' => array(
'shift_x' => '',
......@@ -68,15 +67,15 @@ function uw_virtual_site_homepage_image_default_styles() {
),
);
// Exported image style: uw_homepage_banners_medium.
$styles['uw_homepage_banners_medium'] = array(
'label' => 'Homepage banners medium',
// Exported image style: uw_homepage_banners_small.
$styles['uw_homepage_banners_small'] = array(
'label' => 'Homepage banners small',
'effects' => array(
2 => array(
'name' => 'focal_point_scale_and_crop',
'data' => array(
'width' => 800,
'height' => 400,
'width' => 480,
'height' => 250,
'focal_point_advanced' => array(
'shift_x' => '',
'shift_y' => '',
......@@ -87,14 +86,14 @@ function uw_virtual_site_homepage_image_default_styles() {
),
);
// Exported image style: uw_homepage_banners_small.
$styles['uw_homepage_banners_small'] = array(
'label' => 'Homepage banners small',
// Exported image style: uw_homepage_banners_xl.
$styles['uw_homepage_banners_xl'] = array(
'label' => 'Homepage banners xl',
'effects' => array(
1 => array(
'name' => 'focal_point_scale_and_crop',
'data' => array(
'width' => 480,
'width' => 1280,
'height' => 400,
'focal_point_advanced' => array(
'shift_x' => '',
......@@ -106,15 +105,15 @@ function uw_virtual_site_homepage_image_default_styles() {
),
);
// Exported image style: uw_homepage_banners_xl.
$styles['uw_homepage_banners_xl'] = array(
'label' => 'Homepage banners xl',
// Exported image style: uw_homepage_banners_xs.
$styles['uw_homepage_banners_xs'] = array(
'label' => 'Homepage banners xs',
'effects' => array(
4 => array(
'name' => 'focal_point_scale_and_crop',
'data' => array(
'width' => 1600,
'height' => 400,
'width' => 320,
'height' => 250,
'focal_point_advanced' => array(
'shift_x' => '',
'shift_y' => '',
......
......@@ -71,11 +71,11 @@ features[field_instance][] = node-uw_virtual_site_homepage-field_uw_theme_settin
features[field_instance][] = node-uw_virtual_site_homepage-field_uw_twitter_type
features[field_instance][] = node-uw_virtual_site_homepage-field_uw_twitter_username
features[field_instance][] = node-uw_virtual_site_homepage-og_group_ref
features[image][] = uw_homepage_banners
features[image][] = uw_homepage_banners_large
features[image][] = uw_homepage_banners_medium
features[image][] = uw_homepage_banners_small
features[image][] = uw_homepage_banners_xl
features[image][] = uw_homepage_banners_xs
features[node][] = uw_virtual_site_homepage
features[user_permission][] = create uw_virtual_site_homepage content
features[user_permission][] = delete any uw_virtual_site_homepage content
......@@ -96,4 +96,3 @@ features[variable][] = node_preview_uw_virtual_site_homepage
features[variable][] = node_submitted_uw_virtual_site_homepage
features[views_view][] = uw_virtual_site_homepage_view
features_exclude[menu_links][navigation_uw-virtual-site-homepage:node/add/uw-virtual-site-homepage] = navigation_uw-virtual-site-homepage:node/add/uw-virtual-site-homepage
......@@ -189,8 +189,8 @@ function uw_virtual_site_homepage_page_alter(&$page) {
$file = $page['uw-virtual-site-homepage']['field_uw_homepage_banners'][$index]['entity']['field_collection_item'][$fc_id]['field_uw_homepage_banners_image'][0]['#item']['uri'];
$banner_alt = 'Test ALT';
$banner_small = image_style_url('uw_homepage_banners', $file);
$banner_square = image_style_url('uw_homepage_banners_small', $file);
$banner_xs = image_style_url('uw_homepage_banners_xs', $file);
$banner_small = image_style_url('uw_homepage_banners_small', $file);
$banner_med = image_style_url('uw_homepage_banners_medium', $file);
$banner_large = image_style_url('uw_homepage_banners_large', $file);
$banner_xl = image_style_url('uw_homepage_banners_xl', $file);
......@@ -214,8 +214,8 @@ function uw_virtual_site_homepage_page_alter(&$page) {
<source srcset="' . $banner_xl . '" media="(min-width: 1280px)">
<source srcset="' . $banner_large . '" media="(min-width: 1024px)">
<source srcset="' . $banner_med . '" media="(min-width: 769px)">
<source srcset="' . $banner_square . '" media="(min-width: 480px)">
<source srcset="' . $banner_small . '" media="(min-width: 320px)">
<source srcset="' . $banner_small . '" media="(min-width: 480px)">
<source srcset="' . $banner_xs . '" media="(min-width: 320px)">
<source srcset="' . $banner_large . '">';
$html .= '<img src="' . $banner_xl . '" alt="' . $banner_alt . '">';
$html .= '</picture>';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment