mystery...
138
src/components/cats/cats.jsx
Normal file
|
@ -0,0 +1,138 @@
|
|||
const React = require('react');
|
||||
const bindAll = require('lodash.bindall');
|
||||
|
||||
const Modal = require('../modal/base/modal.jsx');
|
||||
const ModalTitle = require('../modal/base/modal-title.jsx');
|
||||
|
||||
require('./cats.scss');
|
||||
|
||||
const catImages = [
|
||||
'/images/cats/IMG_9775.jpg',
|
||||
'/images/cats/IMG_9766.jpg',
|
||||
'/images/cats/IMG_9587.jpg',
|
||||
'/images/cats/IMG_6558.jpg',
|
||||
'/images/cats/IMG_6521.jpg',
|
||||
'/images/cats/IMG_6020.jpg',
|
||||
'/images/cats/IMG_5880.jpg',
|
||||
'/images/cats/IMG_3218.jpg',
|
||||
'/images/cats/IMG_2776.jpg',
|
||||
'/images/cats/IMG_2775.jpg',
|
||||
'/images/cats/IMG_2681.jpg',
|
||||
'/images/cats/IMG_1092.jpg',
|
||||
'/images/cats/IMG_0684.jpg',
|
||||
'/images/cats/IMG_0698.jpg',
|
||||
'/images/cats/IMG_0504.jpg',
|
||||
'/images/cats/IMG_0288.jpg',
|
||||
'/images/cats/IMG_0122.jpg',
|
||||
'/images/cats/IMG_2507.jpg',
|
||||
'/images/cats/IMG_1977.jpg',
|
||||
'/images/cats/IMG_1696.jpg',
|
||||
'/images/cats/IMG_1463.jpg',
|
||||
'/images/cats/IMG_1157.jpg',
|
||||
'/images/cats/IMG_0681.jpg',
|
||||
'/images/cats/IMG_0135.jpg',
|
||||
'/images/cats/IMG_0071.jpg',
|
||||
'/images/cats/1.jpg',
|
||||
'/images/cats/2.jpg',
|
||||
'/images/cats/3.jpg',
|
||||
'/images/cats/4.jpg',
|
||||
'/images/cats/Cat1.jpg',
|
||||
'/images/cats/Cat2.jpg',
|
||||
'/images/cats/Cat3.jpg',
|
||||
'/images/cats/Cat4.jpg'
|
||||
];
|
||||
|
||||
/* eslint-disable max-len */
|
||||
const mysteryFacts = [
|
||||
'How small can they make a t-shirt?',
|
||||
'Why do hotdogs come in packages of 8?',
|
||||
'Who let the dogs out?',
|
||||
'Why are cats so cute?',
|
||||
'Where is the other sock?',
|
||||
'Why is the sky blue?',
|
||||
'Why does everyday end in y?',
|
||||
'How many licks does it take to get to the center of a lollipop? ',
|
||||
'How many bites does it take to get to the center of a corndog?',
|
||||
'How many hours can a cat sleep in one day?',
|
||||
'Am I hungry?',
|
||||
'What should I eat?',
|
||||
'Who will make me a sandwich?',
|
||||
'Where are my glasses?',
|
||||
'Why did I walk into this room?',
|
||||
'Where is the bathroom?',
|
||||
'Where is the mop?',
|
||||
'Why are ants so strong?',
|
||||
'Why do I wake up before my alarm goes off?',
|
||||
'Where do almonds come from?',
|
||||
'When is the sky blue?',
|
||||
'Wherefore art thou Romeo?',
|
||||
'What was the Scratch Cat like as a kitten?',
|
||||
'What is the plural of Moose?',
|
||||
'Whose chair is that?',
|
||||
'Who paid for that floor?',
|
||||
'What is my cat\'s favorite color?',
|
||||
'What is that cat\'s favorite color?',
|
||||
'Does the "close door" button on an elevator really work?'
|
||||
];
|
||||
|
||||
/* eslint-enable max-len */
|
||||
|
||||
class Cats extends React.Component {
|
||||
constructor (props) {
|
||||
super(props);
|
||||
bindAll(this, [
|
||||
'handleCatsClick',
|
||||
'handleClose',
|
||||
'pickRandomFact'
|
||||
]);
|
||||
this.state = {
|
||||
open: false
|
||||
};
|
||||
}
|
||||
|
||||
handleCatsClick () {
|
||||
this.setState({open: true});
|
||||
}
|
||||
|
||||
handleClose () {
|
||||
this.setState({open: false});
|
||||
}
|
||||
|
||||
pickRandomFact () {
|
||||
const randomNumber = Math.floor(Math.random() * (mysteryFacts.length - 1));
|
||||
const catFact = mysteryFacts[randomNumber];
|
||||
return catFact;
|
||||
}
|
||||
|
||||
pickRandomCatImage () {
|
||||
const randomNumber = Math.floor(Math.random() * (catImages.length - 1));
|
||||
const catImage = catImages[randomNumber];
|
||||
return catImage;
|
||||
}
|
||||
|
||||
render () {
|
||||
return (<React.Fragment>
|
||||
<div onClick={this.handleCatsClick}>
|
||||
<a> {'Mystery'} </a>
|
||||
</div>
|
||||
<Modal
|
||||
useStandardSizes
|
||||
className="mod-cats"
|
||||
isOpen={this.state.open}
|
||||
onRequestClose={this.handleClose}
|
||||
>
|
||||
<div className="cats-modal-header modal-header">
|
||||
<ModalTitle title={'Hmmm...'} />
|
||||
</div>
|
||||
<div className="cats-modal-content modal-content">
|
||||
<p> {this.pickRandomFact()} </p>
|
||||
<img src={this.pickRandomCatImage()} />
|
||||
</div>
|
||||
</Modal>
|
||||
</React.Fragment>
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Cats;
|
34
src/components/cats/cats.scss
Normal file
|
@ -0,0 +1,34 @@
|
|||
@import "../../colors";
|
||||
@import "../../frameless";
|
||||
|
||||
.mod-cats {
|
||||
min-height: 15rem;
|
||||
max-height: calc(100% - 5rem);
|
||||
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.cats-modal-header {
|
||||
box-shadow: inset 0 -1px 0 0 $ui-blue-dark;
|
||||
background-color: $ui-blue;
|
||||
}
|
||||
|
||||
.cats-modal-content {
|
||||
margin: 0 auto;
|
||||
box-shadow: none;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
padding: 20px 50px;
|
||||
}
|
||||
|
||||
.cats-modal-content img {
|
||||
width: 400px;
|
||||
|
||||
@media #{$small}, #{$small-height} {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ const React = require('react');
|
|||
|
||||
const FooterBox = require('../container/footer.jsx');
|
||||
const LanguageChooser = require('../../languagechooser/languagechooser.jsx');
|
||||
const Cats = require('../../cats/cats.jsx');
|
||||
|
||||
const frameless = require('../../../lib/frameless');
|
||||
|
||||
|
@ -31,6 +32,9 @@ const Footer = props => (
|
|||
<FormattedMessage id="general.contactUs" />
|
||||
</a>
|
||||
</dd>
|
||||
<dd>
|
||||
<Cats />
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dd>
|
||||
|
@ -92,6 +96,9 @@ const Footer = props => (
|
|||
<FormattedMessage id="general.press" />
|
||||
</a>
|
||||
</dd>
|
||||
<dd>
|
||||
<Cats />
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>
|
||||
|
|
BIN
static/images/cats/1.jpg
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
static/images/cats/2.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
static/images/cats/3.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
static/images/cats/4.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
static/images/cats/Cat1.jpg
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
static/images/cats/Cat2.jpg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
static/images/cats/Cat3.jpg
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
static/images/cats/Cat4.jpg
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
static/images/cats/IMG_0071.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
static/images/cats/IMG_0122.jpg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
static/images/cats/IMG_0135.jpg
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
static/images/cats/IMG_0288.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
static/images/cats/IMG_0504.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
static/images/cats/IMG_0681.jpg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
static/images/cats/IMG_0684.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
static/images/cats/IMG_0698.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
static/images/cats/IMG_1092.jpg
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
static/images/cats/IMG_1157.jpg
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
static/images/cats/IMG_1463.jpg
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
static/images/cats/IMG_1696.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
static/images/cats/IMG_1977.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
static/images/cats/IMG_2507.jpg
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
static/images/cats/IMG_2681.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
static/images/cats/IMG_2775.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
static/images/cats/IMG_2776.jpg
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
static/images/cats/IMG_3218.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
static/images/cats/IMG_5880.jpg
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
static/images/cats/IMG_6020.jpg
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
static/images/cats/IMG_6521.jpg
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
static/images/cats/IMG_6558.jpg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
static/images/cats/IMG_9587.jpg
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
static/images/cats/IMG_9766.jpg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
static/images/cats/IMG_9775.jpg
Normal file
After Width: | Height: | Size: 36 KiB |