Changeset 35244


Ignore:
Timestamp:
2021-08-03T18:05:23+12:00 (3 years ago)
Author:
anupama
Message:

Narrower main image on pou landing pages and collection pages. Not sure what to do about mobile for this.

Location:
main/trunk/model-interfaces-dev/wmtb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-interfaces-dev/wmtb/styles/gs-wmtb-custom.css

    r35237 r35244  
     1/* DEFINING CSS VARIABLES - redefining them from weebly site (variables.less used in header.less)
     2https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties
     3
     4BUT UNFORTUNATELY, we can't use css variables in media query declarations:
     5https://stackoverflow.com/questions/40722882/css-native-variables-not-working-in-media-queries
     6*/
     7:root {
     8    --height-header: 120px;
     9    --height-header-mobile: 93px;
     10    --bp-small: 1025px;
     11    --bp-small-max: 1024px; /* 1 less */
     12}
     13
    114/* Within the page that loads in iframe, want a spacer (for now 120px high) that
    215will take up the space of the whakatohea navbar. Want the scrollbar shifted from
     
    1023div#spacer-for-nav
    1124{
    12     height: 120px;
     25    height: var(--height-header); /*120px;*/
    1326    width: auto;
    1427}    /* margin-top:120px; Why did height not have any effect? Because of self-closing div. Need explicit closing div. But an empty opening + closing div is dangerous in GS3, try using gsf:div element (not sure if class attribute will work on it) if xml equivalent of nbsp entity inside empty op+closing div doesn't work.*/
     
    2134.shifted-frame {
    2235    overflow: auto;
    23     height: calc(100vh - 120px);
     36    height: calc(100vh - var(--height-header)); /*calc(100vh - 120px);*/
    2437    width: auto;
    2538
    2639} /* Why does height calc(100% -120px) instead of using 100vh not work? */
    2740
    28 /*display: none;*/
    29 /*height: 100vh; */
    3041
    3142/* hardcoded values copied from weebly site theme's variables.less file called in header.less */
    32 @media screen and (max-width: 1024px) {
     43@media screen and (max-width: 1024px) { /* bp-small-max */
    3344    body {
    3445    overflow: auto;
     
    3647
    3748    div#spacer-for-nav {
    38     height:93px;
     49    height: var(--height-header-mobile); /*93px;*/
    3950    }
    4051
     
    4354    /*overflow-y: auto;*//* scroll;*/
    4455    }
    45 }
    46 
    47 
    48 
    49 .bg-img {
     56
     57    /* Maybe undo any changes made below for full-screen version so mobile unaffected*/
     58    /*
     59    div.crop-bg {
     60    height: 100px;
     61    background-position: center 20%;
     62    }
     63
     64    .crop-bg div.container {
     65    padding: 100px 0;
     66    }
     67   */
     68}
     69
     70
     71/* Want to have the full size bg banner image on the main page listing the Pou-s,
     72but on each Pou landing page and each collection landing page, want a vertically
     73narrower banner img. Achieved by cropping same image.
     74  https://www.w3schools.com/cssref/pr_background-image.asp
     75  and https://www.w3schools.com/cssref/pr_background-position.asp
     76*/
     77div.wsite-section-bg-image {
    5078    /*Can't set background-image as url contains variable: interfaces/{$interface_name}/images/digital-library.jpg*/
    5179    background-color: transparent;  /* Used if the image is unavailable. OR: grey */
     
    5482}
    5583
    56 .full-bg {
     84div.full-bg {
    5785    height: auto;
    5886    background-position: 50.00% 21.94%;
    59     background-size: 100%;
    60 }
    61 
    62 /* https://www.w3schools.com/cssref/pr_background-image.asp
    63 and https://www.w3schools.com/cssref/pr_background-position.asp*/
    64 
    65 .crop-bg {
    66     height: 230px; /* You must set a specified height */
    67     background-position: center -100px; /* OR: center OR: center 20% */
    68 }
    69 
     87    /*background-size: 100%;*/
     88}
     89
     90@media screen and (min-width: 1025px) { /* bp-small */
     91    div.crop-bg {
     92    height: 230px; /* You must set a specified height */
     93    background-position: center -100px; /* OR: center OR: center 20% */
     94    display: block; /* div with bg image needs to change from display: table-cell
     95               to display: block when cropping bg image, as table-cell setting
     96               overrides height customisation */
     97    }
     98    /* Restyle .container *descendant* of .crop-bg:
     99       Padding can not be 100px as it is when .full-bg is in effect,
     100       and should be no greater than 95px for .crop-bg, else there
     101       appears a bottom border of sorts under the cropped image. */
     102    .crop-bg div.container {
     103    padding: 50px 0;
     104    }
     105
     106}
    70107
    71108a, span#addNewMD, span#clearSaved {
  • main/trunk/model-interfaces-dev/wmtb/transform/layouts/main.xsl

    r35236 r35244  
    4343          <div class="wsite-section-wrap">
    4444              <!--<div  class="wsite-section wsite-header-section wsite-section-bg-image" style="height: auto;background-image: url(&quot;interfaces/{$interface_name}/images/digital-library.jpg&quot;) ;background-repeat: no-repeat ;background-position: 50.00% 21.94% ;background-size: 100% ;background-color: transparent ;background-size: cover;" >-->
    45             <div  class="wsite-section wsite-header-section wsite-section-bg-image" style="height: auto;background-image: url(&quot;interfaces/{$interface_name}/images/digital-library.jpg&quot;) ;background-repeat: no-repeat ;background-position: 50.00% 21.94% ;background-size: 100% ;background-color: transparent ;background-size: cover;" >
     45            <div style="background-image: url(&quot;interfaces/{$interface_name}/images/digital-library.jpg&quot;);" >
    4646              <xsl:choose>
    4747            <xsl:when test="/page/pageResponse/collection or /page/pageResponse/pathList/group">
    48               <xsl:attribute name="class">wsite-section wsite-header-section wsite-section-bg-image bg-img crop-bg</xsl:attribute>
     48              <xsl:attribute name="class">wsite-section wsite-header-section wsite-section-bg-image crop-bg</xsl:attribute>
    4949            </xsl:when>
    5050            <xsl:otherwise>
    51               <xsl:attribute name="class">wsite-section wsite-header-section wsite-section-bg-image bg-img full-bg</xsl:attribute>
     51              <xsl:attribute name="class">wsite-section wsite-header-section wsite-section-bg-image full-bg</xsl:attribute>
    5252            </xsl:otherwise>
    5353              </xsl:choose>
Note: See TracChangeset for help on using the changeset viewer.