LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
Push the button. Go on, I dare you

Are you sure?

You’ve pressed a big red button. It might do… something.

CSS
@-webkit-keyframes fadeIn {
  to { background: rgba(0,0,0,0.9); }
}
@keyframes fadeIn {
  to { background: rgba(0,0,0,0.9); }
}
body { font-family: Avenir, Arial, sans-serif; }
figure#launchtime { 
  min-height: 300px;
  margin: 0;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align:center;
      -ms-flex-align:center;
          align-items:center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
}
figure#launchtime button {
  border-radius: 50%;
  width: 200px;
  height: 200px;
  border: none;
  color: #fff;
  font-weight: 900;
  font-size: 2.5rem;
  background: red;
  text-shadow: 0 3px 1px rgba(122,17,8,.8);
  box-shadow: 0 8px 0 rgb(183,9,0),0 15px 20px rgba(0,0,0,.35);
  text-transform: uppercase;
  -webkit-transition: .4s all ease-in;
  transition: .4s all ease-in;
  outline: none;
  cursor: pointer;
  text-align: center;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0)
}
figure#launchtime button span { position:relative; }
figure#launchtime button.pressed { 
  padding-top: 3px;
  -webkit-transform: translateY(4px);
          transform: translateY(4px);
  box-shadow: 0 4px 0 rgb(183,0,0), 0 8px 6px rgba(0,0,0,.45);
}
figure#launchtime figcaption { margin-top: 2rem; }
dialog { 
  width: 25%; text-align: center;
  border: 3px solid red;
  background: #100; color: #fff; 
  position: absolute;
  left: 0;
  right: 0;
  margin: auto;
  padding: 1em;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  height: -webkit-fit-content;
  height: -moz-fit-content;
  height: fit-content;
  display: none;
}
dialog div { 
  display: -webkit-box; 
  display: -ms-flexbox; 
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between; 
}
dialog::-webkit-backdrop { 
  -webkit-animation: fadeIn .5s forwards; 
          animation: fadeIn .5s forwards; 
}
dialog::backdrop { 
  -webkit-animation: fadeIn .5s forwards; 
          animation: fadeIn .5s forwards; 
}
dialog button { 
  padding: 1rem;
  font-size: 1.1rem;
  background: #333;
  color: white;
  border: none;
  cursor: pointer; 
}
dialog[open] { display: block; }
.backdrop {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    -webkit-animation: fadeIn .5s forwards;
            animation: fadeIn .5s forwards;
}
JS
function showWindow(){
	dialog.showModal();
}	
function closeWindow(){
	launchbutton.classList.remove("pressed");
	dialog.close(); 
}

	var launchbutton = document.getElementById("launch"),
	dialog = document.getElementById('dialog'),
	okay = document.getElementById("okay"),
	cancel = document.getElementById("cancel");
	dialogPolyfill.registerDialog(dialog);
	launchbutton.onclick = function() {
		launchbutton.classList.add("pressed");
		setTimeout( function() { showWindow() }, 800);
	}
	okay.onclick = function(){ closeWindow(); }
	cancel.onclick = function(){ closeWindow(); }
Host Instantly Drag and Drop Website Builder

 

Description

Uses the Google dialog polyfill for non-Chrome/Opera. Button derived from my Big Red Party Button pen. Complete explanatory article
Term
Mon, 11/27/2017 - 21:49

Related Codes

Pen ID
Pen ID
Pen ID