managarten/memoro/apps/mobile/components/statistics/GlassCard.tsx
Till-JS e7f5f942f3 chore: initial commit - consolidate 4 projects into monorepo
Projects included:
- maerchenzauber (NestJS backend + Expo mobile + SvelteKit web + Astro landing)
- manacore (Expo mobile + SvelteKit web + Astro landing)
- manadeck (NestJS backend + Expo mobile + SvelteKit web)
- memoro (Expo mobile + SvelteKit web + Astro landing)

This commit preserves the current state before monorepo restructuring.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:38:24 +01:00

78 lines
1.8 KiB
TypeScript

import React from 'react';
import { View, StyleSheet, ViewStyle } from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
import { useTheme } from '~/features/theme/ThemeProvider';
interface GlassCardProps {
children: React.ReactNode;
style?: ViewStyle;
width?: number | string;
}
/**
* Glass morphism card component with blur effect and transparency
*/
const GlassCard: React.FC<GlassCardProps> = ({ children, style, width = '100%' }) => {
const { isDark } = useTheme();
// Glass effect colors
const glassBackground = isDark
? 'rgba(255, 255, 255, 0.08)'
: 'rgba(255, 255, 255, 0.7)';
const borderColor = isDark
? 'rgba(255, 255, 255, 0.15)'
: 'rgba(255, 255, 255, 0.3)';
const gradientColors = isDark
? ['rgba(255, 255, 255, 0.1)', 'rgba(255, 255, 255, 0.05)']
: ['rgba(255, 255, 255, 0.8)', 'rgba(255, 255, 255, 0.6)'];
return (
<View style={[styles.container, { width }, style]}>
<LinearGradient
colors={gradientColors}
start={{ x: 0, y: 0 }}
end={{ x: 1, y: 1 }}
style={styles.gradient}
>
<View
style={[
styles.innerContainer,
{
backgroundColor: glassBackground,
borderColor: borderColor,
},
]}
>
{children}
</View>
</LinearGradient>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
borderRadius: 24,
overflow: 'hidden',
shadowColor: '#000',
shadowOffset: { width: 0, height: 8 },
shadowOpacity: 0.15,
shadowRadius: 20,
elevation: 8,
},
gradient: {
flex: 1,
borderRadius: 24,
},
innerContainer: {
flex: 1,
borderRadius: 24,
borderWidth: 1,
padding: 24,
},
});
export default GlassCard;