Skip to content

Commit a6d5b9c

Browse files
authored
Merge pull request #2670 from appwrite/fix-sidebar-in-mobile-view-and-banner-for-small-devices
fix: improve banner mobile responsiveness and remove unused sidebar calculations
2 parents 22707ba + b81c394 commit a6d5b9c

File tree

2 files changed

+30
-34
lines changed

2 files changed

+30
-34
lines changed

src/lib/components/MobileNav.svelte

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,28 @@
44
import { SOCIAL_STATS } from '$lib/constants';
55
import type { NavLink } from './MainNav.svelte';
66
import { getAppwriteDashboardUrl } from '$lib/utils/dashboard';
7-
import { Button, InlineTag, Icon } from '$lib/components/ui';
7+
import { Button } from '$lib/components/ui';
88
import { GithubStats } from '$lib/components/shared';
99
import { trackEvent } from '$lib/actions/analytics';
1010
import { browser } from '$app/environment';
11-
import { onMount } from 'svelte';
1211
1312
export let open = false;
1413
export let links: NavLink[];
1514
export let offerButton = false;
1615
17-
let bannerHeight = 0;
18-
let banner: HTMLElement | null = null;
19-
2016
afterNavigate(() => {
2117
open = false;
2218
document.body.style.overflow = '';
2319
});
24-
25-
function getBannerElement() {
26-
if (banner !== null) return banner;
27-
28-
banner = document.getElementById('top-banner');
29-
return banner;
30-
}
31-
32-
function updateBannerHeight() {
33-
if (browser) {
34-
const bannerElement = getBannerElement();
35-
bannerHeight = bannerElement ? bannerElement.getBoundingClientRect().height : 0;
36-
}
37-
}
38-
39-
onMount(updateBannerHeight);
4020
</script>
4121

4222
<svelte:window
4323
on:resize={() => {
4424
open && (open = false);
45-
updateBannerHeight();
4625
}}
4726
/>
4827

49-
<nav
50-
class="web-side-nav sticky block max-h-screen overflow-hidden lg:hidden"
51-
class:hidden={!open}
52-
style:top="calc(73px + {bannerHeight}px)"
53-
>
28+
<nav class="web-side-nav sticky block max-h-screen overflow-hidden lg:hidden" class:hidden={!open}>
5429
<div class="web-side-nav-wrapper ps-4 pe-4">
5530
<div class="flex items-center gap-2 px-4">
5631
{#if offerButton}

src/routes/(marketing)/(components)/teaser/teaser-banner.svelte

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@
103103

104104
<style>
105105
.banner-container {
106-
width: 360px;
107-
height: 110px;
106+
width: 100%;
107+
min-height: auto;
108+
max-width: 100%;
108109
}
109110
110111
@media (min-width: 640px) {
@@ -121,7 +122,7 @@
121122
122123
.banner-text-introducing {
123124
font-family: 'Neue Haas Grotesk Display Pro', Inter, sans-serif;
124-
font-size: 20px;
125+
font-size: 18px;
125126
font-style: normal;
126127
font-weight: 450;
127128
line-height: 106%;
@@ -133,6 +134,12 @@
133134
white-space: nowrap;
134135
}
135136
137+
@media (min-width: 375px) {
138+
.banner-text-introducing {
139+
font-size: 20px;
140+
}
141+
}
142+
136143
@media (min-width: 640px) {
137144
.banner-text-introducing {
138145
font-size: 18px;
@@ -148,13 +155,20 @@
148155
.banner-text-right {
149156
color: var(--primary, #e4e4e7);
150157
font-family: Inter, sans-serif;
151-
font-size: 16px;
158+
font-size: 14px;
152159
font-weight: 400;
153-
line-height: 22px;
160+
line-height: 20px;
154161
letter-spacing: -0.072px;
155162
white-space: nowrap;
156163
}
157164
165+
@media (min-width: 375px) {
166+
.banner-text-right {
167+
font-size: 16px;
168+
line-height: 22px;
169+
}
170+
}
171+
158172
@media (min-width: 640px) {
159173
.banner-text-right {
160174
font-size: 15px;
@@ -171,15 +185,22 @@
171185
172186
.logo-container {
173187
display: flex;
174-
width: 143.384px;
175-
height: 35.785px;
188+
width: 120px;
189+
height: 30px;
176190
padding: 1.348px 0.634px 1.348px 0;
177191
justify-content: center;
178192
align-items: flex-end;
179193
gap: 10.75px;
180194
flex-shrink: 0;
181195
}
182196
197+
@media (min-width: 375px) {
198+
.logo-container {
199+
width: 143.384px;
200+
height: 35.785px;
201+
}
202+
}
203+
183204
@media (min-width: 640px) {
184205
.logo-container {
185206
width: 120px;

0 commit comments

Comments
 (0)