From 4df9fd5ac5ba5346666325a0ea4ad3000fc4d6ce Mon Sep 17 00:00:00 2001 From: real-zephex <143923795+real-zephex@users.noreply.github.com> Date: Tue, 7 May 2024 03:40:03 +0530 Subject: Create eslint.yml --- .github/workflows/eslint.yml | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/eslint.yml diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml new file mode 100644 index 0000000..3d5569d --- /dev/null +++ b/.github/workflows/eslint.yml @@ -0,0 +1,50 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# ESLint is a tool for identifying and reporting on patterns +# found in ECMAScript/JavaScript code. +# More details at https://github.com/eslint/eslint +# and https://eslint.org + +name: ESLint + +on: + push: + branches: [ "master" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master" ] + schedule: + - cron: '25 7 * * 0' + +jobs: + eslint: + name: Run eslint scanning + runs-on: ubuntu-latest + permissions: + contents: read + security-events: write + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install ESLint + run: | + npm install eslint@8.10.0 + npm install @microsoft/eslint-formatter-sarif@2.1.7 + + - name: Run ESLint + run: npx eslint . + --config .eslintrc.js + --ext .js,.jsx,.ts,.tsx + --format @microsoft/eslint-formatter-sarif + --output-file eslint-results.sarif + continue-on-error: true + + - name: Upload analysis results to GitHub + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: eslint-results.sarif + wait-for-processing: true -- cgit v1.2.3 From d4cb608107f48c763d489411189a7a634edfdded Mon Sep 17 00:00:00 2001 From: real-zephex Date: Tue, 7 May 2024 08:38:08 +0530 Subject: small fixes and shit --- src/app/movies/[id]/page.jsx | 17 +++++++++-------- src/app/movies/components/popular.jsx | 8 ++++---- src/app/movies/components/search_2.jsx | 4 ++-- src/app/movies/components/trending.jsx | 8 ++++---- src/app/movies/components/video_player.jsx | 1 - src/app/movies/styles/info.module.css | 27 ++++++++++++++++++++++++--- src/app/movies/styles/pop_trend.module.css | 21 ++++++++++----------- src/app/movies/styles/video_player.module.css | 7 ++++++- src/app/page.jsx | 2 +- utils/movie_urls.js | 7 ++++--- 10 files changed, 64 insertions(+), 38 deletions(-) diff --git a/src/app/movies/[id]/page.jsx b/src/app/movies/[id]/page.jsx index 1baec1f..313fc83 100644 --- a/src/app/movies/[id]/page.jsx +++ b/src/app/movies/[id]/page.jsx @@ -15,7 +15,7 @@ export default async function MOVIE_INFO({ params }) { return (
Movie Poster
-

Release Date: {data.release_date}

+

+ Release Date:{" "} + {data.release_date || "Not found"} +

@@ -93,13 +96,11 @@ export default async function MOVIE_INFO({ params }) { style={{ textAlign: "center", margin: 0, - fontSize: 14, + fontSize: 12, }} > - NOTE: Please wait for some time for the video to - load. If it buffers for a long time, then try - chanding the server. If the issue persists, please - check your internet connection. + IMPORTANT: Please use adblockers like uBlock Orgin + or Ghostery for an ad free experience.


diff --git a/src/app/movies/components/popular.jsx b/src/app/movies/components/popular.jsx index 04d9cf8..d2d5e36 100644 --- a/src/app/movies/components/popular.jsx +++ b/src/app/movies/components/popular.jsx @@ -27,7 +27,7 @@ export default async function POPULAR_MOVIES() { style={{ borderRadius: "0.5rem", overflow: "hidden", - backgroundImage: `url(https://image.tmdb.org/t/p/original${item.backdrop_path})`, + backgroundImage: `url(https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=https://image.tmdb.org/t/p/original${item.backdrop_path})`, backgroundRepeat: "no-repeat", backgroundSize: "cover", }} @@ -35,9 +35,9 @@ export default async function POPULAR_MOVIES() { >
Movie Poster diff --git a/src/app/movies/components/search_2.jsx b/src/app/movies/components/search_2.jsx index 0eb66fb..fbfc714 100644 --- a/src/app/movies/components/search_2.jsx +++ b/src/app/movies/components/search_2.jsx @@ -33,8 +33,8 @@ const SearchResults = async (title) => {

{item.title || item.original_title}

Movie Poster
Movie Poster

{item.title}

diff --git a/src/app/movies/components/video_player.jsx b/src/app/movies/components/video_player.jsx index 15db6a8..a808ea3 100644 --- a/src/app/movies/components/video_player.jsx +++ b/src/app/movies/components/video_player.jsx @@ -16,7 +16,6 @@ export default function VIDEO_PLAYER({ id: id }) { src={url} referrerPolicy="origin" allowFullScreen - height={500} className={styles.VideoPlayer} > ); diff --git a/src/app/movies/styles/info.module.css b/src/app/movies/styles/info.module.css index 23b3322..bc3b30a 100644 --- a/src/app/movies/styles/info.module.css +++ b/src/app/movies/styles/info.module.css @@ -26,8 +26,8 @@ .HeroTitle { display: flex; flex-direction: column; - margin-left: 1rem; - padding: 0.5rem; + margin-left: 0.6rem; + padding: 0.3rem; } .HeroTitle h2 { @@ -49,6 +49,8 @@ .MovieDescription { font-size: 18px; margin: 0.2rem 0 0 0; + max-height: 140px; + overflow: auto; } .OtherInfo { @@ -117,4 +119,23 @@ .VideoPlayer iframe { height: 250px; } -} + + .HeroTitle h2 { + font-size: 22px; + } + + .HeroSection img { + width: 170px; + height: 267px; + } + + .MovieDescription { + font-size: 16px; + } + + .OtherInfo { + width: 90%; + margin: 1rem auto; + } + +} \ No newline at end of file diff --git a/src/app/movies/styles/pop_trend.module.css b/src/app/movies/styles/pop_trend.module.css index 9b94078..2e9ebd9 100644 --- a/src/app/movies/styles/pop_trend.module.css +++ b/src/app/movies/styles/pop_trend.module.css @@ -8,13 +8,11 @@ margin: 0 0 0.5rem 0; text-align: center; color: transparent; - background: linear-gradient( - 90deg, - var(--neon-green) 40%, - var(--light-green) 60%, - var(--neon-yellow) 80%, - var(--soft-purple) 100% - ); + background: linear-gradient(90deg, + var(--neon-green) 40%, + var(--light-green) 60%, + var(--neon-yellow) 80%, + var(--soft-purple) 100%); background-size: 60% 50%; background-clip: text; } @@ -36,7 +34,7 @@ .MovieContainer:hover .MovieEntryPrev:hover { opacity: 1; - scale: 1.02; + scale: 1.015; } .MovieEntryPrev { @@ -52,15 +50,16 @@ justify-content: center; flex-direction: column; cursor: pointer; - backdrop-filter: blur(5px); + backdrop-filter: blur(10px); } .MovieEntry img { border-radius: 0.5rem; + box-shadow: 0px 0px 10px 8px rgb(32, 32, 32); } .MovieEntry p { - width: 190px; + width: 160px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; @@ -79,4 +78,4 @@ overflow-x: auto; overflow-y: hidden; } -} +} \ No newline at end of file diff --git a/src/app/movies/styles/video_player.module.css b/src/app/movies/styles/video_player.module.css index aa65b07..b8946e8 100644 --- a/src/app/movies/styles/video_player.module.css +++ b/src/app/movies/styles/video_player.module.css @@ -1,5 +1,5 @@ .VideoContainer { - margin: 0.5rem 0 0 0; + margin: 0.5rem 0 0 0; } .VideoContainer button { @@ -17,9 +17,14 @@ .VideoPlayer { width: 100%; + height: 500px; aspect-ratio: "16/9"; border: none; outline: none; border-radius: 0.5rem; margin: 0.5rem 0 0 0; } + +.VideoPlayer::-webkit-scrollbar { + width: 0px; +} \ No newline at end of file diff --git a/src/app/page.jsx b/src/app/page.jsx index 6efc2f3..4f9eda2 100644 --- a/src/app/page.jsx +++ b/src/app/page.jsx @@ -39,7 +39,7 @@ export default async function Home() { >

Movies

-

Your one stop for all your kdrama needs

+

Your one stop for all your movie needs

diff --git a/utils/movie_urls.js b/utils/movie_urls.js index 20cbfef..eb512aa 100644 --- a/utils/movie_urls.js +++ b/utils/movie_urls.js @@ -1,8 +1,9 @@ const API_KEY = "171fe27dbfecc58e2a18fbced644cda9"; +const PROXY = "https://sup-proxy.zephex0-f6c.workers.dev/api-json?url="; // MOVIES -export const TRENDING = `https://api.themoviedb.org/3/trending/movie/day?api_key=${API_KEY}`; +export const TRENDING = `${PROXY}https://api.themoviedb.org/3/trending/movie/day?api_key=${API_KEY}`; export const SEARCH = `https://api.themoviedb.org/3/search/movie?api_key=${API_KEY}&query=`; -export const POPULAR = `https://api.themoviedb.org/3/movie/popular?api_key=${API_KEY}`; +export const POPULAR = `${PROXY}https://api.themoviedb.org/3/movie/popular?api_key=${API_KEY}`; export const getInfoURL = (movieId) => - `https://api.themoviedb.org/3/movie/${movieId}?api_key=${API_KEY}`; + `${PROXY}https://api.themoviedb.org/3/movie/${movieId}?api_key=${API_KEY}`; -- cgit v1.2.3 From 276960e86efb95799c903a1d78f2d3642835062a Mon Sep 17 00:00:00 2001 From: real-zephex Date: Tue, 7 May 2024 10:09:08 +0530 Subject: well, I tried something --- src/app/anime/search/page.jsx | 50 +++++++++++++++++++-------------- src/app/anime/search/search.module.css | 7 ++--- src/app/kdrama/components/search.jsx | 9 +++++- src/app/movies/components/search.jsx | 6 ++-- src/app/movies/components/search_2.jsx | 2 +- src/app/movies/styles/search.module.css | 2 +- 6 files changed, 45 insertions(+), 31 deletions(-) diff --git a/src/app/anime/search/page.jsx b/src/app/anime/search/page.jsx index bf399cf..e94ef92 100644 --- a/src/app/anime/search/page.jsx +++ b/src/app/anime/search/page.jsx @@ -12,28 +12,28 @@ export default function Input() { const [loading, setLoading] = useState(null); const [info, setInfo] = useState(null); - const handleKeyPress = async (event) => { - if ( - (event.code === "Enter" || - event.key === "Enter" || - event.code === 13) && - searchedAnime !== "" - ) { - setLoading(true); - setInfo(await fetchedInfo(await Results(searchedAnime))); - setLoading(false); - } else if ( - (event.code === "Enter" || - event.key === "Enter" || - event.code === 13) && - searchedAnime === "" - ) { - alert("Input cannot be empty"); - } - }; + // const handleKeyPress = async (event) => { + // if ( + // (event.code === "Enter" || + // event.key === "Enter" || + // event.code === 13) && + // searchedAnime !== "" + // ) { + // setLoading(true); + // setInfo(await fetchedInfo(await Results(searchedAnime))); + // setLoading(false); + // } else if ( + // (event.code === "Enter" || + // event.key === "Enter" || + // event.code === 13) && + // searchedAnime === "" + // ) { + // alert("Input cannot be empty"); + // } + // }; return ( -
+
@@ -43,7 +43,15 @@ export default function Input() { setSearchedAnime(event.target.value); } }} - onKeyDown={(event) => handleKeyPress(event)} + onKeyDown={async (event) => { + if (event.code !== 8) { + setInfo( + await fetchedInfo( + await Results(searchedAnime) + ) + ); + } + }} placeholder="Enter anime title" className={styles.SearchInput} > diff --git a/src/app/anime/search/search.module.css b/src/app/anime/search/search.module.css index 185f6d5..bbb2795 100644 --- a/src/app/anime/search/search.module.css +++ b/src/app/anime/search/search.module.css @@ -40,7 +40,7 @@ .searchContainer { display: flex; align-items: center; - margin: 20px 0px 20px 0px; + margin: 20px 0px 10px 0px; background-color: #121212; padding: 10px; border-radius: 10px; @@ -55,8 +55,7 @@ .animeEntry { display: flex; overflow-x: auto; - margin-bottom: 1rem; - margin-left: 0.5rem; + margin: 0 0 1rem 0.5rem; } .animeEntry:hover .anime { @@ -111,4 +110,4 @@ .anime p { width: 50dvw; } -} +} \ No newline at end of file diff --git a/src/app/kdrama/components/search.jsx b/src/app/kdrama/components/search.jsx index f44e4bb..1d1b93b 100644 --- a/src/app/kdrama/components/search.jsx +++ b/src/app/kdrama/components/search.jsx @@ -21,13 +21,20 @@ export default function DramaSearch() { setInfoTitle(data); }; + const fetch_every_title = async (title) => { + FetchSearchTitle(title); + }; + return (
setTitle(event.target.value)} + onChange={(event) => { + setTitle(event.target.value); + fetch_every_title(title); + }} onKeyDown={async (e) => { if ((e.key === "Enter" || e.code === 13) && title) { await handleSearch(e.target.value); diff --git a/src/app/movies/components/search.jsx b/src/app/movies/components/search.jsx index 6514b76..20f8cac 100644 --- a/src/app/movies/components/search.jsx +++ b/src/app/movies/components/search.jsx @@ -24,9 +24,9 @@ export default function SEARCH_COMPONENT() { setTitle(event.target.value)} - onKeyDown={async (e) => { - if ((e.key === "Enter" || e.code === 13) && title) { - await fetch_results(e.target.value); + onKeyDown={async (event) => { + if (event.code !== 8) { + await fetch_results(title); } }} > diff --git a/src/app/movies/components/search_2.jsx b/src/app/movies/components/search_2.jsx index fbfc714..82bba52 100644 --- a/src/app/movies/components/search_2.jsx +++ b/src/app/movies/components/search_2.jsx @@ -20,7 +20,7 @@ const SearchResults = async (title) => { href={`/movies/${item.id}`} key={index} style={{ - backgroundImage: `url(https://image.tmdb.org/t/p/original${item.backdrop_path})`, + backgroundImage: `url(https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=https://image.tmdb.org/t/p/original${item.backdrop_path})`, backgroundRepeat: "no-repeat", backgroundSize: "cover", textDecoration: "none", diff --git a/src/app/movies/styles/search.module.css b/src/app/movies/styles/search.module.css index 1148ad0..66b6046 100644 --- a/src/app/movies/styles/search.module.css +++ b/src/app/movies/styles/search.module.css @@ -73,4 +73,4 @@ .InputContainer { width: 100%; } -} +} \ No newline at end of file -- cgit v1.2.3 From fb481fc6a5211f66bf68087406fa6064bb9ca8d8 Mon Sep 17 00:00:00 2001 From: real-zephex Date: Tue, 7 May 2024 10:21:36 +0530 Subject: didn't like it --- src/app/anime/search/page.jsx | 50 +++++++++++++++--------------------- src/app/kdrama/components/search.jsx | 9 +------ src/app/movies/components/search.jsx | 6 ++--- 3 files changed, 25 insertions(+), 40 deletions(-) diff --git a/src/app/anime/search/page.jsx b/src/app/anime/search/page.jsx index e94ef92..bf399cf 100644 --- a/src/app/anime/search/page.jsx +++ b/src/app/anime/search/page.jsx @@ -12,28 +12,28 @@ export default function Input() { const [loading, setLoading] = useState(null); const [info, setInfo] = useState(null); - // const handleKeyPress = async (event) => { - // if ( - // (event.code === "Enter" || - // event.key === "Enter" || - // event.code === 13) && - // searchedAnime !== "" - // ) { - // setLoading(true); - // setInfo(await fetchedInfo(await Results(searchedAnime))); - // setLoading(false); - // } else if ( - // (event.code === "Enter" || - // event.key === "Enter" || - // event.code === 13) && - // searchedAnime === "" - // ) { - // alert("Input cannot be empty"); - // } - // }; + const handleKeyPress = async (event) => { + if ( + (event.code === "Enter" || + event.key === "Enter" || + event.code === 13) && + searchedAnime !== "" + ) { + setLoading(true); + setInfo(await fetchedInfo(await Results(searchedAnime))); + setLoading(false); + } else if ( + (event.code === "Enter" || + event.key === "Enter" || + event.code === 13) && + searchedAnime === "" + ) { + alert("Input cannot be empty"); + } + }; return ( -
+
@@ -43,15 +43,7 @@ export default function Input() { setSearchedAnime(event.target.value); } }} - onKeyDown={async (event) => { - if (event.code !== 8) { - setInfo( - await fetchedInfo( - await Results(searchedAnime) - ) - ); - } - }} + onKeyDown={(event) => handleKeyPress(event)} placeholder="Enter anime title" className={styles.SearchInput} > diff --git a/src/app/kdrama/components/search.jsx b/src/app/kdrama/components/search.jsx index 1d1b93b..f44e4bb 100644 --- a/src/app/kdrama/components/search.jsx +++ b/src/app/kdrama/components/search.jsx @@ -21,20 +21,13 @@ export default function DramaSearch() { setInfoTitle(data); }; - const fetch_every_title = async (title) => { - FetchSearchTitle(title); - }; - return (
{ - setTitle(event.target.value); - fetch_every_title(title); - }} + onChange={(event) => setTitle(event.target.value)} onKeyDown={async (e) => { if ((e.key === "Enter" || e.code === 13) && title) { await handleSearch(e.target.value); diff --git a/src/app/movies/components/search.jsx b/src/app/movies/components/search.jsx index 20f8cac..6514b76 100644 --- a/src/app/movies/components/search.jsx +++ b/src/app/movies/components/search.jsx @@ -24,9 +24,9 @@ export default function SEARCH_COMPONENT() { setTitle(event.target.value)} - onKeyDown={async (event) => { - if (event.code !== 8) { - await fetch_results(title); + onKeyDown={async (e) => { + if ((e.key === "Enter" || e.code === 13) && title) { + await fetch_results(e.target.value); } }} > -- cgit v1.2.3 From 33b537499494ead01896e61eba9672cb27208732 Mon Sep 17 00:00:00 2001 From: real-zephex <143923795+real-zephex@users.noreply.github.com> Date: Tue, 7 May 2024 12:32:58 +0530 Subject: Delete .github/workflows/eslint.yml --- .github/workflows/eslint.yml | 50 -------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 .github/workflows/eslint.yml diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml deleted file mode 100644 index 3d5569d..0000000 --- a/.github/workflows/eslint.yml +++ /dev/null @@ -1,50 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# ESLint is a tool for identifying and reporting on patterns -# found in ECMAScript/JavaScript code. -# More details at https://github.com/eslint/eslint -# and https://eslint.org - -name: ESLint - -on: - push: - branches: [ "master" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "master" ] - schedule: - - cron: '25 7 * * 0' - -jobs: - eslint: - name: Run eslint scanning - runs-on: ubuntu-latest - permissions: - contents: read - security-events: write - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install ESLint - run: | - npm install eslint@8.10.0 - npm install @microsoft/eslint-formatter-sarif@2.1.7 - - - name: Run ESLint - run: npx eslint . - --config .eslintrc.js - --ext .js,.jsx,.ts,.tsx - --format @microsoft/eslint-formatter-sarif - --output-file eslint-results.sarif - continue-on-error: true - - - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: eslint-results.sarif - wait-for-processing: true -- cgit v1.2.3