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

Coding: Develop a timeline for programs page (#73) #150

Merged
merged 31 commits into from
Jan 31, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
806f2a0
feat: added timeline for programs
iamkryptonite Sep 23, 2020
8043c3c
fixed timeline ui issues
iamkryptonite Oct 4, 2020
773f73d
added scroll view
iamkryptonite Oct 15, 2020
6a93f00
added marker and fade
iamkryptonite Oct 15, 2020
e88414a
added arrows for scrolling
iamkryptonite Oct 17, 2020
abb12b1
fixed everything
iamkryptonite Oct 18, 2020
ea82321
added stroke
iamkryptonite Oct 18, 2020
3c76396
added current date
iamkryptonite Oct 19, 2020
ad751c9
fixed date format
iamkryptonite Oct 19, 2020
f0aafc1
added months
iamkryptonite Oct 19, 2020
b3dc12a
Feat: Develope timeline for the programs page (#73)
iamkryptonite Oct 19, 2020
360bde2
moved events and months to contents/programs_events
iamkryptonite Oct 25, 2020
526fbf2
refractored styles
iamkryptonite Oct 25, 2020
d18e579
fixed styles
iamkryptonite Dec 10, 2020
475496b
gh-pages
iamkryptonite Dec 11, 2020
125f1f4
style changes
iamkryptonite Dec 12, 2020
5e0e3b1
Merge branch 'xxx' into master
iamkryptonite Dec 12, 2020
5d7a52c
style changes
iamkryptonite Dec 12, 2020
0e3aadb
Merge branch 'xxx' into master
iamkryptonite Dec 12, 2020
64acbe7
fixed css
iamkryptonite Dec 27, 2020
aecab5f
Merge branch 'xxx' into master
iamkryptonite Dec 27, 2020
27bb0d5
Merge pull request #1 from anitab-org/develop
iamkryptonite Dec 27, 2020
0042c5e
fixed conflicts
iamkryptonite Dec 27, 2020
012d2f8
fixed scroller,removed jquery
iamkryptonite Dec 28, 2020
f6d52ce
fixed css issues
iamkryptonite Dec 28, 2020
66d8b40
minor changes
iamkryptonite Dec 28, 2020
c586501
added yarn lock
iamkryptonite Jan 1, 2021
76fe6cc
minor changes
iamkryptonite Jan 1, 2021
31141d0
minor changes
iamkryptonite Jan 3, 2021
fd82971
resolved conflicts
iamkryptonite Jan 19, 2021
cd5884a
minor changes
iamkryptonite Jan 26, 2021
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
25 changes: 9 additions & 16 deletions src/Components/Programs/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,24 @@ import {Event,Line,Date,Marker,Fade,Stroke} from './styles';
import $ from 'jquery';
import {ArrowLeftOutlined ,ArrowRightOutlined} from '@ant-design/icons'
import dayjs from 'dayjs'
const events=[
{
event:"GSoC'20",
date:[[0,1],[0,7],[0,8],[0,12],[0,18],[0,20],[0,31],[1,10],[1,20]],
color:'#ffdd30'
},
{
event:"Rails Girls'20",
date:[[0,5],[0,7],[0,9],[0,22],[0,28],[0,31],[1,8],[1,10]],
color:'#039eff'
},
]
const months = [[0,"January"],[1,"February"],[2,"March"],[3,"April"],[4,"May"],[5,"June"],[6,"July"],[7,"August"],[8,"September"],[9,"October"],[10,"November"],[11,"December"]];
import {getEvents,getMonths} from '../../content/programs_events'
const events = getEvents();
const months = getMonths();
function Timeline() {
var p = dayjs().date();
//scrolls the timeline to the current date and month
useEffect(() => {
var scroll = $('.css-view-1dbjc4n');
scroll.scrollLeft(p);
scroll.scrollLeft(p+500);
})
//onclick scrolls the timeline to the left
const scrollLeft=()=>{
var scroll = $('.css-view-1dbjc4n');
scroll.scrollLeft(p-=35);
if(p<0)
p=0;
}
//onclick scrolls the timeline to the right
const scrollRight=()=>{
var scroll = $('.css-view-1dbjc4n');
scroll.scrollLeft(p+=35);
Expand Down Expand Up @@ -62,13 +55,13 @@ function Timeline() {
</View>
<ScrollView
horizontal={true}
style={{ marginBottom:'5vw',marginTop:'3vw',flexDirection:'column',width:'70%',position:'absolute',right:'0',top:'-45px'}}
style={{ marginBottom:'5vw',marginTop:'45px',flexDirection:'column',width:'70%',position:'absolute',right:'0',top:'-45px'}}
showsHorizontalScrollIndicator={false}
>
<View style={{width:'90%'}}>
{
events.map((item)=>(
<View style={{marginBottom:'3vw',flexDirection:'column'}} key={item.event}>
<View style={{marginBottom:'47px',flexDirection:'column'}} key={item.event}>
<Line style={{left:(item.date[0][1]-1)*5+'%', width:30*12*5+'vw', borderBottomColor:item.color}}></Line>
{
item.date.map((d)=>(
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Programs/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useEffect} from 'react';
import React from 'react';
import Timeline from './Timeline';
function Programs() {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Programs/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const Stroke = styled(View,{
borderBottomColor:'#000',
borderBottomWidth:'2px',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't use px because this will break moving to modules to native app.

width:'40vw',
top:'-7vh',
top:'-35px',
// zIndex:'10px'

})
22 changes: 22 additions & 0 deletions src/content/programs_events.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const events=[
{
event:"GSoC'20",
date:[[0,1],[0,7],[0,8],[0,12],[0,18],[0,20],[0,31],[1,10],[1,20]],
color:'#ffdd30'
},
{
event:"Rails Girls'20",
date:[[0,5],[0,7],[0,9],[0,22],[0,28],[0,31],[1,8],[1,10]],
color:'#039eff'
},
]
const months = [[0,"January"],[1,"February"],[2,"March"],[3,"April"],[4,"May"],[5,"June"],[6,"July"],[7,"August"],[8,"September"],[9,"October"],[10,"November"],[11,"December"]];

export const getEvents = () => {
return events;
};
export const getMonths = () => {
return months;
};