diff --git a/static/src/js/app.js b/static/src/js/app.js index 6e05723..a4915cc 100644 --- a/static/src/js/app.js +++ b/static/src/js/app.js @@ -1,7 +1,6 @@ var React = require('react'); var ProjectImages = require('./components/project-images'); - $(window).load(function(){ $(window).trigger('scroll').trigger('resize'); var s = skrollr.init(); diff --git a/static/src/js/components/project-image.js b/static/src/js/components/project-image.js new file mode 100644 index 0000000..60d0f09 --- /dev/null +++ b/static/src/js/components/project-image.js @@ -0,0 +1,32 @@ +var React = require('react'); +var ReactBootstrap = require('react-bootstrap'); +var Row = ReactBootstrap.Row; +var Col = ReactBootstrap.Col; + +var projectImage = React.createClass({ + render: function () { + var contents = this.props.isHovered ? + ( + +

{this.props.data.title}

+

{this.props.data.text}

+ + Find out more + +
+ ) : null; + return ( + +
+
+ { contents } +
+
+ + ); + } +}); + +module.exports = projectImage; \ No newline at end of file diff --git a/static/src/js/components/project-images.js b/static/src/js/components/project-images.js index 66af2ac..6d04918 100644 --- a/static/src/js/components/project-images.js +++ b/static/src/js/components/project-images.js @@ -1,13 +1,32 @@ var React = require('react'); +var ReactBootstrap = require('react-bootstrap'); +var Row = ReactBootstrap.Row; +var ProjectImage = require('./project-image'); -const projectData = [ - {key: 1, title: "College", info: "", link: ""}, - {key: 2, title: "Personal", info: "", link: ""}, - {key: 3, title: "Work", info: "", link: ""} +const DATA = [ + { + className: "", + title: "College", + text: "", + link: "", + }, + { + className: "", + title: "Personal", + text: "", + link: "", + }, + { + className: "", + title: "Work", + text: "", + link: "", + } ]; var projectImages = React.createClass({ + keys: [1,2,3], getInitialState: function () { return { hover: 0, @@ -18,21 +37,20 @@ var projectImages = React.createClass({ this.setState({hover: key}); }, render: function () { - var isHovered; - var projectTiles = projectData.map(function (project) { - isHovered = (project.key == this.state.hover); + var images = this.keys.map(function (key) { return ( -
- -
- ); - }); + + ); + }.bind(this)); return (
-
- { projectTiles } -
+ + { images } +
); diff --git a/static/src/less/style.less b/static/src/less/style.less index cbb88bb..864fc7a 100644 --- a/static/src/less/style.less +++ b/static/src/less/style.less @@ -73,15 +73,56 @@ ol , ul{ font-size: 17px; } } + + #project-images { background: url(http://catesmechanical.com/images/blueprint-background1.jpg); - background-position: fixed; + background-size: cover; .container { text-align: center; margin-top: 35px; margin-bottom: 35px; .panel-body { font-size: 16px; + @media screen and (max-width: @screen-xs-max) { + .wrapper, + .wrapper .project { + height: 275px; + width: 275px; + } + } + + @media screen and (min-width: @screen-sm-min) { + .wrapper, + .wrapper .project { + height: 200px; + width: 200px; + } + } + @media screen and (min-width: @screen-md-min) { + .wrapper, + .wrapper .project { + height: 280px; + width: 280px; + } + } + & > div { + margin: 10px 0; + } + + .wrapper { + background-color: black; + color: white; + margin: 0 auto; + + &:hover .project { + opacity: 0.6; + } + + & .project { + opacity: 1; + } + } } } }