mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 07:55:52 +01:00
🎨 Made opacity change app background
Made the opacity slider change the individual app background and border rgba values instead of the entire app.
This commit is contained in:
@@ -1,4 +1,13 @@
|
|||||||
import { Text, Card, Anchor, AspectRatio, Image, Center, createStyles } from '@mantine/core';
|
import {
|
||||||
|
Text,
|
||||||
|
Card,
|
||||||
|
Anchor,
|
||||||
|
AspectRatio,
|
||||||
|
Image,
|
||||||
|
Center,
|
||||||
|
createStyles,
|
||||||
|
useMantineColorScheme,
|
||||||
|
} from '@mantine/core';
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { useSortable } from '@dnd-kit/sortable';
|
import { useSortable } from '@dnd-kit/sortable';
|
||||||
@@ -26,10 +35,8 @@ export function SortableAppShelfItem(props: any) {
|
|||||||
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({
|
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({
|
||||||
id: props.id,
|
id: props.id,
|
||||||
});
|
});
|
||||||
const { config } = useConfig();
|
|
||||||
|
|
||||||
const style = {
|
const style = {
|
||||||
opacity: `${config.settings.appOpacity || 100}%`,
|
|
||||||
transform: CSS.Transform.toString(transform),
|
transform: CSS.Transform.toString(transform),
|
||||||
transition,
|
transition,
|
||||||
};
|
};
|
||||||
@@ -44,6 +51,8 @@ export function SortableAppShelfItem(props: any) {
|
|||||||
export function AppShelfItem(props: any) {
|
export function AppShelfItem(props: any) {
|
||||||
const { service }: { service: serviceItem } = props;
|
const { service }: { service: serviceItem } = props;
|
||||||
const [hovering, setHovering] = useState(false);
|
const [hovering, setHovering] = useState(false);
|
||||||
|
const { config } = useConfig();
|
||||||
|
const { colorScheme } = useMantineColorScheme();
|
||||||
const { classes } = useStyles();
|
const { classes } = useStyles();
|
||||||
return (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
@@ -60,7 +69,18 @@ export function AppShelfItem(props: any) {
|
|||||||
setHovering(false);
|
setHovering(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Card withBorder radius="lg" shadow="md" className={classes.item}>
|
<Card
|
||||||
|
withBorder
|
||||||
|
radius="lg"
|
||||||
|
shadow="md"
|
||||||
|
className={classes.item}
|
||||||
|
style={{
|
||||||
|
background: `rgba(${colorScheme === 'dark' ? '37, 38, 43,' : '255, 255, 255,'} \
|
||||||
|
${(config.settings.appOpacity || 100) / 100}`,
|
||||||
|
borderColor: `rgba(${colorScheme === 'dark' ? '37, 38, 43,' : '233, 236, 239,'} \
|
||||||
|
${(config.settings.appOpacity || 100) / 100}`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Card.Section>
|
<Card.Section>
|
||||||
<Anchor
|
<Anchor
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|||||||
Reference in New Issue
Block a user