Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
feat(glass): add overlay to blur
Browse files Browse the repository at this point in the history
  • Loading branch information
adriancarriger authored and adriancarriger committed Feb 15, 2018
1 parent a88110c commit c92be6c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ declare global {
namespace JSXElements {
export interface FrostedGlassAttributes extends HTMLAttributes {
blurAmount?: string;
overlayColor?: string;
uuid?: string;
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/components/frosted-glass/frosted-glass.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ frosted-glass {
position: absolute;
width: 100vw;
}

.overlay {
background-color: transparent;
bottom: 0;
content: '';
left: 0;
position: absolute;
right: 0;
top: 0;
}
}

.glass-content {
Expand Down
2 changes: 2 additions & 0 deletions src/components/frosted-glass/frosted-glass.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { tempClosest } from '../../util';
export class FrostedGlass {
@Element() el: HTMLElement;
@Prop() uuid: string;
@Prop() overlayColor: string;
@Prop() blurAmount = '15px';
@State() blurOffsetLeft = 0;
@State() blurOffsetTop = 0;
Expand Down Expand Up @@ -58,6 +59,7 @@ export class FrostedGlass {
top: `-${this.blurOffsetTop}px`,
transform: `translateY(-${this.scrollOffset}px)`
}}></div>
<div style={{'background-color': this.overlayColor}} class="overlay"></div>
</div>,
<div class={`glass-content${this.isFixed ? ' fixed': ''}`}><slot /></div>
]
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
</ul>
</frosted-glass>
<div class="hero-container">
<frosted-glass class="hero-value-add">
<frosted-glass overlay-color="#ffffff52" class="hero-value-add">
<h1><span class="hero-focus">Frosted Glass</span></h1>
<div class="hero-details">next level street art gastropub flannel keytar sartorial sustainable ennui Brooklyn kitsch artisan typewriter</div>
<button class="hero-cta">Order now</button>
Expand Down

0 comments on commit c92be6c

Please sign in to comment.