From 95093eee278b7deee7f0fef7556dd710f4a747e9 Mon Sep 17 00:00:00 2001
From: elukjanovica <elukjanovica.e@rkg.lv>
Date: Fri, 19 Apr 2024 22:03:43 +0300
Subject: [PATCH]

---
 static/css/main.css    |  27 +++++++++++++++++++++++++++
 static/images/bird.gif | Bin 0 -> 1413 bytes
 static/js/main.js      |  29 +++++++++++++++++++++++++++++
 templates/base.html    |  11 +++++++++--
 templates/index.html   |   5 +++--
 5 files changed, 68 insertions(+), 4 deletions(-)
 create mode 100644 static/images/bird.gif

diff --git a/static/css/main.css b/static/css/main.css
index beed3e3..62f7aae 100644
--- a/static/css/main.css
+++ b/static/css/main.css
@@ -396,4 +396,31 @@ i.far.fa-comment {
 
 .post h2 {
     margin-top: 20px;
+}
+
+/* Tooltip */
+.gif-container {
+    position: relative;
+    display: inline-block;
+}
+
+.tooltiptext {
+    visibility: hidden;
+    width: 170px;
+    background-color: #333;
+    color: #fff;
+    text-align: center;
+    border-radius: 5px;
+    padding: 5px 0;
+    position: absolute;
+    z-index: 1;
+    left: 30px;
+    margin-left: 12px;
+    opacity: 0;
+    transition: opacity 0.3s;
+}
+
+.gif-container:hover .tooltiptext {
+    visibility: visible;
+    opacity: 1;
 }
\ No newline at end of file
diff --git a/static/images/bird.gif b/static/images/bird.gif
new file mode 100644
index 0000000000000000000000000000000000000000..03ba1cca80391bc1e58a3b3bb3687b045de0f781
GIT binary patch
literal 1413
zcmZ?wbh9u|lw*)%C}&_${Lk&@8WQa67~pE8XTZ$J02KPk!pa4tb$}SCNRFWi#PDol
zEjh;4dRuPxJ<DZRwjI9=6l0#tvFpyi53QcrdltNENYzNt@RK#}%y670?6_q4s@S*P
z$E5exF0__x6HPhJ{FBKcaq+V(p&9;N=U%o%*)%)8nsHW3cJdpuTe3CNT}8H6n=N(C
z)>jvjZom2Y;cj=c=P#?>YI8G`rBYk++C)3*6RepgPMX-s?J{}tRIc(VE<qA=nC8u|
za`)1nCCRv~enp>L%R1Tc{@LqQGq&xp+9l43>5~SKPZ$`OWLo-Ho_@=}c+Qqv-J9?2
z`OV+<$Ya{G&SkGoZOdk)sy1L)G0DMgyCkp%)wXxs#jI4dkG{SGri#JmJI-O6c=2Y#
zJs%CWd4}#;nDwFS|AWoGvKd{AMFm<Sr`-6qL9gay1jDBO#0695ygSVOqoG$aJ2J(~
z#4D}%rwS_@bGTr)Yt+W5L(SG7)Y=~!UO%I;bp2}{k=$Fy3ibNu)}9mpR#YJ`ky4Xe
z(o$Y5!PMK=+s0?v-#<|+VuF)^X4cGEjUry5GDXvtxO!+TTimWSXZFIS3p5=!ZBbse
Td3*Xg=|PbV>6|SH7BSWUril`l

literal 0
HcmV?d00001

diff --git a/static/js/main.js b/static/js/main.js
index e69de29..89ed756 100644
--- a/static/js/main.js
+++ b/static/js/main.js
@@ -0,0 +1,29 @@
+document.addEventListener("DOMContentLoaded", function() {
+    var gif = document.querySelector(".clickable");
+  
+    var notification = document.getElementById("copyNotification");
+  
+    gif.addEventListener("mouseenter", function() {
+      notification.textContent = "Get link to game";
+      notification.style.visibility = "visible";
+    });
+  
+    gif.addEventListener("click", function() {
+      var gameUrl = "https://gitea.rkg.lv/elukjanovica/Picture-Puzzle-website.git";
+  
+      navigator.clipboard.writeText(gameUrl).then(function() {
+        notification.textContent = "Link copied!";
+        
+        setTimeout(function() {
+          notification.textContent = "Get link to game";
+        }, 2000);
+      }, function() {
+        console.error("Failed to copy link.");
+      });
+    });
+  
+    gif.addEventListener("mouseleave", function() {
+      notification.style.visibility = "hidden";
+    });
+  });
+  
\ No newline at end of file
diff --git a/templates/base.html b/templates/base.html
index db5eaf8..5276eea 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -9,7 +9,13 @@
 </head>
 <body>
     <nav>
-        <a href="{{ url_for('index') }}"><img src="{{ url_for('static', filename='images/Picture-Puzzle-logo.png') }}" alt="Picture Puzzle website logo"></a>
+        <div class="logo-container">
+            <a href="{{ url_for('index') }}"><img src="{{ url_for('static', filename='images/Picture-Puzzle-logo.png') }}" alt="Picture Puzzle website logo"></a>
+            <div class="gif-container">
+                <img src="{{ url_for('static', filename='images/bird.gif') }}" class="clickable" aria-label="Copy game link">
+                <span class="tooltiptext" id="copyNotification">Get link to game</span>
+            </div>
+        </div>
         <ul>
             <li><a class="link" href="{{ url_for('all_posts') }}">Posts</a></li>
             <li><a class="link" href="#">About</a></li>
@@ -56,5 +62,6 @@
         </ul>
         <p>&copy; 2024 Picture Puzzle. All rights reserved.</p>
     </footer>
+<script src="{{ url_for('static', filename='js/main.js') }}"></script>
 </body>
-</html>
+</html>
\ No newline at end of file
diff --git a/templates/index.html b/templates/index.html
index d35546f..12854f7 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -46,11 +46,12 @@
     </section>
     
     <section class="trending-topics">
-        <h2>Trending Topics</h2>
+    </br></br><h2>Main Topics</h2>
         <div class="topics">
             <i class="far fa-comment fa-lg"></i><a href="#"> Instalation</a></br>
             <i class="far fa-comment fa-lg"></i><a href="#"> How to play</a></br>
-            <i class="far fa-comment fa-lg"></i><a href="#"> Known issues</a></br>
+            <i class="far fa-comment fa-lg"></i><a href="#"> Game settings</a></br>
+            <i class="far fa-comment fa-lg"></i><a href="#"> Export/import</a></br></br></br>
         </div>
     </section>