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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div class="section-center">
  <div class="section-path">
    <div class="globe">
      <div class="wrapper">
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
      </div>
    </div>
  </div>
  <div id="switch">
    <div id="circle"></div>
  </div>
  <p><span>light</span> <span>dark</span></p>  
</div>

<audio id="link" src="http://ivang-design.com/svg-load/menu/link.mp3" preload="none"></audio>

<!-- Link to page
================================================== -->

<a id="portfolio" href="https://themeforest.net/user/ig_design/portfolio"      class="link-to-portfolio hover-target" target=”_blank”></a>
              
            
!

CSS

              
                

/* Please ❤ this if you like it! */


@import url('https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i');

body{
	font-family: 'Poppins', sans-serif;
	font-weight: 300;
	font-size: 14px;
	background-color: #f2f5f5;
	overflow: hidden;
  height: 100vh;
  color: #fff;
	-webkit-transition: all 300ms linear;
	transition: all 300ms linear; 
}
.section-center {
	position: absolute;
	top: 50%;
	left: 0;
	z-index: 10;
    transform: translateY(-50%);
	width: 100%;
	margin: 0 auto;
	text-align: center;
	-webkit-transition: all 500ms linear;
	transition: all 500ms linear; 
}
.section-path{
  position: relative;
  width: 538px;
  height: 76px;
  border-radius: 35px;
  margin: 0 auto;
  text-align: center;
	background-color: #e6e6e6;
	box-shadow: 
		inset -2px 20px 10px 0 rgba(0,0,0,.06),
		inset -2px 30px 10px 0 rgba(0,0,0,.04);
  border: 3px groove rgba(225,225,225,0.07);
  overflow: hidden;
	-webkit-transition: all 300ms linear;
	transition: all 300ms linear; 
}
.globe{
  position: relative;
  width: 66px;
  height: 66px;
  overflow: hidden;
  margin-top: 2px;
  margin-left: 2px;
  border-radius: 50%;
	box-shadow: 0 10px 40px rgba(0,0,0,0.65);
	animation: rotateBall 4s ease infinite;
	-webkit-transition: all 300ms linear;
	transition: all 300ms linear; 
}
@keyframes rotateBall {
  0% { 
		transform: translateX(0);
  }
  50% { 
		transform: translateX(462px);
  }
  100% { 
		transform: translateX(0);
  }
}
.globe:after {
  position: absolute;
  width: 5px;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.1);
  content:'';
  left: 40px;
  top: 15px;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 14px 7px rgba(255, 255, 255, 0.1);
}
.globe:before {
  position: absolute;
  width: 100%;
  height: 100%;
  content:'';
  left: 0;
  top: 0;
  border-radius: 50%;
  z-index: 1;
	box-shadow: inset 0 0 15px #1a252f;
  opacity: 0.4;
	-webkit-transition: all 300ms linear;
	transition: all 300ms linear; 
}
.globe .wrapper{
  position: absolute;
  width: 528px;
  height: 528px;
  top: 0;
  left: -462px;
	animation: moveBall 4s ease infinite;
}
@keyframes moveBall {
  0% { 
		left: -462px; 
  }
  50% { 
		left: 0; 
  }
  100% { 
		left: -462px;
  }
}
.globe .wrapper span{
  position: absolute;
  width: 33px;
  height: 528px;
  top: 0;
  left: 0;
  background-color: #5c477d;
	box-shadow: inset 0 0 25px #5c487c;
}
.globe .wrapper span:nth-child(2){
  left: 33px;
  background-color: #503e6d;
}
.globe .wrapper span:nth-child(3){
  left: 66px;
}
.globe .wrapper span:nth-child(4){
  left: 99px;
  background-color: #503e6d;
}
.globe .wrapper span:nth-child(5){
  left: 132px;
}
.globe .wrapper span:nth-child(6){
  left: 165px;
  background-color: #503e6d;
}
.globe .wrapper span:nth-child(7){
  left: 198px;
}
.globe .wrapper span:nth-child(8){
  left: 231px;
  background-color: #503e6d;
}
.globe .wrapper span:nth-child(9){
  left: 264px;
}
.globe .wrapper span:nth-child(10){
  left: 297px;
  background-color: #503e6d;
}
.globe .wrapper span:nth-child(11){
  left: 330px;
}
.globe .wrapper span:nth-child(12){
  left: 363px;
  background-color: #503e6d;
}
.globe .wrapper span:nth-child(13){
  left: 396px;
}
.globe .wrapper span:nth-child(14){
  left: 429px;
  background-color: #503e6d;
}
.globe .wrapper span:nth-child(15){
  left: 462px;
}
.globe .wrapper span:nth-child(16){
  left: 495px;
  background-color: #503e6d;
}

#switch,
#circle {
	cursor: pointer;
	-webkit-transition: all 300ms linear;
	transition: all 300ms linear; 
} 
#switch {
	width: 70px;
	height: 8px;
	margin: 0 auto;
	text-align: center;
	border: 2px solid #8167a9;
	border-radius: 27px;
	background: #000;
	position: relative;
	display: inline-block;
  margin-top: 40px;
  margin-bottom: 20px;
}
#circle {
	position: absolute;
	top: -11px;
	left: 5px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	box-shadow: 0 4px 4px rgba(0,0,0,0.25), 0 0 0 1px rgba(26,53,71,0.07);
	background: #000;
}
.switched {
	border-color: #000 !important;
	background: #8167a9 !important;
}
.switched #circle {
	left: 35px;
	background: #fff;
}
.section-center p span {
	position: relative;
  padding: 4px 10px;
  margin: 0 5px;
}
.section-center p span:before {
	position: absolute;
	content: '';
	width: 100%;
	height: 100%;
  border-radius: 4px;
  background-color: #8167a9;
	box-shadow: 0 2px 4px rgba(0,0,0,0.25);
	left: 0;
	top: 0;
  z-index: -1;
	-webkit-transition: all 300ms linear;
	transition: all 300ms linear; 
}
.section-center p span:after {
	position: absolute;
	content: '';
	width: calc(100% - 10px);
	height: 2px;
  border-radius: 4px;
  background-color: #fff;
	left: 5px;
	top: 50%;
  z-index: 1;
	-webkit-transition: all 300ms linear;
	transition: all 300ms linear; 
}
.section-center p span:nth-child(2):after {
	opacity: 0;
}


body.dark{
	background-color: #1f2029;
}
body.dark .section-path{
	background-color: #2a2b38;
	box-shadow: 
		inset -2px 20px 10px 0 rgba(0,0,0,.1),
		inset -2px 30px 10px 0 rgba(0,0,0,.07);
  border: 3px groove rgba(225,225,225,0.04);
}
body.dark .globe:before {
  opacity: 0.7;
}
body.dark .globe{
	box-shadow: 0 10px 40px rgba(0,0,0,0.65);
}
body.dark .section-center p span:nth-child(2):after {
  background-color: #000;
  opacity: 1;
}
body.dark .section-center p span:nth-child(1):after {
  opacity: 0;
}
/* #Link to page
================================================== */

.link-to-portfolio {
	  position: fixed;
    top: 30px;
    right: 30px;
    z-index: 200;
    cursor: pointer;
    width: 40px;
    height: 40px;
    text-align: center;
    border-radius: 3px;
    background-position: center center;
    background-size: cover;
    background-image: url('https://ivang-design.com/ig-logo.jpg');
    box-shadow: 0 0 0 3px rgba(0,0,0,.1);
    transition: opacity .2s, border-radius .2s, box-shadow .2s;
    transition-timing-function: ease-out;
}
.link-to-portfolio:hover {
    opacity: 0.8;
    border-radius: 50%;
    box-shadow: 0 0 0 20px rgba(0,0,0,.1);
}
              
            
!

JS

              
                

/* Please ❤ this if you like it! */


(function($) { "use strict";
              
 	//Switch light/dark
	
	$("#switch").on('click', function () {
		if ($("body").hasClass("dark")) {
			$("body").removeClass("dark");
			$("#switch").removeClass("switched");
		}
		else {
			$("body").addClass("dark");
			$("#switch").addClass("switched");
		}
	});
              
  $(document).ready(function() {    			document.getElementById("switch").addEventListener('click', function(e) {
			document.getElementById("link").play();
	  	});    
			document.getElementById("portfolio").addEventListener('click', function(e) {
			document.getElementById("link").play();
	  	});      
  });  
              
})(jQuery);               
              
            
!
999px

Console