southcodes

mystxmomo raw

Jan 15th, 2026
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 11.66 KB | None | 0 0
  1. <!--
  2.     - commission for @mystxmomo by skye southcodes.tumblr.com
  3.     - modify as you please but please do not touch the credit
  4.     - any errors? need help? have questions? let me know!
  5.     southcodes.tumblr.com/inbox
  6.    
  7.     - normalize css by https://github.com/necolas
  8.     - fonts by google
  9.     - icon font by http://fontawesome.io/icons/
  10.     - multiple popups https://jsfiddle.net/JKurcik/WGPhG/1124/
  11.     - tabs within tabs https://stackoverflow.com/a/48081117
  12.     - modified tabs and popups by @https://egg.design/
  13.  
  14. -->
  15.  
  16. <!DOCTYPE html>
  17. <html>
  18.  
  19. <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# blog: http://ogp.me/ns/blog#">
  20.     <title>terrors</title>
  21.  
  22.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  23.  
  24.     <style>
  25.         figure {
  26.             margin: 0
  27.         }
  28.  
  29.         .tmblr-iframe {
  30.             position: absolute
  31.         }
  32.  
  33.         .tmblr-iframe.hide {
  34.             display: none
  35.         }
  36.  
  37.         .tmblr-iframe--amp-cta-button {
  38.             visibility: hidden;
  39.             position: fixed;
  40.             bottom: 10px;
  41.             left: 50%;
  42.             transform: translateX(-50%);
  43.             z-index: 100
  44.         }
  45.  
  46.         .tmblr-iframe--amp-cta-button.tmblr-iframe--loaded {
  47.             visibility: visible;
  48.             animation: iframe-app-cta-transition .2s ease-out
  49.         }
  50.     </style>
  51.     <link rel="stylesheet" media="screen"
  52.         href="https://assets.tumblr.com/client/prod/standalone/blog-network-npf/index.build.css?_v=f085dde138e244526309d4673db67b4c">
  53.     <link rel="shortcut icon"
  54.         href="https://64.media.tumblr.com/05dcc6f47fb157a069b0de026c92a315/7951a2bd5ebbdefe-66/s128x128u_c1/1bca196d517938438f835ed534c94a4094d5a0c9.pnj">
  55.     <meta name="description" content="" />
  56.  
  57.     <!-- fonts -->
  58.     <link rel="preconnect" href="https://fonts.googleapis.com">
  59.     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  60.     <link
  61.         href="https://fonts.googleapis.com/css2?family=Karla:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800&family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap"
  62.         rel="stylesheet">
  63.  
  64.     <!-- normalize -->
  65.     <link href="https://necolas.github.io/normalize.css/7.0.0/normalize.css" rel="stylesheet">
  66.  
  67.     <link rel="stylesheet" type="text/css" href="mystxmomo.css">
  68.  
  69.     <style>
  70.         :root {
  71.             --background: #ffffff;
  72.             --text: #333;
  73.             --links: #8cb3db;
  74.             --links-hover: #36608c;
  75.             --borders: #eee;
  76.             --icons: #36608c;
  77.             --buttons: lightblue
  78.         }
  79.  
  80.         .tmblr-iframe {
  81.             margin: .7rem;
  82.             opacity: .6;
  83.             -ms-transform: scale(0.85);
  84.             -webkit-transform: scale(0.85);
  85.             /* Safari */
  86.             transform: scale(0.85);
  87.         }
  88.  
  89.         .tmblr-iframe:hover {
  90.             opacity: .8;
  91.         }
  92.  
  93.         ::-webkit-scrollbar-thumb:vertical {
  94.             border-left: 2px solid var(--borders);
  95.         }
  96.  
  97.         ::-webkit-scrollbar {
  98.             width: 6px
  99.         }
  100.  
  101.         ::-webkit-scrollbar-track-piece {
  102.             margin: 5px 0;
  103.         }
  104.  
  105.         pre {
  106.             font-family: consolas;
  107.             white-space: pre-wrap;
  108.             /* css-3 */
  109.             white-space: -moz-pre-wrap;
  110.             /* Mozilla, since 1999 */
  111.             white-space: -pre-wrap;
  112.             /* Opera 4- */
  113.             white-space: -o-pre-wrap;
  114.             /* Opera 7 */
  115.             word-wrap: break-word;
  116.         }
  117.  
  118.         /* Internet Explorer 5.5+ */
  119.  
  120.         * {
  121.             margin: 0;
  122.             padding: 0;
  123.             box-sizing: border-box;
  124.         }
  125.  
  126.         p {
  127.             margin: 1rem 0
  128.         }
  129.  
  130.         body,
  131.         figure {
  132.             margin: 0;
  133.             padding: 0;
  134.         }
  135.  
  136.         html {
  137.             font: 16px 'Karla', sans-serif;
  138.         }
  139.  
  140.         body {
  141.             font-size: 14px;
  142.             color: var(--text);
  143.             background: var(--background);
  144.             font-family: var(--font-family);
  145.             font-size: var(--font-size);
  146.         }
  147.  
  148.         a {
  149.             text-decoration: none;
  150.             color: var(--links);
  151.             word-break: break-word;
  152.         }
  153.  
  154.         a:hover {
  155.             color: var(--links-hover);
  156.         }
  157.  
  158.         blockquote {
  159.             margin: 0;
  160.             padding: 0;
  161.         }
  162.  
  163.         img {
  164.             max-width: 100%;
  165.             height: auto;
  166.             display: block;
  167.             margin: 0
  168.         }
  169.  
  170.         hr {
  171.             border: 0;
  172.             border-top: 1px solid var(--borders);
  173.             margin: 0;
  174.         }
  175.  
  176.         ol,
  177.         ul,
  178.         li {
  179.             list-style-type: none;
  180.             margin: 0;
  181.             padding: 0;
  182.         }
  183.  
  184.         button {
  185.             border: none;
  186.             outline: none;
  187.             cursor: pointer;
  188.             transition: 0.2s;
  189.             background-color: transparent;
  190.             font-family: inherit;
  191.         }
  192.  
  193.         .tab {
  194.             overflow: hidden;
  195.         }
  196.  
  197.         .active-tab {
  198.             background-color: var(--buttons);
  199.         }
  200.  
  201.         .tabcontent {
  202.             display: none;
  203.             inset: 0;
  204.         }
  205.  
  206.         .tabcontent.active {
  207.             display: block;
  208.         }
  209.  
  210.         .popup {
  211.             position: fixed;
  212.             inset: 15%;
  213.             background-color: rgb(252, 235, 235);
  214.         }
  215.  
  216.         .show {
  217.             opacity: 1;
  218.             transition: opacity 200ms ease-in-out;
  219.         }
  220.  
  221.         .hide {
  222.             opacity: 0;
  223.             transition: opacity 200ms ease-in-out;
  224.             z-index: -1;
  225.         }
  226.  
  227.  
  228.         /* MEDIA */
  229.  
  230.         @media only screen and (min-width:0) and (max-width:1400px) {}
  231.     </style>
  232.  
  233.     <script defer type="application/javascript" id="bilmur" data-provider="tumblr.com" data-service="blognetwork"
  234.         data-customproperties='{"theme": ""}' nonce="9s2TZa7lsZZmAZjNQ2yOpKn3y4"
  235.         src="https://s0.wp.com/wp-content/js/bilmur.min.js?m=202501"></script>
  236.     <script
  237.         src="https://assets.tumblr.com/assets/scripts/tumblelog_post_message_queue.js?_v=a8fadfa499d8cb7c3f8eefdf0b1adfdd"></script>
  238.     <link rel="stylesheet" type="text/css" href="https://assets.tumblr.com/fonts/calluna/stylesheet.css?v=3">
  239. </head>
  240.  
  241. <body>
  242.  
  243.     <div class="tab main-tabs">
  244.  
  245.         <button id="active-tab" class="active-tab tablinks" data-tab="pop">POP</button>
  246.         <button id="second-tab" class="tablinks" data-tab="pop1">POP1</button>
  247.     </div>
  248.  
  249.  
  250.  
  251.     <div id="pop" class="tabcontent active">
  252.         <h1>POP</h1>
  253.  
  254.         <button onClick="openPopup('div1');">open div1</button>
  255.  
  256.         <div id="div1" class="popup hide" style="display: none;">
  257.             This is a test message div1
  258.  
  259.             <div class="tab">
  260.                 <button class="tablinks active-tab" data-tab="doel1">Doel 1</button>
  261.                 <button class="tablinks" data-tab="doel2">Doel 2</button>
  262.             </div>
  263.  
  264.             <div id="doel1" class="tabcontent active">
  265.                 Div 1 tab 1
  266.             </div>
  267.  
  268.             <div id="doel2" class="tabcontent">
  269.                 Div 1 tab 2
  270.             </div>
  271.             <div class="cancel">CLOSE</div>
  272.         </div>
  273.  
  274.  
  275.         <button onClick="openPopup('div2');">open div2</button>
  276.  
  277.         <div id="div2" class="popup hide" style="display: none;">
  278.             This is a test message div2
  279.  
  280.             <div class="tab">
  281.                 <button class="tablinks active-tab" data-tab="doela">Doel 1</button>
  282.                 <button class="tablinks" data-tab="doelb">Doel 2</button>
  283.             </div>
  284.  
  285.             <div id="doela" class="tabcontent active">
  286.                 Div 2 tab 1
  287.             </div>
  288.  
  289.             <div id="doelb" class="tabcontent">
  290.                 Div 2 tab 2
  291.             </div>
  292.             <div class="cancel">CLOSE</div>
  293.         </div>
  294.  
  295.     </div>
  296.  
  297.  
  298.  
  299.  
  300.     <div id="pop1" class="tabcontent">
  301.         minor
  302.  
  303.     </div>
  304.  
  305.  
  306.  
  307.     <!-- do not touch -->
  308.     <div
  309.         style="position:fixed;bottom:2rem;right:2rem;z-index:999999999999999999999!important;font-size:.7rem;letter-spacing:.03rem;">
  310.         <a href="https://southcodes.tumblr.com" title="coded by southcodes" target="_blank">SC</a>
  311.     </div>
  312.  
  313.  
  314.     <!-- icons font -->
  315.  
  316.     <script>
  317.         // stores default active tabs for popups
  318.         const defaultTabs = Array.from(document.querySelectorAll('.tabcontent.active'));
  319.         // listens for clicks on tablinks and cancel buttons
  320.         document.addEventListener('click', (e) => {
  321.             if (e.target.closest('.tablinks')) {
  322.                 const tabId = e.target.dataset.tab;
  323.                 if (!tabId) return;
  324.                 const parent = e.target.closest('.popup, .main-tabs')?.parentElement;
  325.                 if (parent == null) return;
  326.  
  327.                 const tablinks = parent.querySelectorAll('.tablinks');
  328.                 const tabcontents = parent.querySelectorAll('.tabcontent');
  329.                 if (tablinks.length === 0 || tabcontents.length === 0) return;
  330.  
  331.                 // Remove this if you want to keep popups open when switching the main tabs
  332.                 if (e.target.parentElement.closest('.main-tabs')) {
  333.                     closePopup();
  334.                 }
  335.  
  336.                 clearActiveStates(parent);
  337.                 addActiveStates(parent, tabId, e.target);
  338.             }
  339.  
  340.             if (e.target.closest('.cancel')) {
  341.                 closePopup();
  342.             }
  343.         })
  344.  
  345.         // clears active states from from tabs when switching between popups or main tabs
  346.         function clearActiveStates(parent) {
  347.             const tablinks = parent.querySelectorAll('.tablinks');
  348.             const tabcontents = parent.querySelectorAll('.tabcontent');
  349.  
  350.             for (const tablink of tablinks) {
  351.                 tablink.classList.remove('active-tab');
  352.             }
  353.             for (const content of tabcontents) {
  354.                 content.classList.remove('active');
  355.             }
  356.         }
  357.  
  358.         // adds active states to selected tab and tablink
  359.         function addActiveStates(parent, tabId, tablink) {
  360.             const tabcontent = parent.querySelector(`#${tabId}`);
  361.             if (tabcontent) tabcontent.classList.add('active');
  362.             if (tablink) tablink.classList.add('active-tab');
  363.         }
  364.  
  365.         // opens popup and sets default tab
  366.         function openPopup(id) {
  367.             // close any open popups first
  368.             closePopup();
  369.             const popup = document.getElementById(id)
  370.             if (popup == null) return;
  371.             popup.style.display = '';
  372.             const defaultTab = defaultTabs.find(tab => tab.closest(`#${id}`));
  373.             // get default tab id and link
  374.             const defaultTabId = defaultTab?.id;
  375.             const defaultTabLink = popup.querySelector(`.tablinks[data-tab="${defaultTabId}"]`);
  376.             clearActiveStates(popup);
  377.             addActiveStates(popup, defaultTabId, defaultTabLink);
  378.             // clear existing timeout so animations don't overlap
  379.            clearTimeout(popup.dataset.timeoutId);
  380.            // set timeout for animations
  381.            popup.dataset.timeoutId = setTimeout(() => {
  382.                popup.classList.remove('hide');
  383.                popup.classList.add('show');
  384.            }, 200);
  385.        }
  386.  
  387.        // closes all open popups
  388.        function closePopup() {
  389.            const popups = document.querySelectorAll('.popup');
  390.            for (const popup of popups) {
  391.                popup.classList.remove('show');
  392.                popup.classList.add('hide');
  393.            }
  394.        }
  395.    </script>
  396. </body>
  397.  
  398. </html>
Advertisement
Add Comment
Please, Sign In to add comment