aboutsummaryrefslogtreecommitdiff
path: root/templates/shared/core/base.html
blob: 1e4ffdfa7c6ae2885fa5a504c157628c0581ffe9 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{% load static %}
<!DOCTYPE html>
<html lang="{{ request.LANGUAGE_CODE }}">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="title" content="Shifoo - {{ request.meta.title }}" />
    <meta name="description" content="{{ request.meta.description }}" />
    <meta name="image" content="{{ request.meta.image }}" />
    <meta name="url" content="{{ request.meta.url }}" />
    <meta property="og:title" content="Shifoo - {{ request.meta.title }}" />
    <meta property="og:description" content="{{ request.meta.description }}" />
    <meta property="og:image" content="{{ request.meta.image }}" />
    <meta property="og:url" content="{{ request.meta.url }}" />
    <meta property="robots" content="{{ request.meta.robots }}" />
    {% block title %}

    {% endblock %}
    <link rel="apple-touch-icon" sizes="180x180" href="{% static 'images/favicons/apple-touch-icon.png' %}" />
    <link rel="icon" type="image/png" sizes="32x32" href="{% static 'images/favicons/favicon-32x32.png' %}" />
    <link rel="icon" type="image/png" sizes="16x16" href="{% static 'images/favicons/favicon-16x16.png' %}" />
    <link rel="manifest" href="{% static 'images/favicons/site.webmanifest' %}" />
    <link type="text/css" rel="stylesheet" href="{% static 'css/shared/core.css' %}" />
    {% block head %}

    {% endblock %}
  </head>
  <body>
    <video autoplay muted loop id="video-background" preload="auto">
      <source src="{% static 'videos/background_.mp4' %}" type="video/mp4" />
    </video>
    <img src="{% static 'images/core/img/pngegg.png' %}" id="spaceship" />
    <div id="video-overlay"></div>
    <div id="body-wrapper">
      {% include 'partials/_header.html' %}
      <div id="content-wrapper">
        <div id="left-sidebar" style="{% if user.is_authenticated %}border-top-left-radius: 0px;{% endif %}">
          {% include 'partials/_left_sidebar.html' %}
        </div>
        <div id="main-content">
          {% block content %}

          {% endblock %}
        </div>
        <div id="right-sidebar">
          {% include 'partials/_right_sidebar.html' %}
        </div>
      </div>
      <div id="footer">
        {% include 'partials/_footer.html' %}
      </div>
    </div>
    <div id="scanlines"></div>
  </body>
  {% block scripts %}

  {% endblock %}
  <script src="{% static 'js/libs/pamphlet.js' %}"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/MotionPathPlugin.min.js"></script>
  <script type="text/javascript">
    new Pamphlet()
    const animationPlayed = sessionStorage.getItem('animationPlayed')
    document.addEventListener('DOMContentLoaded', function () {
      // Move all calculations inside the DOMContentLoaded event
      const spaceship = document.getElementById('spaceship')
      const leftSidebar = document.getElementById('left-sidebar')
      const sidebarRect = leftSidebar.getBoundingClientRect()
      const sidebarLeft = sidebarRect.left
      const sidebarTop = sidebarRect.top
      const initialX = Math.min(200, sidebarLeft - 100)
    
      if (animationPlayed) {
        // Set final position of spaceship
        gsap.set(spaceship, { x: sidebarLeft + 100, y: -200, rotation: -10 })
        return
      }
    
      gsap.registerPlugin(MotionPathPlugin)
    
      gsap.to(spaceship, {
        duration: 120,
        motionPath: {
          path: [
            { x: initialX, y: -50 },
            { x: sidebarLeft, y: -100 },
            { x: sidebarLeft + 100, y: -200 }
          ],
          curviness: 1.5
        },
        ease: 'power2.inOut',
        rotation: -10,
        onComplete: () => {
          // Set animation played flag
          sessionStorage.setItem('animationPlayed', true)
        }
      })
    })
  </script>
</html>