MCBBS Wiki欢迎您共同参与编辑!在参与编辑之前请先阅读Wiki方针。
如果在编辑的过程中遇到了什么问题,可以去讨论板提问。
为了您能够无阻碍地参与编辑 未验证/绑定过邮箱的用户,请尽快绑定/验证。
MCBBS Wiki GitHub群组已上线!
您可以在回声洞中发表吐槽!
服务器状态监控。点击进入
本站由MCBBS用户自行搭建,与MCBBS及东银河系漫游指南(北京)科技有限公司没有从属关系。点此了解 MCBBS Wiki 不是什么>>
用户:Salt lovely/沙盒:修订间差异
跳到导航
跳到搜索
Salt lovely(留言 | 贡献) 小 (测试ing) |
Salt lovely(留言 | 贡献) 小 (编辑“用户:Salt_lovely/沙盒” // 维基盐编辑器) |
||
(未显示同一用户的25个中间版本) | |||
第1行: | 第1行: | ||
== 测试功能 == |
|||
== 尚未实装,所以除了我以外的人都看不见2333 == |
|||
cccc[[用户:Salt_lovely|<span style="--btnw:257px;--btnh:62px;--backcolor:#574266;--fontcolor:#fff;--fontsize:2em;" class="border-btn center-txt">test</span>]] |
|||
* [[/抓取MCBBS用户头像]] |
|||
bbbb |
|||
* [[/签名]] |
|||
[https://wiki.crash-logs.cn/wiki/%E9%A6%96%E9%A1%B5 <span style="--btnw:257px;--btnh:62px;--backcolor:#fffbf0;--fontcolor:#3b2e7e;--fontsize:2em;" class="border-btn center-txt box-sdw">test</span>]aaaa |
|||
* [[/皮肤测试]] |
|||
* [[/导航盒]] |
|||
* [[/投票箱]] |
|||
{{U:Salt lovely/沙盒/投票箱 |
|||
|title=这里是投票标题 |
|||
|subtitle=默认样式测试(可选)这里是投票副标题 |
|||
|#同意= |
|||
[[U:Salt]]<!-- 多行测试 --> |
|||
[[用户:Salt_lovely|{{color|#d3a|Salt Lovely}}]]<!-- 自定义用户名样式测试 --> |
|||
|*同意=用户选择同意 |
|||
|#反对=[[U:Salt|{{color|#3da|Salt111}}]] |
|||
|*反对=用户选择{{反对}} |
|||
|#弃权=[[User:Example]][[U:Salt|{{color|#3da|Salt111}}]][[U:Salt_lovely]] |
|||
|#重复测试=[[U:Example]][[U:Example]][[U:Example]] |
|||
|*重复测试=重复测试 |
|||
|#无投票1= |
|||
|#无投票2= |
|||
}} |
|||
{{U:Salt lovely/沙盒/投票箱 |
|||
|标题=压力测试 |
|||
|副标题=颜色参数 有横条 |
|||
|bar=1 |
|||
|颜色=#00F5D4,#00BBF9,#FEE440,#F15BB5,#9B5DE5 |
|||
|#1=[[用户:Salt_lovely]][[用户:Salt_lovely]][[用户:Salt_lovely]][[用户:Salt_lovely]] |
|||
|*1=我们可以看到啊,选这个的用户很多 |
|||
|#2= |
|||
|#3=[[User:Salt]][[User:Example]][[U:Example]][[用户:Example]] |
|||
|#4= |
|||
|#5= |
|||
|#6= |
|||
|#7=[[User:Salt]][[User:Example]][[User:Salt]][[User:Example]][[User:Salt]][[User:Example]] |
|||
|#8= |
|||
|#9= |
|||
|#10= |
|||
|#11= |
|||
|#12= |
|||
|#13=[[User:Salt]] |
|||
|#14=[[用户:Salt_lovely]][[用户:Salt_lovely]][[User:Salt]][[User:Example]][[U:Example]][[用户:Example]][[用户:Salt_lovely]][[用户:Salt_lovely]] |
|||
|#15= |
|||
|#16= |
|||
|#17= |
|||
|*123= |
|||
|*456=1234567890 |
|||
}} |
|||
== JS代码存档 == |
|||
<pre>// MCBBS头像上传时三个大小头像切片上传代码 - 修改 - 启用抗锯齿 |
|||
// 其实就加了两行 |
|||
(0, eval)(`function saveAvatar() { |
|||
var img = $('avatarimage'); |
|||
var sd = getSelectorDimention(); |
|||
var ad = getAvatarDimension(); |
|||
var rl = (sd.left-ad.left)/ad.width; |
|||
var rt = (sd.top-ad.top)/ad.height; |
|||
var rw = sd.width/ad.width; |
|||
var rh = sd.height/ad.height; |
|||
var iw = jQuery('#avatarimage').width(); |
|||
var ih = jQuery('#avatarimage').height(); |
|||
var sl = rl*iw; |
|||
var st = rt*ih; |
|||
var sw = rw*iw; |
|||
var sh = rh*ih; |
|||
var tw = sw; |
|||
var th = sh; |
|||
if (sw>200 || sh>250) { |
|||
var r = Math.max(sw/200, sh/250); |
|||
tw = Math.floor(sw/r); |
|||
th = Math.floor(sh/r); |
|||
} |
|||
var canvas = document.createElement('canvas'); |
|||
canvas.width = tw; |
|||
canvas.height = th; |
|||
var ctx = canvas.getContext("2d"); |
|||
ctx.fillStyle = 'white'; |
|||
ctx.fillRect(0, 0, tw, th); |
|||
ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); |
|||
ctx.imageSmoothingEnabled = true; // 启用抗锯齿 |
|||
ctx.imageSmoothingQuality = "high"; // 高品质抗锯齿 |
|||
var dataURL = canvas.toDataURL("image/jpeg"); |
|||
jQuery('#avatar1').val(dataURL.substr(dataURL.indexOf(",") + 1)); |
|||
var tw = sw; |
|||
var th = sh; |
|||
if (sw>120 || sh>120) { |
|||
var r = Math.max(sw/120, sh/120); |
|||
tw = Math.floor(sw/r); |
|||
th = Math.floor(sh/r); |
|||
} |
|||
var canvas = document.createElement('canvas'); |
|||
canvas.width = tw; |
|||
canvas.height = th; |
|||
var ctx = canvas.getContext("2d"); |
|||
ctx.fillStyle = 'white'; |
|||
ctx.fillRect(0, 0, tw, th); |
|||
ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); |
|||
var dataURL = canvas.toDataURL("image/jpeg"); |
|||
jQuery('#avatar2').val(dataURL.substr(dataURL.indexOf(",") + 1)); |
|||
var mwh = Math.min(sw, sh); |
|||
if (sw>mwh) { |
|||
sl += Math.floor((sw-mwh)/2); |
|||
sw = mwh; |
|||
} |
|||
if (sh>mwh) { |
|||
st += Math.floor((sh-mwh)/2); |
|||
sh = mwh; |
|||
} |
|||
var tw = 48; |
|||
var th = 48; |
|||
var canvas = document.createElement('canvas'); |
|||
canvas.width = tw; |
|||
canvas.height = th; |
|||
var ctx = canvas.getContext("2d"); |
|||
ctx.fillStyle = 'white'; |
|||
ctx.fillRect(0, 0, tw, th); |
|||
ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); |
|||
var dataURL = canvas.toDataURL("image/jpeg"); |
|||
jQuery('#avatar3').val(dataURL.substr(dataURL.indexOf(",") + 1)); |
|||
var src = $('avatarform').action; |
|||
$('avatarform').action = data[data.indexOf('src')+1].replace('images/camera.swf?inajax=1', 'index.php?m=user&a=rectavatar&base64=yes'); |
|||
$('avatarform').target='rectframe'; |
|||
}`)</pre> |
2024年3月23日 (六) 19:40的最新版本
测试功能
这里是投票标题
默认样式测试(可选)这里是投票副标题
- 同意用户选择同意
- 反对用户选择(-)反对
- 重复测试重复测试
#00F5D4,#00BBF9,#FEE440,#F15BB5,#9B5DE5
压力测试
颜色参数 有横条
- 1我们可以看到啊,选这个的用户很多
- 123
- 4561234567890
JS代码存档
// MCBBS头像上传时三个大小头像切片上传代码 - 修改 - 启用抗锯齿 // 其实就加了两行 (0, eval)(`function saveAvatar() { var img = $('avatarimage'); var sd = getSelectorDimention(); var ad = getAvatarDimension(); var rl = (sd.left-ad.left)/ad.width; var rt = (sd.top-ad.top)/ad.height; var rw = sd.width/ad.width; var rh = sd.height/ad.height; var iw = jQuery('#avatarimage').width(); var ih = jQuery('#avatarimage').height(); var sl = rl*iw; var st = rt*ih; var sw = rw*iw; var sh = rh*ih; var tw = sw; var th = sh; if (sw>200 || sh>250) { var r = Math.max(sw/200, sh/250); tw = Math.floor(sw/r); th = Math.floor(sh/r); } var canvas = document.createElement('canvas'); canvas.width = tw; canvas.height = th; var ctx = canvas.getContext("2d"); ctx.fillStyle = 'white'; ctx.fillRect(0, 0, tw, th); ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); ctx.imageSmoothingEnabled = true; // 启用抗锯齿 ctx.imageSmoothingQuality = "high"; // 高品质抗锯齿 var dataURL = canvas.toDataURL("image/jpeg"); jQuery('#avatar1').val(dataURL.substr(dataURL.indexOf(",") + 1)); var tw = sw; var th = sh; if (sw>120 || sh>120) { var r = Math.max(sw/120, sh/120); tw = Math.floor(sw/r); th = Math.floor(sh/r); } var canvas = document.createElement('canvas'); canvas.width = tw; canvas.height = th; var ctx = canvas.getContext("2d"); ctx.fillStyle = 'white'; ctx.fillRect(0, 0, tw, th); ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); var dataURL = canvas.toDataURL("image/jpeg"); jQuery('#avatar2').val(dataURL.substr(dataURL.indexOf(",") + 1)); var mwh = Math.min(sw, sh); if (sw>mwh) { sl += Math.floor((sw-mwh)/2); sw = mwh; } if (sh>mwh) { st += Math.floor((sh-mwh)/2); sh = mwh; } var tw = 48; var th = 48; var canvas = document.createElement('canvas'); canvas.width = tw; canvas.height = th; var ctx = canvas.getContext("2d"); ctx.fillStyle = 'white'; ctx.fillRect(0, 0, tw, th); ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); var dataURL = canvas.toDataURL("image/jpeg"); jQuery('#avatar3').val(dataURL.substr(dataURL.indexOf(",") + 1)); var src = $('avatarform').action; $('avatarform').action = data[data.indexOf('src')+1].replace('images/camera.swf?inajax=1', 'index.php?m=user&a=rectavatar&base64=yes'); $('avatarform').target='rectframe'; }`)