Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Commit 9576038

Browse files
committed
initial commit
0 parents  commit 9576038

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+8476
-0
lines changed

.babelrc.bak

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"presets": ["next/babel"],
3+
"plugins": [
4+
[
5+
"lodash",
6+
{
7+
"id": ["lodash", "semantic-ui-react"]
8+
}
9+
]
10+
]
11+
}

.gitignore

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# private files
11+
*.key
12+
*.crt
13+
14+
# zip files
15+
*.tar
16+
17+
# Directory for instrumented libs generated by jscoverage/JSCover
18+
lib-cov
19+
20+
# Coverage directory used by tools like istanbul
21+
coverage
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Compiled binary addons (http://nodejs.org/api/addons.html)
27+
build/Release
28+
29+
# Dependency directory
30+
# Commenting this out is preferred by some people, see
31+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
32+
node_modules
33+
34+
# Users Environment Variables
35+
.lock-wscript
36+
37+
# IDEs and editors (shamelessly copied from @angular/cli's .gitignore)
38+
/.idea
39+
.project
40+
.classpath
41+
.c9/
42+
*.launch
43+
.settings/
44+
*.sublime-workspace
45+
46+
# IDE - VSCode
47+
.vscode/*
48+
!.vscode/settings.json
49+
!.vscode/tasks.json
50+
!.vscode/launch.json
51+
!.vscode/extensions.json
52+
53+
### Linux ###
54+
*~
55+
56+
# temporary files which can be created if a process still has a handle open of a deleted file
57+
.fuse_hidden*
58+
59+
# KDE directory preferences
60+
.directory
61+
62+
# Linux trash folder which might appear on any partition or disk
63+
.Trash-*
64+
65+
# .nfs files are created when an open file is removed but is still being accessed
66+
.nfs*
67+
68+
### OSX ###
69+
*.DS_Store
70+
.AppleDouble
71+
.LSOverride
72+
73+
# Icon must end with two \r
74+
Icon
75+
76+
77+
# Thumbnails
78+
._*
79+
80+
# Files that might appear in the root of a volume
81+
.DocumentRevisions-V100
82+
.fseventsd
83+
.Spotlight-V100
84+
.TemporaryItems
85+
.Trashes
86+
.VolumeIcon.icns
87+
.com.apple.timemachine.donotpresent
88+
89+
# Directories potentially created on remote AFP share
90+
.AppleDB
91+
.AppleDesktop
92+
Network Trash Folder
93+
Temporary Items
94+
.apdisk
95+
96+
### Windows ###
97+
# Windows thumbnail cache files
98+
Thumbs.db
99+
ehthumbs.db
100+
ehthumbs_vista.db
101+
102+
# Folder config file
103+
Desktop.ini
104+
105+
# Recycle Bin used on file shares
106+
$RECYCLE.BIN/
107+
108+
# Windows Installer files
109+
*.cab
110+
*.msi
111+
*.msm
112+
*.msp
113+
114+
# Windows shortcuts
115+
*.lnk
116+
117+
# Others
118+
lib/
119+
data/
120+
.next/

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# **Work In Progress** new coderplex site
2+
3+
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
4+
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
5+
6+
## Demo
7+
8+
[https://dev.coderplex.org](https://dev.coderplex.org)

components/count-down.js

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
3+
4+
class Countdown extends Component {
5+
constructor(props) {
6+
super(props);
7+
8+
this.state = {
9+
days: 0,
10+
hours: 0,
11+
min: 0,
12+
sec: 0,
13+
};
14+
}
15+
16+
componentDidMount() {
17+
// Update every second
18+
this.interval = setInterval(() => {
19+
const date = this.calculateCountdown(this.props.date);
20+
if (date) this.setState(date);
21+
else this.stop();
22+
}, 1000);
23+
}
24+
25+
componentWillUnmount() {
26+
this.stop();
27+
}
28+
29+
calculateCountdown(endDate) {
30+
let diff = (Date.parse(new Date(endDate)) - Date.parse(new Date())) / 1000;
31+
32+
// Clear countdown when date is reached
33+
if (diff <= 0) return false;
34+
35+
const timeLeft = {
36+
years: 0,
37+
days: 0,
38+
hours: 0,
39+
min: 0,
40+
sec: 0,
41+
millisec: 0,
42+
};
43+
44+
// Calculate time difference between now and expected date
45+
if (diff >= 365.25 * 86400) {
46+
// 365.25 * 24 * 60 * 60
47+
timeLeft.years = Math.floor(diff / (365.25 * 86400));
48+
diff -= timeLeft.years * 365.25 * 86400;
49+
}
50+
if (diff >= 86400) {
51+
// 24 * 60 * 60
52+
timeLeft.days = Math.floor(diff / 86400);
53+
diff -= timeLeft.days * 86400;
54+
}
55+
if (diff >= 3600) {
56+
// 60 * 60
57+
timeLeft.hours = Math.floor(diff / 3600);
58+
diff -= timeLeft.hours * 3600;
59+
}
60+
if (diff >= 60) {
61+
timeLeft.min = Math.floor(diff / 60);
62+
diff -= timeLeft.min * 60;
63+
}
64+
timeLeft.sec = diff;
65+
66+
return timeLeft;
67+
}
68+
69+
stop() {
70+
clearInterval(this.interval);
71+
}
72+
73+
addLeadingZeros(value) {
74+
value = String(value);
75+
while (value.length < 2) {
76+
value = '0' + value;
77+
}
78+
return value;
79+
}
80+
81+
render() {
82+
const countDown = this.state;
83+
84+
return (
85+
<div className="countdown">
86+
<span className="countdown-col">
87+
<span className="countdown-col-element">
88+
<strong>
89+
{this.addLeadingZeros(countDown.days)}
90+
</strong>
91+
<span>
92+
{countDown.days === 1 ? 'Day' : 'Days'}
93+
</span>
94+
</span>
95+
</span>
96+
97+
<span className="countdown-col">
98+
<span className="countdown-col-element">
99+
<strong>
100+
{this.addLeadingZeros(countDown.hours)}
101+
</strong>
102+
<span>Hours</span>
103+
</span>
104+
</span>
105+
106+
<span className="countdown-col">
107+
<span className="countdown-col-element">
108+
<strong>
109+
{this.addLeadingZeros(countDown.min)}
110+
</strong>
111+
<span>Min</span>
112+
</span>
113+
</span>
114+
115+
<span className="countdown-col">
116+
<span className="countdown-col-element">
117+
<strong>
118+
{this.addLeadingZeros(countDown.sec)}
119+
</strong>
120+
<span>Sec</span>
121+
</span>
122+
</span>
123+
<style jsx>{`
124+
.countdown {
125+
display: flex;
126+
justify-content: space-around;
127+
padding: 15px 0;
128+
}
129+
.countdown-col {
130+
}
131+
.countdown-col-element {
132+
display: flex;
133+
flex-direction: column;
134+
align-items: center;
135+
}
136+
`}</style>
137+
</div>
138+
);
139+
}
140+
}
141+
142+
Countdown.propTypes = {
143+
date: PropTypes.string.isRequired,
144+
};
145+
146+
Countdown.defaultProps = {
147+
date: new Date(),
148+
};
149+
150+
export default Countdown;

components/footer.js

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import React from 'react';
2+
import FaFacebook from 'react-icons/lib/fa/facebook';
3+
import FaYoutube from 'react-icons/lib/fa/youtube-play';
4+
import FaGithub from 'react-icons/lib/fa/github-alt';
5+
import FaInstagram from 'react-icons/lib/fa/instagram';
6+
7+
export default () =>
8+
<footer>
9+
<div className="footer__container">
10+
<div className="footer__content">
11+
<h3>Follow Us</h3>
12+
<ul>
13+
<li>
14+
<a href="https://www.youtube.com/channel/UCZ2EgRcIyY8lcHz0c5-lOUw">
15+
<FaYoutube size={20} />
16+
</a>
17+
</li>
18+
<li>
19+
<a href="https://www.facebook.com/freecodecamphyderabad/">
20+
<FaFacebook size={20} />
21+
</a>
22+
</li>
23+
<li>
24+
<a href="https://github.com/fcc-hyd">
25+
<FaGithub size={20} />
26+
</a>
27+
</li>
28+
<li>
29+
<a href="https://www.instagram.com/fcc_hyd/">
30+
<FaInstagram size={20} />
31+
</a>
32+
</li>
33+
<li>
34+
<a href="https://www.meetup.com/freeCodeCamp-Hyderabad/">m</a>
35+
</li>
36+
</ul>
37+
</div>
38+
</div>
39+
<style jsx>{`
40+
footer {
41+
padding: 50px 0;
42+
background: #314159;
43+
color: #fff;
44+
}
45+
.footer__container {
46+
max-width: 1280px;
47+
margin: 0 auto;
48+
}
49+
.footer__content {
50+
text-align: center;
51+
}
52+
ul {
53+
margin: 0;
54+
padding: 0;
55+
list-style: none;
56+
display: flex;
57+
justify-content: center;
58+
flex-wrap: wrap;
59+
}
60+
ul li {
61+
margin: 0 10px;
62+
}
63+
ul li a {
64+
width: 50px;
65+
height: 50px;
66+
padding: 10px;
67+
display: flex;
68+
justify-content: center;
69+
align-items: center;
70+
color: #fff;
71+
text-decoration: none;
72+
border: 1px solid #fff;
73+
border-radius: 50%;
74+
transition: all 0.25s;
75+
font-weight: bold;
76+
}
77+
ul li a:hover {
78+
background: #fff;
79+
color: #314159;
80+
}
81+
`}</style>
82+
</footer>;

0 commit comments

Comments
 (0)