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

Skip to content

Commit 3dd8f8b

Browse files
remrobemSchaeStewart
authored andcommitted
codeforgso#10 Join Us button changes (codeforgso#14)
* 2 options for footer: sticky bottom or end content * 2 options for footer: sticky bottom or end content * 2 options for footer: sticky bottom or end content * increave viewport over 100%/vh to force scroll * remove extraneous code added * nav bar links and initial link pages * remove invalid character * join us button updates * Join Us button fixes
1 parent ef031b0 commit 3dd8f8b

File tree

6 files changed

+93
-28
lines changed

6 files changed

+93
-28
lines changed

components/join-button.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Link from 'next/link';
2+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3+
import { faArrowRight as icon } from '@fortawesome/free-solid-svg-icons';
4+
5+
const JoinButton = (props) => {
6+
return (
7+
<section className='JoinButton'>
8+
<div className={"level join " + props.location} >
9+
<div className="level-item">
10+
<Link href='/join'>
11+
<a className="button is-large">
12+
<span>JOIN US</span>
13+
<span className="icon join-icon">
14+
<FontAwesomeIcon className='arrow fa-2x' icon={icon} />
15+
</span>
16+
</a>
17+
</Link>
18+
</div>
19+
</div>
20+
</section>
21+
);
22+
}
23+
24+
export default JoinButton;

components/join.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

components/page.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@ import React from 'react';
22
import Head from '../components/head';
33
import Nav from '../components/nav';
44
import Footer from '../components/footer';
5-
import Join from '../components/join';
5+
import JoinButton from './join-button';
66
import '../styles.scss';
77

88
const Page = ({ children, title = '' }) => (
99
<React.Fragment>
1010
<Head title={title} />
1111
<Nav />
12-
<Join />
12+
<JoinButton location='top'/>
1313
<div className="section">
1414
<div className="container">{children}</div>
1515
</div>
16+
<JoinButton location='bottom'/>
1617
<Footer />
1718
</React.Fragment>
18-
19-
2019
);
2120

2221
export default Page;

package-lock.json

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"start": "next start"
77
},
88
"dependencies": {
9+
"@fortawesome/fontawesome-svg-core": "^1.2.8",
10+
"@fortawesome/free-solid-svg-icons": "^5.5.0",
11+
"@fortawesome/react-fontawesome": "^0.1.3",
912
"@zeit/next-sass": "^1.0.1",
1013
"bulma": "^0.7.5",
1114
"eslint": "^6.1.0",

styles.scss

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ $footer-background-color: $footer-background;
4747
html,
4848
body {
4949
height: 100%;
50+
z-index: -1;
5051
}
5152

5253
#__next {
@@ -55,9 +56,7 @@ body {
5556
min-height: 105vh;
5657
}
5758

58-
.section {
59-
flex: 1 0 auto;
60-
}
59+
// footer at bottom of page or content
6160
// not needed if min-height > 100vh or %
6261
// .footer {
6362
// flex-shrink: 0;
@@ -76,16 +75,39 @@ body {
7675
// }
7776
// end sticky footer - always on bottom of page
7877

79-
.button {
78+
.JoinButton .button {
8079
justify-content: left;
8180
padding-right: 10rem;
8281
color: white;
8382
background: linear-gradient(to right, $red 70%, $green 30%);
8483
}
8584

86-
div.sticky-top {
85+
.JoinButton .join-icon {
86+
position: absolute;
87+
top: 15%;
88+
right: 10%;
89+
margin: auto;
90+
}
91+
92+
.JoinButton .bottom {
8793
position: -webkit-sticky; /* Safari */
8894
position: sticky;
89-
top: 0;
95+
bottom: 0;
96+
visibility: visible;
97+
display: block;
9098
}
9199

100+
.JoinButton .top {
101+
display: none;
102+
}
103+
104+
@media (min-width: 769px) {
105+
.JoinButton .top {
106+
top: 0;
107+
visibility: visible;
108+
display: block;
109+
}
110+
.JoinButton .bottom {
111+
display: none;
112+
}
113+
}

0 commit comments

Comments
 (0)