diff --git a/src/components/home/FeaturedContent.tsx b/src/components/home/FeaturedContent.tsx index 8a6dc27..c6687f9 100644 --- a/src/components/home/FeaturedContent.tsx +++ b/src/components/home/FeaturedContent.tsx @@ -45,6 +45,9 @@ const imageCache: Record = {}; const { width, height } = Dimensions.get('window'); +// Utility to determine if device is tablet-sized +const isTablet = width >= 768; + const NoFeaturedContent = () => { const navigation = useNavigation>(); const { currentTheme } = useTheme(); @@ -447,131 +450,279 @@ const FeaturedContent = ({ featuredContent, isSaved, handleSaveToLibrary }: Feat return ; } - return ( - - { - navigation.navigate('Metadata', { - id: featuredContent.id, - type: featuredContent.type - }); - }} - style={styles.featuredContainer as ViewStyle} + if (isTablet) { + // Tablet layout: full-width image with overlaid content + return ( + - - - {/* Subtle content overlay for better readability */} - - - { + navigation.navigate('Metadata', { + id: featuredContent.id, + type: featuredContent.type + }); + }} + style={styles.tabletFullContainer as ViewStyle} + > + + - - {logoUrl && !logoLoadError ? ( - - - - ) : ( - - {featuredContent.name} - + + + + + + + + {logoUrl && !logoLoadError ? ( + + + + ) : ( + + {featuredContent.name} + + )} + + + {featuredContent.genres?.slice(0, 4).map((genre, index, array) => ( + + + {genre} + + {index < array.length - 1 && ( + )} - - {featuredContent.genres?.slice(0, 3).map((genre, index, array) => ( - - - {genre} - - {index < array.length - 1 && ( - - )} - - ))} - - + + ))} + - - - - - {isSaved ? "Saved" : "Save"} - - + {featuredContent.description && ( + + {featuredContent.description} + + )} - { - if (featuredContent) { - navigation.navigate('Streams', { - id: featuredContent.id, - type: featuredContent.type - }); - } - }} - activeOpacity={0.8} - > - - - Play - - + + { + if (featuredContent) { + navigation.navigate('Streams', { + id: featuredContent.id, + type: featuredContent.type + }); + } + }} + activeOpacity={0.8} + > + + + Play Now + + - - - - Info - - - - - + + + + {isSaved ? "Saved" : "My List"} + + + + + + + More Info + + + - - - ); + + {/* Bottom fade to blend with background */} + + + ); + } else { + // Phone layout: original vertical stack + return ( + + { + navigation.navigate('Metadata', { + id: featuredContent.id, + type: featuredContent.type + }); + }} + style={styles.featuredContainer as ViewStyle} + > + + + + + + {logoUrl && !logoLoadError ? ( + + + + ) : ( + + {featuredContent.name} + + )} + + {featuredContent.genres?.slice(0, 3).map((genre, index, array) => ( + + + {genre} + + {index < array.length - 1 && ( + + )} + + ))} + + + + + + + + {isSaved ? "Saved" : "Save"} + + + + { + if (featuredContent) { + navigation.navigate('Streams', { + id: featuredContent.id, + type: featuredContent.type + }); + } + }} + activeOpacity={0.8} + > + + + Play + + + + + + + Info + + + + + + + + + {/* Bottom fade to blend with background */} + + + ); + } }; const styles = StyleSheet.create({ featuredContainer: { width: '100%', - height: height * 0.55, // Slightly taller for better proportions + height: height * 0.55, marginTop: 0, marginBottom: 12, position: 'relative', @@ -622,10 +773,12 @@ const styles = StyleSheet.create({ paddingTop: 40, }, featuredLogo: { - width: width * 0.7, - height: 100, + width: width * 0.8, + height: 120, marginBottom: 0, alignSelf: 'center', + minWidth: 250, + minHeight: 80, }, featuredTitleText: { fontSize: 28, @@ -714,6 +867,158 @@ const styles = StyleSheet.create({ fontSize: 12, fontWeight: '500', }, + // Tablet-specific styles + tabletContainer: { + width: '100%', + height: height * 0.7, + position: 'relative', + marginTop: 0, + marginBottom: 12, + borderRadius: 16, + overflow: 'hidden', + elevation: 8, + shadowColor: '#000', + shadowOffset: { width: 0, height: 4 }, + shadowOpacity: 0.3, + shadowRadius: 8, + }, + tabletFullContainer: { + width: '100%', + height: '100%', + position: 'absolute', + top: 0, + left: 0, + }, + tabletImageWrapper: { + width: '100%', + height: '100%', + }, + tabletImage: { + width: '100%', + height: '100%', + transform: [{ scale: 1.02 }], + }, + tabletImageGradient: { + position: 'absolute', + top: 0, + left: 0, + right: 0, + bottom: 0, + }, + tabletOverlayContent: { + position: 'absolute', + bottom: 0, + left: 0, + right: 0, + padding: 40, + paddingBottom: 50, + alignItems: 'center', + zIndex: 10, + }, + tabletBottomFade: { + position: 'absolute', + bottom: 0, + left: 0, + right: 0, + height: 40, + zIndex: 11, + pointerEvents: 'none', + }, + phoneBottomFade: { + position: 'absolute', + bottom: 0, + left: 0, + right: 0, + height: 30, + zIndex: 11, + pointerEvents: 'none', + }, + tabletLogo: { + width: width * 0.32, + height: 120, + marginBottom: 16, + alignSelf: 'center', + minWidth: 200, + minHeight: 80, + }, + tabletTitle: { + fontSize: 36, + fontWeight: '900', + marginBottom: 16, + textShadowColor: 'rgba(0,0,0,0.8)', + textShadowOffset: { width: 0, height: 2 }, + textShadowRadius: 4, + lineHeight: 42, + }, + tabletGenreContainer: { + flexDirection: 'row', + flexWrap: 'wrap', + marginBottom: 24, + alignItems: 'center', + justifyContent: 'center', + }, + tabletGenreText: { + fontSize: 16, + fontWeight: '500', + opacity: 0.9, + marginRight: 8, + }, + tabletGenreDot: { + fontSize: 16, + fontWeight: '500', + opacity: 0.6, + marginRight: 8, + }, + tabletDescription: { + fontSize: 16, + lineHeight: 24, + opacity: 0.85, + marginBottom: 28, + textShadowColor: 'rgba(0,0,0,0.8)', + textShadowOffset: { width: 0, height: 1 }, + textShadowRadius: 2, + }, + tabletButtons: { + flexDirection: 'row', + gap: 16, + width: '100%', + justifyContent: 'center', + alignItems: 'center', + }, + tabletPlayButton: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + paddingVertical: 14, + paddingHorizontal: 28, + borderRadius: 30, + elevation: 4, + shadowColor: '#000', + shadowOffset: { width: 0, height: 2 }, + shadowOpacity: 0.3, + shadowRadius: 4, + minWidth: 160, + }, + tabletPlayButtonText: { + fontWeight: '700', + marginLeft: 12, + fontSize: 18, + }, + tabletSecondaryButton: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + paddingVertical: 12, + paddingHorizontal: 20, + borderRadius: 25, + borderWidth: 1, + gap: 6, + minWidth: 120, + }, + tabletSecondaryButtonText: { + fontWeight: '600', + fontSize: 16, + }, contentOverlay: { position: 'absolute', top: 0,