Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature orizontal menu #80

Merged
merged 29 commits into from
Apr 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4e3946f
first version of the IconMenu
kalwalt Apr 13, 2019
f8eeaa6
added eventlistener for the animations
kalwalt Apr 14, 2019
8a726ab
passing href arguments to the component
kalwalt Apr 14, 2019
7c9d7be
is-8 become is-4
kalwalt Apr 14, 2019
b6e9fd2
a new full image for the home page
kalwalt Apr 14, 2019
88900a6
Merge branch 'improvements-home-page' of github.com:kalwalt/gatsby-st…
kalwalt Apr 15, 2019
9bf28c6
miised image and heading props
kalwalt Apr 15, 2019
9fdb865
including the iconMenu into a div with a container and a section class
kalwalt Apr 15, 2019
7e57fd1
adding true property (userCapture) for the addEventListener
kalwalt Apr 15, 2019
922cc0d
simple banner
kalwalt Apr 19, 2019
8d3dd58
slogan banner improvement
kalwalt Apr 19, 2019
f790a5a
working on a card id
kalwalt Apr 19, 2019
afd0d2b
improved card, but img-rounded does not works
kalwalt Apr 19, 2019
48bcae3
is-rounded solved with inline styling for now
kalwalt Apr 20, 2019
4945463
all the props are passed to the CardSlide Component
kalwalt Apr 20, 2019
c81a8b5
added Tesimonials Component
kalwalt Apr 20, 2019
9fcdb19
addin content classNmae to initial div
kalwalt Apr 20, 2019
e47c417
creating a Banner Component from the Home template
kalwalt Apr 20, 2019
cf8cc2d
icon color changed
kalwalt Apr 20, 2019
e198fd6
better lintering
kalwalt Apr 20, 2019
29f1ecd
added a div and a subtitle
kalwalt Apr 20, 2019
04a12aa
better styling
kalwalt Apr 22, 2019
144ba63
adding react-wow
kalwalt Apr 22, 2019
efd001d
it seems that fa-stack works in this way
kalwalt Apr 23, 2019
e549aa6
reformatting the icon menu with fontawesome
kalwalt Apr 23, 2019
c5e5c1e
added some "lorem ipsum" text to the home page
kalwalt Apr 28, 2019
fcc3a21
replaced react-dom for @hot-loader/react-dom because an issue
kalwalt Apr 28, 2019
9e73007
minor fixes in the home template
kalwalt Apr 28, 2019
01b00a9
adding WoW animation to CardSlide Component
kalwalt Apr 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@
"node-sass": "^4.11.0",
"path": "^0.12.7",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"@hot-loader/react-dom": "^16.3.1",
"react-helmet": "^5.2.0",
"react-icon-base": "^2.1.2",
"react-icons": "^3.5.0",
"react-image-gallery": "^0.8.14",
"react-intl": "^2.7.2",
"react-typography": "^0.16.3",
"react-wow": "^1.0.0",
"slash": "^2.0.0",
"slug": "^1.0.0",
"style-loader": "^0.23.1",
Expand Down
46 changes: 46 additions & 0 deletions src/components/Banner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from "react"
import ReactWOW from 'react-wow'
import * as PropTypes from "prop-types"
import { FaAward } from 'react-icons/fa'
import PreviewImage from '../components/PreviewCompatibleImage'

const Banner = ({main, mainpitch}) =>(

<section className="section banner">
<ReactWOW animation='bounceInUp'>
<div className="container">
<div className="columns is-size-5-mobile is-size-5-tablet is-size-4-widescreen">
<div className="column is-three-fifths is-offset-one-fifth"
style={{
backgroundImage: 'linear-gradient(rgb(255, 68, 0), yellow)',
borderRadius: '4px',
}}>
<PreviewImage imageInfo={main}/>
<div className="section">
<div className="tile is-parent">
<div className="tile is-child notification is-success">
<div className="content">
<FaAward color="magenta" className="icon is-large"/>
<h3 className="title is-2">
{mainpitch.title}
</h3>
<p className="subtitle is-4">
{mainpitch.description}
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ReactWOW>
</section>
)

Banner.propTypes = {
main: PropTypes.object,
mainpitch: PropTypes.object,
}

export default Banner
71 changes: 71 additions & 0 deletions src/components/CardSlide.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import React from 'react'
import ReactWOW from 'react-wow'
import Img from 'gatsby-image'
import * as PropTypes from "prop-types"

const CardImageSlide = ({ imageInfo }) => {
const { alt = '', childImageSharp, image } = imageInfo
const imageStyle = { borderRadius: '50%' }

if (!!image && !!image.childImageSharp) {
return (
<Img style={imageStyle} fluid={image.childImageSharp.fluid} alt={alt} />
)
}

if (!!childImageSharp) {
return (
<Img style={imageStyle} fluid={childImageSharp.fluid} alt={alt} />
)
}

if (!!image && typeof image === 'string')
return <img style={imageStyle} src={image} alt={alt} />
return null
}

CardImageSlide.propTypes = {
imageInfo: PropTypes.shape({
alt: PropTypes.string,
childImageSharp: PropTypes.object,
image: PropTypes.oneOfType([PropTypes.object, PropTypes.string]).isRequired,
}).isRequired,
}

class CardSlide extends React.Component {

render(){
const props = this.props;
const imageInfo = props.imageInfo;
const name = props.imageInfo.name;
const description = props.imageInfo.description;
const website = props.imageInfo.website;

return (
<div className="section card-slide">
<div className="card">
<div className="card-content">
<div className="media">
<div className="media-left">
<figure className="image is-128x128">
<CardImageSlide imageInfo={imageInfo}/>
</figure>
</div>
<div className="media-content">
<ReactWOW animation='pulse'>
<p className="title is-4">{name}</p>
</ReactWOW>
<ReactWOW delay='1s' animation='shake'>
<p className="title is-6">{description}</p>
</ReactWOW>
<br/>
<a href={"https://" + website}><i className="is-family-code">{website}</i></a>
</div>
</div>
</div>
</div>
</div>
)}
}

export default CardSlide
100 changes: 100 additions & 0 deletions src/components/IconMenu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FaCircle, FaPaintBrush, FaGavel, FaBolt, FaHandPointer } from 'react-icons/fa';
import { FormattedMessage } from 'react-intl';

const IconMenu = class extends React.Component {

componentDidMount() {
// Get all "icon" elements
const sectionMenu = Array.prototype.slice.call(document.querySelectorAll('.icon'), 0);
// Check if there are any icon links
if (sectionMenu.length > 0) {

// Add a mouseenter event on each of them
sectionMenu.forEach( el => {
el.addEventListener('mouseenter', () => {
el.classList.toggle('shake');
}, true);
});
}

}
render() {
const firstLink = this.props.firstLink;
const secondLink = this.props.secondLink;
const thirdLink = this.props.thirdLink;
const fourthLink = this.props.fourthLink;
return(
<div className="section box">
<div className="section">
<h3 className="title has-text-centered">
<FormattedMessage id="menu-icon-message"/>
</h3>
</div>
<div className="box">
<div className="content">
<h4 className="subtitle has-text-centered">
<FormattedMessage id="menu-icon-subtitle"/>
</h4>
</div>
<div className="columns is-4 is-mobile is-multiline is-centered">
<a className="column is-narrow has-text-centered" href={firstLink}>
<span className="fa icon is-large fa-2x fa-stack animated">
<FaCircle className="fa fa-stack-2x"/>
<FaPaintBrush className="fa fa-stack-1x fa-inverse"/>
</span>
<div className="section">
<h4 className="title has-text-centered">
<FormattedMessage id="menu-icon-painting"/>
</h4>
</div>
</a>
<a className="column is-narrow has-text-centered" href={secondLink}>
<span className="fa icon is-large fa-2x fa-stack animated">
<FaCircle className="fa fa-stack-2x"/>
<FaGavel className="fa fa-stack-1x fa-inverse"/>
</span>
<div className="section">
<h4 className="title has-text-centered">
<FormattedMessage id="menu-icon-sculpture"/>
</h4>
</div>
</a>
<a className="column is-narrow has-text-centered" href={thirdLink}>
<span className="fa icon is-large fa-2x fa-stack animated">
<FaCircle className="fa fa-stack-2x"/>
<FaBolt className="fa fa-stack-1x fa-inverse"/>
</span>
<div className="section">
<h4 className="title has-text-centered">
<FormattedMessage id="menu-icon-performance"/>
</h4>
</div>
</a>
<a className="column is-narrow has-text-centered" href={fourthLink}>
<span className="fa icon is-large fa-2x fa-stack animated">
<FaCircle className="fa fa-stack-2x"/>
<FaHandPointer className="fa fa-stack-1x fa-inverse"/>
</span>
<div className="section">
<h4 className="title has-text-centered">
<FormattedMessage id="menu-icon-interactivity"/>
</h4>
</div>
</a>
</div>
</div>
</div>
)
}
};

IconMenu.propTypes = {
firstLink: PropTypes.string,
secondLink: PropTypes.string,
thirdLink: PropTypes.string,
fourthLink: PropTypes.string,
}

export default IconMenu;
28 changes: 28 additions & 0 deletions src/components/Testimonials.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react'
import PropTypes from 'prop-types'
import { v4 } from 'uuid'

const Testimonials = ({ testimonials }) => (
<div className="content">
{testimonials.map(testimonial => (
<article key={v4()} className="message is-medium">
<div style={{ paddingTop: "10%", paddingBottom: "10%"}} className="message-body testimonials">
{testimonial.quote}
<br />
<cite>{testimonial.author}</cite>
</div>
</article>
))}
</div>
)

Testimonials.propTypes = {
testimonials: PropTypes.arrayOf(
PropTypes.shape({
quote: PropTypes.string,
author: PropTypes.string,
})
),
}

export default Testimonials
37 changes: 37 additions & 0 deletions src/components/all.sass
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import "~bulma/sass/utilities/initial-variables"
@import "~animate.css/animate.css"
@import "~font-awesome/css/font-awesome.css"

// Config vars
// Kalidi logo brand color: #FD461E
Expand Down Expand Up @@ -50,6 +51,15 @@ $linkedin-color: #57F9FF
justify-content: center
align-items: center

.full-width-image
width: 100vw
height: 400px
background-size: cover
background-position: bottom
display: flex
justify-content: center
align-items: center

.margin-top-0
margin-top: 0 !important

Expand Down Expand Up @@ -104,4 +114,31 @@ footer.footer
margin-left: .5em
margin-right: .5em

.menu-icon
padding: 2em
.menu-icon ul li a
padding: .5em .5em .5em .5em
margin: .5em
//width: 1em
//height: 1em
vertical-align: middle
display: inline
background-color: red
border-radius: 5px
position: relative

.banner
margin-top: 10%
margin-bottom: 10%

.testimonials
margin-top: 10%
margin-bottom: 10%

.card-slide
margin-top: 10%
margin-bottom: 10%
.card-content
padding: 5%

@import "~bulma"
6 changes: 6 additions & 0 deletions src/data/messages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ module.exports = {
'not_found': "404 - Page Not Found",
'404': "You are arrived to an unvailable page or you have missed the path...",
'copyright': "2019, KAKI - All rights reserved.",
'menu-icon-message': "Choose a section",
'menu-icon-subtitle': "Artworks sections",
'menu-icon-painting': "Painting",
'menu-icon-sculpture': "Sculpture",
'menu-icon-performance': "Performance",
'menu-icon-interactivity': "Interactivity",
};
6 changes: 6 additions & 0 deletions src/data/messages/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ module.exports = {
'not_found': "404 - Pagina Non Trovata",
'404': "Sei giunto ad una pagina che non esiste più o hai sbagliato il percorso...",
'copyright': "2019, KAKI - Tutti i diritti riservati.",
'menu-icon-message': "Scegli una sezione",
'menu-icon-subtitle': "Sezione opere d'arte",
'menu-icon-painting': "Pittura",
'menu-icon-sculpture': "Scultura",
'menu-icon-performance': "Performance",
'menu-icon-interactivity': "Interattività",
};
Loading