Skip to content
Snippets Groups Projects
NarrativeIntro.vue 2.71 KiB
Newer Older
  • Learn to ignore specific revisions
  • <template>
    
      <section id="narrativeIntro">
    
    Azadpour, Elmera's avatar
    Azadpour, Elmera committed
        <div id="grid-container">
          <div id="text2" class="text-container">
            <p v-html="introText.paragraph1"></p>
          </div>
          <img src="@/assets/images/water_security_less-stylized.png" class="img" alt = "Stylized city-scape image with buildings in background and lush green grass surrouding pond in foreground."/>
          <img src="@/assets/images/water_insecurity_less-stylized.png" class="img right-align" alt = "Stylized image with an orange hue displaying a home surrounded by sagebrush, barren land, and a nearby road."/>
          <div id="text3" class="text-container quote">
            <p v-html="introText.paragraph2"></p>
          </div>
    
        </div>
        <div id="text4" class="text-container">
    
    Azadpour, Elmera's avatar
    Azadpour, Elmera committed
          <p v-html="introText.paragraph3"></p>
    
        </div>
        <div id="text5" class="text-container">
    
    Azadpour, Elmera's avatar
    Azadpour, Elmera committed
          <p v-html="introText.paragraph4"></p>
    
        </div>
      </section>
    </template>
    
    import text from './../assets/text/text.js';
    
    
    const introText = text.components.introNarrative;
    </script>
    
    
    <style scoped>
    
      position: relative;
    
      cursor: pointer;
    
      display: inline-block;
    }
    
    .tooltiptext {
      visibility: hidden;
    
      width: 200px;
      background-color: #555;
    
      color: #fff;
      text-align: center;
      border-radius: 6px;
    
      padding: 5px;
      position: absolute;
      z-index: 1;
      bottom: 100%; /* Position the tooltip above the text */
      left: 50%;
      transform: translateX(-50%);
      opacity: 0;
      transition: opacity 0.3s;
    
    .tooltip-span:hover .tooltiptext {
    
      visibility: visible;
    
      opacity: 1;
    
    .text-container {
      margin-bottom: 20px; /* Add some space between text containers */
    }
    
    #narrativeIntro img {
    
    Azadpour, Elmera's avatar
    Azadpour, Elmera committed
      width: 45%; /* Reduce the size of the images */
    }
    
    #grid-container {
      display: grid;
    
    Cee Nell's avatar
    Cee Nell committed
      max-width: 700px;
    
    Azadpour, Elmera's avatar
    Azadpour, Elmera committed
      margin: auto;
      height: auto;
      vertical-align: middle;
      overflow: hidden;
      grid-template-columns: 1fr;
      grid-template-areas:
        "text2"
        "image1"
        "image2"
        "text3";
    }
    
    @media screen and (min-width: 551px) {
      #grid-container {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
          "text2 image1"
          "image2 text3";
      }
    
      #text2 {
        grid-area: text2;
      }
    
      #text3 {
        grid-area: text3;
      }
    
      #grid-container .img:nth-of-type(1) {
        grid-area: image1;
      }
    
      #grid-container .img:nth-of-type(2) {
        grid-area: image2;
      }
    }
    
    @media screen and (max-width: 700px) {
      #grid-container {
        grid-template-columns: 1fr;
        grid-template-areas:
          "image1"
          "text2"
          "image2"
          "text3";
      }
    
      #text2 {
        grid-area: text2;
      }
    
      #text3 {
        grid-area: text3;
      }
    
      #grid-container .img:nth-of-type(1),
      #grid-container .img:nth-of-type(2) {
        width: 100%;
      }
    }
    
    .right-align {
    
      display: block;
    
    Azadpour, Elmera's avatar
    Azadpour, Elmera committed
      margin-left: auto;
    
    }
    </style>