Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a66bc1cedc |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wedding",
|
"name": "wedding",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.5",
|
"node": ">=6.5",
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ html {
|
|||||||
line-height: 1.375; /* ~22px */
|
line-height: 1.375; /* ~22px */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: #0074c2;
|
color: #0074c2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,14 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
background: rgba(0, 0, 0, 0.1);
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
z-index: 100;
|
||||||
|
background: rgba(0, 0, 0, 0.1);
|
||||||
|
transition: background 0.3s, ease-in;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navDark {
|
||||||
|
background: rgba(60, 60, 60, 0.95);
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
|
|||||||
@@ -8,12 +8,40 @@ class Navigation extends React.Component {
|
|||||||
current: PropTypes.string,
|
current: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
scrollAtTop: true,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
window.addEventListener('scroll', this.handleScroll);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
window.removeEventListener('scroll', this.handleScroll);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleScroll = (event) => {
|
||||||
|
const scrollTop = event.srcElement.body.scrollTop;
|
||||||
|
this.setState({
|
||||||
|
scrollAtTop: scrollTop < 10,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (!this.props.current) {
|
if (!this.props.current) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className={s.root} role="navigation">
|
<div
|
||||||
|
className={[
|
||||||
|
s.root,
|
||||||
|
this.state.scrollAtTop ? null : s.navDark,
|
||||||
|
].join(' ')}
|
||||||
|
role="navigation"
|
||||||
|
>
|
||||||
<div className={s.container}>
|
<div className={s.container}>
|
||||||
<Link className={[s.link, this.props.current === 'home' ? s.active : null].join(' ')} to="/">RSVP</Link>
|
<Link className={[s.link, this.props.current === 'home' ? s.active : null].join(' ')} to="/">RSVP</Link>
|
||||||
<Link className={[s.link, this.props.current === 'ceremony' ? s.active : null].join(' ')} to="/church">Church</Link>
|
<Link className={[s.link, this.props.current === 'ceremony' ? s.active : null].join(' ')} to="/church">Church</Link>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
background: url('/img/offley_2560.jpg');
|
background: url('/img/offley_2560.jpg');
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position-x: 54%;
|
background-position-x: 54%;
|
||||||
|
background-position-y: 66%;
|
||||||
background-color: #c1c1c1;
|
background-color: #c1c1c1;
|
||||||
filter: grayscale(1) brightness(0.4);
|
filter: grayscale(1) brightness(0.4);
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
background: url('/img/church_2560.jpg');
|
background: url('/img/church_2560.jpg');
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position-x: 54%;
|
background-position-x: 54%;
|
||||||
|
background-position-y: 66%;
|
||||||
background-color: #c1c1c1;
|
background-color: #c1c1c1;
|
||||||
filter: grayscale(1) brightness(0.4);
|
filter: grayscale(1) brightness(0.4);
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
background: url('/img/prague_2560.jpg');
|
background: url('/img/prague_2560.jpg');
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position-x: 54%;
|
background-position-x: 54%;
|
||||||
|
background-position-y: 66%;
|
||||||
background-color: #c1c1c1;
|
background-color: #c1c1c1;
|
||||||
filter: grayscale(1) brightness(0.6);
|
filter: grayscale(1) brightness(0.6);
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
background: url('/img/offley_2560.jpg');
|
background: url('/img/offley_2560.jpg');
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position-x: 54%;
|
background-position-x: 54%;
|
||||||
|
background-position-y: 66%;
|
||||||
background-color: #c1c1c1;
|
background-color: #c1c1c1;
|
||||||
filter: grayscale(1) brightness(0.4);
|
filter: grayscale(1) brightness(0.4);
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
background: url('/img/cervenalhota_2560.jpg');
|
background: url('/img/cervenalhota_2560.jpg');
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position-x: 30%;
|
background-position-x: 30%;
|
||||||
|
background-position-y: 66%;
|
||||||
background-color: #c1c1c1;
|
background-color: #c1c1c1;
|
||||||
filter: grayscale(1) brightness(0.6);
|
filter: grayscale(1) brightness(0.6);
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
background: url('/img/offley_2560.jpg');
|
background: url('/img/offley_2560.jpg');
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position-x: 54%;
|
background-position-x: 54%;
|
||||||
|
background-position-y: 66%;
|
||||||
background-color: #c1c1c1;
|
background-color: #c1c1c1;
|
||||||
filter: grayscale(1) brightness(0.4);
|
filter: grayscale(1) brightness(0.4);
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user