Skip to content

Commit

Permalink
site
Browse files Browse the repository at this point in the history
  • Loading branch information
dormalk committed May 31, 2020
1 parent e8099c4 commit 2d71db5
Show file tree
Hide file tree
Showing 19 changed files with 1,616 additions and 54 deletions.
1,376 changes: 1,376 additions & 0 deletions workoutathome2/.firebase/hosting..cache

Large diffs are not rendered by default.

201 changes: 201 additions & 0 deletions workoutathome2/debug.log

Large diffs are not rendered by default.

26 changes: 0 additions & 26 deletions workoutathome2/index.html

This file was deleted.

Binary file added workoutathome2/public/favicon.ico
Binary file not shown.
36 changes: 32 additions & 4 deletions workoutathome2/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossOrigin="anonymous">
</script>
<link href="./assets/css/app/app.css" rel="stylesheet">
<link href="./assets/css/vendor/all.css" rel="stylesheet"/>
<link href="/assets/css/app/app.css" rel="stylesheet">
<link href="/assets/css/vendor/all.css" rel="stylesheet"/>
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down Expand Up @@ -47,8 +47,36 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script src="./assets/js/vendor/all.js"></script>
<script src="./assets/js/app/app.js"></script>
<script src="/assets/js/vendor/all.js"></script>
<script src="/assets/js/app/app.js"></script>
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '1720730761523421');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=1720730761523421&ev=PageView&noscript=1"
/></noscript>

<!-- Hotjar Tracking Code for Workoutathome.online -->
<script>
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:1835606,hjsv:6};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>
<!-- End Facebook Pixel Code -->
</body>
</html>
4 changes: 2 additions & 2 deletions workoutathome2/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Workout At Home",
"name": "Workout At Home",
"icons": [
{
"src": "favicon.ico",
Expand Down
3 changes: 0 additions & 3 deletions workoutathome2/src/actions/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const login = (uid) => {
convertToArr(results[1]).map(res => { return {...res, type: 'clickVideo'}}).forEach(res => user.activities.push(res));
convertToArr(results[2]).map(res => { return {...res, type: 'createChallenges'}}).forEach(res => user.activities.push(res));
user.activities = user.activities.sort((v1,v2) => v2.datetime-v1.datetime)
console.log(user.activities)
dispatch({type:'LOGIN', user })
})
}
Expand All @@ -37,7 +36,6 @@ export const login = (uid) => {
}

export const logout = () => {
console.log('logout')
return(dispatch) => {
return firebase.auth().signOut()
.then(() =>dispatch({type: 'LOGOUT'}))
Expand Down Expand Up @@ -126,7 +124,6 @@ export const takeChallenge = (userdata, challenge) => {
challengeId: challenge.id || challenge,
completedVideos: [],
}
console.log(userdata.challengesInProgress.find(c => c.challengeId === challengeProgress.challengeId))
if(!userdata.challengesInProgress.find(c => c.challengeId === challengeProgress.challengeId)){
userdata.challengesInProgress.push(challengeProgress);
dispatch(updateUser(userdata))
Expand Down
2 changes: 2 additions & 0 deletions workoutathome2/src/actions/videos.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export const fetchAllVideos = () => {
return firebase.database().ref('videos')
.once('value',snapshot => {
const data = snapshot.val();

// firebase.firestore().collection('videos').add(data);
dispatch({type: 'FETCH_ALL', videos:convertToArr(data)})
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export default ({days,videos,onUpdate}) => {
const onSelect = (selectedList, selectedItem) => {
selectedValues[pickedDay-1] = selectedList;
selectedValues[pickedDay-1] = updateData();
console.log(selectedValues[pickedDay-1])
setSelectedValues(selectedValues)
onUpdate(selectedValues)
forceUpdate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ const AddVideoScreenFoo = (props) => {
getVideoDetails(video.videoId)
.then(({data}) => {
if(data.items.length > 0){
console.log(video)
video = {
...video,
...convertDetails(data),
videoUrl: `https://www.youtube.com/watch?v=${video.videoId}`
};
console.log(video)
setPickedVideo(video)
setPhase(phase+1);
} else {
Expand All @@ -52,7 +50,6 @@ const AddVideoScreenFoo = (props) => {

const convertDetails = (data) => {
let { title, thumbnails } = data.items[0].snippet;
console.log(data.items[0].snippet)
let duration = data.items[0].contentDetails.duration;
let length = "L";
const { hours, minutes, seconds } = moment.duration(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import React from 'react';

export default ({videoDetails,insertVideo,success}) => {
const [title, setTitle] = React.useState(videoDetails.title)
console.log(videoDetails)
(videoDetails)
const convertDuration = ({hours,minutes,seconds}) => {
console.log(hours,minutes,seconds)
return `${("0" + hours).slice(-2)}:${("0" + minutes).slice(
-2
)}:${("0" + seconds).slice(-2)}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const ChallengesScreenFoo = ({challengedata,showBar,userId}) => {
if(duration.length > 0) list = list.filter(item => {
var flag = false;
duration.forEach(d => {
console.log(item.avgDuration)
if(d.label === 'Short' && item.avgDuration.hour === 0 && item.avgDuration.minutes <= 30) flag = true;
else if(d.label === 'Medium' && (item.avgDuration.hour >= 1 || item.avgDuration.minutes >= 30)) flag = true;
else if(d.label === 'Long' && item.avgDuration.hour >= 1) flag = true;
Expand Down
3 changes: 0 additions & 3 deletions workoutathome2/src/components/Commons/Dragable.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ export default ({children,id, initialPos}) => {
if(isDrag){
const {pageX,pageY} = handleMouseMove(event)
var {prevPageX,prevPageY} = prevPage;
console.log('prevPageY=>'+prevPageY)
console.log('pageY=>'+pageY)

if(prevPageX == null) prevPageX = pageX
if(prevPageY == null) prevPageY = pageY
setPos({pageX:elem.offsetLeft + pageX - prevPageX ,pageY: elem.offsetTop + pageY - prevPageY})
Expand Down
2 changes: 1 addition & 1 deletion workoutathome2/src/components/Commons/SingleWorkoutCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const SingleWorkoutCard = ({video, onClick}) => {
return(
<div className="panel panel-default" key={video.id} onClick={() => onClick(video.id)} style={{cursor: 'pointer'}}>
<div className="cover overlay hover cover-image-full" style={{height: 'unset'}}>
<img src={getVideoImage()} alt="music" />
<img src={getVideoImage()} alt="music" className="pull-left" style={{height: '200px', width:'auto'}}/>
<div className="overlay overlay-full overlay-hover overlay-bg-black">
<div className="v-center">
<a className="btn btn-lg btn-circle btn-white"><i className="fa fa-play"></i></a>
Expand Down
1 change: 0 additions & 1 deletion workoutathome2/src/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const HeaderFoo = (props) => {
const SignInWithGoogle = () => {
props.startSignInWithGoogle()
.then(({user}) => {
console.log(user)
const updateUser = {
displayName: user.displayName,
email: user.email,
Expand Down
1 change: 0 additions & 1 deletion workoutathome2/src/components/LeftSideBar/TopWorkouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {createNewSession} from '../../actions/workout_session';
import { generateUniqKey } from '../../helpers/fucntions';

export default ({workouts,videos,userId}) => {
console.log(workouts())
function openSession(videoId) {
var session = new Session(generateUniqKey(10),userId);
session.setCurrentVideoId(videoId)
Expand Down
5 changes: 1 addition & 4 deletions workoutathome2/src/components/ViewChallengeScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export const ViewChallengeScreen = connect(mapStateToProps,mapDispatchToProp)
completedDaysArr.push(parseInt(day))
}
}
console.log(completedDaysArr)
if(completedDaysArr.length > 0) setCompletedDays(completedDaysArr)
}

Expand All @@ -90,7 +89,6 @@ export const ViewChallengeScreen = connect(mapStateToProps,mapDispatchToProp)
}

function renderPane(){
console.log(pickedDay-1)
return pickedDay ?
challenge.days[pickedDay-1].map((v,index) => <SingleWorkoutCard video={v} onClick={(videoId) => onOpenSession(videoId)} key={index}/>):
null;
Expand All @@ -101,7 +99,6 @@ export const ViewChallengeScreen = connect(mapStateToProps,mapDispatchToProp)
var tabs = [];
const days = challenge.days.length;
for(let i = 1; i <= days; i++){
console.log(completedDays.includes(i-1))
tabs.push( <li key={i} className={`${pickedDay === i? 'active': ''} ${completedDays.includes(i-1)? 'done': ''}`} onClick={() => setPickedDay(i)}>
<a href={`day${i}`} data-toggle="tab"><i className="fa fa-fw fa-star"></i> Day {i}</a>
</li>)
Expand Down Expand Up @@ -143,7 +140,7 @@ export const ViewChallengeScreen = connect(mapStateToProps,mapDispatchToProp)
<section>
<div className="panel panel-default" style={{marginBottom: "35x"}}>
<div className="cover overlay hover cover-image-full" style={{height: 'unset'}}>
<img src={ challenge.thumbnails} alt="music" />
<img src={ challenge.thumbnails} alt="music" className="pull-left" style={{height: '200px', width:'auto'}}/>
</div>
<div className="panel-body">
<h4 className="margin-none title">{challenge.title}</h4>
Expand Down
1 change: 0 additions & 1 deletion workoutathome2/src/components/Workout/ControlPannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default (props) => {

function copyUrl() {
/* Get the text field */
console.log('hhhh');
var dummy = document.createElement('input'),
text = window.location.href;
var general_pop = document.getElementById('global-message');
Expand Down
1 change: 0 additions & 1 deletion workoutathome2/src/components/Workout3/ControlPannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default (props) => {

function copyUrl() {
/* Get the text field */
console.log('hhhh');
var dummy = document.createElement('input'),
text = window.location.href;
var general_pop = document.getElementById('global-message');
Expand Down

0 comments on commit 2d71db5

Please sign in to comment.