From 59a41b208714fc3c1e31f4b8b8a31f14500bcfb4 Mon Sep 17 00:00:00 2001
From: Felix Eckhofer <felix@eckhofer.com>
Date: Sun, 29 Dec 2024 15:20:48 +0100
Subject: [PATCH] Make navigation fixed except on mobile

---
 app/views/conferences/show.html.erb    | 2 +-
 app/views/layouts/application.html.erb | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/views/conferences/show.html.erb b/app/views/conferences/show.html.erb
index 6b1d442..673127b 100644
--- a/app/views/conferences/show.html.erb
+++ b/app/views/conferences/show.html.erb
@@ -131,7 +131,7 @@ current_time = Time.zone.now.in_time_zone(@conference.time_zone)
         sessions = @sessions_by_date_and_stage[date][stage]
       %>
           <div class="stage">
-            <h4 class="sticky top-0 bg-white bg-opacity-70 w-full z-30"><%= stage.name %></h4>
+            <h4 class="sticky md:top-16 top-0 bg-white bg-opacity-70 w-full z-30"><%= stage.name %></h4>
             <div class="stage-sessions">
               <% sessions.each do |session| %>
                 <div class="session-holder hover:z-30 h-full" style="
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 2524e4f..7a482d3 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -12,7 +12,7 @@
   </head>
 
   <body <%= tag.attributes(body_data_attributes) %>>
-  <nav class="bg-slate-100 text-gray-700 shadow relative" data-controller="navigation">
+  <nav class="bg-slate-100 text-gray-700 shadow w-full relative md:fixed z-50" data-controller="navigation">
     <div class="relative bg-slate-100 z-50 container mx-auto px-4 py-4 flex justify-between items-center">
       <div class="flex items-center space-x-4">
         <div class="text-xl font-bold text-black"><%= link_to 're:scheduled', '/', class: "!no-underline" %></div>
@@ -63,7 +63,7 @@
 
 
     <%= render partial: 'shared/flash' %>
-    <main class="container mx-auto mt-8 px-5 flex pb-4">
+    <main class="container mx-auto mt-8 px-5 flex pb-4 md:mt-24">
       <%= yield %>
     </main>
   </body>
-- 
GitLab