H5 Resources

HTML5

html5rocks

首先要提的是很多时候我们都不确定这个HTML5能不能在我们的APP里面使用,是的,当遇到这种情况首先是打开Can I Use,如果还需要更多的信息,那就去这个上面看看吧

html5doctor

html5please

diveintohtml5

互联网时代的资源非常丰富,在网上一搜一大把,身边也不乏同事用T级别的硬盘来存储资源,不过我坚信适合自己的并且能解决自己问题的资源才是最好的。

相信大家应该经常刷微信,然后经常会看到一些非常炫酷的H5页面。对没错,把链接放到chrome里面调试,相信你一定会有收获的。

最简单的,判断浏览器的

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<script type="text/javascript">
!function(){var a=navigator.userAgent;-1==a.indexOf("iPhone")&&-1==a.indexOf("iPad")&&-1==a.indexOf("iPod")&&-1==a.indexOf("Android")&&(self.location="http://your/location/for/pc/")}();
var browser={
versions:function(){
var u = navigator.userAgent, app = navigator.appVersion;
return {
webKit: u.indexOf('AppleWebKit') > -1,
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
weixin: u.indexOf('MicroMessenger') > -1,
txnews: u.indexOf('qqnews') > -1,
sinawb: u.indexOf('weibo') > -1,
mqq : u.indexOf('QQ') > -1
};
}(),
language:(navigator.browserLanguage || navigator.language).toLowerCase()
};

if (browser.versions.android||browser.versions.weixin||browser.versions.txnews||browser.versions.mqq){
self.location="http://your/location/for/mobile";
}
</script>

做H5开发最经常打交道的是各种手机和尺寸了,一般开发者都会知道iPhone4,5,6,6+的尺寸,但这远远是不够的,最后自己在这里找到了想要的,另外你也可以把他的代码重用一下,因为在做移动端开发时会对某些尺寸的手机做一些适配工作,

参考资料:
https://github.com/gloparco/Master-List-of-HTML5-JS-CSS-Resources