darkvibe314 commited on
Commit
eee7aa0
·
verified ·
1 Parent(s): 4d41fd2

Create app/page.tsx

Browse files
Files changed (1) hide show
  1. app/page.tsx +42 -0
app/page.tsx ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react';
2
+
3
+ export default async function HomePage() {
4
+ // Fetch from your API
5
+ const res = await fetch('https://darkvibe314-silent-movies-api.hf.space/api/search?query=2024');
6
+ const data = await res.json();
7
+ const movies = data.results || [];
8
+ const hero = movies[0];
9
+
10
+ return (
11
+ <div style={{ backgroundColor: '#0f172a', minHeight: '100vh', color: 'white', fontFamily: 'sans-serif' }}>
12
+ {/* Navbar */}
13
+ <nav style={{ padding: '20px 40px', background: 'rgba(0,0,0,0.5)', backdropFilter: 'blur(10px)', position: 'fixed', width: '100%', zIndex: 100 }}>
14
+ <h1 style={{ color: '#e50914', fontSize: '24px', fontWeight: 'bold', margin: 0 }}>SILENT<span style={{color: 'white'}}>STREAM</span></h1>
15
+ </nav>
16
+
17
+ {/* Hero */}
18
+ {hero && (
19
+ <div style={{ height: '80vh', position: 'relative', display: 'flex', alignItems: 'flex-end', padding: '100px 40px', backgroundImage: `url(${hero.cover?.url})`, backgroundSize: 'cover', backgroundPosition: 'center' }}>
20
+ <div style={{ position: 'absolute', inset: 0, background: 'linear-gradient(to top, #0f172a 0%, transparent 100%)' }}></div>
21
+ <div style={{ position: 'relative', zIndex: 10 }}>
22
+ <h2 style={{ fontSize: '60px', fontWeight: 'bold', margin: '0 0 10px 0' }}>{hero.title}</h2>
23
+ <p style={{ fontSize: '20px', marginBottom: '20px' }}>⭐ {hero.imdbRatingValue} | {hero.genre}</p>
24
+ <a href={`/watch/${hero.subjectId}`} style={{ background: 'white', color: 'black', padding: '15px 30px', borderRadius: '5px', textDecoration: 'none', fontWeight: 'bold', fontSize: '18px' }}>▶ Play Now</a>
25
+ </div>
26
+ </div>
27
+ )}
28
+
29
+ {/* Movie Row */}
30
+ <div style={{ padding: '0 40px', marginTop: '-50px', position: 'relative', zIndex: 20 }}>
31
+ <h3 style={{ fontSize: '24px', borderLeft: '4px solid #e50914', paddingLeft: '10px' }}>Trending Movies</h3>
32
+ <div style={{ display: 'flex', overflowX: 'auto', gap: '20px', padding: '20px 0' }}>
33
+ {movies.map(m => (
34
+ <a key={m.subjectId} href={`/watch/${m.subjectId}`} style={{ minWidth: '200px', display: 'block', borderRadius: '10px', overflow: 'hidden', transition: 'transform 0.3s' }}>
35
+ <img src={m.cover?.url} style={{ width: '100%', height: '300px', objectFit: 'cover' }} />
36
+ </a>
37
+ ))}
38
+ </div>
39
+ </div>
40
+ </div>
41
+ );
42
+ }