aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorreal-zephex <[email protected]>2024-03-17 06:47:32 +0530
committerreal-zephex <[email protected]>2024-03-17 06:47:32 +0530
commitbb50d08f5e0476fc302ca45aa2e377471d10b118 (patch)
treeeeb9de9580c6812166bf754fd9abaef3f1695763 /src
parentminor fixes: tried to make the video player responsive but failed (diff)
downloaddramalama-bb50d08f5e0476fc302ca45aa2e377471d10b118.tar.xz
dramalama-bb50d08f5e0476fc302ca45aa2e377471d10b118.zip
minor fixes and feature improvements: added an indicator which shows when the animes are being loaded and also indicates when no anime with given title is found
Diffstat (limited to 'src')
-rw-r--r--src/app/kdrama/kdrama.css79
-rw-r--r--src/app/kdrama/page.js52
-rw-r--r--src/app/recent/recent.css11
-rw-r--r--src/app/search/page.js44
-rw-r--r--src/app/video/video.css7
5 files changed, 119 insertions, 74 deletions
diff --git a/src/app/kdrama/kdrama.css b/src/app/kdrama/kdrama.css
index 014083e..7a82bea 100644
--- a/src/app/kdrama/kdrama.css
+++ b/src/app/kdrama/kdrama.css
@@ -1,31 +1,31 @@
-
-.navbar {
+.sC {
display: flex;
- flex-direction: column;
- justify-content: center;
align-items: center;
- margin: 0px auto;
-}
-
-.navbar p {
- font-family: "Kanit";
- font-size: 36px;
- color: var(--soft-purple);
+ margin: 30px auto;
+ background-color: #2c2c2c;
+ padding: 8px;
+ border-radius: 5px;
+ width: 20%;
}
-.navbar input {
- padding: 5px;
- border-radius: 5px;
+.sC input {
border: none;
+ border-radius: 5px;
+ color: white;
outline: none;
- width: 200px;
- margin-top: 5px;
- box-shadow: 0 4px 8px #0003, 0 6px 20px #00000030;
- background-color: #9eacc4;
- color: #fff;
- font-family: "Atkinson Hyperlegible";
+ background: none;
+ width: 100%;
+ font-family: "Lato";
+ font-size: 16px;
}
+
+.searchIcon {
+ color: white;
+ margin-right: 5px;
+}
+
+
.intro {
display: flex;
color: white;
@@ -57,13 +57,9 @@
height: 100%;
justify-content: center;
width: 100%;
- background-color: #141414e8;
+ background-color: #141414ad;
}
-.popupEntries::-webkit-scrollbar {
- width: 5px;
- height: 5px;
-}
.popupEntries {
border-radius: 5px;
@@ -73,20 +69,27 @@
overflow-y: auto;
}
+.popupEntries::-webkit-scrollbar {
+ width: 5px;
+ height: 5px;
+}
+
.popupEntry {
background: #272727b4;
display: flex;
flex-direction: row;
justify-content: space-between;
- border-style: groove;
align-items: center;
border-radius: 10px;
width: 800px;
margin: 5px auto;
padding: 3px;
border-color: var(--soft-purple);
+ cursor: pointer;
}
+
+
.popupEntry img {
width: 120px;
height: "auto";
@@ -96,7 +99,7 @@
}
.popupEntry p {
- color: var(--neon-green);
+ color: #8CABFF;
font-size: 20px;
margin-left: 10px;
}
@@ -105,7 +108,7 @@
position: absolute;
bottom: 0;
left: 0;
- margin: 10px
+ margin: 10px;
}
.closeButton button {
@@ -115,6 +118,7 @@
font-size: 18px;
border-radius: 5px;
border: none;
+ cursor: pointer;
}
.videoContainer {
@@ -127,14 +131,13 @@
border-radius: 20px;
border-width: 4px;
padding: 10px;
- text-align: center
+ /* text-align: center */
}
.titleContainer {
display: flex;
flex-direction: row;
justify-content: space-between;
- width: 900px;
align-items: center;
margin: 0px auto;
}
@@ -153,13 +156,15 @@
.dramaDescription {
color: var(--softer-purple);
font-family: "Atkinson Hyperlegible";
+ text-align: center;
}
.episodesButtonsContainer {
- max-width: 70%;
+ max-width: 80%;
margin: 0px auto;
max-height: 200px;
overflow-y: auto;
+ text-align: center;
}
.episodeButton {
@@ -178,13 +183,19 @@
background-color: var(--soft-purple);
}
+.episodeButton:focus {
+ background-color: var(--pastel-red);
+ transition: padding 0.2s ease;
+ padding: 5px;
+}
+
.videoPlayer {
display: flex;
justify-content: center;
}
.videoPlayer video {
- border-radius: 5px;
+ border-radius: 10px;
}
@media screen and (max-width: 1440px) {
@@ -212,6 +223,10 @@
.popupEntry {
width: 90%;
}
+
+ .sC {
+ width: 70%;
+ }
}
@media (prefers-color-scheme: dark) {
diff --git a/src/app/kdrama/page.js b/src/app/kdrama/page.js
index fdd42c7..3877453 100644
--- a/src/app/kdrama/page.js
+++ b/src/app/kdrama/page.js
@@ -5,6 +5,7 @@ import "./kdrama.css"
import { useState } from "react";
import ReactPlayer from "react-player";
import Image from 'next/image';
+import { FaSearch } from 'react-icons/fa'; // Import the search icon from react-icons library
import {
fetchAnimeInfo,
@@ -48,8 +49,8 @@ export default function Kdrama() {
return (
<main className="main">
- <div className="navbar">
- <p>Dramaverse</p>
+ <div className="sC">
+ <FaSearch className='searchIcon' />
<input
placeholder="Enter drama title"
onChange={(event) => setSearchTitle(event.target.value)}
@@ -68,6 +69,32 @@ export default function Kdrama() {
<div className="videoContainer" id="videoContainer">
<div className="dramaInfoContainer">
+
+ {videoLink && (
+ <div className="videoPlayer">
+ <ReactPlayer
+ url={videoLink}
+ controls
+ playsinline
+ width={"100%"}
+ height={"auto"}
+ id="thing"
+ />
+ </div>
+ )}
+ {episodeNo && (
+ <p
+ style={{
+ color: "white",
+ fontFamily: "Atkinson Hyperlegible",
+ color: "#FF6868",
+ textAlign: "center",
+ }}
+ >
+ Episode {episodeNo}
+ </p>
+ )}
+
{details && (
<div className="dramaInfo">
<div className="titleContainer">
@@ -102,27 +129,6 @@ export default function Kdrama() {
</button>
))}
</div>
- <p
- style={{
- color: "white",
- fontFamily: "Atkinson Hyperlegible",
- color: "#FF6868",
- }}
- >
- Playing episode {episodeNo}
- </p>
- {videoLink && (
- <div className="videoPlayer">
- <ReactPlayer
- url={videoLink}
- autoPlay
- controls
- width={"90%"}
- height={"auto"}
- id="thing"
- />
- </div>
- )}
</div>
)}
</div>
diff --git a/src/app/recent/recent.css b/src/app/recent/recent.css
index 3fc5e26..aaca306 100644
--- a/src/app/recent/recent.css
+++ b/src/app/recent/recent.css
@@ -5,11 +5,10 @@
}
.trendingText {
- color: white;
+ color: #FEFFAC;
font-family: "Open Sans";
- font-size: 30px;
+ font-size: 26px;
margin: 10px;
- /* margin-bottom: 10px; */
}
.trending {
@@ -38,8 +37,8 @@
.trendingEntries img {
border-radius: 10px;
- width: 160px;
- height: 220px;
+ width: 150px;
+ height: 210px;
}
.trendingEntries p {
@@ -49,7 +48,7 @@
overflow-y: auto;
font-family: "Lato";
margin: 10px auto;
- font-size: 18px;
+ font-size: 16px;
}
.trendingEntries p::-webkit-scrollbar{
diff --git a/src/app/search/page.js b/src/app/search/page.js
index c64030c..f384d85 100644
--- a/src/app/search/page.js
+++ b/src/app/search/page.js
@@ -9,6 +9,7 @@ import Link from 'next/link';
export default function Input() {
const [searchedAnime, setSearchedAnime] = useState(null)
+ const [loading, setLoading] = useState(null)
const handleKeyPress = (event) => {
if (
@@ -31,11 +32,12 @@ export default function Input() {
const [search1, setSearch] = useState(null);
const fetch_animes = (title) => {
fetch("https://dramalama-api.vercel.app/anime/gogoanime/" + title)
+ .then(setLoading(true))
.then(res => res.json())
.then(
data => {
setSearch(data)
- console.log(search1)
+ setLoading(false)
}
)
}
@@ -54,21 +56,37 @@ export default function Input() {
</div>
</div>
+
+ {loading && (
+ <p style={{color: "white", textAlign: "center"}}>
+ Please wait while we crunch all the data for you.
+ </p>
+ )}
<div className='animeEntry'>
- {search1 && search1.results.map((item, index) => (
- <Link key={index} href={`/info/${item.id}`} style={{textDecoration: "none"}}>
- <div className='anime'>
- <p>{item.title}</p>
- <Image
- src={item.image}
- className='animeImage'
- width={120}
- height={160}
- />
+ {search1 ? (
+ search1.results && search1.results.length > 0 ? (
+ search1.results.map((item, index) => (
+ <Link key={index} href={`/info/${item.id}`} style={{textDecoration: "none"}}>
+ <div className='anime'>
+ <p>{item.title}</p>
+ <Image
+ src={item.image}
+ className='animeImage'
+ width={120}
+ height={160}
+ alt='Drama Poster'
+ />
+ </div>
+ </Link>
+ ))
+ ) : (
+ <div style={{margin: "0px auto"}}>
+ <p style={{color: "white"}}>No results found</p>
</div>
- </Link>
- ))}
+ )
+ ) : null}
</div>
+
</div>
)
diff --git a/src/app/video/video.css b/src/app/video/video.css
index a75054b..c739968 100644
--- a/src/app/video/video.css
+++ b/src/app/video/video.css
@@ -3,6 +3,7 @@
flex-direction: column;
align-items: center;
margin: 0px auto;
+ width: 50%;
}
.video2 video {
@@ -21,3 +22,9 @@
color: black;
}
}
+
+@media screen and (max-width: 768px) {
+ .video2 {
+ width: 100%;
+ }
+}