File size: 1,047 Bytes
6778ee0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!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>Plausible Playwright tests</title>
    <script async src="/tracker/js/plausible.hash.local.js"></script>
  </head>

  <body>
    <nav>
      <a id="home-link" href="#home">Home</a>
      <a id="about-link" href="#about">About</a>
    </nav>

    <div id="content"></div>

    <script>
      const routes = {
        '#home': '<h1>Home</h1><p>Welcome to the Home page!</p>',
        '#about':
          '<h1>About</h1><p style="height: 2000px;">Learn more about us here</p>'
      }

      function loadContent() {
        const hash = window.location.hash || '#home'
        const content = routes[hash]
        document.getElementById('content').innerHTML = content
      }

      window.addEventListener('hashchange', loadContent)
      window.addEventListener('DOMContentLoaded', loadContent)
    </script>
  </body>
</html>