恶搞请假条

看到一堆人写这东西还收费,我就佛了,特喵我直接弄了一个,代码都差不多 ,各位朋友拿去用!

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>请假条</title>
    <style>
        html, body {
            margin: 0;
            padding: 0;
            background: #f2f1f6;
        }
        .container {
            position: relative;
            width: 500px;
            height: 300px;
            background: #f2f1f6;

        }
        .container h1 {
            margin-top: 0;
            text-align: center;
        }
        .container img {
            vertical-align: -70px;
        }
        .bd {
            padding-left: 30px;
        }
        .ft {
            position: absolute;
            width: 100%;
            bottom: 20px;
            padding: 0 30px;
            line-height: 30px;
            box-sizing: border-box;
        }
        .btn-group {
            float: left;
        }
        .fr {
            float: right;
        }
        button {
            cursor: pointer;
        }
        #p1 {
        }
        .not-allow {
            position: relative;
        }
        #p2 {
            display: none;
        }
        .red {
            margin: 0;
            font-size: 24px;
            padding: 30px 40px;
            color: red;
            letter-spacing: 4px;
        }
        .wavy {
            text-decoration: underline;
            text-decoration-style: wavy;
        }
        .name {
            padding-left: 10px;
        }
        .btn {
            padding: 6px 12px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div id="p1">
            <h1>请假条</h1>
            <div class="bd">
                尊敬的各位领导: <img src="https://p.qqan.com/up/2021-1/16100050925828871.jpg" width="120"/>
            </div>

            <div class="ft">
                <div class="btn-group">
                    <button class="btn allow">同意</button>
                    <button class="btn not-allow" id="not-allow">不同意</button>
                </div>
                <div class="fr">
                    请假人: <span class="name">匹诺操</span>
                </div>
            </div>
        </div>
        <div id="p2">
            <h2 class="red">
                老板大人, 我 这就回家</span>明天再见!。<br/>
                !!!!再贱!!!!
            </h2>
            <div class="ft">
                <button class="btn fr exit">退出</button>
            </div>
        </div>
    </div>
    <script>
        (function(){
            function $(selector) {
                return document.querySelector(selector);
            }
            var $p1 = document.getElementById('p1');
            var $p2 = document.getElementById('p2');
            var $container = $('.container');
            var $btn = $('#not-allow');
            var isBlockClose = true;

            var maxX = $container.clientWidth - 1, maxY = $container.clientHeight - 1;
            var originPos = $btn.getBoundingClientRect();

            $('.allow').addEventListener('click', function() {
                $p1.style.display = 'none';
                $p2.style.display = 'block';
            });
            $btn.addEventListener('mouseover', function() {
                this.style.left = Math.floor(Math.random() * maxX - originPos.left) + 'px';
                this.style.top = Math.floor(Math.random() * maxY - originPos.top) + 'px';
                //console.log(this.style.left, this.style.top);
            });
            $('.exit').addEventListener('click', function() {
                isBlockClose = false;
                window.close();
            });
            window.addEventListener('beforeunload', function(e) {
                if (isBlockClose) {
                    alert("此路不通");
                    e.returnValue = false;
                    e.preventDefault();
                    return "此路不通";
                }
            });
        })();
    </script>
</body>
</html>

 记得 先创建一个文档,然后把里面的复制粘贴进去,然后把后缀.txt改未.html就行了,没看到txt的话

 

 把文件拓展名钩上就行了

  • 9
    点赞
  • 54
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Faly晨

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值