2018-07-05 16:49:34 +02:00
|
|
|
import React, { Component } from 'react'
|
2018-07-05 17:28:49 +02:00
|
|
|
import Link from 'gatsby-link'
|
2018-07-05 16:49:34 +02:00
|
|
|
|
2018-09-05 00:07:15 +02:00
|
|
|
import Facebook from '../images/facebook.svg'
|
|
|
|
|
import Instagram from '../images/instagram.svg'
|
|
|
|
|
import Twitter from '../images/twitter.svg'
|
|
|
|
|
import LinkedIn from '../images/linkedin.svg'
|
|
|
|
|
|
2018-07-05 16:53:33 +02:00
|
|
|
import './SideMenu.css'
|
2018-07-05 16:49:34 +02:00
|
|
|
class SideMenu extends Component {
|
2018-07-05 16:53:33 +02:00
|
|
|
componentDidMount() {
|
|
|
|
|
var Slideout = require('slideout')
|
|
|
|
|
|
|
|
|
|
const slideout = new Slideout({
|
|
|
|
|
panel: document.querySelector('.side-panel'),
|
|
|
|
|
menu: document.querySelector('.side-menu'),
|
|
|
|
|
toggle: document.querySelector('.side-toggle'),
|
|
|
|
|
padding: 0,
|
|
|
|
|
tolerance: 70,
|
|
|
|
|
side: 'right',
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
document
|
|
|
|
|
.querySelector('.side-toggle')
|
|
|
|
|
.addEventListener('click', function() {
|
|
|
|
|
slideout.toggle()
|
|
|
|
|
})
|
2018-07-05 17:52:02 +02:00
|
|
|
|
2018-07-10 22:34:52 +02:00
|
|
|
close = () => {
|
2018-07-05 17:52:02 +02:00
|
|
|
slideout.close()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slideout
|
|
|
|
|
.on('beforeopen', function() {
|
|
|
|
|
this.panel.classList.add('panel-open')
|
|
|
|
|
})
|
|
|
|
|
.on('open', function() {
|
|
|
|
|
this.panel.addEventListener('click', close)
|
2018-07-10 22:34:52 +02:00
|
|
|
let closeMenu = document.querySelectorAll('.side-close')
|
|
|
|
|
|
|
|
|
|
Array.from(closeMenu).forEach(trigger => {
|
|
|
|
|
trigger.addEventListener('click', close)
|
|
|
|
|
})
|
2018-07-05 17:52:02 +02:00
|
|
|
})
|
|
|
|
|
.on('beforeclose', function() {
|
|
|
|
|
this.panel.classList.remove('panel-open')
|
|
|
|
|
this.panel.removeEventListener('click', close)
|
|
|
|
|
})
|
2018-07-05 16:53:33 +02:00
|
|
|
}
|
|
|
|
|
|
2018-07-05 16:49:34 +02:00
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<div className="side-menu">
|
2018-09-06 00:15:18 +02:00
|
|
|
<ul className="m-0 p-0 mt-4 side-navigation list-reset">
|
2018-07-10 22:34:52 +02:00
|
|
|
<button className="text-white text-2xl m-2 opacity-50 hover:opacity-100 px-2 side-close">
|
2018-07-05 17:52:02 +02:00
|
|
|
X
|
|
|
|
|
</button>
|
2018-07-10 22:34:52 +02:00
|
|
|
<Link to="/" className="side-close menu-home no-underline">
|
2018-08-29 14:52:49 +02:00
|
|
|
<li className="hover:bg-white hover:text-black text-right no-underline text-2xl uppercase p-4 text-white">
|
2018-07-05 18:14:05 +02:00
|
|
|
Home
|
|
|
|
|
</li>
|
|
|
|
|
</Link>
|
2018-07-10 22:34:52 +02:00
|
|
|
<Link
|
|
|
|
|
to="/services"
|
|
|
|
|
className="side-close menu-services no-underline"
|
|
|
|
|
>
|
2018-08-29 14:52:49 +02:00
|
|
|
<li className="hover:bg-white hover:text-black text-right no-underline text-2xl uppercase p-4 text-white">
|
2018-07-10 11:47:58 +02:00
|
|
|
Services
|
2018-07-05 17:28:49 +02:00
|
|
|
</li>
|
|
|
|
|
</Link>
|
2018-07-10 22:34:52 +02:00
|
|
|
<Link to="/about" className="side-close menu-about no-underline">
|
2018-08-29 14:52:49 +02:00
|
|
|
<li className="hover:bg-white hover:text-black text-right no-underline text-2xl uppercase p-4 text-white">
|
2018-07-10 11:47:58 +02:00
|
|
|
About Us
|
2018-07-05 17:28:49 +02:00
|
|
|
</li>
|
|
|
|
|
</Link>
|
2018-07-10 22:34:52 +02:00
|
|
|
<Link to="/blog" className="side-close menu-blog no-underline">
|
2018-08-29 14:52:49 +02:00
|
|
|
<li className="hover:bg-white hover:text-black text-right no-underline text-2xl uppercase p-4 text-white">
|
2018-07-05 17:28:49 +02:00
|
|
|
Blog
|
|
|
|
|
</li>
|
|
|
|
|
</Link>
|
2018-07-10 22:34:52 +02:00
|
|
|
<Link to="/contact" className="side-close menu-contact no-underline">
|
2018-08-29 14:52:49 +02:00
|
|
|
<li className="hover:bg-white hover:text-black text-right no-underline text-2xl uppercase p-4 text-white">
|
2018-07-10 11:47:58 +02:00
|
|
|
Contact
|
|
|
|
|
</li>
|
|
|
|
|
</Link>
|
2018-07-05 17:28:49 +02:00
|
|
|
</ul>
|
2018-09-05 01:47:51 +02:00
|
|
|
<div className="absolute pin-b hidden social-icons p-8">
|
2018-09-05 00:07:15 +02:00
|
|
|
<div>
|
2018-09-14 12:52:11 +02:00
|
|
|
<a
|
|
|
|
|
href="https://facebook.com/saburly"
|
|
|
|
|
rel="noreferrer"
|
|
|
|
|
target="_blank"
|
|
|
|
|
>
|
2018-09-05 00:07:15 +02:00
|
|
|
<img
|
|
|
|
|
src={Facebook}
|
|
|
|
|
alt="Facebook Social Media"
|
|
|
|
|
className="w-full p-2 saburly-transition opacity-80 hover:opacity-100"
|
|
|
|
|
/>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
2018-09-14 12:52:11 +02:00
|
|
|
<a
|
|
|
|
|
href="https://instagram.com/saburly"
|
|
|
|
|
rel="noreferrer"
|
|
|
|
|
target="_blank"
|
|
|
|
|
>
|
2018-09-05 00:07:15 +02:00
|
|
|
<img
|
|
|
|
|
src={Instagram}
|
|
|
|
|
alt="Instagram Social Media"
|
|
|
|
|
className="w-full p-2 saburly-transition opacity-80 hover:opacity-100"
|
|
|
|
|
/>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
2018-09-14 12:52:11 +02:00
|
|
|
<a
|
|
|
|
|
href="https://twitter.com/saburly"
|
|
|
|
|
rel="noreferrer"
|
|
|
|
|
target="_blank"
|
|
|
|
|
>
|
2018-09-05 00:07:15 +02:00
|
|
|
<img
|
|
|
|
|
src={Twitter}
|
|
|
|
|
alt="Twitter Social Media"
|
|
|
|
|
className="w-full p-2 saburly-transition opacity-80 hover:opacity-100"
|
|
|
|
|
/>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
2018-09-14 12:52:11 +02:00
|
|
|
<a
|
|
|
|
|
href="https://www.linkedin.com/company/saburly/"
|
|
|
|
|
rel="noreferrer"
|
|
|
|
|
target="_blank"
|
|
|
|
|
>
|
2018-09-05 00:07:15 +02:00
|
|
|
<img
|
|
|
|
|
src={LinkedIn}
|
|
|
|
|
alt="LinkedIn Social Media"
|
|
|
|
|
className="w-full p-2 saburly-transition opacity-80 hover:opacity-100"
|
|
|
|
|
/>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2018-07-05 16:49:34 +02:00
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default SideMenu
|