国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

第7次修改了可刪除可持久保存的前端html備忘錄

這篇具有很好參考價(jià)值的文章主要介紹了第7次修改了可刪除可持久保存的前端html備忘錄。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

第7次修改了可刪除可持久保存的前端html備忘錄,前端,html,狀態(tài)模式

第7次修改了可刪除可持久保存的前端html備忘錄

?文章來源地址http://www.zghlxwxcb.cn/news/detail-807491.html

<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>備忘錄(memorandum)</title>
    <style>
        * {
            margin: 0;
        }

        textarea,
        div {
            background-color: rgba(103, 240, 49, 0.621);
        }

        div input+button {
            background-color: #fff5664f;
        }

        a {
            color: #f5de0b;
            text-decoration: none;
        }

        div input+button+button {
            background-color: #47eb0b;
        }

        /* div>button {
            display: none;
        } */
        form,
        h1 {
            /* 塊級元素轉(zhuǎn)行內(nèi)元素 ;行內(nèi)轉(zhuǎn)塊:display:block; 塊、行內(nèi)元素轉(zhuǎn)換行內(nèi)塊:display:inline-block;*/
            display: inline;
        }

        button,
        h1,
        input {
            /* 禁止元素選中;    解除文本選中user-select: text;*/
            user-select: none;
        }

        /* 完成樣式  */
        .finish {
            /* 文本-裝飾:刪除線 */
            text-decoration: line-through;
            /* 文本陰影:水平偏移量 垂直偏移量 模糊距離 陰影顏色 */
            /* 陰影效果:水平偏移量 垂直偏移量 模糊距離 陰影顏色 內(nèi)陰影 */
            text-shadow: 2px 2px 2px rgb(240, 48, 10);
            box-shadow: 0 0 10px 5px rgba(90, 9, 9, 0.916);
            background-color: rgba(12, 1, 1, 0.447);
            color: #5e0606;
        }

        /* 下面的是顏色樣式*/
        h1 {
            color: #fff;
            text-shadow:
                2px 2px 2px #ddd,
                4px 4px 2px #bbb,
                6px 6px 2px #999,
                8px 8px 2px #777,
                10px 10px 2px #555,
                12px 12px 2px #333,
                14px 14px 2px #111;
        }

        bdi {
            color: #df1212;
            border-radius: 10px;
            background-color: #efed6a;
        }

        u {
            color: #fff;
            text-shadow:
                1px 1px 2px #ddd,
                2px 2px 2px #bbb,
                3px 3px 2px #999,
                4px 4px 2px #777;
        }

        button,
        input {
            cursor: pointer;
            border: 0;
            line-height: 30px;
            padding: 0 10px;
            font-size: 1rem;
            border-radius: 10px;
            background-color: rgba(220, 0, 0, 1);
            background-image: linear-gradient(to top left,
                    rgba(0, 0, 0, 0.2),
                    rgba(0, 0, 0, 0.2) 30%,
                    rgba(0, 0, 0, 0));
            box-shadow:
                inset 2px 2px 3px rgba(255, 255, 255, 0.6),
                inset -2px -2px 3px rgba(0, 0, 0, 0.6);
            color: #fcf9f9;
            text-shadow: 1px 1px 1px #100000;
        }

        a,
        textarea {
            line-height: 2;
            font-size: 1rem;
            text-align: center;
            color: #fff;
            text-shadow: 1px 1px 1px #000;
        }

        div,
        u,
        h1,
        textarea {
            background-color: rgba(44, 220, 0, 0.5);
            background-image: linear-gradient(to top left,
                    rgba(0, 0, 0, 0.2),
                    rgba(0, 0, 0, 0.2) 30%,
                    rgba(0, 0, 0, 0));
            box-shadow: inset 2px 2px 3px rgba(255, 255, 255, 0.6),
                inset -2px -2px 3px rgba(0, 0, 0, 0.6);
            box-sizing: border-box;
            padding: 5px 1px;
            border: 2px solid rgba(173, 12, 157, 0.616);
            border-radius: 10px;
        }

        textarea:hover,
        input:hover,
        button:hover {
            background-color: rgba(78, 168, 13, 0.587);
        }

        div input+button+button:hover {
            background-color: rgb(251, 231, 11);
        }

        span:hover {
            box-shadow: 0 0 10px 5px rgba(255, 255, 255, 0.916);
        }

        button:active,
        input:active {
            box-shadow:
                inset -2px -2px 3px rgba(255, 255, 255, 0.6),
                inset 2px 2px 3px rgba(0, 0, 0, 0.6);
        }

        ::placeholder {
            color: rgb(255, 255, 255);
            box-shadow: 0 0 10px 5px rgba(255, 255, 255, 0.916);
            letter-spacing: 13px;
        }

        ::placeholder,
        span {
            color: rgb(255, 255, 255);
            border-radius: 10px;
            background-color: #0a541e;
            text-shadow:
                1px 1px 2px #ddd,
                2px 2px 2px #bbb,
                3px 3px 2px #999,
                4px 4px 5px #777;
        }

        /* =============第一種input的checkbox樣式================= 
        input[type="checkbox"] {
            width: 21px;
            height: 21px;
            position: relative;
        }*/
        /* ---------------------------第2種input的checkbox樣式----------------------------------------- */
        /* input的checkbox樣式添加偽元素*/
        input[type="checkbox"]::after {
            content: "";
            width: 100%;
            height: 100%;
            border: 2px solid #f10505;
            position: absolute;
            left: -3px;
            top: -3px;
            border-radius: 50%;
        }

        input[type="checkbox"] {
            -webkit-appearance: none;
            appearance: none;
            width: 25px;
            height: 25px;
            position: relative;
            margin-right: 10px;
            background-color: #fff666;
        }

        /* ---------------------------------------------*/
        /* 設(shè)置checkbox點(diǎn)擊之后的樣式*/
        input[type="checkbox"]:checked::after {
            height: 15px;
            width: 25px;
            border-top: none;
            border-right: none;
            border-radius: 0;
            transform: rotate(-45deg);
            transition: all 0.5s ease-in-out;
        }

        /* 重新設(shè)置span的樣式 */
        span {
            text-decoration-color: #bf1313;
            text-underline-offset: 1px;
            /* 添加過渡效果 */
            transition: all 0.5s;
        }

        /* span添加hover事件 */
        span:hover {
            text-decoration-color: var(--checked);
            text-underline-offset: 10px;
            color: var(--checked);
        }

        /* *****************備用信息盒子************************ */
        .model-box {
            /* 隱藏盒子*/
            display: none;
        }

        .model-box .content {
            position: absolute;
            top: 100px;
            /* calc方法可以自動計(jì)算數(shù)值 */
            left: calc(50% - 270px);
            width: 680px;
            height: 350px;
            border-radius: 5px;
            /* 盒子陰影 */
            box-shadow: 0 2px 12px rgba(43, 4, 4, 0.2);
            background-color: #cfe9d4;
        }

        h2 {
            padding: 0 10px;
        }

        .model-box .content .title {
            /* 彈性布局 */
            display: flex;
            /* 讓子元素水平與兩端對齊 */
            justify-content: space-between;
            height: 50px;
            line-height: 50px;
            /* 鼠標(biāo)移入呈現(xiàn)移動光標(biāo) */
            cursor: move;
            border-radius: 5px;
            background-color: #a0eab0;
        }

        .model-box .content .title i {
            /* i標(biāo)簽?zāi)J(rèn)是斜體 這個(gè)屬性可以變正 */
            font-style: normal;
            font-size: 50px;
            color: #b1b4ba;
            cursor: pointer;
            margin-right: 10px;
            line-height: 42px;
        }

        /*備用信息 X 鼠標(biāo)移入變色 */
        .model-box .content .title i:hover {
            color: #110647;
        }

        .mess button {
            background-color: #ea600b;
            /* 相對定位 */
            position: relative;
            top: 10px;
        }

        bdi,
        .mess {
            margin: 10px;
        }
    </style>
</head>

<body background="yyds.jpg" style="background-repeat:no-repeat;
background-attachment:fixed;
background-size:100% 100%; ">
    <h1>
        <dfn>備忘錄
        </dfn>(memorandum)
    </h1>
    <hr>
    <textarea class="text-input-box" rows="1" cols="50%" placeholder="請輸入備忘內(nèi)容"></textarea><button type="text"
        class="addto">添加</button><button id="openButton">打開URL</button><input type="submit" value="查看備用信息"
        class="open" />
    <hr>
    <!--------------------- 隱藏的備用信息html盒子------------------------- -->
    <main class="model-box">
        <main class="content">
            <main class="title">
                <h2 class="xzcz">備用信息</h2>
                <i class="close">&times</i>
            </main>
            <main class="mess">
                <u>
                    &lt;a href="輸入網(wǎng)站地址" target="_blank"&gt;
                    輸入網(wǎng)站名稱
                    &lt;/a&gt;
                </u>
                <bdi>^\s*(?=\r?$)\n
                </bdi>
                <hr>
                <button><a  target="_blank">百度一下</a></button>
                <button><a  target="_blank"
                        title='菜鳥教程https://www.runoob.com/'>菜鳥取色器</a></button>
                <button><a 
                        target="_blank">csdn博客</a></button>
                <button> <a  target="_blank">w3schools 教程</a></button>
                <button><a  target="_blank">嗶哩嗶哩bilibili</a></button>
                <button><a  target="_blank">西瓜視頻</a></button>
                <button><a  target="_blank">原神社區(qū)-米游社</a></button>
                <button><a
                        
                        target="_blank">原神大地圖</a></button>
            </main>
        </main>
    </main>
    <div class="text"></div>
    <script>

        var TextInputBox = document.querySelector(".text-input-box");
        var addto = document.querySelector(".addto");
        var text = document.querySelector(".text");
        addto.onclick = function () {
            inserhtml(TextInputBox.value, '');
            TextInputBox.value = '';
            TextInputBox.focus();
            savetodo();
        }
        var savetodo = function () {
            let todoarr = [];
            let todojs = {};
            var econtent = document.querySelectorAll('.content');
            for (let index = 0; index < econtent.length; index++) {
                todojs.name = econtent[index].innerHTML;
                todojs.finish = econtent[index].classList.contains('finish');
                todoarr.push(todojs);
                todojs = {};
            }
            save(todoarr);
        }
        var loadtodo = function () {
            let todoarr = load();
            for (let index = 0; index < todoarr.length; index++) {
                inserhtml(todoarr[index].name, todoarr[index].finish ? 'finish' : '');
            }
        }
        var save = function (arr) {
            // 持久儲存
            localStorage.todos = JSON.stringify(arr);
        }
        var load = function (arr) {
            var arr = JSON.parse(localStorage.todos);
            return arr;
        }
        text.onclick = function () {
            var tg = event.target;
            var tgkids = tg.parentElement.children;

            if (tgkids[0].checked) {

                tgkids[1].style.display = "block";
                tgkids[3].style.display = "none";
                tgkids[4].classList.remove("finish");
            }
            else {
                tgkids[4].classList.remove("finish");
                tgkids[1].style.display = "none";
                tgkids[2].style.display = "none";
                tgkids[3].style.display = "none";
            }

            if (tg.innerHTML == "選擇刪除") {
                tgkids[4].classList.add("finish");
                tgkids[1].style.display = "none";
                tgkids[2].style.display = "block";
                tgkids[3].style.display = "block";
                tgkids[3].onclick = function () {
                    tg.parentElement.remove("");

                }
            }
            if (tg.innerHTML == "取消") {

                tgkids[0].checked = false;
                tgkids[1].style.display = "none";
                tgkids[2].style.display = "none";
            }
            savetodo();
        }

        var inserhtml = function (val, cls) {
            text.insertAdjacentHTML("beforeend",
                `<div>
                    <input type="checkbox">
                    <button style="display: none">選擇刪除</button>   
                    <button style="display: none">取消</button>  
                    <button style="display: none">確定刪除</button>                     
                    <span class='content ${cls}'>${val}</span>                            
                </div>`
            )
        }
        loadtodo();
        /*********************一個(gè)html提示彈窗無需點(diǎn)擊的函數(shù) ******************************/
        function displayAlert(type, data, time) {

            var a = document.createElement("a");
            if (type == "info") {
                a.style.backgroundColor = "#990000";
            }
            a.id = "a";
            a.style.position = "absolute";
            a.style.width = "300px";
            a.style.height = "60px";
            a.style.marginLeft = "-100px";
            a.style.marginTop = "-30px";
            a.style.left = "30%";
            a.style.top = "15%";
            a.style.color = "white";
            a.style.fontSize = "25px";
            a.style.borderRadius = "20px";
            a.style.textAlign = "center";
            a.style.lineHeight = "60px";
            if (document.getElementById("a") == null) {
                document.body.appendChild(a);
                a.innerHTML = data;
                setTimeout(function () {
                    document.body.removeChild(a);
                }, time);
            }
        }
        /*********************打開文件JavaScript部分 ******************************/
        var openBtn = document.getElementById("openButton");
        openBtn.addEventListener('click', function () {
            var filePath = prompt("請輸入網(wǎng)站地址或者本地文件路徑", "D:/前端學(xué)習(xí)");

            if (filePath) {
                window.open(filePath);
            } else {

                displayAlert("info", "未提供有效的文件路徑!", 1500);
            }
        });
        /***************隱藏的備用信息頁面的JS部分******************************/
        window.addEventListener("load", () => {
            const open = document.querySelector(".open");
            const close = document.querySelector(".close");
            const fillScreen = document.querySelector(".model-box");
            const header = document.querySelector(".title");
            const modelBox = document.querySelector(".content");
            open.addEventListener("click", () => {
                fillScreen.style.display = "block";
            });
            close.addEventListener("click", () => {
                fillScreen.style.display = "none";
            });
            header.addEventListener("mousedown", (event) => {
                const x = event.pageX - modelBox.offsetLeft;
                const y = event.pageY - modelBox.offsetTop;
                console.log(x, y);
                document.addEventListener("mousemove", move);
                function move(event) {
                    modelBox.style.left = event.pageX - x + "px";
                    modelBox.style.top = event.pageY - y + "px";
                }
                document.addEventListener("mouseup", () => {
                    document.removeEventListener("mousemove", move);
                });
            });
        });
    </script>
</body>

</html>

到了這里,關(guān)于第7次修改了可刪除可持久保存的前端html備忘錄的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 手機(jī)備忘錄怎么設(shè)置提醒 備忘錄提醒設(shè)置方法

    手機(jī)備忘錄怎么設(shè)置提醒 備忘錄提醒設(shè)置方法

    具備提醒功能的手機(jī)備忘錄有很多,比如云便簽的提醒功能十分好用,不僅可設(shè)置單次定時(shí)提醒,還能添加重復(fù)提醒、重要事項(xiàng)提醒或到期延時(shí)提醒等,而且提醒方式也支持應(yīng)用、微信、短信、電話、郵箱及手機(jī)系統(tǒng)日歷等多種。那這款手機(jī)備忘錄怎么設(shè)置提醒?備忘錄提醒

    2024年02月12日
    瀏覽(14)
  • 蘋果備忘錄如何轉(zhuǎn)移?備忘錄怎么轉(zhuǎn)移到新手機(jī)?

    蘋果備忘錄如何轉(zhuǎn)移?備忘錄怎么轉(zhuǎn)移到新手機(jī)?

    對于很多蘋果手機(jī)的用戶而言,想必都有使用備忘錄的習(xí)慣吧?但是,經(jīng)過長期的使用,當(dāng)需要更換手機(jī)設(shè)備時(shí),您考慮過如何轉(zhuǎn)移這些記錄嗎? 蘋果備忘錄怎么轉(zhuǎn)移到新手機(jī)? 如您使用的是蘋果手機(jī)內(nèi)置的備忘錄,并且需要更換的新設(shè)備依然是蘋果手機(jī),其解決方案非常

    2024年02月13日
    瀏覽(18)
  • 手機(jī)備忘錄如何批量導(dǎo)出來,備忘錄整體導(dǎo)出方法介紹

    手機(jī)備忘錄如何批量導(dǎo)出來,備忘錄整體導(dǎo)出方法介紹

    手機(jī)備忘錄如何批量導(dǎo)出來?一些品牌的手機(jī)上有自帶的備忘錄,大多手機(jī)自帶備忘錄都不支持直接批量導(dǎo)出,只能通過分享或復(fù)制類的功能逐條導(dǎo)出,手動進(jìn)行整理。 除了手機(jī)自帶備忘錄,一些朋友會選擇在自己的手機(jī)上使用云便簽備忘錄,不僅可以在線添加備忘錄提醒事

    2024年02月16日
    瀏覽(27)
  • 蘋果手機(jī)備忘錄如何導(dǎo)入新手機(jī)?手機(jī)備忘錄怎么轉(zhuǎn)移?

    蘋果手機(jī)備忘錄如何導(dǎo)入新手機(jī)?手機(jī)備忘錄怎么轉(zhuǎn)移?

    一般來說,大多數(shù)手機(jī)用戶更換手機(jī)的頻率是3—5年,在一部手機(jī)使用了幾年之后,就會出現(xiàn)內(nèi)存不足、系統(tǒng)卡頓、電池續(xù)航時(shí)間較短等問題,這時(shí)候就需要更換新的手機(jī)了。有不少蘋果手機(jī)用戶在更換新手機(jī)的時(shí)候,都很發(fā)愁一個(gè)問題,這就是手機(jī)備忘錄如何導(dǎo)入新手機(jī)。

    2024年01月25日
    瀏覽(19)
  • 備忘錄模式

    在不破壞封裝性的前提下,捕獲一個(gè)對象的內(nèi)部狀態(tài),并在該對象之外保存這個(gè)狀態(tài)。這樣以后就可將該對象恢復(fù)到原先保存的狀態(tài)。 1.1 撤銷操作: 例如,在文本編輯器中,當(dāng)我們對文本進(jìn)行修改時(shí),可以使用備忘錄模式來實(shí)現(xiàn)撤銷操作。每次對文本進(jìn)行修改時(shí),就保存當(dāng)

    2024年02月03日
    瀏覽(21)
  • 博文備忘錄

    博文備忘錄

    https://blog.csdn.net/ZQ_KING/article/details/80320080 (鏈接層)MAC地址——ARP協(xié)議 (網(wǎng)絡(luò)層)IP地址——IP協(xié)議 (傳輸層)端口——UDP協(xié)議、TCP協(xié)議 (應(yīng)用層)域名——HTTP協(xié)議、HTTPS協(xié)議 https://github.com/xiaomuzhu/front-end-interview/blob/master/docs/guide/http.md (http) https://github.com/xiaomuzhu/front-

    2024年02月08日
    瀏覽(37)
  • 備忘錄模式(Memento)

    備忘錄模式(Memento)

    備忘錄模式是一種行為設(shè)計(jì)模式,在不破壞封裝性的前提下,允許在不暴露對象實(shí)現(xiàn)細(xì)節(jié)的情況下保存和恢復(fù)對象之前的狀態(tài)。 一個(gè)備忘錄(memento)是一個(gè)對象,它存儲另一個(gè)對象在某個(gè)瞬間的內(nèi)部狀態(tài),而后者稱為備忘錄的原發(fā)器(originator)。當(dāng)需要設(shè)置原發(fā)器的檢查點(diǎn)時(shí),取

    2024年02月13日
    瀏覽(23)
  • stata備忘錄

    stata備忘錄

    1. 畫圖 (1)時(shí)間趨勢圖 等價(jià)命令 字體大小 option 字體大小option description zero no size whatsoever, vanishingly small minuscule smallest quarter_tiny third_tiny half_tiny tiny vsmall small medsmall medium medlarge large vlarge huge vhuge largest tenth one-tenth the size of the graph quarter one-fourth the size of the graph third one-thi

    2024年02月03日
    瀏覽(27)
  • 《設(shè)計(jì)模式》備忘錄模式

    《設(shè)計(jì)模式》備忘錄模式

    定義 : 備忘錄模式又稱為快照模式或者令牌模式, 在不破壞封裝性的前提下,捕獲一個(gè)對象的內(nèi)部狀態(tài),并在該對象之外保存這個(gè)狀態(tài),這樣可以在以后將對象恢復(fù)到原先保存的狀態(tài)。 屬性 行為型 模式。 備忘錄模式的角色組成 : Originator(發(fā)起人) :負(fù)責(zé)創(chuàng)建一個(gè) Memento

    2024年02月06日
    瀏覽(32)
  • 【設(shè)計(jì)模式】備忘錄模式

    【設(shè)計(jì)模式】備忘錄模式

    主頁傳送門: ?? 傳送 ???????備忘錄(Memento Pattern)模式又叫做快照模式(Snapshot Pattern)或Token模式,是對象的行為模式。。其定義如下: Without violating encapsulation,capture and externalize an object’s internal state so that the object can be restored to this state later. ???????即:在不破壞封

    2024年02月07日
    瀏覽(25)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包