Skip to content

Commit

Permalink
add profile image users, add audio draven, start creation of play music
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrosilvaadev committed Apr 30, 2022
1 parent 5846586 commit ae9874c
Show file tree
Hide file tree
Showing 40 changed files with 635 additions and 7 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-icons": "^4.3.1",
"react-responsive-carousel": "^3.2.23",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"react-toastify": "^8.2.0",
Expand Down
Binary file removed src/assets/Ellipse 95.png
Binary file not shown.
Binary file added src/assets/audio/draven-audio.mp3
Binary file not shown.
Binary file added src/assets/borda.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/heart.png
Binary file not shown.
Binary file removed src/assets/left.png
Binary file not shown.
Binary file removed src/assets/next-image.png
Binary file not shown.
Binary file removed src/assets/no-image.png
Binary file not shown.
Binary file removed src/assets/play.png
Binary file not shown.
Binary file removed src/assets/repeat.png
Binary file not shown.
Binary file removed src/assets/right.png
Binary file not shown.
Binary file removed src/assets/rotate-cw.png
Binary file not shown.
Binary file removed src/assets/volume-2.png
Binary file not shown.
Binary file added src/assets/wallpapers/ahri-kda.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallpapers/akali.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallpapers/evelin-kda.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallpapers/fiora.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallpapers/pentakill-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallpapers/pentakill-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallpapers/qyana.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallpapers/teemo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallpapers/true-damage-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallpapers/true-damage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallpapers/viego.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallpapers/yasuo-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallpapers/yasuo-true-damage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallpapers/yasuo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions src/components/Header/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { useState } from "react";

import { store } from "../../facilities/store";
import { useNavigate } from "react-router-dom";
import { toast } from "react-toastify";

import * as C from "./styles";
import { FiLogOut } from "react-icons/fi";
import MusicLegend from "../../assets/music-legends.png";
import { ProfileImages } from "../ProfileImages";
import Borda from "../../assets/borda.png";
export function Header({ children, isProfile }) {
const [profile, setProfile] = useState(false);
const [imageProfile, setImageProfile] = useState({
id: 0,
name: "Yasuo",
image:
"https://i.pinimg.com/originals/fb/e5/72/fbe572e1faefa97388243a952acfbe93.jpg",
});

const navigate = useNavigate();

const logoutClient = () => {
store.removeStorage("user");
toast.success("Logout efetuado com sucesso!", {
position: "top-right",
autoClose: 1500,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: false,
draggable: true,
progress: undefined,
});
navigate("/");
};

const handleProfile = () => {
if (profile) {
setProfile(false);
return;
}
setProfile(true);
};

const handleImageProfile = (element) => {
setImageProfile(element);
setProfile(false);
};

return (
<C.Container>
<div className="lib">
<p className="info">Biblioteca de Musicas</p>
</div>

<img className="logo" alt="music-legends" src={MusicLegend} />

<C.ContainerUser>
<p className="info">{children}Yasuo</p>
<img src={imageProfile.image} alt={imageProfile.name} />
<img
className="borda"
src={Borda}
alt="borda-lvl-500"
onClick={handleProfile}
/>
<FiLogOut onClick={() => logoutClient()} />
</C.ContainerUser>

{profile && isProfile && (
<ProfileImages onClickOn={(element) => handleImageProfile(element)} />
)}
</C.Container>
);
}
96 changes: 96 additions & 0 deletions src/components/Header/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import styled from "styled-components";

export const Container = styled.div`
width: 100%;
height: 12vh;
background: #14061f;
align-items: center;
justify-content: space-between;
display: flex;
padding: 0px 40px;
position: fixed;
z-index: 1000;
.logo {
width: 200px;
}
.lib {
width: 200px;
display: flex;
justify-content: center;
}
.info:after {
content: "";
width: 0;
height: 2px;
background: #2ef4cc;
position: absolute;
left: 0;
bottom: -12px;
transition: width 0.2s;
}
.info {
transition: color 0.2s;
position: relative;
color: #c0c0c0;
font-weight: 400;
font-size: 18px;
padding-bottom: 3px;
line-height: 20px;
cursor: pointer;
transition: 0.1s;
}
.info:hover::after {
width: 100%;
}
`;

export const ContainerUser = styled.div`
width: 200px;
display: flex;
align-items: center;
gap: 32px;
position: relative;
p {
border: none;
}
img {
width: 50px;
height: 50px;
border-radius: 50%;
cursor: pointer;
:hover {
opacity: 0.8;
}
:active {
opacity: 0.6;
}
}
svg {
color: #c0c0c0;
font-size: 24px;
cursor: pointer;
transition: 0.2s;
:hover {
opacity: 0.8;
}
:active {
opacity: 0.6;
}
}
.borda {
width: 70px;
height: 70px;
position: absolute;
right: 61px;
}
`;
41 changes: 41 additions & 0 deletions src/components/MediaPlayer/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { useState } from "react";
import * as C from "./styles";

import {
AiOutlineLeft,
AiOutlineRight,
AiOutlinePlayCircle,
AiOutlineEllipsis,
AiOutlinePauseCircle,
} from "react-icons/ai";

export function MediaPlayer() {
const [pause, setPause] = useState(false);

return (
<C.Container>
<C.ContainerNameMusic>
<p className="music">Warrior</p>
<p className="description">RIOT GAMES FT. IMAGINE DRAGONS</p>
</C.ContainerNameMusic>
<C.ContainerControls>
<AiOutlineLeft />
{pause ? (
<AiOutlinePauseCircle
className="control"
onClick={() => setPause(false)}
/>
) : (
<AiOutlinePlayCircle
className="control"
onClick={() => setPause(true)}
/>
)}
<AiOutlineRight />
</C.ContainerControls>
<C.ContainerMenu>
<AiOutlineEllipsis />
</C.ContainerMenu>
</C.Container>
);
}
80 changes: 80 additions & 0 deletions src/components/MediaPlayer/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import styled from "styled-components";

export const Container = styled.div`
width: 100%;
height: 10vh;
position: fixed;
bottom: 0px;
background: #14061f;
justify-content: space-between;
display: flex;
align-items: center;
padding: 0px 30px;
color: #fff;
`;

export const ContainerNameMusic = styled.div`
max-width: 200px;
.music {
font-weight: 500;
font-size: 18px;
line-height: 28px;
letter-spacing: 0.04em;
color: #f1f0f0;
}
.description {
font-weight: 500;
font-size: 12px;
line-height: 21px;
text-transform: uppercase;
color: #c0c0c0;
opacity: 0.6;
}
`;

export const ContainerControls = styled.div`
width: 200px;
display: flex;
align-items: center;
gap: 20px;
justify-content: space-between;
svg {
color: #4ac08f;
font-size: 26px;
cursor: pointer;
:hover {
opacity: 0.8;
}
:active {
opacity: 0.6;
}
}
.control {
font-size: 32px;
}
`;

export const ContainerMenu = styled.div`
width: 200px;
display: flex;
align-items: center;
justify-content: end;
svg {
color: #4ac08f;
font-size: 32px;
cursor: pointer;
:hover {
opacity: 0.8;
}
:active {
opacity: 0.6;
}
}
`;
15 changes: 15 additions & 0 deletions src/components/ProfileImages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as C from "./styles";

import { profileImages } from "./profile-images";
export function ProfileImages({ onClickOn }) {
return (
<C.Container>
{profileImages.map((element) => (
<div onClick={() => onClickOn(element)}>
<img key={element.id} src={element.image} alt={element.name} />
<C.Name>{element.name}</C.Name>
</div>
))}
</C.Container>
);
}
Loading

0 comments on commit ae9874c

Please sign in to comment.