diff --git a/app/views/conferences/show.html.erb b/app/views/conferences/show.html.erb index e453ec52794b8913446540ac3ae1c295d029b862..f5c4bf360e6886d0ca8306e6dea45356139b8c4d 100644 --- a/app/views/conferences/show.html.erb +++ b/app/views/conferences/show.html.erb @@ -9,6 +9,9 @@ current_time = Time.zone.now.in_time_zone(@conference.time_zone) %> <%= turbo_stream_from @conference %> <div> + <div> + <a href="#now" onclick="document.querySelector('#now').scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'nearest' }); return false" class="underline text-blue-500">Jump to current time</a> + </div> <h1 class="text-2xl font-bold my-2"><%= @conference.name %></h1> <p class="text-xs mb-6"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="inline-block size-4 stroke-slate-500"> @@ -88,8 +91,10 @@ current_time = Time.zone.now.in_time_zone(@conference.time_zone) currentTimeDiv.style.top = `${topPosition}px`; currentTimeDiv.style.display = 'block'; + currentTimeDiv.id = 'now'; } else { currentTimeDiv.style.display = 'none'; + currentTimeDiv.removeAttribute('id'); } }