Add less transparent bg to scrolled nav

Reposition the background images
This commit is contained in:
2017-03-06 23:39:09 +00:00
parent 3f068dfcec
commit 547d7f3364
10 changed files with 47 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "wedding",
"version": "1.0.1",
"version": "1.0.2",
"private": true,
"engines": {
"node": ">=6.5",

View File

@@ -13,6 +13,10 @@ html {
line-height: 1.375; /* ~22px */
}
body {
overflow-x: hidden;
}
a {
color: #0074c2;
}

View File

@@ -4,8 +4,14 @@
right: 0;
left: 0;
height: 40px;
background: rgba(0, 0, 0, 0.1);
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 {

View File

@@ -8,12 +8,40 @@ class Navigation extends React.Component {
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() {
if (!this.props.current) {
return null;
}
return (
<div className={s.root} role="navigation">
<div
className={[
s.root,
this.state.scrollAtTop ? null : s.navDark,
].join(' ')}
role="navigation"
>
<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 === 'ceremony' ? s.active : null].join(' ')} to="/church">Church</Link>

View File

@@ -12,6 +12,7 @@
background: url('/img/offley_2560.jpg');
background-size: cover;
background-position-x: 54%;
background-position-y: 66%;
background-color: #c1c1c1;
filter: grayscale(1) brightness(0.4);
z-index: -1;

View File

@@ -12,6 +12,7 @@
background: url('/img/church_2560.jpg');
background-size: cover;
background-position-x: 54%;
background-position-y: 66%;
background-color: #c1c1c1;
filter: grayscale(1) brightness(0.4);
z-index: -1;

View File

@@ -12,6 +12,7 @@
background: url('/img/prague_2560.jpg');
background-size: cover;
background-position-x: 54%;
background-position-y: 66%;
background-color: #c1c1c1;
filter: grayscale(1) brightness(0.6);
z-index: -1;

View File

@@ -12,6 +12,7 @@
background: url('/img/offley_2560.jpg');
background-size: cover;
background-position-x: 54%;
background-position-y: 66%;
background-color: #c1c1c1;
filter: grayscale(1) brightness(0.4);
z-index: -1;

View File

@@ -12,6 +12,7 @@
background: url('/img/cervenalhota_2560.jpg');
background-size: cover;
background-position-x: 30%;
background-position-y: 66%;
background-color: #c1c1c1;
filter: grayscale(1) brightness(0.6);
z-index: -1;

View File

@@ -12,6 +12,7 @@
background: url('/img/offley_2560.jpg');
background-size: cover;
background-position-x: 54%;
background-position-y: 66%;
background-color: #c1c1c1;
filter: grayscale(1) brightness(0.4);
z-index: -1;