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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <!-- Edit and Copy only the code in this 'HTML' code box and use by pasting it into an "HTML Block" in your ACC website. -->
<!-- Adjust Colors in lines 6-18 -->
<!-- Adjust Image (logo) and text in lines 180-184 --> 
<style>
:root {
  --behind-modal-grad-color-start: #ab6e80cc;
  --behind-modal-grad-color-end: #9f6af5cc;
  --behind-modal-grad-angle: 45deg;
  --modal-border-size: .25em;
  --modal-border-color: #003CFF;
  --modal-border-radius: 20px;
  --modal_background: #E9EFFF;
  --close-x: #003CFF;
  --logo-size: 40%;
  --font-color: #005278;
  --button-text: #003CFF;
  --button-border: #003CFF;
  --button-border-radius: 7px;
  --button-background: #E9EFFF;
}
.img-replace {
  /* replace 'close' text with an 'X' image */
  display: inline-block;
  overflow: hidden;
  text-indent: 100%; 
  color: transparent;
  white-space: nowrap;
}
.bts-popup {
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background-color: var(--behind-modal-color-start);
  background: linear-gradient(var(--behind-modal-grad-angle), var(--behind-modal-grad-color-start), var(--behind-modal-grad-color-end));
  opacity: 0;
  visibility: hidden;
  -webkit-transition: opacity 0.3s 0s, visibility 0s 0.3s;
  -moz-transition: opacity 0.3s 0s, visibility 0s 0.3s;
  transition: opacity 0.3s 0s, visibility 0s 0.3s;
}
.bts-popup.is-visible {
  opacity: 1;
  visibility: visible;
  -webkit-transition: opacity 0.3s 0s, visibility 0s 0s;
  -moz-transition: opacity 0.3s 0s, visibility 0s 0s;
  transition: opacity 0.3s 0s, visibility 0s 0s;
}

.bts-popup-container {
  position: relative;
  width: 90%;
  max-width: 500px;
  margin: 4em auto;
  background: var(--modal_background); 
  text-align: center;
  box-shadow: 0 .25em 2em -2em black, 
        inset 0 0 0 var(--modal-border-size) var(--modal-border-color);
  padding: 10px;
  -webkit-transform: translateY(-40px);
  -moz-transform: translateY(-40px);
  -ms-transform: translateY(-40px);
  -o-transform: translateY(-40px);
  transform: translateY(-40px);
  -webkit-backface-visibility: hidden;
  -webkit-transition-property: -webkit-transform;
  -moz-transition-property: -moz-transform;
  transition-property: transform;
  -webkit-transition-duration: 0.3s;
  -moz-transition-duration: 0.3s;
  transition-duration: 0.3s;
  -webkit-border-radius: var(--modal-border-radius);
  -moz-border-radius: var(--modal-border-radius);
  border-radius: var(--modal-border-radius);
}
.bts-popup-container img {
  padding: 20px 0 0 0;
  width: var(--logo-size);
  height: var(--logo-size);
}

.bts-popup-container p, .bts-popup-container h1, .bts-popup-container h2, .bts-popup-container h3 {
    color: var(--font-color);
    padding: 10px 40px;
}

.bts-popup-container .bts-popup-button {
  padding: 5px 25px;
  border: 2px solid var(--button-border);
  background-color: var(--button-background);
	display: inline-block;
  margin-bottom: 10px;
  -webkit-border-radius: var(--button-border-radius);
  -moz-border-radius: var(--button-border-radius);
  border-radius: var(--button-border-radius);
}

.bts-popup-container a {
  color: var(--button-text);
  text-decoration: none;
  text-transform: uppercase;
}

.bts-popup-container .bts-popup-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 30px;
  height: 30px;
}

.bts-popup-container .bts-popup-close::before, .bts-popup-container .bts-popup-close::after {
  content: '';
  position: absolute;
  top: 12px;
  width: 16px;
  height: 3px;
  background-color: var(--close-x);
}
.bts-popup-container .bts-popup-close::before {
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
  left: 8px;
}
.bts-popup-container .bts-popup-close::after {
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
  right: 6px;
  top: 13px;
}
.is-visible .bts-popup-container {
  -webkit-transform: translateY(0);
  -moz-transform: translateY(0);
  -ms-transform: translateY(0);
  -o-transform: translateY(0);
  transform: translateY(0);
}
iframe.rounded {
    -webkit-border-radius: var(--modal-border-radius);
    -moz-border-radius: var(--modal-border-radius);
    border-radius: var(--modal-border-radius);
}
@media only screen and (min-width: 1170px) {
  .bts-popup-container {
    margin: 8em auto;
  }
}
</style>
<script>
  jQuery(document).ready(function($){
  
  window.onload = function (){
    $(".bts-popup").delay(1000).addClass('is-visible');
	}
  
	//open popup
	$('.bts-popup-trigger').on('click', function(event){
		event.preventDefault();
		$('.bts-popup').addClass('is-visible');
	});
	
	//close popup
	$('.bts-popup').on('click', function(event){
		if( $(event.target).is('.bts-popup-close') || $(event.target).is('.bts-popup') ) {
			event.preventDefault();
			$(this).removeClass('is-visible');
		}
	});
	//close popup when clicking the esc keyboard button
	$(document).keyup(function(event){
    	if(event.which=='27'){
    		$('.bts-popup').removeClass('is-visible');
	    }
    });
});
</script>
<div class="bts-popup" role="alert">
    <div class="bts-popup-container">
      <img  data-cke-saved-src="https://i.imgur.com/IhuBwGZ.png" alt="" / src="https://i.imgur.com/IhuBwGZ.png" alt="" />
      <h2>Easy Auto Popup Modal - V1</h2>
      <p>This is a simple Drop-in automatic display Modal. Tested in the Organic, and Spruce Themes.</p>
      <iframe class="rounded" width="400" height="225" src="https://www.youtube.com/embed/pn4XSDnaiPY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
      <br>
      <br>
				<div class="bts-popup-button">
		       <a  data-cke-saved-href="/contact" href="/contact">Learn More</a>
         </div>
        <a  data-cke-saved-href="#" class="bts-popup-close img-replace" href="#" class="bts-popup-close img-replace">Close</a>
    </div>
</div>
              
            
!

CSS

              
                /* The CSS is included in the HTML (lines 4-144) for easy Copy and Paste into an "HTML Block" */
              
            
!

JS

              
                // All of this Javascript is already included in the HTML (lines 145-172) for easy Copy and Paste into an "HTML Block". It is also here so that this Codpen also works //
jQuery(document).ready(function($){
  
  window.onload = function (){
    $(".bts-popup").delay(1000).addClass('is-visible');
	}
  
	//open popup
	$('.bts-popup-trigger').on('click', function(event){
		event.preventDefault();
		$('.bts-popup').addClass('is-visible');
	});
	
	//close popup
	$('.bts-popup').on('click', function(event){
		if( $(event.target).is('.bts-popup-close') || $(event.target).is('.bts-popup') ) {
			event.preventDefault();
			$(this).removeClass('is-visible');
		}
	});
	//close popup when clicking the esc keyboard button
	$(document).keyup(function(event){
    	if(event.which=='27'){
    		$('.bts-popup').removeClass('is-visible');
	    }
    });
});
              
            
!
999px

Console