-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit decf637
Showing
28 changed files
with
2,610 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + React + TS</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "gym", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"@firebase/app": "^0.7.33", | ||
"@types/axios": "^0.14.0", | ||
"@types/styled-components": "^5.1.26", | ||
"axios": "^0.27.2", | ||
"firebase": "^9.10.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-draggable": "^4.4.5", | ||
"styled-components": "^5.3.6" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.0.17", | ||
"@types/react-dom": "^18.0.6", | ||
"@vitejs/plugin-react": "^2.1.0", | ||
"typescript": "^4.6.4", | ||
"vite": "^3.1.0" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
import Footer from "./components/Footer"; | ||
import MainHeader from "./components/MainHeader"; | ||
import { Context } from "./contexts/AppContext"; | ||
import { Layout } from "./styles/Layout"; | ||
import { initializeApp } from "firebase/app"; | ||
import { getAuth, GoogleAuthProvider, signInWithPopup } from "firebase/auth"; | ||
import { useEffect, useState } from "react"; | ||
import Content from "./components/Content"; | ||
import Sound from "./assets/dale.mp3"; | ||
|
||
// Types - Interfaces | ||
|
||
interface IUser { | ||
name: string; | ||
} | ||
|
||
// Config Firebase | ||
|
||
// const firebaseConfig = { | ||
// apiKey: import.meta.env.VITE_API_KEY, | ||
// authDomain: import.meta.env.VITE_AUTH_DOMAIN, | ||
// projectId: import.meta.env.VITE_PROJECT_ID, | ||
// storageBucket: import.meta.env.VITE_STORAGE_BUCKET, | ||
// messagingSenderId: import.meta.env.VITE_MESSAGING_SENDER_ID, | ||
// appId: import.meta.env.VITE_APP_ID, | ||
// }; | ||
|
||
/** Initialize Firebase */ | ||
// const app = initializeApp(firebaseConfig); | ||
|
||
// export const auth = getAuth(app); | ||
|
||
const provider = new GoogleAuthProvider(); | ||
|
||
function App() { | ||
// Hooks | ||
const [userProfile, setUserProfile] = useState<IUser>(); | ||
const [userEmail, setUserEmail] = useState(); | ||
const [userName, setUserName] = useState(); | ||
const [error, setError] = useState(); | ||
const [isUserLogIn, setIsUserLogIn] = useState(true); | ||
|
||
const audioTune = new Audio(Sound); | ||
|
||
const [audio, setAudio] = useState(audioTune); | ||
const [playInLoop, setPlayInLoop] = useState(false); | ||
const [isDale, setIsDale] = useState(false); | ||
|
||
useEffect(() => { | ||
audioTune.load(); | ||
}, []); | ||
|
||
useEffect(() => { | ||
audioTune.loop = playInLoop; | ||
}, [playInLoop]); | ||
|
||
/** Toca a musica */ | ||
const playSound = () => { | ||
audio.play(); | ||
setIsDale(true); | ||
}; | ||
|
||
/** Pausa a musica */ | ||
const pauseSound = () => { | ||
setIsDale(false); | ||
audio.pause(); | ||
}; | ||
|
||
/** Para a musica */ | ||
const stopSound = () => { | ||
setIsDale(false); | ||
audio.pause(); | ||
audio.currentTime = 0; | ||
}; | ||
|
||
// const signInWithGoogle = () => { | ||
// signInWithPopup(auth, provider) | ||
// .then((result) => { | ||
// const name: any = result.user.displayName; | ||
// const email: any = result.user.email; | ||
// const profilePic: any = result.user.photoURL; | ||
|
||
// setUserName(name); | ||
// setUserEmail(email); | ||
// setUserProfile(profilePic); | ||
// setIsUserLogIn(false); | ||
// }) | ||
// .catch((error) => { | ||
// console.log(error); | ||
// setError(error); | ||
// }); | ||
// }; | ||
|
||
return ( | ||
<Layout> | ||
<Context.Provider | ||
value={{ | ||
userName, | ||
userProfile, | ||
// signInWithGoogle, | ||
isUserLogIn, | ||
error, | ||
playSound, | ||
pauseSound, | ||
stopSound, | ||
isDale, | ||
}} | ||
> | ||
<MainHeader /> | ||
<Content /> | ||
<Footer /> | ||
</Context.Provider> | ||
</Layout> | ||
); | ||
} | ||
|
||
export default App; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { | ||
MainContainer, | ||
FirstSection, | ||
SecondSection, | ||
ThirdSection, | ||
} from "./styles"; | ||
|
||
export function Content() { | ||
return ( | ||
<MainContainer> | ||
<FirstSection> | ||
|
||
|
||
</FirstSection> | ||
</MainContainer> | ||
); | ||
} | ||
|
||
export default Content; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import styled from "styled-components"; | ||
|
||
export const MainContainer = styled.main` | ||
grid-area: CT; | ||
background-color: whitesmoke; | ||
display: flex; | ||
justify-content: space-around; | ||
align-items: center; | ||
`; | ||
|
||
export const FirstSection = styled.div` | ||
height: 100%; | ||
width: 100%; | ||
padding: 10px; | ||
`; | ||
|
||
export const SecondSection = styled.div` | ||
height: 100%; | ||
width: 100%; | ||
`; | ||
|
||
export const ThirdSection = styled.div` | ||
height: 100%; | ||
width: 100%; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { useContext } from "react"; | ||
import { | ||
FooterContainer, | ||
SoundButton, | ||
PauseButton, | ||
StopButton, | ||
Text, | ||
SocialMedia, | ||
SoundSection | ||
} from "./styles"; | ||
import { Context } from "../../contexts/AppContext"; | ||
|
||
export function Footer() { | ||
const { userName, isDale, playSound, pauseSound, stopSound }: any = | ||
useContext(Context); | ||
|
||
return ( | ||
<FooterContainer isDale={isDale}> | ||
|
||
<SocialMedia> | ||
<Text>Acesse as redes:</Text> | ||
<br /> | ||
<a href="https://www.linkedin.com/" target="_blank"> | ||
<img | ||
src="https://www.svgrepo.com/show/138936/linkedin.svg" | ||
alt="Acesse o LinkedIn" | ||
style={{ width: "40px" }} | ||
/> | ||
</a> | ||
<a href="https://twitter.com/" target="_blank"> | ||
<img | ||
src="https://www.svgrepo.com/show/157815/twitter.svg" | ||
alt="Acesse o Twitter" | ||
style={{ width: "40px" }} | ||
/> | ||
</a> | ||
<a href="https://www.instagram.com/" target="_blank"> | ||
<img | ||
src="https://www.svgrepo.com/show/217758/instagram.svg" | ||
alt="Acesse o Instagram" | ||
style={{ width: "40px" }} | ||
/> | ||
</a> | ||
</SocialMedia> | ||
</FooterContainer> | ||
); | ||
} | ||
|
||
export default Footer; |
Oops, something went wrong.