uikit实现各种弹窗模态弹出层效果代码

代码语言:html

所属分类:弹出层

代码描述:uikit实现各种弹窗模态弹出层效果代码

代码标签: uikit 弹出层 模态 弹窗

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- UIkit CSS -->
    <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/uikit.min.css">

    <!-- UIkit JS -->
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/uikit.min.js"></script>
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/uikit-icons.min.js"></script>
    <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/medium-editor.min.css">

    <style>
        #back-to-top {
          position: fixed;
          bottom: 40px;
          right: 40px;
          z-index: 9999;
          width: 32px;
          height: 32px;
          text-align: center;
          line-height: 30px;
          background: #f5f5f5;
          color: #444;
          cursor: pointer;
          border: 0;
          border-radius: 4px;
          text-decoration: none;
          transition: opacity 0.2s ease-out;
          opacity: 0;
        }
        
        #back-to-top:hover {
          background: #e9ebec;
        }
        
        #back-to-top.show {
          opacity: 1;
        }
        
        #content {
          height: 2000px;
        }
        
        h2 {
          color: black;
          text-decoration: none;
          font-size: 1.4em;
          position: relative;
        }
        h2:before {
          content: "";
          position: absolute;
          width: 50%;
          height: 2px;
          bottom: -5px;
          border-bottom: 1px solid #000;
          transform: scale(0, 1);
          transition: transform 0.4s;
        }
        h2:hover:before {
          transform: scale(1);
        }
        
        .uk-dotnav {
          left: 10px;
        }
        
        ::-webkit-scrollbar {
          width: 7px;
          height: 7px;
        }
        
        ::-webkit-scrollbar-thumb {
          background-color: #fcebd5;
          border: 2.5px solid #424242;
        }
        
        ::-webkit-scrollbar-track {
          background-color: #424242;
        }
        
        .uk-modal-dialog {
          border-radius: 4px;
        }
    </style>



</head>

<body>
    <div class="uk-container">

        <ul class="uk-dotnav uk-dotnav-vertical uk-position-center-left uk-position-fixed">
            <li class="uk-active" title="kafana" uk-tooltip="pos: right"><a href="#">Kafana</a></li>
            <li title="Section" uk-tooltip="pos: right"><a href="#">Item 2</a></li>
            <li title="Lection" uk-tooltip="pos: right"><a href="#">Item 3</a></li>
            <li title="Modal Center Scroll" uk-tooltip="pos: right"><a href="#modal-center-scrollbar" uk-toggle>Modal Center scrollbar</a></li>
            <li title="how long can one tooltip go? too long. maybe | I don't know. lets find out" uk-tooltip="pos: right"><a href="#modal-full" uk-toggle>Item 5</a></li>
        </ul>


        <h1>Modal</h1>

        <div class="uk-child-width-1-3@m" uk-grid>
            <div>

                <h2>Objects</h2>

                <p uk-margin>
                    <a class="uk-button uk-button-default" href="#modal" uk-toggle>Default</a>
                    <a class="uk-button uk-button-default" href="#modal-sections" uk-toggle>Sections</a>
                    <a class="uk-button uk-button-default" href="#modal-nobody" uk-toggle>No Body</a>
                    <a class="uk-button uk-button-default" href="#modal-caption" uk-toggle>Caption</a>
                    <a class="uk-button uk-button-default" href="#modal-close-outside" uk-toggle>Close Outside</a>
                    <a class="uk-button uk-button-default" href="#whiskas-kittens" uk-toggle>Whiskas</a>

                    <a class="uk-button uk-button-default" href="#modal-lightbox" uk-toggle>Lightbox</a>
                </p>

            </div>
            <div>

                <h2>Scrollbar</h2>

                <p uk-margin>
                    <a class="uk-button uk-button-default" href="#modal-scrollbar" uk-toggle>Scrollbar</a>
                    <a class="uk-button uk-button-default" href="#modal-overflow" uk-toggle>Overflow Auto</a>
                </p>

            </div>
            <div>

                <h2>Sizes</h2>

                <p uk-margin>
                    <a class="uk-button uk-button-default " href="#modal-container" uk-toggle>Container</a>
                    <a class="uk-button uk-button-default" href="#modal-expand" uk-toggle>Expand</a>
                    <a class="uk-button uk-button-default" href="#modal-widths" uk-toggle>Widths</a>
                    <a class="uk-button uk-button-default" href="#modal-full" uk-toggle>Full</a>
                    <a class="uk-button uk-button-default" href="#modal-full-split" uk-toggle>Full Split</a>
                </p>

            </div>
            <div>

                <h2>Center</h2>

                <p uk-margin>
                    <a class="uk-button uk-button-default" href="#modal-center" uk-toggle>Center</a>
                    <a class="uk-button uk-button-default" href="#modal-center-scrollbar" uk-toggle>With scrollbar</a>

                </p>

            </div>
            <div>

                <h2>Group</h2>

                <p uk-margin>
                    <a class="uk-button uk-button-default" href="#modal-group-1" uk-toggle>Modal 1</a>
                    <a class="uk-button uk-button-default" href="#modal-group-2" uk-toggle>Modal 2</a>
                </p>

            </div>
            <div>

                <h2>Dialogs</h2>

                <p uk-margin>
                    <a id="modal-dialog" class="uk-button uk-button-default" href="#">Dialog</a>
                    <a id="modal-alert" class="uk-button uk-button-default" href="#">Alert</a>
                    <a id="modal-confirm" class="uk-button uk-button-default" href="#">Credit card</a>
                    <a id="modal-prompt" class="uk-button uk-button-default" href="#">Prompt</a>
                </p>

            </div>
            <div>

                <h2>Stack</h2>

                <p uk-margin>
                    <a class="uk-button uk-button-default" href="#modal-stack-1" uk-toggle>Modal 1</a>
                    <a class="uk-button uk-button-default" href="#modal-stack-2" uk-toggle>Modal 2</a>
                </p>

            </div>
        </div>

    </div>

    <div class="uk-container">

        <p>
            <button class="uk-button uk-button-default" type="button" uk-toggle="target: #scrollbar">Toggle scrollbar</button>
        </p>

        <div id="scrollbar">

            <p contenteditable>Merovinzi su ih preuzeli, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute
                irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

            <div class="uk-child-width-1-2@m" uk-grid>
                <div>

                    <div class="uk-inline uk-light">
                        <img src="//repo.bfw.wiki/bfwrepo/image/5d6539c1971b8.png" alt="">
                        <div class="uk-position-center">
                            <span uk-overlay-icon></span>
                        </div>
                    </div>

                </div>
                <div>

                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

                </div>

                <h2>Javascript Options</h2>

                <div class="uk-overflow-auto">
                    <table class="uk-table uk-table-striped">
                        <thead>
                            <tr>
                                <th>Option</th>
                                <th>Value</th>
                                <th>Default</th>
                                <th>Description</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td><code>center</code></td>
                                <td>Boolean</td>
                                <td>false</td>
                                <td>Center the modal.</td>
                            </tr>
                            <tr>
                                <td><code>container</code></td>
                                <td>Boolean</td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td><code>esc-close</code></td>
                                <td>Boolean</td>
                                <td>true</td>
                                <td>Close the modal when <em>Esc</em> key is pressed.</td>
                            </tr>
                            <tr>
                                <td><code>bg-close</code></td>
                                <td>Boolean</td>
                                <td>true</td>
                                <td>Close the modal when background is clicked.</td>
                            </tr>
                            <tr>
                                <td><code>stack</code></td>
                                <td>Boolean</td>
                                <td>false</td>
                                <td>Stack modals, when more than one is open? By default, the previous modal will be hidden.</td>
                            </tr>
                        </tbody>
                    </table>
                </div>

            </div>

            <div id="modal" uk-modal>
                <div class="uk-modal-dialog uk-modal-body">
                    <button class="uk-modal-close-default" type="button" uk-close></button>
                    <h2 class="uk-modal-title">Headline</h2>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                    <p class="uk-text-right">
                        <button class="uk-button uk-button-default uk-modal-close" type="button">Cancel</button>
                        <button class="uk-button uk-button-primary" type="button">Save</button>
                    </p>
                </div>
            </div>

            <div id="modal-sections" uk-modal>
                <div class="uk-modal-dialog">
                    <button class="uk-modal-close-default" type="button" uk-close></button>
                    <div class="uk-modal-header">
                        <h2 class="uk-modal-title">Headline</h2>
                    </div>
                    <div class="uk-modal-body">
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                            Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                    </div>
                    <div class="uk-modal-footer uk-text-right">
                        <button class="uk-button uk-button-default uk-modal-close" type="button">Cancel</button>
                        <button class="uk-button uk-button-primary" type="button">Save</button>
                    </div>
                </div>
            </div>

            <div id="modal-nobody" uk-modal>
                <div class="uk-modal-dialog">
                    <button class="uk-modal-close-outside" type="button" uk-close></button>
                    <img src="//repo.bfw.wiki/bfwrepo/image/5d6539c1971b8.png" alt="">
                </div>
            </div>


            <div id="whiskas-kittens" uk-modal>
                <div class="uk-modal-dialog">
                    <button class="uk-modal-close-outside" type="button" uk-close></button>
                    <img src="//repo.bfw.wiki/bfwrepo/image/5d6539c1971b8.png" alt="jumanji">
                    <div>semper fi, mon dear</div>
                </div>
            </div>


            <div id="modal-caption" uk-modal>
                <div class="uk-modal-dialog">
                    <button class="uk-modal-close-default" type="button" uk-close></button>
                    <div class="uk-modal-body">
                        <p>I used to rule the world, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                            Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                    </div>
                    <div class="uk-modal-caption uk-button">HaskyHeart</div>
                </div>
            </div>

            <div id="modal-close-outside" uk-modal>
                <div class="uk-modal-dialog uk-modal-body">
                    <button class="uk-modal-close-outside" type="button" uk-close></button>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                </div>
            </div>

            <div id="modal-lightbox" class="uk-modal-lightbox" uk-modal>
                <div class="uk-modal-bar uk-position-top">
                    <button class="uk-modal-close-default" type="button" uk-close></button>
                </div>
                <div class="uk-modal-dialog">
                    <img src="//repo.bfw.wiki/bfwrepo/image/5d6539c1971b8.png" alt="">
                </div>
                <div class="uk-modal-bar uk-position-bottom">
                    Caption
                </div>
            </div>

            <div id="modal-container" class="uk-modal-container" uk-modal>
                <div class="uk-modal-dialog uk-modal-body">
                    <button class="uk-modal-close-default" type="button" uk-close></button>
                    <p contenteditable>Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow
                        it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. You think water moves fast? You should see ice. It moves like it
                        has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the
                        slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man.</p>
                </div>
            </div>

            <div id="modal-expand" uk-modal>
                <div class="uk-modal-dialog uk-modal-body uk-width-1-1">
                    <button class="uk-modal-close-default" type="button" uk-close></button>
                    <p>wakka wakka Bailey's irish cream the amarosa cocktail pegu caesar paddy, "benedictine pappy van winkle; ardmore painkiller el presidente." Caridan galliano nikolaschka benromach bengal, lochnagar, rusty nail linkwood, tequila slammer
                        glenburgie vesper martini jack daniel's. Bombay strega glenfarclas gin sour bearded lady lime rickey caol ila amaretto sour cafe zürich. Lochnagar; the amarosa cocktail: bombay black velvet, glogg hiram walker! Glen elgin old mr.
                        boston, link up! Chicago cocktail johnny walker red sazerac canadian mist, nikolaschka kir royale hi-fi pulteney glenlivet bloodhound sake manhattan champagne cocktail.</p>
                </div>
            </div>

            <div id="modal-widths" uk-modal>
                <div class="uk-modal-dialog uk-modal-body uk-width-3-4@m uk-width-2-3@l uk-width-1-2@xl">
                    <button class="uk-modal-close-default" type="button" uk-close></button>
                    <p contenteditable>Changes can be made via here Bailey's irish cream the amarosa cocktail pegu caesar paddy, "benedictine pappy van winkle; ardmore painkiller el presidente." Caridan galliano nikolaschka benromach bengal, lochnagar, rusty nail linkwood,
                        tequila slammer glenburgie vesper martini jack daniel's. Bombay strega glenfarclas gin sour bearded lady lime rickey caol ila amaretto sour cafe zürich. Lochnagar; the amarosa cocktail: bombay black velvet, glogg hiram walker!
                        Glen elgin old mr. boston, link up! Chicago cocktail johnny walker red sazerac canadian mist, nikolaschka kir royale hi-fi pulteney glenlivet bloodhound sake manhattan champagne cocktail.</p>
                </div>
            </div>

            <div id="modal-full" class="uk-modal-full" uk-modal>
                <div class="uk-modal-dialog uk-flex uk-flex-center uk-flex-middle" uk-height-viewport>
                    <button class="uk-modal-close-full" type="button" uk-close></button>
                    <div class="uk-width-xxlarge uk-padding-large">
                        <h1>Naranča müsli</h1>
                        <p>Na tavici zagrijati naribane bademe i müsli, dodati marmeladu i ulje te miješati dok se ne stvori kompaktna, karamelizirana masa. Žlicom razmazati po dnu okrugle posude. Filetirati naranče i sitno ih narezati, u hladnoj vodi omekšati
                            želatinu. Pomiješati slatko vrhnje, sok od limuna, naranče, postupno dodati želatinu i zasladiti po želji smeđim šećerom ili šećerom u prahu. Istući bjelanjke i dodati u kremu. Preliti preko badema i müslija te ostaviti da
                            se ohladi najmanje 2 sata Ukrasiti svježim voćem.</p>
                    </div>
                </div>
            </div>

            <div id="modal-full-split" class="uk-modal-full" uk-modal>
                <div class="uk-modal-dialog">
                    <button class="uk-modal-close-full" type="button" uk-close></button>
                    <div class="uk-grid-collapse uk-child-width-1-2@s uk-flex-middle" uk-grid>
                        <div class="uk-background-cover" style="background-image: url('//repo.bfw.wiki/bfwrepo/image/5d6539c1971b8.png');" uk-height-viewport></div>
                        <div class="uk-padding-large">
                            <h1>ARRIVAL</h1>
                            <p class="editable">Čitav naš svijet je poput oceana tekuće materije. Svi njegovi rubovi i rubovi objekata koje percipiramo kao objekte sa čvrstim stjenkama samo su iluzija koju nam nameću naša ograničena osjetila. Odnosno, naša osjetila ili kakav
                                god drugi instrumentarij izmislili kako bismo proširili područje vlastita opažanja, uvijek će ostati nedovoljno savršena i ograničena za druge dimenzije svijesti, dimenzije koje nadilaze materijalni svijet, prostor i vrijeme.
                                No...zađemo li malo dublje u smisao i bit ljudskog postojanja shvatiti ćemo da postoje i drugi načini komunikacije i opažanja kudikamo suptilniji od onih kojeg čovjek može dosegnuti sa svojih pet čula, a to su oni putem
                                univerzalne svijesti. Naime, mi kao ljudska bića n.........完整代码请登录后点击上方下载按钮下载查看

网友评论0