Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed login btn #22

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified backend/db.sqlite3
Binary file not shown.
64 changes: 64 additions & 0 deletions frontend/src/components/Home/UpcomingCarousel/Item.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

import "../../../styles/UpcomingCarousel.scoped.scss";
import { Link } from "react-router-dom";



const Item = ({item,index }) => {


//convert date to 'Month Year' string..
let convertDate = (start_date) => {
let dateObj = new Date(start_date);

let month = dateObj.toLocaleString("en-US", { month: "long" });
let year = dateObj.getFullYear();

return `${month} ${year}`;
};

return (

<>

<Link
to="/detailspage"
state={{ id: item.anime_id, anime: true }}
key={item.anime_id}
>



<div
className="item flex flex-col justify-start items-stretch "
key={index}


>

{/* image */}
{/* to scale it well you need to put in <div> contaiener. remove width and height and put ' object-fit: contain;' and on <div> put 'overflow: hidden;'*/}
<div className="item_div">
<img src={item.image} alt={item.title} />
</div>
<div className="line"> </div>

<div className="inner flex flex-col gap-2 justify-start items-start ml-2 mt-2 md:ml-4 md:mt-4">
<h1>{item.title}</h1>
<p>Season {item.seasons}</p>
</div>

<p className="release_date md:mt-16 mb-4 mt-4 md:mt-26 mb:mb-8 ml-2 md:ml-4 ">
{convertDate(item.start_date)}{" "}
</p>
</div>
</Link>

</>
)


}


export {Item}
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import "../../styles/UpcomingCarousel.scoped.scss";
import { Link } from "react-router-dom";
import "../../../styles/UpcomingCarousel.scoped.scss";
import { useEffect } from "react";
import { Link } from "react-router-dom";
import ScrollCarousel from "scroll-carousel";
import { anime_data } from "../../data";
import { anime_data } from "../../../data";
import { Item } from "./Item";

var top10UpcomingAnime;

export const UpcomingCarousel = () => {





useEffect(() => {
let main = document.querySelector(".main");

Expand All @@ -21,16 +27,6 @@ export const UpcomingCarousel = () => {
});
}, []);

//convert date to 'Month Year' string..
let convertDate = (start_date) => {
let dateObj = new Date(start_date);

let month = dateObj.toLocaleString("en-US", { month: "long" });
let year = dateObj.getFullYear();

return `${month} ${year}`;
};

// Sort the anime_data array based on start_date in descending order
// this way, we get most recent by start_date, elements. and put them in other list, which shows latest 10 by start_date
const sortedAnimeData = anime_data.sort((a, b) => {
Expand All @@ -42,11 +38,14 @@ export const UpcomingCarousel = () => {
// this way, we get most recent by start_date, elements. and put them in other list, which shows latest 10 by start_date
top10UpcomingAnime = sortedAnimeData.slice(0, 10);

var item = {};

return (
<>
<div className="line"> </div>

<div className="main flex flex-col ">

{/* this is just container for showing title and then carousel */}
<div className="small_header ml-4 md:ml-6 lg:ml-10 mt-6 ">
{/* check index.css, for global use, vertical rectangle.. */}
Expand All @@ -56,54 +55,27 @@ export const UpcomingCarousel = () => {
<p>Season - fall 2023</p>
</div>
</div>
<div className="carousel-container">
{/* container for items*/}

<div className="flex flex-row gap-3 justify-center mt-2">
{/* show items (render from object) dynamically render items */}

{/*only prop that will be passed is 'anime_id'. because on DetailedPage, it will be fetched again from database for all info. And 'anime_id' because this if for 'upcoming animes'. it can be manga as well .. just say to include it if needed */}





{/* carousel container (for carousel) */}
<div className="carousel-container">


{/* container for items*/}
<div className="flex flex-row gap-3 justify-center mt-2">
{top10UpcomingAnime.map((item, index) => (
<Link
to="/detailspage"
state={{ id: item.anime_id, anime: true }}
key={item.anime_id}
>



<div
className="item flex flex-col justify-start items-stretch "
key={index}


>

{/* image */}
{/* to scale it well you need to put in <div> contaiener. remove width and height and put ' object-fit: contain;' and on <div> put 'overflow: hidden;'*/}
<div className="item_div">
<img src={item.image} alt={item.title} />
</div>
<div className="line"> </div>

<div className="inner flex flex-col gap-2 justify-start items-start ml-2 mt-2 md:ml-4 md:mt-4">
<h1>{item.title}</h1>
<p>Season {item.seasons}</p>
</div>

<p className="release_date md:mt-16 mb-4 mt-4 md:mt-26 mb:mb-8 ml-2 md:ml-4 ">
{convertDate(item.start_date)}{" "}
</p>
</div>
</Link>
<Item item={item} index={index} />
))}
</div>



</div>



</div>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PopularCarousel } from "../components/Home/PopularCarousel/PopularCarousel";
import { UpcomingCarousel } from "../components/Home/UpcomingCarousel";
import { UpcomingCarousel } from "../components/Home/UpcomingCarousel/UpcomingCarousel";
import { BrowseHome } from "../components/Home/BrowseHome/BrowseHome";

const Home = () => {
Expand Down
14 changes: 12 additions & 2 deletions frontend/src/pages/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ const Login = () => {
<div className="container">
<div className="forms-container">
<div className="signin-signup">


<form action="#" className="sign-in-form" onSubmit={loginUser}>

<h2 className="title">Sign in</h2>
<div className="input-field">
<i className="fas fa-user"></i>
Expand All @@ -81,7 +84,7 @@ const Login = () => {
/>
</div>

<Button sx={{color: "white"}} type="submit" className="btn solid" variant="text" value="Login" onClick={loginUser} >Login</Button>
<Button sx={{color: "white"}} type="submit" className="btn solid pc" variant="text" value="Login" >Login</Button>


<p className="social-text">Or Sign in with social platforms</p>
Expand Down Expand Up @@ -132,7 +135,14 @@ const Login = () => {
autoComplete="new-password"
/>
</div>
<Button sx={{color: "white"}} type="submit" className="btn" variant="text" value="Sign up" >Sign up</Button>




<Button sx={{color: "white"}} type="submit" className="btn pc" variant="text" value="Sign up" >Sign up</Button>



<p className="social-text">Or Sign up with social platforms</p>
<div className="social-media">
<a href="#" className="social-icon">
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/styles/login.scoped.scss
Original file line number Diff line number Diff line change
Expand Up @@ -428,4 +428,5 @@ form.sign-in-form {
bottom: 28%;
left: 50%;
}
}
}