<div id='app'>
	<fx-blur>
		<nav class="composite navbar navbar-flush">
			<div class="container-fluid">
				<!-- Brand and toggle get grouped for better mobile display-->
				<div class="navbar-header">
					<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand ion-ios-infinite" href="#"></a>
				</div>
				<!-- Collect the nav links, forms, and other content for toggling-->
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
						<li><a href="#">Link</a></li>
						<li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="ion-ios-arrow-down"></span></a>
							<ul class="dropdown-menu">
								<li><a href="#">Action</a></li>
								<li><a href="#">Another action</a></li>
								<li><a href="#">Something else here</a></li>
								<li class="divider" role="separator"></li>
								<li><a href="#">Separated link</a></li>
								<li class="divider" role="separator"></li>
								<li><a href="#">One more separated link</a></li>
							</ul>
						</li>
					</ul>
					<ul class="nav navbar-nav navbar-right">
						<li><a class="ion-ios-heart" href="#"></a></li>
						<li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="ion-android-search"></span><span>	Search</span></a>
							<ul class="dropdown-menu">
								<li><a href="#">Action</a></li>
								<li><a href="#">Another action</a></li>
								<li><a href="#">Something else here</a></li>
								<li class="divider" role="separator"></li>
								<li><a href="#">Separated link</a></li>
							</ul>
						</li>
					</ul>
				</div>
				<!-- /.navbar-collapse-->
			</div>
			<!-- /.container-fluid-->
		</nav>
	</fx-blur>
</div>


<div class="jumbotron">
  <div class="align pull-reset">
    <div class="col-md-4 col-sm-6 row">
      <div class="panel">
        <div class="panel-heading">
          <h2>Scroll down</h2>
        </div>
        <div class="panel-body">
          <p>keep your eyes on the navbar.</p>
					<sup>Cross origin images do not work</sup>
        </div>
        <div class="panel-footer clearfix">
          <button class="pull-right btn btn-default" type="button">Okay</button>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="container-fluid">
  <div class="col-md-10">
    <h1 class="hr">Heading h1</h1>
    <p class="psudo-col-2 text-light">
       Lorem ipsum dolor sit amet, sea nibh quaestio repudiare an, eos et homero constituto. An quot adhuc mei, consul inimicus honestatis mel ut. Has veri erat intellegebat in. Usu agam magna nonumes eu, id mea dolore feugait cotidieque. In pro duis utamur fabulas, ei suas deserunt atomorum mei. Has eu percipit evertitur. Eam falli mollis ad. Praesent cotidieque usu in, pro quidam omnium gubergren et, recusabo persequeris an has. Duo te ipsum deleniti consulatu, ei nulla oporteat ius, eu est definiebas efficiendi. Nam ad solum suavitate expetendis, pri eu sint assueverit eloquentiam. No eripuit molestie est, nam falli audire electram te.</p>
  </div>
  <div class="col-md-2">
    <aside>
      <button class="pull-right btn btn-default" type="button">ye olde Bootstrap</button>
    </aside>
  </div>
  <div class="col-md-10">
    <h2 class="hr">Heading h2</h2>
    <button class="btn btn-default" type="button">Bootstrap</button>
  </div>
</div>
<!--.composite-->
body {
  font-size: 1rem;
}
nav.navbar {
  font-size: 1.4em;
}
[class^='ion-'] {
  font-size: 1em;
}
p {
  font-size: 1.7em;
  line-height: 1.6;
}
p.text-light {
  color: #d5d1d7;
}
.jumbotron {
  padding-left: 45px;
  padding-right: 45px;
}
.jumbotron h1,
.jumbotron h2,
.jumbotron h3,
.jumbotron h4,
.jumbotron h5 {
  font-weight: 100;
  font-size: 4.8em;
}
h1.hr,
h2.hr,
h3.hr,
h4.hr,
h5.hr {
  position: relative;
  overflow-x: hidden;
  font-wieght: 300;
  color: #e2e2e2;
  position: relative;
  font-family: 'Lato', sans-serif;
  font-weight: 100;
  display: table;
  white-space: nowrap;
}
h1.hr:after,
h2.hr:after,
h3.hr:after,
h4.hr:after,
h5.hr:after {
  content: "";
  border-bottom: #717171 0.06em solid;
  width: 0%;
  display: table-cell;
  width: 100%;
  padding-left: 20px;
  position: relative;
  left: 10px;
}
.btn.btn-default {
  border-radius: 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 3.688rem;
  padding: 0 2.875rem;
  border: 0;
  background-color: #288edf;
  box-shadow: inset 0 1px rgba(255,255,255,0.36);
  color: #fff;
  font-weight: 500;
  text-shadow: 0 -1px rgba(0,0,0,0.36);
}
.btn.btn-default:active {
  background-color: #1e7dc8;
  box-shadow: inset 0 1px rgba(0,0,0,0.12);
  color: #fafafa;
}
nav.navbar {
  border: 0;
  background-color: rgba(255,255,255,0);
  height: 64px;
  border-radius: 0;
}
.navbar-flush {
  margin-bottom: 0;
}
body {
  background-color: #444;
}
.jumbotron .align {
  display: table-cell;
  vertical-align: middle;
}
[class^='panel'] {
  border-radius: 0;
}
[class^='panel'] h1,
[class^='panel'] h2,
[class^='panel'] h3,
[class^='panel'] h4,
[class^='panel'] h5 {
  font-size: 3.4em;
  color: #444;
}
.panel-footer {
  background-color: rgba(255,255,255,0);
  border: 0;
}

.pull-reset {
  float: none;
}
.container-fluid {
  padding-left: 45px;
  padding-right: 45px;
}
.jumbotron {
  background-image: url('data:image/svg+xml,%3Csvg width="64" height="64" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zm0-2c3.314 0 6-2.686 6-6s-2.686-6-6-6-6 2.686-6 6 2.686 6 6 6zm33.414-6l5.95-5.95L45.95.636 40 6.586 34.05.636 32.636 2.05 38.586 8l-5.95 5.95 1.414 1.414L40 9.414l5.95 5.95 1.414-1.414L41.414 8zM40 48c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zm0-2c3.314 0 6-2.686 6-6s-2.686-6-6-6-6 2.686-6 6 2.686 6 6 6zM9.414 40l5.95-5.95-1.414-1.414L8 38.586l-5.95-5.95L.636 34.05 6.586 40l-5.95 5.95 1.414 1.414L8 41.414l5.95 5.95 1.414-1.414L9.414 40z" fill="%239C92AC" fill-opacity="0.4" fill-rule="evenodd"/%3E%3C/svg%3E');
  background-size: cover;
  background-position: left;
  display: table;
  width: 100%;
  height: 536px;
}
const FxBlur = {
	template: `
		<div data-html2canvas-ignore 
				class="fx-RootContent" 
				:style='rootStyle'>
				<div class='fx-Crop' :style='cropStyle'>
					<slot/>
					<canvas 
						ref='composite'
						:style='compositeStyle'
						class='fx-Blur'
						:height='composite.height' 
						:width='composite.width'/>
				</div>
		</div>`,
	name: 'FxBlur',
	data() {
		return {
			composite: {
				width: 0,
				height: 0
			},
			canvasCreated: false,
			css: {
				ns: 'FxBlur',
				compositeClear: 'composite-clear',
				compositeImage: 'composite-raster'
			},
			rootStyle: {
				position: 'fixed',
				width: '100%',
				zIndex: 1
			},
			compositeStyle: {
				left: 0,
				top: 0,
				overflow: 'hidden',
				position: 'fixed',
				zIndex: -1,
				filter: 'blur(3px)',
				transform: 'var(--FxBlur-scroll-pos-y)',
				willChange: 'transform'
			},
			cropStyle: {
				clipPath: 'polygon(0 0, 100% 0, 100% 100%, 0% 100%)'
			}
		}
	},
	computed: {
		docSize () {
			const { height, width } = document.body.getBoundingClientRect();
			return { height, width };
		},
		slotElem () {
			return this.$slots.default[0].elm;
		},
		getElComposite () {
			return this.$refs.composite;
		}
	},
	methods: {
		setFxBlurCssProp({property, value}) {
			document.documentElement.style.setProperty(
				`--${this.css.ns}-${property}`, value
			);
		},
		setIsWindowResizing(isResizing) {
			this.setFxBlurCssProp({
				property: this.css.compositeClear,
				value: isResizing ? "none" : "true"
			});
		},
		async rasterizeDocument() {
			const { width, height } = this.docSize;
			const canvas = await html2canvas(document.body, {
				canvas: this.getElComposite,
				width,
				height,
				scale: 1
			});
			return {
				canvas,
				height,
				width
			}
		},
		setupCanvas({width, height}) {
			this.composite.width = width;
			this.composite.height = height;
		},
		async drawFx({width, height}) {
			this.setIsWindowResizing(false);
			this.setupCanvas({width, height});
			const result = await this.rasterizeDocument();
		},
	},
	async mounted() {
		// set scroll position variable
		const { scrollY } = window;
		const property = 'scroll-pos-y';
		this.setFxBlurCssProp({property, value: `translateY(-${scrollY}px)`});
		window.addEventListener('scroll', (e) => {
      const { scrollY } = window;
			this.setFxBlurCssProp({property, value: `translateY(-${scrollY}px)`});
    });
		
		// resize
		let resizeTimer;
		window.addEventListener('resize', ({target}) => {
			this.setIsWindowResizing(true);
			this.composite.width = `${target.innerWidth}px`;
			clearTimeout(resizeTimer);
			resizeTimer = setTimeout(() => {
				this.drawFx({
					width: target.innerWidth,
					height: this.docSize.height
				});
			}, 250);
		});
		this.composite.width = `${window.innerWidth}px`;
		this.drawFx({
			width: this.docSize.width,
			height: this.docSize.height
		});
	}
};

new Vue({
	el: '#app',
	components: {
		'fx-blur': FxBlur
	}
}).$mount();
View Compiled

External CSS

  1. https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
  2. https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css

External JavaScript

  1. https://cdn.jsdelivr.net/npm/html2canvas@1.0.0-rc.5/dist/html2canvas.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js