Skip to content

Instantly share code, notes, and snippets.

@hpstuff
Created January 9, 2017 15:43
Show Gist options
  • Save hpstuff/5c2ad87e8fa0d50481ed13a6af83c4ce to your computer and use it in GitHub Desktop.
Save hpstuff/5c2ad87e8fa0d50481ed13a6af83c4ce to your computer and use it in GitHub Desktop.
<!-- use with image //-->
<HoverComponent [imageUrl]="url">
<div class="article-info">
<time>{{date}}</time>
<h1>{{title}}</h1>
</div>
</HoverComponent>
<!-- use with video //-->
<HoverComponent (onHover)="video.play()">
<!-- this is named ng-content //-->
<div class="video" background >
<video #video></video>
</div>
<div class="article-info">
<time>{{date}}</time>
<h1>{{title}}</h1>
</div>
</HoverComponent>
<!-- template //-->
<section
on-mouseover="hover = true; triggerHover()"
on-mouseleave="hover = false"
[class.hover]="hover"
(click)="handleClick()"
[ngStyle]="{'background-image': 'url(' + imageUrl + ')'}"
>
<!-- we left imageUrl so we don't have to change alot //-->
<div class="background-wrapper" *ngIf="!imageUrl">
<ng-content select="[background]"></ng-content>
</div>
<div class="basic-info">
<ng-content></ng-content>
</div>
<div class="block-overlay"></div>
</section>
<!-- template //-->
<HoverComponent *mediaIf="'only desktop'">(...)</HoverComponent>
<other-hover-html *mediaIf="'not desktop'">(...)</other-hover-html>
<!-- use //-->
<TileHoverComponent>
<div class="video" background >
<video #video></video>
</div>
<div class="article-info">
<time>{{date}}</time>
<h1>{{title}}</h1>
</div>
</TileHoverComponent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment