1
Fork 0

Made project image component more generic

This commit is contained in:
Jake Howard 2015-11-13 18:14:54 +00:00
parent 6dcec5e701
commit 350a1b94d9
5 changed files with 75 additions and 69 deletions

View file

@ -1,5 +1,5 @@
var React = require('react'); var React = require('react');
var ProjectImages = require('./components/project-images'); var ProjectImagesTypes = require('./components/project-images-types');
$(function() { // https://css-tricks.com/snippets/jquery/smooth-scrolling/ $(function() { // https://css-tricks.com/snippets/jquery/smooth-scrolling/
$('a[href*=#]:not([href=#])').click(function() { $('a[href*=#]:not([href=#])').click(function() {
@ -20,4 +20,4 @@ $(window).load(function(){
$(window).trigger('scroll').trigger('resize'); $(window).trigger('scroll').trigger('resize');
}); });
React.render(<ProjectImages />, document.getElementById('project-images')); React.render(<ProjectImagesTypes />, document.getElementById('project-images-types'));

View file

@ -7,7 +7,7 @@ var projectImage = React.createClass({
render: function () { render: function () {
var animationClass = this.props.isHovered ? 'zoomIn' : 'zoomOut'; var animationClass = this.props.isHovered ? 'zoomIn' : 'zoomOut';
return ( return (
<Col sm={4}> <Col sm={4} className="project-image">
<div className={"wrapper " + this.props.data.className}> <div className={"wrapper " + this.props.data.className}>
<div className="project" <div className="project"
onMouseOver={this.props.onHover} onMouseOver={this.props.onHover}

View file

@ -25,7 +25,7 @@ const DATA = [
]; ];
var projectImages = React.createClass({ var projectImagesTypes = React.createClass({
keys: [1,2,3], keys: [1,2,3],
getInitialState: function () { getInitialState: function () {
return { return {
@ -56,4 +56,4 @@ var projectImages = React.createClass({
} }
}); });
module.exports = projectImages; module.exports = projectImagesTypes;

View file

@ -48,6 +48,25 @@
color: white; color: white;
font-size: 40px; font-size: 40px;
} }
.row {
margin-bottom: 10px;
}
}
}
#twitter-feed {
height: 75vh;
text-align: center;
.twitter-icon {
& > div{
height: 200px;
width: 200px;
}
}
}
}
/* @group project-images */
.project-image {
@media screen and (max-width: @screen-xs-max) { @media screen and (max-width: @screen-xs-max) {
.wrapper, .wrapper,
.wrapper .project { .wrapper .project {
@ -70,9 +89,6 @@
width: 280px; width: 280px;
} }
} }
& > div {
margin: 10px 0;
}
.wrapper { .wrapper {
color: white; color: white;
@ -102,6 +118,7 @@
.transition(~"opacity 0.5s ease-in"); .transition(~"opacity 0.5s ease-in");
opacity: 0; opacity: 0;
background-color: rgba(0,0,0,0.6); background-color: rgba(0,0,0,0.6);
text-align: center;
p, a.btn { p, a.btn {
font-size: 12px; font-size: 12px;
@ -112,15 +129,4 @@
} }
} }
} }
} /* @end project-images */
#twitter-feed {
height: 75vh;
text-align: center;
.twitter-icon {
& > div{
height: 200px;
width: 200px;
}
}
}
}

View file

@ -18,7 +18,7 @@
</div> </div>
</div> </div>
<div class="container-fluid" id="project-images"></div> <div class="container-fluid" id="project-images-types"></div>
<div class="container-fluid" id="twitter-feed"> <div class="container-fluid" id="twitter-feed">
<div class="container"> <div class="container">