|
42 | 42 | </head> |
43 | 43 | <body> |
44 | 44 | <script> |
45 | | - let shown = false; |
46 | | - function toggle() { |
| 45 | + let menuShown = false; |
| 46 | + function toggleMenu() { |
47 | 47 | const el = document.getElementById("menu"); |
48 | 48 | const body = document.body; |
49 | | - if (shown) { |
| 49 | + if (menuShown) { |
50 | 50 | el.style.transform = "translate(100%, 0)"; |
51 | 51 | body.style.overflow = "auto"; |
52 | | - shown = false; |
| 52 | + menuShown = false; |
53 | 53 | } else { |
54 | 54 | el.style.transform = "translate(0, 0)"; |
55 | 55 | body.style.overflow = "hidden"; |
56 | | - shown = true; |
| 56 | + menuShown = true; |
| 57 | + } |
| 58 | + } |
| 59 | + |
| 60 | + let switchOn = true; |
| 61 | + function toggleSwitch() { |
| 62 | + const el = document.getElementById("switch"); |
| 63 | + const sq = document.getElementById("switch-sq"); |
| 64 | + if (switchOn) { |
| 65 | + el.style.backgroundColor = "#FF9A9A"; |
| 66 | + sq.style.marginLeft = "0px"; |
| 67 | + switchOn = false; |
| 68 | + } else { |
| 69 | + el.style.backgroundColor = "#74DAAD"; |
| 70 | + sq.style.marginLeft = "calc(100% - 16px)"; |
| 71 | + switchOn = true; |
57 | 72 | } |
58 | 73 | } |
59 | 74 | </script> |
|
64 | 79 | class="xl:hidden flex flex-row grow items-center justify-between px-5 py-5" |
65 | 80 | > |
66 | 81 | <img src="/softpoint/assets/images/logo.svg" alt="Logo" /> |
67 | | - <button onclick="toggle()" aria-label="Open Menu"> |
| 82 | + <button onclick="toggleMenu()" aria-label="Open Menu"> |
68 | 83 | <img |
69 | 84 | src="/softpoint/assets/images/burger.svg" |
70 | 85 | alt="Menu icon" |
|
94 | 109 | <div |
95 | 110 | class="fixed top-0 right-0 left-0 bottom-0 z-3 bg-white/50 backdrop-blur-xl flex flex-col items-center justify-center gap-8 transition" |
96 | 111 | id="menu" |
97 | | - onclick="toggle()" |
| 112 | + onclick="toggleMenu()" |
98 | 113 | style="transform: translate(100%, 0)" |
99 | 114 | > |
100 | 115 | <a class="text-xl" href="#features">Features</a> |
@@ -574,9 +589,16 @@ <h2 class="mt-6 font-semibold text-xl">Clean Code</h2> |
574 | 589 | <div class="flex flex-row gap-4 mt-9"> |
575 | 590 | <p class="text-xl">Monthly</p> |
576 | 591 | <div |
577 | | - class="rounded-md bg-[#74DAAD] w-15 h-7 flex flex-row justify-end p-[6px]" |
| 592 | + class="rounded-md w-15 h-7 p-[6px] transition" |
| 593 | + style="background-color: #74daad" |
| 594 | + id="switch" |
| 595 | + onclick="toggleSwitch()" |
578 | 596 | > |
579 | | - <div class="rounded-sm w-4 h-4 bg-white"></div> |
| 597 | + <div |
| 598 | + class="rounded-sm w-4 h-4 bg-white transition-all" |
| 599 | + id="switch-sq" |
| 600 | + style="margin-left: calc(100% - 16px)" |
| 601 | + ></div> |
580 | 602 | </div> |
581 | 603 | <p class="text-xl">Quarterly</p> |
582 | 604 | </div> |
|
0 commit comments