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
function RgbToHsv(r, g, b) { | |
var min = Math.min(r, g, b), | |
max = Math.max(r, g, b), | |
delta = max - min, | |
h, s, v = max; | |
v = Math.floor(max / 255 * 100); | |
if (max == 0) return {h: 0, s: 0, v: 0}; | |
s = Math.floor(delta / max * 100); | |
var deltadiv = delta == 0 ? 1 : delta; |
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 lang="en"> | |
<head> | |
<title>Template Example</title> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<section id="placeholder0"></section> | |
<section id="placeholder1"></section> |
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 lang="en"> | |
<head> | |
<title>Underscore Template Example</title> | |
<meta charset="utf-8"> | |
<style> | |
.viewer {width:240px;height:280px;margin:10px;float:left;border:1px solid red} | |
.viewer nav {width:100%;height:50px;border:1px solid green} | |
.viewer nav a {width:30px;height:30px;float:left;margin:5px;border:1px solid orange} | |
.viewer aside {width:106px;height:210px;margin:5px 0 0;border:1px solid purple} |
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 lang="en" ng-app="app"> | |
<head> | |
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> | |
<head> | |
<title>Angular Template Example</title> | |
<style> | |
.viewer {width:240px;height:280px;margin:10px;float:left;border:1px solid red} | |
.viewer nav {width:100%;height:50px;border:1px solid green} | |
.viewer nav a {width:30px;height:30px;float:left;margin:5px;border:1px solid orange} |
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
(function () { | |
'use strict'; | |
var str = window.navigator.userAgent, | |
ie11 = /Trident\/7\.0/, | |
docMode8 = /MSIE 8\.0/; | |
if (ie11.test(str) && docMode8.test(str)) { | |
$('<link/>', { | |
rel: 'stylesheet', | |
type: 'text/css', |
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
/* | |
domModified | |
Add mutation listener to DOM element and trigger callback once it has completed | |
https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver | |
Usage: | |
domModified({ | |
selector: '#selector', |
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
(function () { | |
var el = document.querySelector('#header'), | |
className = 'fixed', | |
offset = (el.offsetTop + el.offsetHeight), | |
scrollTop = function () { | |
return document.body.scrollTop || document.documentElement.scrollTop; | |
}; | |
if (scrollTop() > offset) { | |
el.className = className; |
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
var tapFlag = 0, | |
tapping = function (ev) { | |
var bool = false; | |
if (ev.type === 'touchstart') { | |
tapFlag = 1; | |
} | |
if (ev.type === 'touchmove') { | |
tapFlag = 0; | |
} | |
if (ev.type === 'touchend') { |
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
/* jshint strict: true */ | |
/* globals $ */ | |
/* | |
* Show a "Download App" notification on Android and iPhone. | |
* Notification will appear once per page every 30 days unless dismissed, | |
* once dismissed, it won't show again for 30 days | |
*/ | |
(function () { |
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 lang="en"> | |
<head> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.0.8/css/swiper.min.css"> | |
<style> | |
.swiper-container img { | |
max-width:100%; | |
} | |
.swiper-slide { |
OlderNewer