Skip to content

Commit aace99e

Browse files
committed
first design
1 parent 482de07 commit aace99e

2 files changed

Lines changed: 90 additions & 12 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<script lang="ts">
2+
import { Card, Layout, Typography, Icon, Alert } from '@appwrite.io/pink-svelte';
3+
import { IconDeviceMobile, IconDesktopComputer } from '@appwrite.io/pink-icons-svelte';
4+
import { isSmallViewport } from '$lib/stores/viewport';
5+
</script>
6+
7+
{#if $isSmallViewport}
8+
<div class="mobile-studio-scrim">
9+
<div class="mobile-studio-modal">
10+
<Card.Base variant="secondary" padding="l" radius="l">
11+
<Layout.Stack gap="l" alignItems="center" justifyContent="center">
12+
<Icon icon={IconDesktopComputer} size="l" color="--fgcolor-neutral-primary" />
13+
<Layout.Stack gap="m" alignItems="center">
14+
<Typography.Title size="l" align="center">
15+
This experience needs a larger screen
16+
</Typography.Title>
17+
<Typography.Text align="center" color="--fgcolor-neutral-secondary">
18+
We're working on making Imagine Studio fully responsive for mobile
19+
devices. For the best experience, please use Imagine Studio on a desktop
20+
or tablet with a larger screen.
21+
</Typography.Text>
22+
</Layout.Stack>
23+
<div class="studio-alert-wrapper">
24+
<Alert.Inline status="info" title="Quick tip">
25+
<svelte:fragment slot="icon">
26+
<Icon icon={IconDeviceMobile} size="m" />
27+
</svelte:fragment>
28+
You can use desktop mode in your mobile's browser to access Studio
29+
</Alert.Inline>
30+
</div>
31+
</Layout.Stack>
32+
</Card.Base>
33+
</div>
34+
</div>
35+
{/if}
36+
37+
<style>
38+
.mobile-studio-scrim {
39+
position: fixed;
40+
top: 0;
41+
left: 0;
42+
width: 100%;
43+
height: 100%;
44+
background-color: hsl(240 5% 8% / 0.6);
45+
backdrop-filter: blur(4px);
46+
display: flex;
47+
align-items: center;
48+
justify-content: center;
49+
z-index: 9999;
50+
padding: var(--space-6, 12px);
51+
}
52+
53+
.mobile-studio-modal {
54+
width: 100%;
55+
max-width: 480px;
56+
}
57+
58+
.studio-alert-wrapper {
59+
margin-block-start: var(--space-2, 4px);
60+
width: 100%;
61+
}
62+
63+
/* Prevent background scroll when mobile message is shown */
64+
:global(html:has(.mobile-studio-scrim)) {
65+
height: 100%;
66+
overflow: hidden !important;
67+
}
68+
</style>

src/routes/(console)/project-[region]-[project]/(studio)/studio/+page.svelte

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import { getPageTitle } from '../../store';
1010
import { resolvedProfile } from '$lib/profiles/index.svelte';
1111
import type { PageProps } from './$types';
12+
import { isSmallViewport } from '$lib/stores/viewport';
13+
import MobileMessage from '$lib/studio/mobileMessage.svelte';
1214
1315
let { params, data }: PageProps = $props();
1416
let anchor: HTMLElement = $state();
@@ -19,32 +21,40 @@
1921
}
2022
2123
onMount(async () => {
22-
ensureStudioComponent();
23-
await tick();
24-
positionStudio();
25-
navigateToRoute({
26-
id: 'project',
27-
props: {
28-
projectId: params.project,
29-
region: params.region
30-
}
31-
});
24+
if (!$isSmallViewport) {
25+
ensureStudioComponent();
26+
await tick();
27+
positionStudio();
28+
navigateToRoute({
29+
id: 'project',
30+
props: {
31+
projectId: params.project,
32+
region: params.region
33+
}
34+
});
35+
}
3236
});
3337
3438
onDestroy(() => {
3539
hideStudio();
3640
});
3741
3842
$effect(() => {
39-
positionStudio();
43+
if (!$isSmallViewport && anchor) {
44+
positionStudio();
45+
}
4046
});
4147
</script>
4248

4349
<svelte:head>
4450
<title>{getPageTitle(data.project.name, 'Studio', resolvedProfile.platform)}</title>
4551
</svelte:head>
4652

47-
<div class="studio-page" bind:this={anchor}></div>
53+
{#if $isSmallViewport}
54+
<MobileMessage />
55+
{:else}
56+
<div class="studio-page" bind:this={anchor}></div>
57+
{/if}
4858

4959
<style>
5060
.studio-page {

0 commit comments

Comments
 (0)