style: revert notification margins

This commit is contained in:
Youwen Wu 2024-02-26 13:17:24 -08:00
parent f05a32d0d5
commit 27876c1aae
2 changed files with 11 additions and 47 deletions

View file

@ -145,13 +145,11 @@
<ContactShadows scale={10} blur={2} far={2.5} opacity={0.5} />
<Float floatIntensity={1} floatingRange={[0, 0.5]}>
<Hornet
position.y={1.7}
position.z={robotPos.z}
position.x={robotPos.x}
scale={[0.8, 0.8, 0.8]}
bind:ref={capsule}
rotation.y={rot}
/>
</Float>
<Hornet
position.y={2}
position.z={robotPos.z}
position.x={robotPos.x}
scale={[0.8, 0.8, 0.8]}
bind:ref={capsule}
rotation.y={rot}
/>

View file

@ -25,41 +25,7 @@ export class Notifications {
const sendToast = (duration: number) => {
toast.success(message, {
style:
'padding: 25px; font-size: 1.5rem; background-color: #15803d; color: #fafafa; gap: 0.5rem; user-select: none; max-width: 70vw; margin-top: 30px;',
duration,
...options,
})
}
if (options?.withAudio && options?.src) {
let sound: Howl
sound = new Howl({
src: [options.src],
preload: true,
autoplay: true,
onload: () => {
let duration = sound.duration() * 1000
sendToast(duration)
setTimeout(onComplete, duration)
},
})
} else {
sendToast(this.defaultDuration)
setTimeout(onComplete, this.defaultDuration)
}
}
public static error(message: string, options?: NotificationOptions) {
if (options?.withAudio && !options.src)
throw new Error('No audio source provided')
const onComplete = () => {
if (options?.onComplete) options.onComplete()
}
const sendToast = (duration: number) => {
toast.error(message, {
style:
'padding: 25px; width-200px; font-size: 1.5rem; background-color: #dc2626; color: #fafafa; gap: 0.5rem; user-select: none; max-width: 70vw; margin-top: 30px;',
'padding: 25px; font-size: 1.5rem; background-color: #15803d; color: #fafafa; gap: 0.5rem; user-select: none; max-width: 70vw;',
duration,
...options,
})
@ -90,7 +56,7 @@ export class Notifications {
const sendToast = (duration: number) => {
toast(message, {
style:
'padding: 25px; font-size: 1.5rem; gap: 0.5rem; user-select: none; max-width-600px; max-width: 70vw; margin-top: 30px;',
'padding: 25px; font-size: 1.5rem; gap: 0.5rem; user-select: none; max-width-600px; max-width: 70vw;',
icon: InfoIcon,
duration,
...options,
@ -121,7 +87,7 @@ export class Notifications {
const sendToast = (duration: number) => {
toast(message, {
style:
'padding: 25px; font-size: 1.5rem; background-color: #f59e0b; color: #fafafa; gap: 0.5rem; user-select: none; max-width: 70vw; margin-top: 30px;',
'padding: 25px; font-size: 1.5rem; background-color: #f59e0b; color: #fafafa; gap: 0.5rem; user-select: none; max-width: 70vw;',
icon: WarnIcon,
duration,
...options,