keep-url.html 1.46 KB
Newer Older
Clément's avatar
Clément committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>SIB test: sib-router</title>
    <script type="module" src="../src/index.js"></script>
    <style>
      sib-router {
        display: block;
        text-align: center;
      }
      sib-route,
      sib-link {
        display: inline-block;
        padding: 0.5em;
        margin: 0.2em;
        background-color: #ccc;
        cursor: pointer;
      }
      [active]{
        background-color: #afa;
      }
    </style>
  </head>

  <body>
    <sib-router default-route="page1" use-hash keep-url>
      <sib-route name="page1">1st page</sib-route>
      <sib-route name="page2">2nd page</sib-route>
      <sib-route name="page3">3rd page</sib-route>
    </sib-router>

    <div id="page1" hidden>
      <h1>Page 1</h1>
      <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Reiciendis,
        commodi.</p>
      <sib-link next="page2">page 2 ></sib-link>
    </div>

    <div id="page2" hidden>
      <h1>Page 2</h1>
      <p>Quos, suscipit pariatur! Nulla fugiat excepturi pariatur fuga delectus
        corrupti.</p>
      <sib-link next="page3">page 3 ></sib-link>
    </div>

    <div id="page3" hidden>
      <h1>Page 3</h1>
      <p>Rem, veniam repudiandae! Error repudiandae sapiente blanditiis natus
        libero tenetur.</p>
    </div>
  </body>
</html>