Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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 id="the-door" class="">
	<div id="top-door">

	</div>
	<div id="bottom-door">
			<div class="stripe one"></div>
			<div class="stripe two"></div>
			<div class="stripe three"></div>
			<div class="stripe four"></div>

		<div class="hinge top"></div>
		<div class="hinge middle"></div>
		<div class="hinge bottom"></div>
		<div id="door-opening">
			<div class="eyes">
					
				<div class="eye left">
					<div class="pupil"></div>
				</div>
				<div class="eye right">
					<div class="pupil"></div>
				</div>
			</div>
			<div id="door-cover"></div>
		</div>
		<div class="note">
			<div class="string left"></div>
			<div class="string right">	</div>

			Kom langs!
		</div>
		<div id="door-knob"></div>

  </div>
</div>

<div class="praatwolk">
  <p id="praattekst">
    ...
  </p>
</div>
              
            
!

CSS

              
                
.note{
	font-size:15px;
	line-height: 40px;
	width:100px;
	height:40px;
	background-color: white;
	border:3px solid black;
	right:-32px;
	bottom:45px;
	text-align:center;
	position: absolute;
	transform:rotate(-10deg);
}
b{
	font-weight:600;
}
.string{
	position: absolute;
	height:40px;
	width:1px;
	background-color: 	black;
	
}
.string.left{
	height:40px;
	left:37px;
	top:-37px;
	transform:rotate(45deg);
}
.string.right{
	height:38px;
	right:29px;
	top:-36px;
	transform: rotate(-35deg);
}

.hinge{
	position:absolute;
	width:35px;
	height:5px;
	left:-3px;
	background-color: grey;
	border-top:black solid 1px;
	border-right:black solid 1px;
	border-bottom:black solid 1px;

}

.hinge.top{
	top:5px;
}
.stripe{
	position: absolute;
	height:261px;
	width:2px;
	background-color: black;
	bottom:0;
}
.stripe.one{
left:30px;
height:256px;
bottom:-1px;
}
.stripe.two{
	left:60px;
	bottom:-1px;
}
.stripe.three{
	left:90px;
	/*height:256px;*/
	bottom:-1px;

}
.stripe.four{
	left:120px;
	height:256px;
	bottom:-1px;
}
.hinge.middle{
	bottom:105px;
}

.hinge.bottom{
	bottom:25px;
}

#the-door{
	position:relative;
	bottom:0;
	left:0;
width:250px;

}
#top-door{
	border-left:3px solid black;
	border-top:3px solid black;
	border-right:3px solid black;
	position: relative;
	height:60px;
	width:150px;
	background-color:#8E2BE6;
	border-radius:150px 150px 0 0;
	
}
#bottom-door{
		/*background-image:url('../images/rust-texture.jpg');*/

	position: relative;
	height:200px;
	width:150px;
	background-color:#8E2BE6;
	border-left:3px solid black;
	border-bottom:3px solid black;
	border-right:3px solid black;


}

#door-opening{
	position:relative;
	width:80px;
	height:25px;
	border:black 2px solid;
	background-color: white;
	/*opacity:1;*/
	top:18px;
	left:35px;
}


.eyes{
	position:absolute;
	height:14px;
	left: 15px;
	width:50px;
	bottom:0;
	clip-path: inset(-3px 0px 0 0);

}
.eyes .left{
	left:5px;
}
.eye{
	position: absolute;
	background-color: white;
	width:15px;
	height: 15px;
	border:black 2px solid;
	border-bottom:none;
	bottom:-18px;
	border-radius:5px 5px 0 0;
	/*animation-delay: 5s;*/
	/*animation-name: disappear;*/
	/*animation-duration:2s;*/
	/*animation-fill-mode: forwards;*/
	/*animation-timing-function: ease-in;*/
}
.eyes .right{
	right:5px;
}

.pupil{
	position: absolute;
	width:4px;
	border:3px #276482 solid;
	height:4px;
	border-radius: 4px;
	bottom:0;
	left:2px;
	background-color: black;
/*	animation-delay:4s;
	animation:look_for_something;
	animation-duration: 4s;*/

}

#door-cover{
	background-color: rgba(0,0,0,1);
	position: absolute;
	height: 28px;
	width: 81px;
	border:none;
	left:-0.5px;
	top:-0.5px;
	margin:0;
	padding:0;
	/*z-index: 9;*/
}

#door-knob{
	position: relative;
	width:15px;
	height:15px;
	border:black 1px solid;
	background-color: gold;
	border-radius:10px;
	left:120px;
	top:50px;
}


.open #door-cover{
	height:0px;
}
.open .eye{
	bottom:0;
}
.open .pupil{
	left:2px;
	animation-name: look_at_player;
	animation-duration: 4s;
}

.hover#the-door #door-cover{
height:28px;
animation-fill-mode: forwards;
animation-duration:7.5s;
animation-name: shut_cover;
animation-timing-function: ease-out;
}

#the-door:hover .pupil{
left:2px;
animation-name: look_at_player;
animation-duration:4s;
}

#the-door:hover .eye {
	bottom:-0.5px;
	animation:appear;
	animation-duration: 0.3s;
	animation-timing-function: ease-out;
}	


@keyframes shut_cover{
	0%{height:0px;}
	20%	{	height:0px;
	
	}
	50%{
		height:20px;
		animation:blink;
		animation-duration: 0.1s;
	}
	70%{
		height:20px;
	}
	75%{height:28px;}
	100%{
		height:28px;
	}
}


@keyframes look_at_player{
	0%{left:2; }
	
	10%{left:2px; }
	13%{height:4px;margin:0px;}
	15%{height:0px; margin:1px;}
	16%{ height:4px;margin:0px;}
	60%{left:2px;}
	70%{left:0px;
	}
	90%{
		left:4px;
	}
	100%{
	left:2px;
	}
}

@keyframes look_for_something{
	0%{left:0;}
	25%{left:3px;}
	50%{left:1px;}
	75%{left:3px;
	}
	100%{
		left:2px;
	}
	
}

@keyframes appear{

0%{
	bottom:-15px;
}
50%{
	bottom:0px;	
	
}
100%{
	
}
}



@keyframes disappear {
	0%{
		bottom:-0.5px;
	}
	15%{
		bottom:-2.5px;
	}
	75%{
		bottom:-5px;
	}
	100%{bottom:-20px;

	}
}


.praatwolk{
  width:185px;
  height:100px;
  border:2px dashed black;
  position: absolute;
  top:10px;
  padding: 10px 20px 10px 20px;
  left:225px;
}

#praattekst{
  width:100%;
  height:100%;
}
              
            
!

JS

              
                //lees goed, en verander de reactie van de tinker
function antwoorden(){
  switch(clickCounter){
    case 0:
      antwoord.innerHTML = "Uhh,.. zou je dat even niet willen doen?"; 
      clickCounter++;
      break;
      
    case 1:
      antwoord.innerHTML = "dank je..";
      clickCounter++;
      break; 
      
    case 2:
      antwoord.innerHTML = "Ben je nog steeds hier?";
      clickCounter++;
      break; 
      
    case 3:
      antwoord.innerHTML = "Hmmn, deze deur gaat vandaag niet open.";
      clickCounter++;
      break; 
    
    case 4:
      antwoord.innerHTML = "Kom anders eens langs! ";
      praatwolk.style.backgroundColor = "lime";
      clickCounter++;
      break; 
      
    case 5:
      antwoord.innerHTML = "Tinkeren is voor iedereen"
      praatwolk.style.backgroundColor = "skyblue";
      clickCounter++;
      break; 
      
      
      default:
        antwoord.innerHTML = "www.tinkersguild.nl";
            praatwolk.style.backgroundColor = "white";
      clickCounter=0;
      break;
  } 
};

// grab elements
var door = document.getElementById("the-door");

door.onmouseover = function(event) {
  door.classList.add('hover');
}

door.onmouseout = function(event) {
  // setTimeout
  door.classList.remove('hover');
}

// Hieronder zie je de computer logica, hierin vertellen we het programma wat er moet gebeuren wanneer de deur word aangeklikt.

var theDoor;
var clickCounter = 0;
var antwoord;
var praatwolk = document.getElementsByClassName("praatwolk")[0];

antwoord = document.getElementById("praattekst");
theDoor = document.getElementById("the-door");
theDoor.addEventListener("click", antwoorden);
              
            
!
999px

Console