Skip to content
Snippets Groups Projects
VizTitle.vue 1.86 KiB
Newer Older
  • Learn to ignore specific revisions
  •   <header id="grid-container">
    
    Cee Nell's avatar
    Cee Nell committed
        <div id="title-container" :class="{ mobile: mobileView }">
    
    Cee Nell's avatar
    Cee Nell committed
            :class="{ mobile: mobileView }"
    
            src="@/assets/images/hero_img_cutout_less-stylized_feather.png"
    
            alt="Social vulnerability and water insecurity"
    
    Cee Nell's avatar
    Cee Nell committed
          />
    
          <div id="image-caption">
    
    Cee Nell's avatar
    Cee Nell committed
            <p class="title"><strong>Unequal access to water</strong></p>
            <p class="subtitle">
    
    Cee Nell's avatar
    Cee Nell committed
              How societal factors shape exposure to water-related hazards, likelihood to suffer harm, and ability to cope and recover from losses
    
    Cee Nell's avatar
    Cee Nell committed
            </p>
    
    Cee Nell's avatar
    Cee Nell committed
        <div id="intro-container" :class="{ mobile: mobileView }"></div>
    
    Cee Nell's avatar
    Cee Nell committed
    <script setup>
    import { ref } from 'vue';
    import { isMobile } from 'mobile-device-detect';
    
    Cee Nell's avatar
    Cee Nell committed
    const mobileView = ref(isMobile);
    
    <style lang="scss" scoped>
    #grid-container {
      display: grid;
    
    Cee Nell's avatar
    Cee Nell committed
      padding: 20px 0;
    
    Cee Nell's avatar
    Cee Nell committed
      grid-template-columns: 1fr;
      grid-template-areas: 
        "title"
        "intro";
      width: 100vw;
    
      justify-content: center;
      margin: auto;
      @media screen and (max-width: 600px) {
    
    Cee Nell's avatar
    Cee Nell committed
        padding: 0 0 20px;
    
        grid-template-columns: 100%;
    
    Cee Nell's avatar
    Cee Nell committed
        grid-template-rows: max-content max-content;
    
    Cee Nell's avatar
    Cee Nell committed
    
    
    #title-container {
      grid-area: title;
    
    Cee Nell's avatar
    Cee Nell committed
      text-align: center;
    
    Cee Nell's avatar
    Cee Nell committed
      width: 100vw;
      max-width: 100%;
      margin: auto;
    
    Cee Nell's avatar
    Cee Nell committed
    #image-caption {
      font-family: 'Source Sans Pro', sans-serif;
      margin-top: -10px;
    
    Cee Nell's avatar
    Cee Nell committed
    .title {
      font-size: 60px;
      font-weight: bold;
    
    Cee Nell's avatar
    Cee Nell committed
    .subtitle {
      font-size: 38px;
      margin-top: 10px;
    
    #intro-container {
      grid-area: intro;
    
    Cee Nell's avatar
    Cee Nell committed
      padding: 5px 0 0 5px;
    
      @media screen and (max-width: 600px) {
    
    Cee Nell's avatar
    Cee Nell committed
        padding: 1px 0 0 5px;
    
    Cee Nell's avatar
    Cee Nell committed
    
    #title-image.mobile {
      width: 100vw; /* Ensure the image takes up the full width on mobile */
    }
    
    #intro-container.mobile {
      padding: 1px 0 0 5px; /* Specific padding for mobile view */
    }