This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This component shows a smaller image or a base64 encoded image till the bigger version is fully loaded. | |
Added a blur/fade effect for the transition. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Trying to lazy load images. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, h, cloneElement } from 'preact'; | |
export default class SwipeRecognizer extends Component { | |
tolerance = 100; | |
gesture = { x: [], y: [], match: '' }; | |
componentDidMount() { | |
this.base.addEventListener('touchstart', this.capture); | |
this.base.addEventListener('touchmove', this.capture); | |
this.base.addEventListener('touchend', this.compute) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'core-js/es6'; | |
import 'core-js/es7/reflect'; | |
import 'reflect-metadata'; | |
import 'zone.js/dist/zone'; | |
import 'zone.js/dist/long-stack-trace-zone'; | |
import 'zone.js/dist/proxy'; | |
import 'zone.js/dist/sync-test'; | |
import 'zone.js/dist/jasmine-patch'; | |
import 'zone.js/dist/async-test'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, h } from 'preact'; | |
import ListItem from '../list-item'; | |
export default class List extends Component<{}, { indices: number[] }> { | |
state = { indices: [0, 1, 2, 3] }; | |
public render() { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ngOnInit() { | |
this.navigationResults = this.helpDataService.getMainGroups() | |
.concat(this.filterBox.valueChanges | |
.let((text: Observable<string>) => this.filterAndDebounceFor(text)(500)) | |
.switchMap((filterTerm: string) => | |
this.defaultObservableIfEmpty( | |
this.helpDataService.getNavigationByFilter(filterTerm), | |
this.helpDataService.getMainGroups()))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
languageChangedSubscription = this.languageService.languageChanged | |
.subscribe((language: string) => { | |
this.updateViewData(language); | |
}); | |
updateViewData(language: string) { | |
this.searchResults = this.searchBox.valueChanges | |
.let((text: Observable<string>) => this.filterAndDebounceFor(text)(150)) | |
.switchMap((searchTerm: string) => this.helpDataService.search(searchTerm, language)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AfterViewChecked, Component, EventEmitter, Input, Output } from '@angular/core'; | |
@Component({ | |
selector: 'seveves-checkbox', | |
template: ` | |
<fieldset class="form-group"> | |
<div class="form-check"> | |
<label class="form-check-label" [for]="name"> | |
<input type="checkbox" | |
[id]="name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"extends": "tslint:recommended", | |
"rulesDirectory": ["path/to/custom/rules/directory/", "another/path/"], | |
"rules": { | |
"max-line-length": { | |
"options": [120] | |
}, | |
"new-parens": true, | |
"no-arg": true, | |
"no-bitwise": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
OlderNewer