<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">

    <!-- this is what prevents the text & images from shrinking in the mobile versions -->
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">

    <!-- Alpine Plugins https://alpinejs.dev/plugins/collapse -->
    <script defer src="https://unpkg.com/@alpinejs/collapse@3.x.x/dist/cdn.min.js"></script>

    <!-- Alpine Core -->
    <script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>

    <!-- internal JavaScript file -->
    <script src="scripts/scripts.js"></script>

    <link rel="stylesheet" type="text/css" href="./tailwind-css/styles.css">

    <link href="https://fonts.cdnfonts.com/css/arial-rounded-mt-bold" rel="stylesheet">
    <style>
      /* NOTE: this link works locally, but not on Heroku, so I'm trying the link above */
      /* https://www.cdnfonts.com/arial-rounded-mt-bold.font */
      @import url('https://fonts.cdnfonts.com/css/arial-rounded-mt-bold');
      .UCS-fav-font {
        font-family: Arial Rounded MT Bold, Helvetica Rounded, Arial,sans-serif;
      }


      /* disable horizontal scroll on mobile web */
      /* https://stackoverflow.com/questions/4192277/disable-horizontal-scroll-on-mobile-web */
      html, body {
        overflow-x: hidden;
      }
      body {
        position: relative
      }


    </style>
    <title>layout-n-partials</title>
  </head>
  <body>
    <div class="bg-gray-200 m-5 p-4">
      <h4 class="hidden sm:block UCS-fav-font transition duration-500 ease-in-out hover:text-red-900 hover:bg-red-400 bg-gray-400 p-2">This text should be Arial Rounded MT Bold, which is the favorite font for titles found inside the UCS website; it should change to red when you hover on it if tailwind is working properly</h4>
      <h3 class="hidden sm:block text-xl">This is the very start (top) of the <strong class="font-mono">'./views/layoutsandpartials.ejs'</strong> file wrapped in the <strong class="font-mono">./layouts/full-width.ejs</strong> layout; it behaves much like an HTML file, but uses Express.js</h3>
      <div class="m-4 p-4 text-justify">
        <p>
          <strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.


          It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
        </p>
        <br>
        <h2 class="rounded m-2 px-2 py-1 bg-purple-400 text-purple-900"><a href="/myfolder/nested">Click here to see the navbar displayed with a layout & partials located in a subdirectory (.egs)</a></h2>
        <br>
        <p>
          Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
        </p>
        <br>
        <p>
          The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
        </p>
        <br>
        <p>
          <strong>Why do we use it?</strong> It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
        </p>


        <!-- Button that hides & shows a div w/alpine.js component -->
        <div class="bg-yellow-100" x-data="{isShowing: false}">
          <button class="rounded-full m-2 px-2 py-1 bg-yellow-400 text-yellow-900" x-data x-on:click="isShowing = !isShowing">
            Alpine.js Component Button
          </button>

          <div x-show="isShowing">
            <h2 class="m-2 p-2 text-yellow-900">i am content that should dissappear and reappear via the Alpine.js framework every time you click the button above!</h2>
          </div>
        </div>

        <br>

        <!-- https://www.codegrepper.com/code-examples/javascript/alpine+js+ejs -->
        <!-- This Alpine.js component works too, but has simpler syntax -->
        <div class="bg-yellow-100" x-data="{ open: false }">
          <button class="rounded-full m-2 px-2 py-1 bg-yellow-400 text-yellow-900 transition duration-500 ease-in-out hover:bg-yellow-600 hover:text-white" @click="open = true">Another Alpine.js Component Button</button>

          <ul class="m-4 p-4 text-yellow-900"
            x-show="open"
            @click.away="open = false"
            x-transition.duration.1000ms
            x-transition:leave.scale.20
          >
            I am just another example. but I have better (i.e. <i>simpler</i>) syntax...I also have hover styling and a web component inside of me below!

            <!-- this is a web component inside of an Alpine.js component -->
            <custom-web-component name="This is a Web Component, it requires less back-end code than Express.js layouts & partials, but it must be inserted onto each .html & .egs file in which it occurs; in contrast, the Express.js layouts & partials (.ejs files) are only defined once and that's it." avatar="./images/web-components.svg">
              <div class="text-gray-900" slot="homepage"><a href="https://www.webcomponents.org/">Click here to learn all about web components and why they are useful</a></div>
              <div class="text-gray-900" slot="resources"><a href="https://youtu.be/PCWaFLy3VUo">Click here to watch the tutorial video that was used to create this web component</a></div>
            </custom-web-component>

          </ul>
        </div>

        <br>

        <div x-data="{ expanded: false }" class="bg-green-100">
          <button @click="expanded = ! expanded" class="rounded-full m-2 px-2 py-1 bg-green-400 text-green-900">Special Alpine.js Animated Dropdown Button (Mouse-Click)</button>
          <div x-show="expanded" x-collapse.duration.500ms class="mx-2 px-2 text-green-900">
            <p>
              It is possible to have an animated dropdown button with
              Alpine.js, but only with a special plugin called the
              <a href="https://alpinejs.dev/plugins/collapse"><ins class="text-red-900">Collapse Plugin</ins></a>
              Which requires an additional CDN link or NPM installations,
              depending on how you are using it.
            </p>
            <br>
            <p>
              Reprehenderit eu excepteur ullamco esse cillum reprehenderit
              exercitation labore non. Dolore dolore ea dolore veniam sint
              in sint ex Lorem ipsum. Sint laborum deserunt deserunt amet
              voluptate cillum deserunt. Amet nisi pariatur sit ut id.
              Ipsum est minim est commodo id dolor sint id quis sint Lorem.
              Reprehenderit eu excepteur ullamco esse cillum reprehenderit
              exercitation labore non. Dolore dolore ea dolore veniam sint
              in sint ex Lorem ipsum. Sint laborum deserunt deserunt amet
              voluptate cillum deserunt. Amet nisi pariatur sit ut id.
              Ipsum est minim est commodo id dolor sint id quis sint Lorem.
              Reprehenderit eu excepteur ullamco esse cillum reprehenderit
              exercitation labore non. Dolore dolore ea dolore veniam sint
              in sint ex Lorem ipsum. Sint laborum deserunt deserunt amet
              voluptate cillum deserunt. Amet nisi pariatur sit ut id.
              Ipsum est minim est commodo id dolor sint id quis sint Lorem.
              Reprehenderit eu excepteur ullamco esse cillum reprehenderit
              exercitation labore non. Dolore dolore ea dolore veniam sint
              in sint ex Lorem ipsum. Sint laborum deserunt deserunt amet
              voluptate cillum deserunt. Amet nisi pariatur sit ut id.
              Ipsum est minim est commodo id dolor sint id quis sint Lorem.
            </p>
            <br>
          </div>
        </div>

        <br>

        <div x-data="{ expanded: false }" class="bg-green-100">
          <button @mouseover="expanded = true" @mouseout="expanded = false" class="rounded-full m-2 px-2 py-1 bg-green-400 text-green-900">Special Alpine.js Animated Dropdown Button (Mouse-Hover)</button>
          <div x-show="expanded" x-collapse.duration.500ms class="mx-2 px-2 text-green-900">
            <p>
              It is possible to have an animated dropdown button with
              Alpine.js, but only with a special plugin called the
              <a href="https://alpinejs.dev/plugins/collapse"><ins class="text-red-900">Collapse Plugin</ins></a>
              Which requires an additional CDN link or NPM installations,
              depending on how you are using it.
            </p>
            <br>
            <p>
              Reprehenderit eu excepteur ullamco esse cillum reprehenderit
              exercitation labore non. Dolore dolore ea dolore veniam sint
              in sint ex Lorem ipsum. Sint laborum deserunt deserunt amet
              voluptate cillum deserunt. Amet nisi pariatur sit ut id.
              Ipsum est minim est commodo id dolor sint id quis sint Lorem.
              Reprehenderit eu excepteur ullamco esse cillum reprehenderit
              exercitation labore non. Dolore dolore ea dolore veniam sint
              in sint ex Lorem ipsum. Sint laborum deserunt deserunt amet
              voluptate cillum deserunt. Amet nisi pariatur sit ut id.
              Ipsum est minim est commodo id dolor sint id quis sint Lorem.
              Reprehenderit eu excepteur ullamco esse cillum reprehenderit
              exercitation labore non. Dolore dolore ea dolore veniam sint
              in sint ex Lorem ipsum. Sint laborum deserunt deserunt amet
              voluptate cillum deserunt. Amet nisi pariatur sit ut id.
              Ipsum est minim est commodo id dolor sint id quis sint Lorem.
              Reprehenderit eu excepteur ullamco esse cillum reprehenderit
              exercitation labore non. Dolore dolore ea dolore veniam sint
              in sint ex Lorem ipsum. Sint laborum deserunt deserunt amet
              voluptate cillum deserunt. Amet nisi pariatur sit ut id.
              Ipsum est minim est commodo id dolor sint id quis sint Lorem.
            </p>
            <br>
          </div>
        </div>










        <br>

        <!-- Looping over an array in the scripts.js JavaScript file -->
        <div x-data="{ myArray }" style="background: #c0d9eb">
          <div style="border: 10px; padding: 10px; margin: 10px">
            <p>This list of three pets below is being generated by an Alpine.js component from an array in the scripts.js file in the public folder</p>
            <template x-for="person in myArray">
              <li x-text="person"></li>
            </template>
          </div>
        </div>

        <br><br><br>


        <!-- this is a web component  -->
        <div class="bg-green-300">
          <custom-web-component name="This is a Web Component, it requires less back-end code than Express.js layouts & partials, but it must be inserted onto each .html & .egs file in which it occurs; in contrast, the Express.js layouts & partials (.ejs files) are only defined once and that's it." avatar="./images/web-components.svg">
            <div class="text-gray-900" slot="homepage"><a href="https://www.webcomponents.org/">Click here to learn all about web components and why they are useful</a></div>
            <div class="text-gray-900" slot="resources"><a href="https://youtu.be/PCWaFLy3VUo">Click here to watch the tutorial video that was used to create this web component</a></div>
          </custom-web-component>
        </div>

        <script src="./web-components/ourWebComponent.js"></script>

        <br><br><br>

        <!-- This is a pair of dropdown accordions built with raw HTML and CSS -->
        <%- include('./partials/pureaccordion.ejs') %>

      </div>
      <h3 class="invisible sm:visible text-xl">This is the very end (bottom) of the <strong class="font-mono">'./views/layoutsandpartials.ejs'</strong> file wrapped in the <strong class="font-mono">./layouts/full-width.ejs</strong> layout; it behaves much like an HTML file, but uses Express.js</h3>
    </div>
  </body>
</html>
