volunteers/app/views/layouts/_mobile_menu.haml

43 lines
2.7 KiB
Plaintext
Raw Normal View History

2023-06-03 17:09:23 +02:00
#mobile-menu.absolute.top-0.leaving-0.w-full.hidden.z-10
2022-12-22 15:45:55 +01:00
.p-5.bg-white.border.rounded.shadow-sm
.flex.items-center.justify-between.mb-4
%div
%a.inline-flex.items-center{"aria-label" => "Hub Feenix", :href => "/", :title => "Hub Feenix"}
2023-01-12 21:09:15 +01:00
= image_tag("feenix_lintu.webp" , class: "h-20")
2022-12-22 15:45:55 +01:00
%span.ml-2.text-xl.font-bold.tracking-wide.text-gray-800.uppercase Hub Feenix
%div
%button.p-2.-mt-2.-mr-2.transition.duration-200.rounded.hover:bg-gray-200.focus:bg-gray-200.focus:outline-none.focus:shadow-outline{"aria-label" => "Close Menu", :title => "Close Menu" , onclick: "menu_off();"}
%svg.w-5.text-gray-600{:viewbox => "0 0 24 24"}
%path{:d => "M19.7,4.3c-0.4-0.4-1-0.4-1.4,0L12,10.6L5.7,4.3c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l6.3,6.3l-6.3,6.3 c-0.4,0.4-0.4,1,0,1.4C4.5,19.9,4.7,20,5,20s0.5-0.1,0.7-0.3l6.3-6.3l6.3,6.3c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3 c0.4-0.4,0.4-1,0-1.4L13.4,12l6.3-6.3C20.1,5.3,20.1,4.7,19.7,4.3z", :fill => "currentColor"}
%nav
2023-01-21 22:34:57 +01:00
%ul.space-y-6.px-20.w-lg.text-center
- main_menu.each do |link , text|
2022-12-22 15:45:55 +01:00
%li
2023-01-21 22:34:57 +01:00
%a.w-full.h-full.block.tracking-wide.text-xl.p-2.rounded-lg.hover:bg-cyan-200{ :href => link , :title => text}
= text
%li
%hr
- mobile_menu.each do |link , text|
%li
%a.w-full.h-full.block.tracking-wide.text-xl.p-2.rounded-lg.hover:bg-cyan-200{ :href => link , :title => text}
= text
2023-01-23 11:22:57 +01:00
-if(current_member)
= form_tag( main_app.destroy_member_session_path , {method: :delete ,class: "text-center"}) do
%button.w-full.items-center.gap-2.rounded-lg.px-4.py-2.text-sm.text-blue-700.hover:bg-red-50{:role => "menuitem", :type => "submit"}
%svg.h-4.w-4{:fill => "none", :stroke => "currentColor", "stroke-width" => "2", :viewbox => "0 0 24 24", :xmlns => "http://www.w3.org/2000/svg"}
%path{:d => "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16", "stroke-linecap" => "round", "stroke-linejoin" => "round"}
Sign out
-else
%a.inline-flex.items-center.justify-center.h-12.px-6.font-medium.tracking-wide.text-white.transition.duration-200.rounded-lg.shadow-md.bg-green-800.hover:bg-blue-800.focus:shadow-outline.focus:outline-none{"aria-label" => "Sign up", :href => main_app.member_session_path, :title => "Log in or Sign up"}
Login
2022-12-22 15:45:55 +01:00
:javascript
var drop_hidden = true;
function menu_on() {
var x = document.getElementById("mobile-menu");
x.style.display = "block";
}
function menu_off() {
var x = document.getElementById("mobile-menu");
x.style.display = "none";
}