2021-04-10 05:40:50 +02:00
< template >
2023-05-17 05:31:13 +02:00
< div
class = "dkgtipfy"
: class = "{ wallpaper, isMobile, centered: ui === 'classic' }"
>
2023-06-12 20:59:54 +02:00
< XSidebar v-if = "!isMobile" / >
2023-04-08 02:01:42 +02:00
< MkStickyContainer class = "contents" >
< template # header
> < XStatusBars :class = "$style.statusbars"
/ > < / t e m p l a t e >
< main
id = "maincontent"
style = "min-width: 0"
: style = "{ background: pageMetadata?.value?.bg }"
@ contextmenu . stop = "onContextmenu"
>
2023-05-25 01:33:59 +02:00
< RouterView / >
2023-04-08 02:01:42 +02:00
< / main >
< / MkStickyContainer >
2023-06-08 20:16:00 +02:00
< div v-if = "isDesktop" ref="widgetsEl" class="widgets-container" >
2023-06-09 05:30:14 +02:00
< XWidgets @mounted ="attachSticky" / >
2023-04-08 02:01:42 +02:00
< / div >
< button
v - if = "!isDesktop && !isMobile"
2023-09-17 23:59:09 +02:00
v - vibrate = "5"
2023-04-08 02:01:42 +02:00
class = "widgetButton _button"
@ click = "widgetsShowing = true"
>
2023-10-17 03:57:20 +02:00
< i :class = "icon('ph-stack')" > < / i >
2023-01-04 02:01:11 +01:00
< / button >
2023-04-08 02:01:42 +02:00
< div v-if = "isMobile" class="buttons" >
< button
2023-09-17 23:59:09 +02:00
v - vibrate = "5"
2023-05-22 17:23:00 +02:00
: aria - label = "i18n.t('menu')"
2023-04-08 02:01:42 +02:00
class = "button nav _button"
@ click = "drawerMenuShowing = true"
>
< div class = "button-wrapper" >
2023-10-17 03:57:20 +02:00
< i :class = "icon('ph-list')" > < / i
2023-06-28 04:25:01 +02:00
> < span
v - if = "menuIndicated"
class = "indicator"
2023-10-17 03:57:20 +02:00
: class = " {
animateIndicator : defaultStore . state . animation ,
} "
2023-04-08 02:01:42 +02:00
> < i class = "ph-circle ph-fill" > < / i
> < / span >
< / div >
< / button >
< button
2023-09-17 23:59:09 +02:00
v - vibrate = "5"
2023-05-22 17:23:00 +02:00
: aria - label = "i18n.t('home')"
2023-04-08 02:01:42 +02:00
class = "button home _button"
@ click = "
mainRouter . currentRoute . value . name === 'index'
? top ( )
: mainRouter . push ( '/' ) ;
updateButtonState ( ) ;
"
>
< div
class = "button-wrapper"
: class = "buttonAnimIndex === 0 ? 'on' : ''"
>
2023-10-17 03:57:20 +02:00
< i :class = "icon('ph-house')" > < / i >
2023-04-08 02:01:42 +02:00
< / div >
< / button >
< button
2023-09-17 23:59:09 +02:00
v - vibrate = "5"
2023-05-22 17:23:00 +02:00
: aria - label = "i18n.t('notifications')"
2023-04-08 02:01:42 +02:00
class = "button notifications _button"
@ click = "
mainRouter . push ( '/my/notifications' ) ;
updateButtonState ( ) ;
"
>
< div
2023-09-17 23:59:09 +02:00
v - vibrate = "5"
2023-04-08 02:01:42 +02:00
class = "button-wrapper"
: class = "buttonAnimIndex === 1 ? 'on' : ''"
>
2023-10-17 03:57:20 +02:00
< i :class = "icon('ph-bell')" > < / i
2023-06-28 04:25:01 +02:00
> < span
v - if = "$i?.hasUnreadNotification"
class = "indicator"
2023-10-17 03:57:20 +02:00
: class = " {
animateIndicator : defaultStore . state . animation ,
} "
2023-04-08 02:01:42 +02:00
> < i class = "ph-circle ph-fill" > < / i
> < / span >
< / div >
< / button >
< button
2024-02-15 05:35:26 +01:00
v - if = "replaceChatButtonWithAccountButton"
: aria - label = "i18n.t('accounts')"
class = "button messaging _button"
@ click = "openAccountMenu"
>
< div class = "button-wrapper" >
< i class = "ph-users ph-bold ph-lg" > < / i >
< / div >
< / button >
< button
v - else
2023-09-17 23:59:09 +02:00
v - vibrate = "5"
2023-05-22 17:23:00 +02:00
: aria - label = "i18n.t('messaging')"
2023-04-08 02:01:42 +02:00
class = "button messaging _button"
@ click = "
mainRouter . push ( '/my/messaging' ) ;
updateButtonState ( ) ;
"
>
< div
class = "button-wrapper"
: class = "buttonAnimIndex === 2 ? 'on' : ''"
>
2023-10-17 03:57:20 +02:00
< i :class = "icon('ph-chats-teardrop')" > < / i
2023-04-08 02:01:42 +02:00
> < span
v - if = "$i?.hasUnreadMessagingMessage"
class = "indicator"
2023-10-17 03:57:20 +02:00
: class = " {
animateIndicator : defaultStore . state . animation ,
} "
2023-04-08 02:01:42 +02:00
> < i class = "ph-circle ph-fill" > < / i
> < / span >
< / div >
< / button >
< button
2023-09-17 23:59:09 +02:00
v - vibrate = "5"
2023-05-22 17:23:00 +02:00
: aria - label = "i18n.t('_deck._columns.widgets')"
2023-04-08 02:01:42 +02:00
class = "button widget _button"
@ click = "widgetsShowing = true"
>
< div class = "button-wrapper" >
2023-10-17 03:57:20 +02:00
< i :class = "icon('ph-stack')" > < / i >
2023-04-08 02:01:42 +02:00
< / div >
< / button >
< / div >
< button
v - if = "isMobile && mainRouter.currentRoute.value.name === 'index'"
ref = "postButton"
2023-10-22 10:44:32 +02:00
v - vibrate = "5"
2023-05-21 23:02:22 +02:00
: aria - label = "i18n.t('note')"
2023-04-08 02:01:42 +02:00
class = "postButton button post _button"
@ click = "os.post()"
>
2023-10-17 03:57:20 +02:00
< i :class = "icon('ph-pencil')" > < / i >
2023-01-04 02:01:11 +01:00
< / button >
2023-04-08 02:01:42 +02:00
< button
v - if = "
isMobile && mainRouter . currentRoute . value . name === 'messaging'
"
ref = "postButton"
class = "postButton button post _button"
2023-05-21 23:02:22 +02:00
: aria - label = "i18n.t('startMessaging')"
2023-04-08 02:01:42 +02:00
@ click = "messagingStart"
>
2023-10-17 03:57:20 +02:00
< i :class = "icon('ph-user-plus')" > < / i >
2023-01-04 02:01:11 +01:00
< / button >
2021-04-10 05:40:50 +02:00
2023-10-17 03:57:20 +02:00
< transition
: name = "defaultStore.state.animation ? 'menuDrawer-back' : ''"
>
2023-04-08 02:01:42 +02:00
< div
v - if = "drawerMenuShowing"
class = "menuDrawer-back _modalBg"
@ click = "drawerMenuShowing = false"
@ touchstart . passive = "drawerMenuShowing = false"
> < / div >
< / transition >
2023-10-17 03:57:20 +02:00
< transition : name = "defaultStore.state.animation ? 'menuDrawer' : ''" >
2023-04-08 02:01:42 +02:00
< XDrawerMenu v-if = "drawerMenuShowing" class="menuDrawer" / >
< / transition >
2023-10-17 03:57:20 +02:00
< transition
: name = "defaultStore.state.animation ? 'widgetsDrawer-back' : ''"
>
2023-04-08 02:01:42 +02:00
< div
v - if = "widgetsShowing"
class = "widgetsDrawer-back _modalBg"
@ click = "widgetsShowing = false"
@ touchstart . passive = "widgetsShowing = false"
> < / div >
< / transition >
2023-10-17 03:57:20 +02:00
< transition : name = "defaultStore.state.animation ? 'widgetsDrawer' : ''" >
2023-04-08 02:01:42 +02:00
< XWidgets v-if = "widgetsShowing" class="widgetsDrawer" / >
< / transition >
< XCommon / >
< / div >
2021-04-10 05:40:50 +02:00
< / template >
2022-02-01 15:48:19 +01:00
< script lang = "ts" setup >
2023-07-17 00:32:32 +02:00
import { computed , defineAsyncComponent , onMounted , provide , ref } from "vue" ;
2024-02-12 16:40:46 +01:00
import { acct } from "firefish-js" ;
2023-04-08 02:01:42 +02:00
import type { ComputedRef } from "vue" ;
2023-07-17 00:32:32 +02:00
import XCommon from "./_common_/common.vue" ;
2023-04-08 02:01:42 +02:00
import type { PageMetadata } from "@/scripts/page-metadata" ;
2023-05-14 23:06:58 +02:00
import { instanceName , ui } from "@/config" ;
2023-04-08 02:01:42 +02:00
import XDrawerMenu from "@/ui/_common_/navbar-for-mobile.vue" ;
2023-05-25 01:33:59 +02:00
import XSidebar from "@/ui/_common_/navbar.vue" ;
2023-04-08 02:01:42 +02:00
import * as os from "@/os" ;
import { defaultStore } from "@/store" ;
import { navbarItemDef } from "@/navbar" ;
import { i18n } from "@/i18n" ;
2024-02-15 05:35:26 +01:00
import { openAccountMenu as openAccountMenuImpl } from "@/account" ;
2023-10-22 23:29:46 +02:00
import { $i } from "@/reactiveAccount" ;
2023-04-08 02:01:42 +02:00
import { mainRouter } from "@/router" ;
2023-10-17 03:57:20 +02:00
import { provideMetadataReceiver } from "@/scripts/page-metadata" ;
2023-04-08 02:01:42 +02:00
import { deviceKind } from "@/scripts/device-kind" ;
2023-10-17 03:57:20 +02:00
import icon from "@/scripts/icon" ;
2023-04-08 02:01:42 +02:00
const XWidgets = defineAsyncComponent ( ( ) => import ( "./universal.widgets.vue" ) ) ;
const XStatusBars = defineAsyncComponent (
2023-07-06 03:28:27 +02:00
( ) => import ( "@/ui/_common_/statusbars.vue" ) ,
2023-04-08 02:01:42 +02:00
) ;
2021-04-10 05:40:50 +02:00
const DESKTOP _THRESHOLD = 1100 ;
2021-12-03 14:09:40 +01:00
const MOBILE _THRESHOLD = 500 ;
2021-04-10 05:40:50 +02:00
2022-07-24 11:44:50 +02:00
// デスクトップでウィンドウを狭くしたときモバイルUIが表示されて欲しいことはあるので deviceKind === 'desktop' の判定は行わない
2022-02-01 15:48:19 +01:00
const isDesktop = ref ( window . innerWidth >= DESKTOP _THRESHOLD ) ;
2023-04-08 02:01:42 +02:00
const isMobile = ref (
2023-07-06 03:28:27 +02:00
deviceKind === "smartphone" || window . innerWidth <= MOBILE _THRESHOLD ,
2023-04-08 02:01:42 +02:00
) ;
window . addEventListener ( "resize" , ( ) => {
isMobile . value =
deviceKind === "smartphone" || window . innerWidth <= MOBILE _THRESHOLD ;
2022-02-01 15:48:19 +01:00
} ) ;
2024-02-15 05:35:26 +01:00
const replaceChatButtonWithAccountButton =
defaultStore . state . replaceChatButtonWithAccountButton ;
const openAccountMenu = ( ev : MouseEvent ) => {
openAccountMenuImpl (
{
withExtraOperation : true ,
} ,
ev ,
isMobile . value ,
) ;
} ;
2022-11-07 21:09:30 +01:00
const buttonAnimIndex = ref ( 0 ) ;
const drawerMenuShowing = ref ( false ) ;
2022-11-07 08:49:08 +01:00
2023-09-02 01:27:33 +02:00
const pageMetadata = ref < null | ComputedRef < PageMetadata > > ( ) ;
2023-08-12 02:44:46 +02:00
const widgetsEl = ref < HTMLElement > ( ) ;
const postButton = ref < HTMLElement > ( ) ;
const widgetsShowing = ref ( false ) ;
2022-06-20 10:38:49 +02:00
2023-04-08 02:01:42 +02:00
provide ( "router" , mainRouter ) ;
2022-06-20 10:38:49 +02:00
provideMetadataReceiver ( ( info ) => {
2023-08-12 02:44:46 +02:00
pageMetadata . value = info ;
if ( pageMetadata . value . value ) {
document . title = ` ${ pageMetadata . value . value . title } | ${ instanceName } ` ;
2022-06-20 10:38:49 +02:00
}
} ) ;
2022-02-01 15:48:19 +01:00
const menuIndicated = computed ( ( ) => {
2022-07-14 10:42:12 +02:00
for ( const def in navbarItemDef ) {
2023-09-17 23:59:09 +02:00
if ( def === "notifications" || def === "messaging" ) continue ; // Notifications & Messaging are bottom nav buttons and thus shouldn't be highlighted in the sidebar
2022-07-14 10:42:12 +02:00
if ( navbarItemDef [ def ] . indicated ) return true ;
2022-02-01 15:48:19 +01:00
}
return false ;
} ) ;
2022-11-07 21:46:05 +01:00
function updateButtonState ( ) : void {
2023-07-17 00:32:32 +02:00
const routerState = window . location . pathname ;
2023-04-08 02:01:42 +02:00
if ( routerState === "/" ) {
2022-11-07 21:46:05 +01:00
buttonAnimIndex . value = 0 ;
return ;
}
2023-04-08 02:01:42 +02:00
if ( routerState . includes ( "/my/notifications" ) ) {
2022-11-07 21:46:05 +01:00
buttonAnimIndex . value = 1 ;
return ;
}
2023-04-08 02:01:42 +02:00
if ( routerState . includes ( "/my/messaging" ) ) {
2022-11-07 21:46:05 +01:00
buttonAnimIndex . value = 2 ;
return ;
}
buttonAnimIndex . value = 3 ;
}
updateButtonState ( ) ;
2023-04-08 02:01:42 +02:00
mainRouter . on ( "change" , ( ) => {
2022-11-07 21:46:05 +01:00
drawerMenuShowing . value = false ;
updateButtonState ( ) ;
} ) ;
2022-02-01 15:48:19 +01:00
if ( defaultStore . state . widgets . length === 0 ) {
2023-04-08 02:01:42 +02:00
defaultStore . set ( "widgets" , [
{
name : "calendar" ,
id : "a" ,
place : "right" ,
data : { } ,
} ,
{
name : "notifications" ,
id : "b" ,
place : "right" ,
data : { } ,
} ,
{
name : "trends" ,
id : "c" ,
place : "right" ,
data : { } ,
} ,
] ) ;
2022-02-01 15:48:19 +01:00
}
2023-03-24 07:51:59 +01:00
function messagingStart ( ev ) {
2023-04-08 02:01:42 +02:00
os . popupMenu (
[
{
text : i18n . ts . messagingWithUser ,
2023-10-17 03:57:20 +02:00
icon : ` ${ icon ( "ph-user" ) } ` ,
2023-04-08 02:01:42 +02:00
action : ( ) => {
startUser ( ) ;
} ,
} ,
{
text : i18n . ts . messagingWithGroup ,
2023-10-17 03:57:20 +02:00
icon : ` ${ icon ( "ph-users-three" ) } ` ,
2023-04-08 02:01:42 +02:00
action : ( ) => {
startGroup ( ) ;
} ,
} ,
{
text : i18n . ts . manageGroups ,
2023-10-17 03:57:20 +02:00
icon : ` ${ icon ( "ph-user-circle-gear" ) } ` ,
2023-04-08 02:01:42 +02:00
action : ( ) => {
mainRouter . push ( "/my/groups" ) ;
} ,
} ,
] ,
2023-07-06 03:28:27 +02:00
ev . currentTarget ? ? ev . target ,
2023-04-08 02:01:42 +02:00
) ;
2023-03-24 07:51:59 +01:00
}
async function startUser ( ) : void {
2023-04-08 02:01:42 +02:00
os . selectUser ( ) . then ( ( user ) => {
2024-02-12 16:40:46 +01:00
mainRouter . push ( ` /my/messaging/ ${ acct . toString ( user ) } ` ) ;
2023-03-24 07:51:59 +01:00
} ) ;
}
async function startGroup ( ) : void {
2023-04-08 02:01:42 +02:00
const groups1 = await os . api ( "users/groups/owned" ) ;
const groups2 = await os . api ( "users/groups/joined" ) ;
2023-03-24 07:51:59 +01:00
if ( groups1 . length === 0 && groups2 . length === 0 ) {
os . alert ( {
2023-04-08 02:01:42 +02:00
type : "warning" ,
2023-03-24 07:51:59 +01:00
title : i18n . ts . youHaveNoGroups ,
text : i18n . ts . joinOrCreateGroup ,
} ) ;
return ;
}
const { canceled , result : group } = await os . select ( {
title : i18n . ts . group ,
2023-04-08 02:01:42 +02:00
items : groups1 . concat ( groups2 ) . map ( ( group ) => ( {
value : group ,
text : group . name ,
2023-03-24 07:51:59 +01:00
} ) ) ,
} ) ;
if ( canceled ) return ;
2023-03-24 08:34:13 +01:00
mainRouter . push ( ` /my/messaging/group/ ${ group . id } ` ) ;
2023-03-24 07:51:59 +01:00
}
2022-02-01 15:48:19 +01:00
onMounted ( ( ) => {
if ( ! isDesktop . value ) {
2023-06-12 22:20:30 +02:00
matchMedia ( ` (min-width: ${ DESKTOP _THRESHOLD - 1 } px) ` ) . onchange = (
2023-07-06 03:28:27 +02:00
mql ,
2023-06-12 22:20:30 +02:00
) => {
if ( mql . matches ) isDesktop . value = true ;
} ;
2022-02-01 15:48:19 +01:00
}
} ) ;
2022-08-19 02:23:32 +02:00
const onContextmenu = ( ev : MouseEvent ) => {
2022-02-01 15:48:19 +01:00
const isLink = ( el : HTMLElement ) => {
2023-04-08 02:01:42 +02:00
if ( el . tagName === "A" ) return true ;
2022-02-01 15:48:19 +01:00
if ( el . parentElement ) {
return isLink ( el . parentElement ) ;
}
} ;
if ( isLink ( ev . target ) ) return ;
2023-04-08 02:01:42 +02:00
if (
[ "INPUT" , "TEXTAREA" , "IMG" , "VIDEO" , "CANVAS" ] . includes (
2023-07-06 03:28:27 +02:00
ev . target . tagName ,
2023-04-08 02:01:42 +02:00
) ||
2023-07-17 00:32:32 +02:00
ev . target . attributes . contenteditable
2023-04-08 02:01:42 +02:00
)
return ;
if ( window . getSelection ( ) ? . toString ( ) !== "" ) return ;
2022-06-20 10:38:49 +02:00
const path = mainRouter . getCurrentPath ( ) ;
2023-04-08 02:01:42 +02:00
os . contextMenu (
[
{
type : "label" ,
text : path ,
} ,
{
2023-10-17 03:57:20 +02:00
icon : ` ${ icon ( "ph-browser" ) } ` ,
2023-04-08 02:01:42 +02:00
text : i18n . ts . openInWindow ,
action : ( ) => {
os . pageWindow ( path ) ;
} ,
} ,
] ,
2023-07-06 03:28:27 +02:00
ev ,
2023-04-08 02:01:42 +02:00
) ;
2022-02-01 15:48:19 +01:00
} ;
2023-06-09 05:30:14 +02:00
const attachSticky = ( el : any ) => {
2023-06-10 22:49:07 +02:00
let lastScrollTop = 0 ;
2023-06-11 00:33:39 +02:00
addEventListener (
"scroll" ,
2023-06-12 20:59:54 +02:00
( ) => {
2023-06-11 00:33:39 +02:00
requestAnimationFrame ( ( ) => {
2023-08-12 02:44:46 +02:00
widgetsEl . value . scrollTop += window . scrollY - lastScrollTop ;
2023-06-12 20:59:54 +02:00
lastScrollTop = window . scrollY ;
2023-06-11 00:33:39 +02:00
} ) ;
} ,
2023-07-06 03:28:27 +02:00
{ passive : true } ,
2023-06-11 00:33:39 +02:00
) ;
2023-08-12 02:44:46 +02:00
widgetsEl . value . classList . add ( "hide-scrollbar" ) ;
widgetsEl . value . onmouseenter = ( ) => {
2023-06-12 20:59:54 +02:00
if ( document . documentElement . scrollHeight <= window . innerHeight ) {
2023-08-12 02:44:46 +02:00
widgetsEl . value . classList . remove ( "hide-scrollbar" ) ;
2023-06-12 20:59:54 +02:00
} else {
2023-08-12 02:44:46 +02:00
widgetsEl . value . classList . add ( "hide-scrollbar" ) ;
2023-06-12 20:59:54 +02:00
}
2023-06-12 22:20:30 +02:00
} ;
2023-06-09 05:30:14 +02:00
} ;
2022-02-01 15:48:19 +01:00
function top ( ) {
2023-04-08 02:01:42 +02:00
window . scroll ( { top : 0 , behavior : "smooth" } ) ;
2022-02-01 15:48:19 +01:00
}
2021-04-10 05:40:50 +02:00
2023-04-08 02:01:42 +02:00
const wallpaper = localStorage . getItem ( "wallpaper" ) != null ;
2023-03-24 07:59:42 +01:00
console . log ( mainRouter . currentRoute . value . name ) ;
2021-04-10 05:40:50 +02:00
< / script >
< style lang = "scss" scoped >
2021-12-03 14:09:40 +01:00
. widgetsDrawer - enter - active ,
. widgetsDrawer - leave - active {
2021-04-10 05:40:50 +02:00
opacity : 1 ;
transform : translateX ( 0 ) ;
2023-07-06 03:28:27 +02:00
transition :
transform 300 ms cubic - bezier ( 0.23 , 1 , 0.32 , 1 ) ,
2023-04-08 02:01:42 +02:00
opacity 300 ms cubic - bezier ( 0.23 , 1 , 0.32 , 1 ) ;
2021-04-10 05:40:50 +02:00
}
2021-12-03 14:09:40 +01:00
. widgetsDrawer - enter - from ,
. widgetsDrawer - leave - active {
2021-04-10 05:40:50 +02:00
opacity : 0 ;
transform : translateX ( 240 px ) ;
}
2021-12-03 14:09:40 +01:00
. widgetsDrawer - back - enter - active ,
. widgetsDrawer - back - leave - active {
2021-04-10 05:40:50 +02:00
opacity : 1 ;
transition : opacity 300 ms cubic - bezier ( 0.23 , 1 , 0.32 , 1 ) ;
}
2021-12-03 14:09:40 +01:00
. widgetsDrawer - back - enter - from ,
. widgetsDrawer - back - leave - active {
2021-04-10 05:40:50 +02:00
opacity : 0 ;
}
2021-12-03 14:09:40 +01:00
. menuDrawer - enter - active ,
. menuDrawer - leave - active {
opacity : 1 ;
transform : translateX ( 0 ) ;
2023-07-06 03:28:27 +02:00
transition :
transform 300 ms cubic - bezier ( 0.23 , 1 , 0.32 , 1 ) ,
2023-04-08 02:01:42 +02:00
opacity 300 ms cubic - bezier ( 0.23 , 1 , 0.32 , 1 ) ;
2021-12-03 14:09:40 +01:00
}
. menuDrawer - enter - from ,
. menuDrawer - leave - active {
opacity : 0 ;
transform : translateX ( - 240 px ) ;
}
. menuDrawer - back - enter - active ,
. menuDrawer - back - leave - active {
opacity : 1 ;
transition : opacity 300 ms cubic - bezier ( 0.23 , 1 , 0.32 , 1 ) ;
}
. menuDrawer - back - enter - from ,
. menuDrawer - back - leave - active {
opacity : 0 ;
}
. dkgtipfy {
2021-04-10 05:40:50 +02:00
$ui - font - size : 1 em ; // TODO: どこかに集約したい
$widgets - hide - threshold : 1090 px ;
// ほんとは単に 100vh と書きたいところだが... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
2023-06-09 05:30:14 +02:00
min - height : calc ( var ( -- vh , 1 vh ) * 100 ) ;
2021-04-10 05:40:50 +02:00
box - sizing : border - box ;
display : flex ;
2023-04-02 23:39:25 +02:00
-- stickyBottom : 1 em ;
& . isMobile {
-- stickyBottom : 6 rem ;
}
2023-05-25 01:33:59 +02:00
& : not ( . isMobile ) {
> . contents {
2023-05-26 04:47:10 +02:00
border - right : 0.5 px solid var ( -- divider ) ;
2023-05-25 01:33:59 +02:00
}
}
2021-04-10 05:40:50 +02:00
& . wallpaper {
background : var ( -- wallpaperOverlay ) ;
2023-06-17 04:54:01 +02:00
: deep ( . sidebar . middle ) {
position : relative ;
& : : before {
content : "" ;
position : absolute ;
inset : - 10 px 10 px ;
background : var ( -- bg ) ;
border - radius : calc ( ( 2.85 rem / 2 ) + 5 px ) ;
opacity : 1 ;
2023-07-09 06:32:55 +02:00
z - index : - 3 ;
2023-06-17 04:54:01 +02:00
}
> . _button : last - child {
margin - bottom : 0 ! important ;
}
}
2023-05-14 23:06:58 +02:00
}
& . centered {
justify - content : center ;
2023-05-14 23:21:28 +02:00
& : not ( . isMobile ) {
-- navBg : transparent ;
2023-05-25 01:33:59 +02:00
> . contents {
2023-05-26 04:47:10 +02:00
border - inline : 0.5 px solid var ( -- divider ) ;
2023-05-25 01:33:59 +02:00
margin - inline : - 1 px ;
}
2023-05-14 23:21:28 +02:00
}
2023-05-14 23:06:58 +02:00
> : deep ( . sidebar : not ( . iconOnly ) ) {
margin - left : - 200 px ;
padding - left : 200 px ;
box - sizing : content - box ;
. banner {
pointer - events : none ;
2023-05-15 01:10:59 +02:00
top : - 20 % ! important ;
2023-05-14 23:06:58 +02:00
mask : radial - gradient (
farthest - side at top ,
hsl ( 0 , 0 % , 0 % ) 0 % ,
hsla ( 0 , 0 % , 0 % , 0.987 ) 0.3 % ,
hsla ( 0 , 0 % , 0 % , 0.951 ) 1.4 % ,
hsla ( 0 , 0 % , 0 % , 0.896 ) 3.2 % ,
hsla ( 0 , 0 % , 0 % , 0.825 ) 5.8 % ,
hsla ( 0 , 0 % , 0 % , 0.741 ) 9.3 % ,
hsla ( 0 , 0 % , 0 % , 0.648 ) 13.6 % ,
hsla ( 0 , 0 % , 0 % , 0.55 ) 18.9 % ,
hsla ( 0 , 0 % , 0 % , 0.45 ) 25.1 % ,
hsla ( 0 , 0 % , 0 % , 0.352 ) 32.4 % ,
hsla ( 0 , 0 % , 0 % , 0.259 ) 40.7 % ,
hsla ( 0 , 0 % , 0 % , 0.175 ) 50.2 % ,
hsla ( 0 , 0 % , 0 % , 0.104 ) 60.8 % ,
hsla ( 0 , 0 % , 0 % , 0.049 ) 72.6 % ,
hsla ( 0 , 0 % , 0 % , 0.013 ) 85.7 % ,
hsla ( 0 , 0 % , 0 % , 0 ) 100 %
) ! important ;
- webkit - mask : radial - gradient (
farthest - side at top ,
hsl ( 0 , 0 % , 0 % ) 0 % ,
hsla ( 0 , 0 % , 0 % , 0.987 ) 0.3 % ,
hsla ( 0 , 0 % , 0 % , 0.951 ) 1.4 % ,
hsla ( 0 , 0 % , 0 % , 0.896 ) 3.2 % ,
hsla ( 0 , 0 % , 0 % , 0.825 ) 5.8 % ,
hsla ( 0 , 0 % , 0 % , 0.741 ) 9.3 % ,
hsla ( 0 , 0 % , 0 % , 0.648 ) 13.6 % ,
hsla ( 0 , 0 % , 0 % , 0.55 ) 18.9 % ,
hsla ( 0 , 0 % , 0 % , 0.45 ) 25.1 % ,
hsla ( 0 , 0 % , 0 % , 0.352 ) 32.4 % ,
hsla ( 0 , 0 % , 0 % , 0.259 ) 40.7 % ,
hsla ( 0 , 0 % , 0 % , 0.175 ) 50.2 % ,
hsla ( 0 , 0 % , 0 % , 0.104 ) 60.8 % ,
hsla ( 0 , 0 % , 0 % , 0.049 ) 72.6 % ,
hsla ( 0 , 0 % , 0 % , 0.013 ) 85.7 % ,
hsla ( 0 , 0 % , 0 % , 0 ) 100 %
) ! important ;
width : 125 % ! important ;
left : - 12.5 % ! important ;
2023-05-15 01:10:59 +02:00
height : 145 % ! important ;
2023-05-14 23:06:58 +02:00
}
}
> . contents {
min - width : 0 ;
width : 750 px ;
background : var ( -- panel ) ;
border - radius : 0 ;
2023-06-08 20:16:00 +02:00
overflow : clip ;
2023-05-14 23:06:58 +02:00
-- margin : 12 px ;
background : var ( -- bg ) ;
}
& . wallpaper {
. contents {
background : var ( -- acrylicBg ) ! important ;
2023-06-17 04:54:01 +02:00
backdrop - filter : var ( -- blur , blur ( 12 px ) ) ;
2023-05-14 23:06:58 +02:00
}
: deep ( . tl ) ,
: deep ( . notes ) {
2023-05-16 04:05:43 +02:00
background : none ;
2023-05-14 23:06:58 +02:00
}
}
2021-04-10 05:40:50 +02:00
}
> . contents {
width : 100 % ;
min - width : 0 ;
2023-05-25 01:33:59 +02:00
$widgets - hide - threshold : 1090 px ;
2023-06-19 18:21:46 +02:00
overflow - x : clip ;
2023-05-25 01:33:59 +02:00
@ media ( max - width : $widgets - hide - threshold ) {
padding - bottom : calc ( env ( safe - area - inset - bottom , 0 px ) + 96 px ) ;
}
2021-04-10 05:40:50 +02:00
}
2023-06-08 20:16:00 +02:00
> . widgets - container {
2023-06-10 22:49:07 +02:00
position : sticky ;
top : 0 ;
max - height : 100 vh ;
overflow - y : auto ;
2023-06-09 05:30:14 +02:00
padding : 0 var ( -- margin ) ;
width : 300 px ;
2023-06-10 22:49:07 +02:00
min - width : max - content ;
2023-05-25 01:33:59 +02:00
box - sizing : content - box ;
2021-04-10 05:40:50 +02:00
@ media ( max - width : $widgets - hide - threshold ) {
display : none ;
}
}
2021-12-03 14:09:40 +01:00
> . widgetsDrawer - back {
z - index : 1001 ;
}
> . widgetsDrawer {
position : fixed ;
top : 0 ;
right : 0 ;
z - index : 1001 ;
// ほんとは単に 100vh と書きたいところだが... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
height : calc ( var ( -- vh , 1 vh ) * 100 ) ;
padding : var ( -- margin ) ;
box - sizing : border - box ;
overflow : auto ;
2021-12-03 14:22:08 +01:00
overscroll - behavior : contain ;
2021-12-03 14:09:40 +01:00
background : var ( -- bg ) ;
2021-04-10 05:40:50 +02:00
}
2023-04-08 02:01:42 +02:00
> . postButton ,
. widgetButton {
2023-04-02 23:39:25 +02:00
bottom : var ( -- stickyBottom ) ;
2022-08-19 01:48:22 +02:00
right : 1.5 rem ;
2022-09-15 23:47:39 +02:00
height : 4 rem ;
width : 4 rem ;
2022-08-19 02:05:30 +02:00
background - position : center ;
2022-08-19 01:48:22 +02:00
background : var ( -- panelHighlight ) ;
2022-08-19 02:05:30 +02:00
color : var ( -- fg ) ;
2022-08-19 01:48:22 +02:00
position : fixed ! important ;
z - index : 1000 ;
font - size : 16 px ;
border - radius : 10 px ;
box - shadow : var ( -- shadow ) 0 px 0 px 25 px ;
2022-08-19 02:05:30 +02:00
transition : background 0.6 s ;
2022-08-19 02:23:32 +02:00
transition : transform 0.3 s ;
> . isHidden {
transform : scale ( 0 ) ;
}
> . isVisible {
transform : scale ( 1 ) ;
}
2022-08-19 02:05:30 +02:00
& : active {
background - color : var ( -- accentedBg ) ;
background - size : 100 % ;
transition : background 0.1 s ;
}
2022-08-19 01:48:22 +02:00
}
2021-04-10 05:40:50 +02:00
> . buttons {
position : fixed ;
z - index : 1000 ;
bottom : 0 ;
2021-12-03 14:09:40 +01:00
left : 0 ;
2022-08-16 03:43:17 +02:00
padding : 12 px 12 px calc ( env ( safe - area - inset - bottom , 0 px ) + 12 px ) 12 px ;
2021-04-10 05:40:50 +02:00
display : flex ;
width : 100 % ;
box - sizing : border - box ;
2022-08-16 03:43:17 +02:00
background - color : var ( -- bg ) ;
2021-04-10 05:40:50 +02:00
> . button {
position : relative ;
flex : 1 ;
padding : 0 ;
margin : auto ;
2022-08-20 08:50:00 +02:00
height : 3.5 rem ;
2021-04-10 05:40:50 +02:00
border - radius : 8 px ;
2022-08-16 09:00:36 +02:00
background - position : center ;
transition : background 0.6 s ;
2021-04-10 05:40:50 +02:00
color : var ( -- fg ) ;
2022-08-16 09:00:36 +02:00
& : active {
background - color : var ( -- accentedBg ) ;
background - size : 100 % ;
2022-08-16 09:08:37 +02:00
transition : background 0.1 s ;
2022-08-16 09:00:36 +02:00
}
2022-11-07 20:57:27 +01:00
> . button - wrapper {
2023-03-19 08:12:24 +01:00
display : inline - flex ;
justify - content : center ;
2022-11-23 06:47:34 +01:00
2022-11-07 21:46:05 +01:00
& . on {
2022-11-07 21:41:47 +01:00
background - color : var ( -- accentedBg ) ;
width : 100 % ;
border - radius : 999 px ;
transform : translateY ( - 0.5 em ) ;
2022-11-08 02:05:27 +01:00
transition : all 0.2 s ease - in - out ;
2022-11-07 21:41:47 +01:00
}
2022-11-07 20:57:27 +01:00
> . indicator {
position : absolute ;
top : 0 ;
left : 0 ;
color : var ( -- indicator ) ;
font - size : 16 px ;
2023-06-28 04:25:01 +02:00
}
> . animateIndicator {
2022-11-07 20:57:27 +01:00
animation : blink 1 s infinite ;
}
}
2021-04-10 05:40:50 +02:00
& : not ( : last - child ) {
margin - right : 12 px ;
}
@ media ( max - width : 400 px ) {
height : 60 px ;
& : not ( : last - child ) {
margin - right : 8 px ;
}
}
2021-04-20 16:22:59 +02:00
> . indicator {
2021-04-10 05:40:50 +02:00
position : absolute ;
top : 0 ;
left : 0 ;
color : var ( -- indicator ) ;
font - size : 16 px ;
2023-06-28 04:25:01 +02:00
}
> . animateIndicator {
2021-04-10 05:40:50 +02:00
animation : blink 1 s infinite ;
}
& : first - child {
margin - left : 0 ;
}
& : last - child {
margin - right : 0 ;
}
> * {
2022-08-16 03:43:17 +02:00
font - size : 16 px ;
2021-04-10 05:40:50 +02:00
}
& : disabled {
cursor : default ;
> * {
opacity : 0.5 ;
}
}
}
}
2021-12-03 14:09:40 +01:00
> . menuDrawer - back {
2021-04-10 05:40:50 +02:00
z - index : 1001 ;
}
2021-12-03 14:09:40 +01:00
> . menuDrawer {
2021-04-10 05:40:50 +02:00
position : fixed ;
top : 0 ;
2021-12-03 14:09:40 +01:00
left : 0 ;
2021-04-10 05:40:50 +02:00
z - index : 1001 ;
// ほんとは単に 100vh と書きたいところだが... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
height : calc ( var ( -- vh , 1 vh ) * 100 ) ;
2021-12-03 14:09:40 +01:00
width : 240 px ;
2021-04-10 05:40:50 +02:00
box - sizing : border - box ;
2022-07-15 15:09:05 +02:00
contain : strict ;
2021-04-10 05:40:50 +02:00
overflow : auto ;
2021-12-03 14:22:08 +01:00
overscroll - behavior : contain ;
2022-07-15 15:09:05 +02:00
background : var ( -- navBg ) ;
2021-04-10 05:40:50 +02:00
}
}
< / style >
2022-07-03 07:40:02 +02:00
< style lang = "scss" module >
. statusbars {
position : sticky ;
top : 0 ;
left : 0 ;
}
2021-04-10 05:40:50 +02:00
< / style >