website
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
customElements.define(
  "back-button",
  class extends HTMLElement {
    constructor() {
      super();
    }
    connectedCallback() {
      this.innerHTML = `
<style>
  .back_button {
    position: fixed;
    margin: 15px;
    z-index: 100;
  }
</style>

<button class="button back_button" onclick="goBack()">
  <i class="fa-solid fa-caret-left"></i> back
</button>`;
    }
  }
);

function goBack() {
  if (typeof window.history.back() == "undefined")
    window.location = "/index.html";
}