zoukankan      html  css  js  c++  java
  • 浏览器记事本

    将代码复制到标题栏即可

    简单记事本

    code:

    data:text/html, <html contenteditable>

    eg:

    美化记事本

    code:

    data:text/html, <title>Notepad</title>
    <body contenteditable style="font-size:2rem;line-height:1.4;max-60rem;
    margin:0 auto;padding:4rem;">

    eg:

    随着打字背景会改变

    code:

    data:text/html, <html><head><link href='http://fonts.googleapis.com/css?family=Open+Sans'
    rel='stylesheet' type='text/css'><style type="text/css"> html
    { font-family: "Open Sans" } * { -webkit-transition: all linear 1s; }</style><script>window.onload=function(){var
    e=false;var t=0;setInterval(function(){if(!e){t=Math.round(Math.max(0,t-Math.max(t/3,1)))}var
    n=(255-t*2).toString(16);document.body.style.backgroundColor="#ff"+n+""+n},1e3);var
    n=null;document.onkeydown=function(){t=Math.min(128,t+2);e=true;clearTimeout(n);n=setTimeout(function(){e=false},1500)}}</script></head><body
    contenteditable style="font-size:2rem;line-height:1.4;max-60rem;margin:0
    auto;padding:4rem;">

    eg:

    涂鸦板

    code:

    data:text/html, <body><canvas id="dyDraw">你的浏览器不支持HTML5 Canvas</canvas></body><script>function $(id){return document.getElementById(id);} $('dyDraw').width=document.body.clientWidth;$('dyDraw').height=document.body.clientHeight;if(window.addEventListener){window.addEventListener('load',function(){var canvas,canvastext;var hua=false;function dyDrawing(){canvas=$('dyDraw');canvastext=canvas.getContext('2d');canvas.addEventListener('mousedown',canvasMouse,false);canvas.addEventListener('mousemove',canvasMouse,false);window.addEventListener('mouseup',canvasMouse,false);} function canvasMouse(dy){var x,y;if(dy.layerX||dy.layerX==0){x=dy.layerX;y=dy.layerY;}else if(dy.offsetX||dy.offsetX==0){x=dy.offsetX;y=dy.offsetY;} x-=dyDraw.offsetLeft;y-=dyDraw.offsetTop;if(dy.type=='mousedown'){hua=false;canvastext.beginPath();canvastext.moveTo(x,y);hua=true;}else if(dy.type=='mousemove'){if(hua){canvastext.strokeStyle="rgb(255,0,0)";canvastext.lineWidth=9;canvastext.lineTo(x,y);canvastext.stroke();}}else if(dy.type=='mouseup'){hua=false;}} dyDrawing();},false);}</script>

    eg:

    身是菩提树,心如明镜台,时时勤拂拭,勿使惹尘埃。
  • 相关阅读:
    帮人“解封微信”犯法?全国首例!判刑!
    热乎的校招面经试题解析——百度篇
    字节跳动入局在线教育:烧钱、亏钱
    TF-IDF 算法介绍
    Django ORM 常见查询条件
    Django中render和render_to_response的区别
    Python异步操作MongoDB --Motor的使用
    Java 如何抛出异常、自定义异常
    java项目中的classpath到底是什么
    maven里的modelVersion
  • 原文地址:https://www.cnblogs.com/birdofparadise/p/7997408.html
Copyright © 2011-2022 走看看