Skip to content

Instantly share code, notes, and snippets.

// 【录制】
//从麦和设像头显示视频
my_video.attachVideo(Camera.get());
my_video.attachAudio(Microphone.get());
//连接
nc = new NetConnection();
nc.connect("rtmp://localhost/aaaa");
nsOut = new NetStream(nc);
nsOut.attachVideo(Camera.get());
nsOut.attachAudio(Microphone.get());
.thing-that-moves {
position: absolute;
width: 100px;
height: 100px;
background: red;
top: 0;
left: 0;
transition: left 0.5s; /* BYO prefixes */
}
/* 不同尺寸不同定位 */
@bennyzhao
bennyzhao / major.css
Last active December 24, 2015 21:19
Hide scroll bar
/* webkit */
.some-element::-webkit-scrollbar {
display:none;
}
/* IE10 -> http://msdn.microsoft.com/en-us/library/ie/hh771902(v=vs.85).aspx */
-ms-overflow-style: -ms-autohiding-scrollbar;
$size : 100%;
$transition: .4s;
$toggled-size : .75;
$bodybg : #449a88;
$navbg : #2a2a2a;
$pagebg : #e7e6dd;
.navicon-button {
@bennyzhao
bennyzhao / blur.css
Created October 4, 2013 01:48
iOS7 Style Blurring Glass Effect From:http://codepen.io/rikschennink/pen/zvcgx
/*Key Method
-webkit-filter: blur(10px);
*/
::-webkit-scrollbar {
display: none;
}
html {
font-family:"Helvetica Neue","Helvetica",sans-serif;
<head>
<!-- Plain script elements -->
<!--Download together, execute in order after any pending CSS,
block rendering until complete-->
<script src="//other-domain.com/1.js"></script>
<script src="2.js"></script>
<!-- Defer -->
<!--
var Timeline = function( option ){
this.config( option );
};
Timeline.prototype = {
EVENT_ENTER_FRAME : "enterFrame",
option:{
fps:30
},
tid:null,
@bennyzhao
bennyzhao / meta.html
Last active December 23, 2015 10:39
Mobile head set (iOS) From:http://bennyrice.com/blog/?p=1994
<!--除了iOS7之后应该又会有新的补充->
<!--强制让文档的宽度与设备的宽度保持1:1,并且文档最大的宽度比例是1.0,且不允许用户点击屏幕放大浏览;-->
<meta name="viewport"
content="width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1.0,user-scalable= no"/>
<!-- 网站在浏览器标签上的图标,最好用ico -->
<link rel="shortcut icon" href="images/touch-icon-iphone.png"/>
<!--这个标题可以使得存到主屏幕时默认的标题和title不同-->
// 根据相对路径获取绝对路径
function getPath(relativePath,absolutePath){
var reg = new RegExp("\\.\\./","g");
var uplayCount = 0; // 相对路径中返回上层的次数。
var m = relativePath.match(reg);
if(m) uplayCount = m.length;
var lastIndex = absolutePath.length-1;
for(var i=0;i<=uplayCount;i++){
lastIndex = absolutePath.lastIndexOf("/",lastIndex);
@bennyzhao
bennyzhao / animtion.css
Created September 19, 2013 00:50
Capture CSS3 Animation Events in JavaScript from:https://gist.github.com/kewah/4493678
#anim.enable
{
-webkit-animation: flash 1s ease 3;
-moz-animation: flash 1s ease 3;
-ms-animation: flash 1s ease 3;
-o-animation: flash 1s ease 3;
animation: flash 1s ease 3;
}
/* animation */