5月pubdate:2020-05-0509:01:13标签:每日总结2020-5-4synaptic这个js神经网络库用起来挺简单的,训练他学习XOR2020-5-9mask使部分图片透明2020-5-12cssborder-radius值语法分析,主要是斜线border-radius的用法border-radius简写设置了所有四个border-*-radius属性。如果在斜线前后给出值,则斜线前的值设置水平半径,斜线后的值设置垂直半径。如果没有斜线,则值将两个半径设置为相等。每个半径的四个值按左上、右上、右下、左下的顺序给出。如果省略bottom-left,则与top-right相同。如果省略bottom-right,则与top-left相同。如果省略top-right,它与top-left.border-radius相同,用于设置所有四个border-*-radius属性。如果在斜线前后都给定了值,那么斜线前的值设置水平半径,斜线后的值设置垂直半径。如果没有斜线,两个值均等设置半径。每个半径的四个值按照左上、右上、右下、左下的顺序给出。如果省略左下角,则与右上角相同。如果省略右下角,则与左上角相同。如果省略右上角,则与左上角相同。斜杠语法的理解:把斜杠前后的部分看成两部分按照多值语法的规则来完成,然后一一对应,前者是水平方向的值,后者是值在垂直方向-14vscode报了很长时间的错误Couldn'tdownloadIntelliCodemodel。请检查您的网络连接或防火墙设置。报错信息:EPERM:operationnotpermitted,打开前,尝试通过管理员打开vscode。可以看到是没有写文件的权限,但是一直不知道真正的解决办法,今天找到了。即修改vscode“vsintellicode.modelDownloadPath”配置项为可写目录引用yapi在api详情页面显示修改列表效果使用油猴脚本实现脚本地址实现方式为监听页面变化,切换到详情页调用yapi接口查询修改记录然后添加到详情页2020-5-18js通用拖拽多选工具功能ts代码将以下代码复制到浏览器控制台执行,按住ctrl查看拖选所有td元素的效果,修改selector实现拖拽选择任何你想选择的元素“usestrict”;functiondraganddropmultipleselection(){letflag=false;让选择区域=[0,0,0,0];constdiv=document.createElement("div");div.style.cssText=`position:fixed;background:gray;opacity:.3;`;文档.body.appendChild(div);让选择矩形=selection_to_rectangle(selection);document.addEventListener("mousedown",(event)=>{console.log("mousedown",event);mask.remove();if(event.ctrlKey){flag=true;selection[0]=event.clientX;selection[1]=event.clientY;event.preventDefault();//防止默认行为event.stopPropagation();//防止事件冒泡}});document.addEventListener("mousemove",(event)=>{if(!flag){return;}selection[2]=event.clientX;selection[3]=event.clientY;selection_rectangle=selection_to_rectangle(selection);div.英石yle.left=选择矩形[0]+"px";div.style.top=选择矩形[1]+"px";div.style.width=selectionrectangle[2]-selectionrectangle[0]+"px";div.style.height=selectionrectangle[3]-selectionrectangle[1]+"px";});document.addEventListener("mouseup",(event)=>{if(!flag){return;}consttd_list=Array.from(document.querySelectorAll("td"));constselected=td_list.filter((el)=>rectangleintersect(selectionrectangle,HtmlElement_to_rectangle(el)));console.log(selectionrectangle,selected.map(HtmlElement_to_rectangle),selected);selected.map(HtmlElement_to_rectangle).forEach(mask.add);flag=false;});}拖动多选();functionHtmlElement_to_rectangle(el){constrect=el.getBoundingClientRect();返回[rect.left,rect.top,rect.right,rect.bottom];}functionrectangleintersection(rect1,rect2){vara_min_x=rect1[0];vara_min_y=rect1[1];vara_max_x=rect1[2];vara_max_y=rect1[3];varb_min_x=rect2[0];varb_min_y=rect2[1];varb_max_x=rect2[2];varb_max_y=rect2[3];返回a_min_x<=b_max_x&&a_max_x>=b_min_x&&a_min_y<=b_max_y&&a_max_y>=b_min_y;}functionselection_to_rectangle(selection){if(selection[0]>selection[2]||selection[1]>selection[3]){返回[selection[2],selection[3],选择[0],选择[1]];}else{返回选择;}}varmask;(function(mask){letlist=[];functionadd(rect){constdiv=document.createElement("div");div.style.cssText=`position:fixed;background:gray;不透明度:.3;`;div.style.left=rect[0]+"px";div.style.top=rect[1]+"px";div.style.width=rect[2]-rect[0]+"px";div.style.height=rect[3]-rect[1]+"px";list.push(div);document.body.appendChild(div);}mask.add=add;functionremove(){list.forEach((el)=>el.remove());list=[];}mask.remove=remove;})(mask||(mask={}));如果你是在shenzilong.cn网站上看这篇文章,你可以按住ctrl并在下表中拖动来试试效果|拖动|选择题|测试||----|----|----||1|2|7||3|4|8||5|6|这个domapi可以使用elementen返回当前文档指定坐标位置的最顶层元素tFromPoint写了一个油猴脚本来去除顶部遮挡。之所以写这个剧本,是因为《好不容易?许多网页都存在顶部大横条占用有限可见空间的问题。例如,搜索引擎。事实上,一旦用户输入搜索词,焦点就不再在搜索框上了。仍然占据顶部空间有意义吗??我求上帝想出一个脚本来解冻顶部并让它随着网页滚动。核心思想是利用elementFromPoint找到最顶层的元素,然后粗略判断是否是最顶层的遮蔽物,如果是则隐藏。一个更好的。有兴趣的可以去这里查看源码,指点一下。Effect:videoeffectwithtopocclusionwithouttopocclusionAddress2020-5-21执行返回promisesinsequencetype的函数UnPromise
