-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement options / mobile menu, dark mode fixes
- Loading branch information
Showing
12 changed files
with
162 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<script lang="ts"> | ||
import { Button } from '@/components/ui/button'; | ||
import * as Sheet from '@/components/ui/sheet'; | ||
import RiMenu3Fill from '~icons/ri/menu-3-fill'; | ||
import RiUserLine from '~icons/ri/user-line'; | ||
import RiMoneyDollarCircleFill from '~icons/ri/money-dollar-circle-fill'; | ||
import Options from '@/components/custom/Options.svelte'; | ||
</script> | ||
|
||
<Sheet.Root> | ||
<Sheet.Trigger asChild let:builder> | ||
<Button | ||
builders={[builder]} | ||
class="lg:hidden" | ||
size="icon" | ||
variant="secondary" | ||
title="Menu" | ||
aria-label="Menu" | ||
> | ||
<RiMenu3Fill class="h-6 w-6 text-black dark:text-white" /> | ||
</Button> | ||
</Sheet.Trigger> | ||
<Sheet.Content side="right"> | ||
<Sheet.Header class="mb-12"> | ||
<Sheet.Title>Options</Sheet.Title> | ||
</Sheet.Header> | ||
<hr class="absolute left-0 top-[4.5rem] w-full" /> | ||
<div class="flex flex-col gap-4"> | ||
<div class="grid grid-cols-2 gap-4"> | ||
Sign in to start curating | ||
<Button href="/account" class="max-w-min justify-self-end px-6"> | ||
<RiUserLine class="mr-2 min-h-5 min-w-5 text-white dark:text-black" /> Sign In | ||
</Button> | ||
</div> | ||
<div class="grid grid-cols-2 gap-4"> | ||
Donate to keep Mwmbl running | ||
<Button | ||
href="https://opencollective.com/mwmbl" | ||
class="max-w-min justify-self-end px-6" | ||
variant="secondary" | ||
> | ||
<RiMoneyDollarCircleFill class="mr-2 min-h-5 min-w-5 text-black dark:text-white" /> Donate | ||
</Button> | ||
</div> | ||
<hr class="my-2" /> | ||
<Options /> | ||
</div> | ||
</Sheet.Content> | ||
</Sheet.Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Popover as PopoverPrimitive } from "bits-ui"; | ||
import Content from "./popover-content.svelte"; | ||
const Root = PopoverPrimitive.Root; | ||
const Trigger = PopoverPrimitive.Trigger; | ||
const Close = PopoverPrimitive.Close; | ||
|
||
export { | ||
Root, | ||
Content, | ||
Trigger, | ||
Close, | ||
// | ||
Root as Popover, | ||
Content as PopoverContent, | ||
Trigger as PopoverTrigger, | ||
Close as PopoverClose, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts"> | ||
import { Popover as PopoverPrimitive } from 'bits-ui'; | ||
import { cn, flyAndScale } from '$lib/utils.js'; | ||
type $$Props = PopoverPrimitive.ContentProps; | ||
let className: $$Props['class'] = undefined; | ||
export let transition: $$Props['transition'] = flyAndScale; | ||
export let transitionConfig: $$Props['transitionConfig'] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<PopoverPrimitive.Content | ||
{transition} | ||
{transitionConfig} | ||
class={cn( | ||
'z-50 w-96 rounded-2xl bg-popover p-4 text-popover-foreground shadow-2xl outline-none', | ||
className | ||
)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</PopoverPrimitive.Content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { browser } from '$app/environment'; | ||
|
||
type optionObject = { | ||
openInNewTab: boolean | undefined; | ||
}; | ||
|
||
const defaults: optionObject = { | ||
openInNewTab: false | ||
}; | ||
|
||
export function localStorageOptions(): optionObject { | ||
let options: optionObject = $state(defaults); | ||
|
||
if (browser) { | ||
const value = window.localStorage.getItem('options'); | ||
if (value) options = JSON.parse(value); | ||
} | ||
|
||
$effect(() => { | ||
window.localStorage.setItem('options', JSON.stringify(options)); | ||
}); | ||
|
||
return options; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.