Navigation Menu

Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.

Commit

Permalink
作死前提交
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaJiaJiang committed May 31, 2014
1 parent cc84723 commit 00283d8
Show file tree
Hide file tree
Showing 4 changed files with 521 additions and 260 deletions.
23 changes: 18 additions & 5 deletions CanvasObjLibrary.js
Expand Up @@ -570,12 +570,10 @@ function newCOL() {
},
t: {
vary: function(ct) {
ct.beginPath();
ct.textBaseline = this.baseline;
ct.lineWidth = this.textborderWidth;
ct.strokeStyle = this.textborderColor;
ct.fillStyle = this.color || COL.font.color || "#000";
//ct.save();
if (this.shadowBlur > 0) {
ct.font = this.font;
ct.shadowBlur = this.shadowBlur;
Expand All @@ -588,22 +586,28 @@ function newCOL() {
ct.translate(0, this.lineHeight / 2);
if (this.columndirection === 0) {
for (var i = 0; i < this.varylist.length; i++) {
ct.save();
if (this.fill) {
ct.fillText(this.varylist[i], this.innerX, this.innerY);
}
if (this.textborderWidth) {
ct.shadowBlur=0;
ct.strokeText(this.varylist[i], this.innerX, this.innerY);
}
ct.restore();
ct.translate(0, this.lineHeight);
}
} else if (this.columndirection == 1) {
for (var i = this.varylist.length - 1; i > 0; i--) {
ct.save();
if (this.fill) {
ct.fillText(this.varylist[i], this.innerX, this.innerY);
}
if (this.textborderWidth) {
ct.shadowBlur=0;
ct.strokeText(this.varylist[i], this.innerX, this.innerY);
}
ct.restore();
ct.translate(0, this.lineHeight);
}
}
Expand All @@ -620,6 +624,7 @@ function newCOL() {
ct.fillText(thisline[im], this.innerX, this.innerY);
}
if (this.textborderWidth) {
ct.shadowBlur=0;
ct.strokeText(thisline[im], this.innerX, this.innerY);
}
ct.restore();
Expand All @@ -639,6 +644,7 @@ function newCOL() {
ct.fillText(thisline[im], this.innerX, this.innerY);
}
if (this.textborderWidth) {
ct.shadowBlur=0;
ct.strokeText(thisline[im], this.innerX, this.innerY);
}
ct.restore();
Expand Down Expand Up @@ -668,6 +674,9 @@ function newCOL() {

this.font = font;
ct.font = font;
this.plusoffsetX=this.shadowBlur+(this.shadowOffset.x<0?-this.shadowOffset.x:0);
this.plusoffsetY=this.shadowBlur+(this.shadowOffset.y<0?-this.shadowOffset.y:0);
var addedwidth=this.shadowBlur*2+Math.abs(this.shadowOffset.x),addedheight=this.shadowBlur*2+Math.abs(this.shadowOffset.y);
if (this.autoSize) {
var w = 0,
tw;
Expand All @@ -676,8 +685,8 @@ function newCOL() {
tw = ct.measureText(this.varylist[i]).width;
w = tw > w ? tw: w;
}
this.width = imgobj.width = (this.maxWidth >= w) ? this.maxWidth: w;
this.height = imgobj.height = this.varylist.length * this.lineHeight;
imgobj.width = (this.width = (this.maxWidth >= w) ? this.maxWidth: w)+addedwidth;
imgobj.height =(this.height = this.varylist.length * this.lineHeight)+addedheight;
} else if (this.linedirection == 1) {
for (var i = 0; i < this.varylist.length; i++) {
tw = this.varylist[i].split("").length;
Expand All @@ -692,6 +701,7 @@ function newCOL() {
imgobj.width = (this.width >= 0) ? this.width: 100;
imgobj.height = (this.height >= 0) ? this.height: 30;
}
ct.translate( this.plusoffsetX,this.plusoffsetY);
this.vary(ct);
},
setSize: function(width, height) {
Expand Down Expand Up @@ -831,9 +841,12 @@ function newCOL() {
cObj.vary(ct);
ct.restore();
} else {

if (cObj.imageobj && cObj.imageobj.width && cObj.imageobj.height) {
ct.drawImage(cObj.imageobj, 0, 0);
ct.save();ct.translate(-cObj.plusoffsetX,-cObj.plusoffsetY);
ct.drawImage(cObj.imageobj, 0, 0);ct.restore();
}

}

break;
Expand Down
15 changes: 13 additions & 2 deletions commands/danmuplayer.php
Expand Up @@ -19,22 +19,33 @@ function optioneles(){
?>
<div>
<h3> 播放器设置</h3>
<div>
<span>默认隐藏边栏:<div switch name="DefaultHideSideBar"></div></span>
<span>进度条显示弹幕密度:<div switch name="ProgressDanmumark"></div></span>
</div>
</div>
<div>
<h3> 效果</h3>
<h3> 普通弹幕</h3>
<div>
<span>单独渲染:<div switch name="DivCommonDanmu"></div></span>
<span>描边宽度:<div range name="StorkeWidth" min=0 max=2 defalut=1></div></span>
<span>阴影厚度:<div range name="ShadowWidth" min=0 max=10 defalut=0></div></span>
<span>弹幕实时渲染:<div switch name="RealtimeVary"></div></span>
</div>
</div>
<div>
<h3> 高级弹幕</h3>
<span>变速调试:<div range name="PlaySpeed" min=0.2 max=1.5></div></span>
<div>
<span>变速调试:<div range name="PlaySpeed" min=0.2 max=1.5 default=1></div></span>
<span>2D高级弹幕:<div switch name="TwoDCodeDanmu"></div></span>
<span>3D高级弹幕:<div switch name="ThreeDCodeDanmu"></div></span>
</div>
</div>
<div>
<h3>开发</h3>
<div>
<span>弹幕层Debug:<div switch name="Debug"></div></span>
</div>
</div>
<?php
}
Expand Down
42 changes: 37 additions & 5 deletions danmu.css
@@ -1,6 +1,29 @@
html {
font-family: "微软雅黑", "黑体";
}
.gray{
filter:url("data:image/svg+xml;utf8,<svg><filter id="\'grayscale\'"><feColorMatrix type="\'matrix\'" values="\'0.3333" 0.3333='"' 0='"' 1='"" 0\'='"''></feColorMatrix><filter></svg>#grayscale") !important;
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1) !important;
-webkit-filter:grayscale(100%) !important;
}
.divbottomdanmu{
margin: 0 auto;
text-align: center !important;
}
.divtopdanmu{
margin: 0 auto;
text-align: center !important;
}
.divtextdanmu{
white-space: pre;
letter-spacing: 0;
-webkit-touch-callout: none;
-webkit-user-select: none;
-o-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.playermainbody {
position: relative;
height:500px;
Expand Down Expand Up @@ -582,6 +605,7 @@ padding-left: 3px;
height: calc(100% - 90px);
height: -webkit-calc(100% - 90px);
left: 0px;
overflow-y: auto;
bottom: 0px;
}
.playermainbody #sidebar #tabpages .tabpage{
Expand Down Expand Up @@ -652,12 +676,19 @@ width: 100%;
}
.playermainbody #sidebar #optionpannel h3{
margin: 2px 8px;
font-size: 16px;
cursor: pointer;
background-color: #F3F3F3;
}
.playermainbody #optionpannel h3+div{
display: none;
}
.playermainbody #sidebar #optionpannel span{
display: block;
padding-left: 3px;
position: relative;
margin: 5px 15px;
font-size: 13px;
}
.playermainbody #sidebar #ctrlpannel .ctrlbutton{
position: absolute;
Expand Down Expand Up @@ -689,12 +720,12 @@ left: 66.6%;
}
.tabpage div[type="switch"]{
cursor: pointer;
position: absolute !important;
position: absolute !important;
right: 16px;
top: 0px;
width: 70px;
height: 20px;
overflow: hidden;;
width: 56px;
height: 19px;
overflow: hidden;
}
.tabpage .switch_center{
position:absolute;height:100%;width:15px;background-color:#ccc;
Expand All @@ -709,6 +740,7 @@ overflow: hidden;;
cursor: pointer;
position: relative!important;
top: 0px;
height: 14px;
width: 94%;
height: 20px;
}
Expand All @@ -721,7 +753,7 @@ background-color: #66ccff;
}
.tabpage div[type="range"] .rangebg{
position: absolute !important;
top: calc(100% / 2 - 1px);
top: calc(100% / 2 - 2px);
width: 100%;
height: 3px;
background-color: #CCC;
Expand Down

0 comments on commit 00283d8

Please sign in to comment.