Skip to content

Instantly share code, notes, and snippets.

View benz2012's full-sized avatar

Ben Zenker benz2012

View GitHub Profile
@benz2012
benz2012 / index.jsx
Created November 3, 2017 20:27
React Portal Modal with Blurred Background
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
const Blur = (radius) = `
filter: url(#svgBlur);
filter: blur(${radius || 5}px);
`
const SVGBlur = ({ radius }) = (
<svg style={{ position: 'absolute', top: '-99999px' }} xmlns="http://www.w3.org/2000/svg">
@benz2012
benz2012 / getClientHTML.js
Last active October 4, 2017 20:57
Node.js Scraper for Client Rendered HTML
const phantom = require('phantom')
const clientRenderedHtml = (url, callback) => {
let _ph, _page, _content
phantom.create().then(ph => {
_ph = ph
return _ph.createPage()
}).then(page => {
_page = page
return _page.property('viewportSize', { width: 1920 })