├── README.md
├── applyContentTimer.js
├── index.html
├── main.js
├── nugget.png
├── recordTest.js
├── resize.js
├── rgbeditor.js
├── style.css
└── test.mp4
/README.md:
--------------------------------------------------------------------------------
1 | # Nugget speens on H5 / 旋转鸡块 H5
2 | ## English
3 | Use custom images, string or HTML codes to create the same effect in the browser as a chicken nugget spin.
4 | [Experience link](https://bugteas-nugget-speens-h5.netlify.app/) [Github pages](http://BUGTeas.github.io/nugget_speens_h5/index.html)
5 | ## 中文
6 | 使用自定义图像、字符串或 HTML 代码在浏览器中创建与鸡块旋转相同的效果。
7 | [体验链接](https://bugteas-nugget-speens-h5.netlify.app/) [Github pages](http://BUGTeas.github.io/nugget_speens_h5/index.html)
8 |
--------------------------------------------------------------------------------
/applyContentTimer.js:
--------------------------------------------------------------------------------
1 | //切换图片/视频/文本模式
2 | function showmode(name){
3 | if(name=="txtopt_sw") applytext();
4 | else if(name=="htmlopt_sw") applyhtml();
5 | else applyimgvid(name.substring(0,3));
6 | var optList = sID("option").getElementsByClassName("optsw");
7 | for(i=0;i";
32 | if(mode=="vid") var element = "";
33 | sID("rotationbox").innerHTML = element;
34 | setTimeout("if(cID('showvid')) sID('showvid').play()",500);
35 | resizeImgVid(mode);
36 | //用户导入文件
37 | if(window.FileReader){
38 | imgOrVid = mode;
39 | anyimg = sID(mode + "FileInput");
40 | anyimg.addEventListener('change',fileget,false);
41 | }else sID(mode + "opt_user").innerHTML = "您的浏览器不支持自定义文件。";
42 | }
43 |
44 | //调整图片/视频宽度
45 | function resizeImgVid(mode,range){
46 | var rge = sID(mode + "WidthRange");
47 | var ipt = sID(mode + "WidthInput");
48 | if(range=="range") ipt.value = rge.value;
49 | else rge.value = ipt.value;
50 | sID("show" + mode).style.width = (ipt.value / deviceDPR) + "px";
51 | }
52 |
53 | //应用文字
54 | function applytext(mode){
55 | if(sID("showimg")) sID("showimg").remove();
56 | var sizeInput = sID("textsizeinput");
57 | var sizeRange = sID("textsizerange");
58 | var txtInput = sID("inputtext");
59 | var txtw = document.getElementsByName("txtweight");
60 | for(i=0;i/g, ">").replace(/\r\n/g, '
').replace(/\n/g, '
').replace(/\s/g, ' ');
64 | console.log("文本模式,输出内容为 “" + iptvl + "”");
65 | if(sID("showtext")) sID("showtext").innerHTML = iptvl;
66 | else sID("rotationbox").innerHTML = "
" + iptvl + "
";
67 | var txtSet = sID("showtext");
68 | if(mode=="sizerange") sizeInput.value = sizeRange.value;
69 | else sizeRange.value = sizeInput.value;
70 | if(txtSet.style.color=="") var txtColor = "#000";
71 | else var txtColor = txtSet.style.color;
72 | if(txtSet.style.backgroundColor=="") var txtBg = "rgba(17,69,20,0)";
73 | else var txtBg = txtSet.style.backgroundColor;
74 | paddingSet = sizeInput.value / 4 / deviceDPR;
75 | txtSet.style = "white-space:nowrap;text-align:center;float:left;font-size:" + (sizeInput.value / deviceDPR) + "px;font-weight:" + txtw + ";padding:" + paddingSet + "px;border-radius:" + paddingSet + "px;color:" + txtColor + ";background-color:" + txtBg;
76 | }
77 |
78 | //应用代码
79 | function applyhtml(mode){
80 | if(sID("showimg")) sID("showimg").remove();
81 | var txtInput = sID("inputhtml");
82 | var iptvl = txtInput.value;
83 | console.log("代码模式,输出内容为 “" + iptvl + "”");
84 | if(sID("showhtml")) sID("showhtml").innerHTML = iptvl;
85 | else sID("rotationbox").innerHTML = "" + iptvl + "
";
86 | }
87 |
88 | //计时器拖拽调整位置
89 | var moveit = document.getElementById("timer");
90 | moveit.style.top = moveit.style.left = "10px";
91 | //鼠标
92 | moveit.onmousedown = function(event){
93 | clickReaction = "none";
94 | moveX = event.clientX - moveit.offsetLeft;
95 | moveY = event.clientY - moveit.offsetTop;
96 | document.onmousemove = function(event){
97 | moveit.style.top = event.clientY - moveY + "px";
98 | moveit.style.left = event.clientX - moveX + "px";
99 | }
100 | document.onmouseup = function(){
101 | document.onmousemove = false;
102 | }
103 | return false;
104 | }
105 | //触摸
106 | moveit.ontouchstart = function(event){
107 | clickReaction = "none";
108 | moveX = event.targetTouches[0].pageX - moveit.offsetLeft;
109 | moveY = event.targetTouches[0].pageY - moveit.offsetTop;
110 | document.ontouchmove = function(event){
111 | moveit.style.left = event.targetTouches[0].pageX - moveX + "px";
112 | moveit.style.top = event.targetTouches[0].pageY - moveY + "px";
113 | }
114 | document.ontouchend = function(){
115 | document.ontouchmove = false;
116 | }
117 | return false;
118 | }
119 |
120 | //应用计时器样式
121 | function timer_optapply(mode){
122 | var sizeInput = document.getElementById("timersizeinput");
123 | var sizeRange = document.getElementById("timersizerange");
124 | var timer = document.getElementById("timer");
125 | var weight = document.getElementsByName("timerweight");
126 | for(var i=0;i=100){
151 | scnt++;
152 | msnum = 0;
153 | }
154 | }
155 | secondnum = Number.parseInt(timeNum / 1000 - mcnt * 60);
156 | if(secondnum>=60){
157 | mcnt++;
158 | secondnum = 0;
159 | }
160 | if(timerFormat[0]=="h"){
161 | minutenum = Number.parseInt(timeNum / 60000 - hcnt * 60);
162 | if(minutenum>=60){
163 | hcnt++;
164 | minutenum = 0;
165 | }
166 | hournum = Number.parseInt(timeNum / 3600000);
167 | }
168 | else minutenum = Number.parseInt(timeNum / 60000);
169 | if(String(hournum).length==1) hournum = "0" + hournum;
170 | if(String(minutenum).length==1) minutenum = "0" + minutenum;
171 | if(String(secondnum).length==1) secondnum = "0" + secondnum;
172 | if(String(msnum).length==1) msnum = "0" + msnum;
173 | optHead = optEnd = "";
174 | if(timerFormat[0]=="h") optHead = hournum + ":";
175 | if(timerFormat[timerFormat.length - 1]=="ms") optEnd = ":" + msnum;
176 | document.getElementById("timer").innerHTML = optHead + minutenum + ":" + secondnum + optEnd;
177 | setTimeout(function(){timerRun(hcnt,mcnt,scnt)},0);
178 | }
179 | }
180 |
181 | //初始化计时器
182 | var readyTimeMode = 0;
183 | function loadtime(timeMode,mode,showmode){
184 | var timer = document.getElementById("timer");
185 | var optUI = document.getElementById('option');
186 | if(mode!="noreset"){
187 | timework = "disabled";
188 | readyCntdn = 3;
189 | showmode = timer.style.display;
190 | readyTimeMode++;
191 | var timeMode = readyTimeMode;
192 | }
193 | if(readyCntdn==0){
194 | if(showmode!="none"){
195 | timework = "enabled";
196 | startTime = new Date().getTime();
197 | timerRun(0,0,0);
198 | }else{
199 | timer.innerHTML = "11:45:14";
200 | if(timerFormat.length==4) timer.innerHTML += ":19";
201 | timer.style.display = "none";
202 | }
203 | if(document.getElementById('showvid')){
204 | var vid = document.getElementById('showvid');
205 | vid.currentTime = 0;
206 | vid.play();
207 | }
208 | if(recorderWork&&sID("record_enabled").checked==true){
209 | console.log("开始录制");
210 | recStatus = true;
211 | playCanvas(ctx);
212 | setTimeout("recStart.click()",100);
213 | }
214 | }
215 | else{
216 | timer.style.display = "block";
217 | if(timer.style.display!="none") timer.innerHTML = readyCntdn + " 秒后开始";
218 | readyCntdn = readyCntdn - 1;
219 | setTimeout(function(){
220 | if(timeMode==readyTimeMode&&optUI.style.display=="none") loadtime(timeMode,'noreset',showmode);
221 | else if(timerFormat.length==4) timer.innerHTML = "11:45:14:19";
222 | else timer.innerHTML = "11:45:14";
223 | if(optUI.style.display!="none") timer.style.display = showmode;
224 | },1000);
225 | }
226 | }
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 万物皆可旋转 (2023-01-03更新)
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | 请稍候...
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
11:45:14
25 |
26 |
27 |
28 |
29 |
30 |
31 | ▼ 向下滑动或按“O”键进入选项 关闭提示
32 |
33 |
34 |
113 |
114 |
115 |
146 |
147 |
148 |
149 |
150 |
151 |
155 |
156 |
157 |
分辨率
158 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
是否结束录制?
182 |
所录制的视频将会以下载的方式保存,停止录制后请确认下载
(部分浏览器可能不兼容,导致无法下载)
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 | 图片
194 |
195 | 颜色
196 |
197 |
198 |
199 |
200 |
图片大小不建议超过2M,否则浏览器会卡顿甚至闪退
201 |
202 |
203 |
204 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
266 |
267 |
268 |
269 |
270 |
271 |
--------------------------------------------------------------------------------
/main.js:
--------------------------------------------------------------------------------
1 | //简写document.getElementById
2 | function sID(id){
3 | if(document.getElementById(id)) return document.getElementById(id);
4 | else console.log("不存在的元素ID:“" + id + "”");
5 | }
6 | function cID(id){
7 | return document.getElementById(id);
8 | }
9 |
10 | //下滑弹出选项
11 | //排除不需要下滑手势的元素
12 | sID("option").onmousedown = sID("timeropt").onmousedown = sID("rgbeditor").onmousedown = sID("recordopt").onmousedown = sID("recordstop").onmousedown = sID("option").ontouchstart = sID("timeropt").ontouchstart = sID("rgbeditor").ontouchstart = sID("recordopt").ontouchstart = sID("recordstop").ontouchstart = function(){
13 | clickReaction = "none";
14 | }
15 | //鼠标
16 | document.body.onmousedown = function(event){
17 | if(typeof clickReaction=="undefined"){
18 | moveY = event.clientY;
19 | document.onmousemove = function(event){
20 | if(moveY+60<=event.clientY){
21 | showOption();
22 | document.onmousemove = false;
23 | }
24 | }
25 | document.onmouseup = function(){
26 | document.onmousemove = false;
27 | }
28 | return false;
29 | }
30 | else delete clickReaction;
31 | }
32 | //触摸
33 | document.body.ontouchstart = function(event){
34 | if(typeof clickReaction=="undefined"){
35 | moveY = event.targetTouches[0].pageY;
36 | document.ontouchmove = function(event){
37 | if(moveY+60<=event.targetTouches[0].pageY){
38 | showOption();
39 | document.ontouchmove = false;
40 | }
41 | }
42 | document.ontouchend = function(){
43 | document.ontouchmove = false;
44 | }
45 | return false;
46 | }
47 | else delete clickReaction;
48 | }
49 |
50 | //按“O”键弹出选项
51 | document.onkeydown = function(event){
52 | if(event.keyCode==79) showOption();
53 | }
54 |
55 | //显示选项界面
56 | function showOption(){
57 | if(sID("option").style.display=="none"){
58 | if(recorderWork&&recStatus==true) sID("recordstop").style.display = "block";
59 | else{
60 | timework = "disabled";
61 | sID("option").style.display = "block";
62 | if(sID("tips")) sID("tips").remove();
63 | applyresize();
64 | }
65 | }
66 | }
67 |
68 | //进入全屏
69 | function launchFullscreen(element) {
70 | var ele = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
71 | if(ele) exitFullscreen();
72 | else if (element.requestFullscreen) element.requestFullscreen();
73 | else if (element.mozRequestFullScreen) element.mozRequestFullScreen();
74 | else if (element.msRequestFullscreen) element.msRequestFullscreen();
75 | else if (element.webkitRequestFullscreen) element.webkitRequestFullScreen();
76 | }
77 |
78 | //退出全屏
79 | function exitFullscreen() {
80 | if (document.exitFullscreen) document.exitFullscreen();
81 | else if (document.mozExitFullScreen) document.mozExitFullScreen();
82 | else if (document.msExitFullscreen) document.msExitFullscreen();
83 | else if (document.webkitExitFullscreen) document.webkitExitFullScreen();
84 | }
85 |
86 | //打开背景图片/颜色设置界面
87 | function coloropt_init(bgimg_enable,opacity){
88 | sID("rgbeditor").style.display = "block";
89 | if(bgimg_enable=="bgimg"){
90 | sID("bgopt_sw").style.display = "inline"
91 | if(sID("mainbox").style.background.substring(0,3)=="url") coloropt_mode("bgimg_sw");
92 | else coloropt_mode("rgbedt_sw",opacity);
93 | }
94 | else{
95 | sID("bgopt_sw").style.display = "none"
96 | coloropt_mode("rgbedt_sw",opacity);
97 | }
98 | }
99 |
100 | //切换背景图片/颜色模式
101 | function coloropt_mode(name,opacity){
102 | var optList = sID("bgopt_sw").getElementsByClassName("optsw");
103 | for(i=0;i {
8 | ctx.drawImage(output, 0, 0, recWidth, recHeight);
9 | output.remove();
10 | });
11 | }
12 | recStatus = false;
13 | function setRecorder(){
14 | recStart = document.createElement("button");
15 | recStop = document.createElement("button");
16 | recAllChunks = [];
17 | var formatlist = ["h264","vp9","vp8","none"];
18 | for(i=0;i {
28 | recAllChunks.push(
29 | e.data
30 | );
31 | }
32 | recStart.onclick = e => {
33 | recorder.start(10);
34 | }
35 | recStop.onclick = e => {
36 | recorder.stop();
37 | const link = document.createElement('a');
38 | link.style.display = 'none';
39 | const fullBlob = new Blob(recAllChunks);
40 | const downloadUrl = window.URL.createObjectURL(fullBlob);
41 | link.href = downloadUrl;
42 | link.download = 'media.mp4';
43 | document.body.appendChild(link);
44 | link.click();
45 | link.remove();
46 | console.log("停止录制")
47 | setRecorder();
48 | }
49 | console.log("录制器设置完成,编码为 " + format);
50 | }
51 | else{
52 | sID("recordopt_tips").innerHTML = "当前浏览器不支持录制功能。";
53 | console.log(sID("recordopt_tips").innerHTML);
54 | }
55 | }
56 | }
57 | recorderWork = true;
--------------------------------------------------------------------------------
/resize.js:
--------------------------------------------------------------------------------
1 | //检测窗口变化自动调整尺寸
2 | lastsize = document.body.clientWidth - document.body.clientHeight;
3 | lastboxsize = 0;
4 | function autoresize(){
5 | var newsize = document.body.clientWidth - document.body.clientHeight;
6 | if(newsize!=lastsize) applyresize();
7 | lastsize = newsize;
8 | var showname = ["img","vid","text","html"];
9 | for(i=0;i=360) var optionWidth = "320px";
42 | else var optionWidth = "calc(100% - 40px)";
43 | if(mainSize[0]=="auto") mainbox.style.height = "100%";
44 | if(mainSize[0]=="auto"&&winbody.clientWidth>=boxWidth + 400&&sID("option").style.display!="none"){
45 | mainbox.style.width = "calc(100% - 360px)";
46 | var optStyle = "height:calc(100% - 40px);background-color:#c8c8c8;width:" + optionWidth;
47 | }else if(mainSize[0]!="auto"&&winbody.clientWidth>=mainbox.clientWidth + 360) var optStyle = "height:calc(100% - 40px);background-color:#c8c8c8;width:" + optionWidth;
48 | else{
49 | if(mainSize[0]=="auto") mainbox.style.width = "100%";
50 | var optStyle = "max-height:calc(100% - 40px);background-color:rgba(150,150,150,0.5);width:" + optionWidth;
51 | }
52 | if(sID("option").style.display!="none") sID("option").style = optStyle;
53 | rotationbox.style.width = shadowbox.style.width = boxWidth + "px";
54 | rotationbox.style.height = boxHeight + "px";
55 | shadowbox.style.height = boxHeight / 5 + "px";
56 | headHeight = (mainbox.clientHeight - rotationbox.clientHeight) / 2
57 | rotationbox.style.marginLeft = shadowbox.style.marginLeft = ((mainbox.clientWidth - rotationbox.clientWidth) / 2)+ "px";
58 | anglechange();
59 | console.log("第 " + resizeCount + " 次调整布局\n窗口尺寸:" + mainbox.clientWidth + "px × " + mainbox.clientHeight + "px\n旋转物体尺寸" + rotationbox.clientWidth + "px × " + rotationbox.clientHeight + "px");
60 | resizeCount++
61 | }
62 |
63 | //旋转框架角度/透视
64 | function anglechange(mode,resize){
65 | var xinput = sID("Xangleinput");
66 | var xrange = sID("Xanglerange");
67 | var yinput = sID("Yangleinput");
68 | var yrange = sID("Yanglerange");
69 | var zinput = sID("Zangleinput");
70 | var zrange = sID("Zanglerange");
71 | var pinput = sID("perspectinput");
72 | var prange = sID("perspectrange");
73 | var aniset = sID("animationset");
74 | if(mode=="xrange") xinput.value = xrange.value - 180;
75 | else if(mode=="yrange") yinput.value = yrange.value - 180;
76 | else if(mode=="zrange") zinput.value = zrange.value - 180;
77 | else if(mode=="prange") pinput.value = 1000 - prange.value;
78 | else{
79 | xrange.value = Number(xinput.value) + 180;
80 | yrange.value = Number(yinput.value) + 180;
81 | zrange.value = Number(zinput.value) + 180;
82 | prange.value = 1000 - pinput.value;
83 | }
84 | //旋转轴
85 | var rMod = document.getElementsByName("rotateRadio");
86 | for(i=0;i=101){
61 | id.value = 100;
62 | idse.value = 100;
63 | }
64 | else idse.value = id.value;
65 | }
66 | else if(idsplit[1]=="hex"){
67 | var d = id.value;
68 | if(d.substring(0,1)=="#"){
69 | if(d.length==7){
70 | iptr.value = Number.parseInt(d.substring(1,3),16);
71 | iptg.value = Number.parseInt(d.substring(3,5),16);
72 | iptb.value = Number.parseInt(d.substring(5,7),16);
73 | }
74 | else if(d.length==4){
75 | var hex1 = d.substring(1,2);
76 | var hex2 = d.substring(2,3);
77 | var hex3 = d.substring(3,4);
78 | var rgb1 = Number.parseInt(hex1 + "" + hex1,16);
79 | var rgb2 = Number.parseInt(hex2 + "" + hex2,16);
80 | var rgb3 = Number.parseInt(hex3 + "" + hex3,16);
81 | iptr.value = rgb1;
82 | iptg.value = rgb2;
83 | iptb.value = rgb3;
84 | }
85 | }
86 | rgbeditor_rgba(iptfnt + "r","none");
87 | rgbeditor_rgba(iptfnt + "g","none");
88 | rgbeditor_rgba(iptfnt + "b","none");
89 | }
90 | else if(id.value>=256){
91 | id.value = 255;
92 | idse.value = 255;
93 | }
94 | else idse.value = id.value;
95 | if(mode!="none"){
96 | var numr = iptr.value;
97 | var numg = iptg.value;
98 | var numb = iptb.value;
99 | if(opacity_enable=="enabled") var seta = "," + ipta.value / 100;
100 | else var seta = ",1";
101 | if(idsplit[1]!="hex"){
102 | var spcr = spcg = spcb = "";
103 | if(numr<=15) var spcr = "0";
104 | if(numg<=15) var spcg = "0";
105 | if(numb<=15) var spcb = "0";
106 | var hexr = (Number.parseInt(numr)).toString(16);
107 | var hexg = (Number.parseInt(numg)).toString(16);
108 | var hexb = (Number.parseInt(numb)).toString(16);
109 | document.getElementById("rgbeditor_hex").value = "#" + spcr + hexr + spcg + hexg + spcb + hexb;
110 | }
111 | var optcolor = "rgba(" + numr + "," + numg + "," + numb + seta + ")";
112 | document.getElementById("rgbeditor_preview").style.backgroundColor = optcolor;
113 | eval(apply_object + "." + apply_attribute + " = optcolor");
114 | }
115 | }
--------------------------------------------------------------------------------
/style.css:
--------------------------------------------------------------------------------
1 | html,body{
2 | margin:0;
3 | height:100%;
4 | overflow:hidden;
5 | font-family:"microsoft yahei",sans-serif;
6 | background:#000;
7 | }
8 | /*阴影圆角*/
9 | #shadowbox{
10 | border-radius:50%;
11 | }
12 | /*计时器悬浮、鼠标指针、禁用选择文字*/
13 | #timer{
14 | position:absolute;
15 | user-select:none;
16 | cursor:move;
17 | }
18 | /*选项界面*/
19 | #option{
20 | position:absolute;
21 | z-index:3;
22 | top:0;
23 | right:0;
24 | padding:20px;
25 | overflow:auto;
26 | font-size:13px;
27 | animation-name:optionEject;
28 | animation-duration:150ms;
29 | animation-timing-function:ease-out;
30 | }
31 | /*向下弹出选项*/
32 | @keyframes optionEject{
33 | 0%{
34 | opacity:0;
35 | top:-40px;
36 | }
37 | 100%{
38 | opacity:1;
39 | top:0px;
40 | }
41 | }
42 | /*滑动条*/
43 | .range{
44 | min-width:calc(100% - 150px);
45 | max-width:100px;
46 | }
47 | /*输入框*/
48 | .input{
49 | width:50px;
50 | border:1px solid #999;
51 | border-radius:7px;
52 | margin:5px;
53 | padding:5px;
54 | }
55 | /*选项按钮*/
56 | #option button{
57 | background:rgb(46, 102, 255);
58 | color:#fff;
59 | border:none;
60 | border-radius:5px;
61 | margin:10px 10px 10px 0px;
62 | transition-property:all;
63 | transition-duration:200ms;
64 | vertical-align:top;
65 | padding:7px;
66 | font-size:13px;
67 | }
68 | /*大选项按钮*/
69 | #option .bigButton{
70 | padding:10px;
71 | font-size:15px;
72 | margin:10px;
73 | margin-left:calc(50% - 75px);
74 | width:150px;
75 | }
76 | /*选项按钮点击后*/
77 | #option button:hover{
78 | background:rgb(100, 142, 255);
79 | }
80 | #option button:active{
81 | transform:scale(0.91);
82 | }
83 | #option .bigButton:active{
84 | transform:scale(0.95);
85 | }
86 | /*选项名称*/
87 | #option .name{
88 | display:inline-block;
89 | text-align:right;
90 | max-width:auto;
91 | min-width:40px;
92 | }
93 | /*选项卡切换*/
94 | #option .optsw{
95 | display:inline-block;
96 | font-size:20px;
97 | user-select:none;
98 | padding-bottom:5px;
99 | margin:0px 20px 10px 0px;
100 | }
101 | #option .optsw:hover{
102 | font-weight:bolder;
103 | }
104 | /*文本选项大文本框*/
105 | #option textarea{
106 | border:1px solid #999;
107 | border-radius:7px;
108 | padding:5px;
109 | min-width:calc(100% - 10px);
110 | max-width:calc(100% - 10px);
111 | min-height:50px;
112 | max-height:200px;
113 | }
114 | /*分隔线*/
115 | hr{
116 | border:0.5px solid #aaa;
117 | }
118 | #mainbox{
119 | position:relative;
120 | overflow:hidden;
121 | }
122 |
123 |
124 | .window_bg{
125 | width:100%;
126 | height:100%;
127 | top:0px;
128 | left:0px;
129 | background:rgba(128,128,128,0.5);
130 | position:absolute;
131 | z-index:4;
132 | display:none;
133 | }
134 | .window{
135 | width:250px;
136 | height:300px;
137 | background:#fff;
138 | box-shadow:0px 7px 12px rgba(128,128,128,0.5);
139 | margin-left:calc(50% - 145px);
140 | padding:20px;
141 | border:1px solid #ddd;
142 | border-radius:5px;
143 | }
144 | .window div,.window table{
145 | margin-bottom:10px;
146 | }
147 | .window_button{
148 | border:none;
149 | border-radius:3px;
150 | background-color:rgb(41, 108, 255);
151 | color:white;
152 | padding:7px;
153 | margin-right:10px;
154 | font-size:13px;
155 | }
156 | .window_close{
157 | float:right;
158 | border:none;
159 | background:none;
160 | padding:0px;
161 | margin:0px;
162 | font-size:25px;
163 | font-family:'Lucida console',monospace;
164 | color:#555;
165 | }
166 | #rgbeditor_window .optsw{
167 | display:inline-block;
168 | font-size:20px;
169 | user-select:none;
170 | padding-bottom:5px;
171 | margin-bottom:10px;
172 | }
173 | #rgbeditor_window table{
174 | border-collapse:collapse;
175 | width:100%;
176 | }
177 | #rgbeditor_window table td{
178 | text-align:right;
179 | padding:7px 0 7px 0;
180 | }
181 | .rgbeditor_input{
182 | width:40px;
183 | border:1px solid #ccc;
184 | border-radius:3px;
185 | padding:5px;
186 | margin-left:2px;
187 | }
188 | #bgimg_input_btn{
189 | width:120px;
190 | border:none;
191 | border-radius:3px;
192 | background-color:rgb(41, 108, 255);
193 | color:white;
194 | padding:10px;
195 | margin-left:10px;
196 | }
197 | .rgbeditor_range{
198 | width:calc(100% - 5px);
199 | margin-left:5px;
200 | }
201 | .rgbeditor_optname{
202 | font-size:15px;
203 | }
--------------------------------------------------------------------------------
/test.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BUGTeas/nugget_speens_h5/c7299d352bb6f8fc15e53fa3154b74e6f3060714/test.mp4
--------------------------------------------------------------------------------