Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!--<iframe src="https://codepen.io/z-/posts/popular/" frameborder="0" width="200" height="200" style="position:absolute; top:9px; right:9px"></iframe>
<a href="https://codepen.io/z-/details/XPQyMo/#new-comment" target="_blank" id="widget-comment">Comment</a>-->
<p>Haii, what a complete mess this is. Yeah it needs improvement, you should have seen the first version though.</p>
<video width="64" height="64" autoplay style="border-radius:100%"><source src="https://i.koya.io/HyOVD4.mp4" type="video/mp4"></video>
              
            
!

CSS

              
                @import url(https://pro.fontawesome.com/releases/v5.11.2/css/all.css);
:root {
	//--user-button-main: #EC87C0;
	//--user-button-background: #FFFFFF;
	--user-button-circle: rgba(0,0,0,0.025);
	--user-button-cardborder: rgba(255,255,255,0.25);
	--user-button-text:#323133;
	--user-button-shadow:rgba(0,0,0,0.1);
}

@mixin dark {
   &.dark {
      @content;
   }
   @media (prefers-color-scheme: dark) {
      &:not(.light) {
         @content;
      }
   }
}
body {
	#user-button {
		//position: fixed;
		z-index:1000;
		bottom:1rem !important;
		right:1rem !important;
		color:var(--user-button-text);
		transition:1s 0s ease-out;
		animation:slide 3s ease-out forwards;
		//display:block !important;
		@keyframes slide {
			0%, 50% {
				opacity:0;
				display:block !important;
			}
			100% {
				opacity:1;
				display:block !important;
			}
		}
		.u-card {
			//background:var(--user-button-background, #FFFFFF);
			border-radius:100%;
			box-shadow:0 0 1rem -.25rem var(--user-button-shadow), inset 0 0 1rem -.75rem var(--user-button-shadow);
		}
		.u-main {
			//position: relative;
			//z-index:1000;
			//display:grid;
			//place-items:center;
			//width:4rem;
			//height:4rem;
			cursor: pointer;
         --user-button-background:var(--user-button-main, #EC87C0);
			img {
				//height:50%;
				//width:50%;
				height:100%;
				width:100%;
			}
			iframe {
				position: absolute;
				top:0;
				left:0;
				width:4rem;
				height:4rem;
				opacity:1;
				transition:0s 4s;
			}
		}
		.u-icons {
         position:relative;
			z-index:950;
			//position: absolute;
			//top:50%;
			//left:50%;
			transform:translate(-50%, -50%);
			//width:0%;
			//height:0%;
			background:var(--user-button-circle);
			box-shadow:0 0 0 0.125rem var(--user-button-cardborder);
			border-radius:100%;
			transition:.25s;
			opacity:1 !important;
         backdrop-filter: blur(10px);
         /*&:before {
            z-index:-1;
            position:absolute;
            top:0; right:0; bottom:0; left:0;
            content:'';
            
            backdrop-filter: blur(10px);
         }*/
			a {
				color:inherit;
				display:grid;
				place-items:center;
				width:30px;
				height:30px;
				text-decoration:none;
				div {
					padding:.5rem;
					//box-shadow: 0 0 0 0rem transparent;
					//box-shadow:0 0 .5rem -.25rem var(--user-button-shadow);
					transition:0s;
				}
            &[href="https://twitter.com/Osorpenke"] {
               position:relative;
               &:before {
                  content:'Middle Click';
                  position:absolute;
                  top:-1.5rem;
                  left:50%;
                  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
                  white-space:pre;
                  transform:translateX(-50%);
                  opacity:0;
                  pointer-events:none;
                  transition:.25s ease-in;
                  background:#fffc;
                  padding:.25rem .5rem;
                  border-radius:.25rem;
               }
               &.show {
                  &:before {
                     opacity:1;
                     transition:.25s ease-out;
                  }
               }
               div {
					   color:#1da1f2;
               }
				}
				&[href="https://codepen.io/z-"] div {
					background:black;
					color:white;
					//--user-button-cardborder:var(--user-button-text);
				}
				&:hover {
					//box-shadow: 0 0 0rem 0.125rem var(--user-button-cardborder);
				}
				&.u-random {
					div {
                  position:relative;
                  top:-1px;
						animation:diespin 2s linear infinite;
						@keyframes diespin {
							0% {
								transform:rotate(0deg);
							}
							100% {
								transform:rotate(360deg);
							}
						}
					}
					&:not(:hover) div {
						animation-play-state:paused;
					}
				}
			}
			>* {
				position: absolute;
				width:30px;
				height:30px;
				
				background:var(--singlecolour);
				border-radius:100%;
				
				cursor: pointer;
				
				transform:translate(-50%,-50%);
				transition:.25s -.05s;
				&:before {
					position: absolute;
					top:50%;
					left:50%;
					transform:translate(-50%,-50%);
				}
				&:hover, &:focus-within {
					background:var(--hcolour);
				}
				&:first-child:nth-last-child(1),
				&:first-child:nth-last-child(1) ~ * { //If there are 3 children
					&:nth-child(1) {
						left:25%;
						top:25%;
					}
				}
				&:first-child:nth-last-child(2),
				&:first-child:nth-last-child(2) ~ * { //If there are 4 children
					&:nth-child(1) {
						left:37.5%;
						top:18.75%;
					}
					&:nth-child(2) {
						left:18.75%;
						top:37.5%;
					}
				}
				&:first-child:nth-last-child(3),
				&:first-child:nth-last-child(3) ~ * { //If there are 3 children
					&:nth-child(1) {
						left:50%;
						top:15.625%;
					}
					&:nth-child(2) {
						left:25%;
						top:25%;
					}
					&:nth-child(3) {
						left:15.625%;
						top:50%;
					}
				}
				&:first-child:nth-last-child(4),
				&:first-child:nth-last-child(4) ~ * { //If there are 4 children
					&:nth-child(1) {
						left:62.5%;
						top:18.75%;
					}
					&:nth-child(2) {
						left:37.5%;
						top:18.75%;
					}
					&:nth-child(3) {
						left:18.75%;
						top:37.5%;
					}
					&:nth-child(4) {
						left:18.75%;
						top:62.5%;
					}
				}
			}
		}
		&:hover, &:focus-within {
			.u-icons {
				width:300% !important;
				height:300% !important;
			}
		}
	}
}
              
            
!

JS

              
                let pen_socialbutton_items = ["ZEzMpdj", "ZEzMpdj", "ZEzMpdj","ZEzMpdj", "LYPqaME", "OBPJKK", "KKPeOPm", "qBWVMop", "PoYepvR", "bpxgWZ", "evxZpZ", "MJKNJZ", "XPQyMo", "JXVpgp", "YNPaaQ", "QmXOOR", "MQRGOe", "zBLGYN", "mGGPXj", "VEZvdg", "XNQaym", "oXpWbd", "oPOVOL", "bqjBMv", "bvpprw", "oaWdOm", "bvgWrO", "ZMbLNM", "eZQKEr", "xywaoW", "yKOMmV", "YNyKpd", "ygNVYM", "QpwZqJ", "rNBZZqv", "gPmNwv", "pJjOGW", "Kxygqv", "QyBKvW", "azVXym", "obyLPe", "dNKKOw", "VPLgaV", "pNZzMg", "qJNRaL", "yNvKpp", "wgwdzr", "WNeEgZx", "LYPBQvW", "GRgZExW", "YzPxWyW", "LYEjxyG", "dyRjmmV", "ZEydQPx", "wvBEOYj", "abzegbx", "gOpvGwV", "GRJvoJR", "bGNKmBR", "ZEYoKBw", "WNbMjEW","wvBPvby","zYxdRQy"];
let pen_socialbutton_num = ["one", "two", "three", "four", "five", "six"];
let pen_socialbutton_randomItem = `<a class="u-random" href="https://codepen.io/z-/details/${pen_socialbutton_items[Math.floor(Math.random() * pen_socialbutton_items.length)]}" target="_blank" style="background:white"><div class="u-card fas fa-dice-${pen_socialbutton_num[Math.floor(Math.random() * pen_socialbutton_num.length)]}"></div></a>`
let pen_socialbutton_theme_needed = document.body.parentNode.classList.contains(`theme_switchable`);// (new URL(window.location.href)).searchParams?.get(`theme`) != undefined; //REMOVE
let pen_socialbutton_theme = pen_socialbutton_theme_needed ? (window.matchMedia(`(prefers-color-scheme: dark)`).matches ? `dark` : `light` ) : `none`;
document.body.className = pen_socialbutton_theme
//document.getElementById(`theme_status`).innerHTML = `${theme_needed} : ${theme}`;

let pen_socialbutton_theme_buttons = {
   none: {},
   light: {
      style:`border:none; background:#323133; color:white;`,
      innerHTML:`<i class="fas fa-lightbulb-slash"></i>`,
      title:`Use dark theme`
   },
   dark:{
      style:`border:none; background:white; color:#323133;`,
      innerHTML:`<i class="fas fa-lightbulb-on"></i>`,
      title:`Use light theme`
   }
}
var pen_socialbutton_button = pen_socialbutton_button || false;

const pen_socialbutton_theme_switch = () => {
   const el = document.getElementById(`theme_button`);
   pen_socialbutton_theme = pen_socialbutton_theme == `dark` ? `light` : `dark`;
   el.setAttribute(`style`, pen_socialbutton_theme_buttons[pen_socialbutton_theme].style)
   el.setAttribute(`title`, pen_socialbutton_theme_buttons[pen_socialbutton_theme].title)
   el.innerHTML = pen_socialbutton_theme_buttons[pen_socialbutton_theme].innerHTML
   
   document.body.className = pen_socialbutton_theme
}

let pen_socialbutton_re_hide_notification_timeout = null;

if(window.location.href.indexOf("fullcpgrid") == -1 /*Small on pages*/ && window.location.href.indexOf("debug") /*...debug, mentioned for whenever I forget how to read code*/ == -1 && window.location.href.indexOf("fullembedgrid") == -1 /*Focused/details*/) { //Don't show on these pages
   /*document.body.innerHTML +=
   `<link href="https://codepen.io/z-/pen/a8e37caf2a04602ea5815e5acedab458.css" rel="stylesheet"><div style=position:fixed;bottom:-5rem;right:-5rem; id=user-button><div class=u-icons style=position:absolute;z-index:950;top:50%;left:50%;width:0;height:0%;opacity:0;><a href=https://twitter.com/Osorpenke target=_blank><div class="u-card fab fa-twitter"></div></a><a href=https://codepen.io/z- target=_blank><div class="u-card fab fa-codepen"></div></a>${randomItem}</div><div class="u-card u-main"style=position:relative;z-index:1000;width:4rem;height:4rem;display:grid;place-items:center;background:var(--user-button-background)><img alt=""style="height:100%; width:100%;"src=https://s3-us-west-2.amazonaws.com/s.cdpn.io/199011/happy.svg>${button?`<iframe frameborder=0 src=https://codepen.io/z-/posts/></iframe>`:``}</div></div>` */
   /*document.body.innerHTML +=
   `<link href="https://codepen.io/z-/pen/a8e37caf2a04602ea5815e5acedab458.css" rel="stylesheet"><div style=position:fixed;bottom:-5rem;right:-5rem; id=user-button><div class=u-icons style=position:absolute;z-index:950;top:50%;left:50%;width:0;height:0%;opacity:0;><a href=https://twitter.com/Osorpenke target=_blank><div class="u-card fab fa-twitter"></div></a><a href=https://codepen.io/z- target=_blank><div class="u-card fab fa-codepen"></div></a>${randomItem}${theme_needed ? `<a id="theme_button" onclick="theme_switch()" style="${theme_buttons[theme].style}" title="${theme_buttons[theme].title}">${theme_buttons[theme].innerHTML}</button>` : ``}</div><div class="u-card u-main"style=position:relative;z-index:1000;width:4rem;height:4rem;display:grid;place-items:center;background:var(--user-button-background)><a href="https://codepen.io/z-" target="_blank"><iframe alt=""style="height:200%; width:200%; transform: translate(-25%, -25%) scale(0.5); border-radius:100%; border:none;"src="https://cdpn.io/z-/debug/4677c6bd4703f7a7f95eab9764b71812"></iframe></a></div></div>` //https://codepen.io/z-/pen*/
   document.body.innerHTML +=
   `<link href="https://codepen.io/z-/pen/a8e37caf2a04602ea5815e5acedab458.css" rel="stylesheet"><div style=position:fixed;bottom:-5rem;right:-5rem; id=user-button><div class=u-icons style=position:absolute;z-index:950;top:50%;left:50%;width:0;height:0%;opacity:0;><a id="socialbutton-twitter" href="https://twitter.com/Osorpenke" target=_blank rel="no-refer"><div class="u-card fab fa-twitter"></div></a><a href=https://codepen.io/z- target=_blank><div class="u-card fab fa-codepen"></div></a>${pen_socialbutton_randomItem}${pen_socialbutton_theme_needed ? `<a id="theme_button" onclick="pen_socialbutton_theme_switch()" style="${pen_socialbutton_theme_buttons[pen_socialbutton_theme].style}" title="${pen_socialbutton_theme_buttons[pen_socialbutton_theme].title}">${pen_socialbutton_theme_buttons[pen_socialbutton_theme].innerHTML}</button>` : ``}</div><div class="u-card u-main"style=position:relative;z-index:1000;width:4rem;height:4rem;display:grid;place-items:center;background:var(--user-button-background)><a href="https://codepen.io/z-" target="_blank"><img src="https://i.koya.io/S70jhQ.webp" style="border-radius:100%; width:64px; height:64px;"/></a></div></div>` //https://codepen.io/z-/pen/37f471adc6c5dba134cac86a34c93a61
   // setTimeout(() => {
   //    const twitter = document.getElementById(`socialbutton-twitter`);
   //    twitter.addEventListener(`click`, e => {
   //       e.preventDefault();
   //       clearTimeout(pen_socialbutton_re_hide_notification_timeout);
   //       twitter.classList.add(`show`);
   //       pen_socialbutton_re_hide_notification_timeout =
   //         setTimeout(() => {
   //           twitter.classList.remove(`show`);
   //         },1000)
   //    })
   // },1000)
}//https://i.imgur.com/DZ3sYcD.png

//fullcpgrid/a8e37caf2a04602ea5815e5acedab458
              
            
!
999px

Console