fix mobile css issues
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -2,10 +2,9 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, viewport-fit=cover"
|
||||
/>
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title>{{block "title" .}}RideAware{{end}}</title>
|
||||
|
||||
<!-- Icons/Fonts -->
|
||||
@@ -29,19 +28,13 @@
|
||||
sizes="32x32"
|
||||
href="/static/assets/32x32.png"
|
||||
/>
|
||||
<link
|
||||
rel="alternate icon"
|
||||
type="image/png"
|
||||
sizes="32x32"
|
||||
href="/static/assets/32x32.png"
|
||||
/>
|
||||
<link
|
||||
rel="apple-touch-icon"
|
||||
sizes="180x180"
|
||||
href="/static/assets/apple-touch-icon.png"
|
||||
/>
|
||||
<link rel="manifest" href="/static/assets/site.webmanifest" />
|
||||
<meta name="theme-color" content="#0f172a" />
|
||||
<meta name="theme-color" content="#1e4e9c" />
|
||||
|
||||
{{block "extra_head" .}}{{end}}
|
||||
</head>
|
||||
@@ -53,8 +46,8 @@
|
||||
src="/static/assets/logo.png"
|
||||
alt="RideAware"
|
||||
class="logo-img"
|
||||
width="140"
|
||||
height="28"
|
||||
width="120"
|
||||
height="24"
|
||||
decoding="async"
|
||||
fetchpriority="high"
|
||||
/>
|
||||
@@ -70,7 +63,7 @@
|
||||
<button
|
||||
class="nav-toggle"
|
||||
id="nav-toggle"
|
||||
aria-label="Toggle navigation"
|
||||
aria-label="Toggle navigation menu"
|
||||
aria-controls="primary-nav"
|
||||
aria-expanded="false"
|
||||
>
|
||||
@@ -100,40 +93,36 @@
|
||||
</footer>
|
||||
|
||||
<!-- Core JS -->
|
||||
<script
|
||||
defer
|
||||
src="https://cdn.statically.io/gl/rideaware/landing/06d19988c7df53636277f945f9ed853bda76471b/static/js/main.min.js"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
<script defer src="/static/js/main.min.js" crossorigin="anonymous"></script>
|
||||
|
||||
{{block "extra_scripts" .}}
|
||||
<script>
|
||||
(function() {
|
||||
const btn = document.getElementById("nav-toggle");
|
||||
const menu = document.getElementById("primary-nav");
|
||||
const btn = document.getElementById('nav-toggle');
|
||||
const menu = document.getElementById('primary-nav');
|
||||
if (!btn || !menu) return;
|
||||
|
||||
function closeMenu() {
|
||||
btn.classList.remove("active");
|
||||
btn.setAttribute("aria-expanded", "false");
|
||||
menu.classList.remove("open");
|
||||
btn.classList.remove('active');
|
||||
btn.setAttribute('aria-expanded', 'false');
|
||||
menu.classList.remove('open');
|
||||
}
|
||||
|
||||
btn.addEventListener("click", () => {
|
||||
const open = btn.classList.toggle("active");
|
||||
btn.setAttribute("aria-expanded", String(open));
|
||||
menu.classList.toggle("open", open);
|
||||
btn.addEventListener('click', () => {
|
||||
const isOpen = btn.classList.toggle('active');
|
||||
btn.setAttribute('aria-expanded', String(isOpen));
|
||||
menu.classList.toggle('open', isOpen);
|
||||
});
|
||||
|
||||
menu.addEventListener("click", (e) => {
|
||||
if (e.target.tagName === "A") closeMenu();
|
||||
menu.addEventListener('click', (e) => {
|
||||
if (e.target.tagName === 'A') closeMenu();
|
||||
});
|
||||
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if (e.key === "Escape") closeMenu();
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Escape') closeMenu();
|
||||
});
|
||||
|
||||
document.addEventListener("click", (e) => {
|
||||
document.addEventListener('click', (e) => {
|
||||
if (!menu.contains(e.target) && !btn.contains(e.target)) {
|
||||
closeMenu();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user