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

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="body-wrapper">
	<div class="map">
		<div class="map-wrapper">
	<div class="map-bg">
		<img src="https://i.ibb.co/tBZf9tN/Floor9.jpg" alt="Floor9" width="600px">
	</div>
	<div class="svg-wrapper-arvon" data-balloon="Arvon" data-balloon-pos="right">
		<svg width="65" height="74" id="arvon" >
			<rect x="0" y="0" width="80" height="80"
  id="svg-arvon" class="free" />
		</svg>
	</div>

	<div class="svg-wrapper-brass" data-balloon="Brasstown" data-balloon-pos="up">
		<svg width="50" height="37" id="brass">
			<rect x="0" y="0" width="50" height="50"
  id="svg-brass" class="free" />
		</svg>
	</div>

	<div class="svg-wrapper-brit" data-balloon="Britton" data-balloon-pos="up">
		<svg width="28" height="37" id="brit">
			<rect x="0" y="0" width="50" height="50"
  id="svg-brit" class="free" />
		</svg>
	</div>

	<div class="svg-wrapper-camp" data-balloon="Campbell" data-balloon-pos="up">
		<svg width="28" height="37" id="brit">
			<rect x="0" y="0" width="50" height="50"
  id="svg-camp" class="free" />
		</svg>
	</div>

	<div class="svg-wrapper-charles" data-balloon="Charles" data-balloon-pos="up">
		<svg width="30" height="37" id="brit">
			<rect x="0" y="0" width="50" height="50"
  id="svg-charles" class="free" />
		</svg>
	</div>

	<div class="svg-wrapper-davis" data-balloon="Davis" data-balloon-pos="left">
		<svg width="32" height="26" id="brit">
			<rect x="0" y="0" width="50" height="50"
  id="svg-davis" class="free" />
		</svg>
	</div>

	<div class="svg-wrapper-well" data-balloon="Wellness Room" data-balloon-pos="up">
		<svg width="28" height="42" id="brit">
			<rect x="0" y="0" width="50" height="50"
  id="svg-well" class="free" />
		</svg>
	</div>

	<div class="svg-wrapper-fris" data-balloon="Frissell" data-balloon-pos="down">
		<svg width="25" height="22" id="brit">
			<rect x="0" y="0" width="50" height="50"
  id="svg-fris" class="free" />
		</svg>
	</div>

	<div class="svg-wrapper-grey" data-balloon="Greylock" data-balloon-pos="up">
		<svg width="25" height="20" id="brit">
			<rect x="0" y="0" width="50" height="50"
  id="svg-grey" class="free" />
		</svg>
	</div>

	<div class="svg-wrapper-guad" data-balloon="Guadalupe" data-balloon-pos="up">
		<svg width="50" height="42" id="brit">
			<rect x="0" y="0" width="50" height="50"
  id="svg-guad" class="free" />
		</svg>
	</div>

	<div class="svg-wrapper-high" data-balloon="High Point" data-balloon-pos="up">
		<svg width="65" height="42" id="high">
			<rect x="0" y="0" width="53" height="50" id="svg-high" class="free" />
		</svg>
	</div>

	<div class="svg-wrapper-jeri" data-balloon="Jerimoth" data-balloon-pos="up">
		<svg width="70" height="42" id="jeri">
			<rect x="0" y="0" width="59" height="50" id="svg-jeri" class="free" />
		</svg>
	</div>

	<div class="svg-wrapper-katahdin" data-balloon="Kahtahdin" data-balloon-pos="right">
		<svg width="70" height="34" id="katahdin">
			<rect x="0" y="0" width="35" height="50" id="svg-katahdin" class="free" />
		</svg>
	</div>

	<div class="svg-wrapper-mans" data-balloon="Mansfield" data-balloon-pos="right">
		<svg width="70" height="30" id="mans">
			<rect x="0" y="0" width="35" height="50" id="svg-mans" class="free" />
		</svg>
	</div>
	<div class="svg-wrapper-mitch" data-balloon="Mitchell" data-balloon-pos="right">
		<svg width="70" height="30" id="mitch">
			<rect x="0" y="0" width="35" height="50" id="svg-mitch" class="free" />
		</svg>
	</div>
		<div class="svg-wrapper-tims" data-balloon="Timms" data-balloon-pos="right">
		<svg width="70" height="30" id="tims">
			<rect x="0" y="0" width="35" height="50" id="svg-tims" class="free" />
		</svg>
	</div>
			<div class="svg-wrapper-wash" data-balloon="Washington" data-balloon-pos="up">
		<svg width="40" height="27" id="wash">
			<rect x="0" y="0" width="35" height="50" id="svg-wash" class="free" />
		</svg>
	</div>
				<div class="svg-wrapper-whit" data-balloon="Whitney" data-balloon-pos="up">
		<svg width="40" height="27" id="whit" data-tooltip="text">
			<rect x="0" y="0" width="35" height="50" id="svg-whit" class="free"/>
		</svg>
	</div>

</div>
	</div>
	<div class="right-info">
		<h4>Conference Room Free/Busy Simulator</h4>
		<p>
			This is an 'offline' version of a page that was created to display a visual representation of conference room availability in realtime. The 'live' version is a webapp built with Google App Script, and JS that lives on an internal web server. It requires a user with rights to view all resource calendars to authenticate over oauth to work with the Google Calendar API. 
		</p>
		<p>
			The offline version just runs through an array of random numbers on each refresh to simulate the changing availability of conference rooms from free -> busy and vice versa. 
		</p>
		<p>
			Clicking 'Refresh' below will refresh conference room availability and hovering over conference rooms will display their name. 
		</p>
		<button id="button-1" class="refresh-button">Refresh</button>
		
		<span class="credits">Tooltips are created using <a href="https://kazzkiq.github.io/balloon.css/">Ballon.css</a><br><a href="https://github.com/leblanck">Github</a>
	</div>
</div>
              
            
!

CSS

              
                .body-wrapper {
	display: flex;
	flex-flow: row nowrap;
	padding-left: 25px;
	font-family: Helvetica, sans-serif
}

.right-info {
	width: 50%;
	margin-left: 25px;
	padding: 20px;
	display: flex;
	flex-flow: column;
	align-items: center;
	text-align: center;
	/*justify-content: center;*/
}

.credits {
	font-size: 60%;
	padding-top: 20px;
}

.credits a {
	text-decoration: underline;
	color: inherit;
}

.credits a:hover {
	
}


.refresh-button {
	padding: 10px;
	border: 2px solid #e684ae;
	background: #fff;
	border-radius: 5px;
	color: #e684ae;
	font-size: 120%;
	cursor: pointer;
}

.refresh-button:hover {
	background:  #fbeaf1;
}

.map-wrapper {
	position: relative;
}

.svg-wrapper-arvon {
	position: absolute;
	top: 17px;
  left: 295px;
	border: 1px solid #333;
	max-width: 80px;
	max-height: 75px;
}

.svg-wrapper-brass {
	position: absolute;
	top: 113px;
  left: 230px;
	border: 1px solid #333;
}

.svg-wrapper-brit {
	position: absolute;
	top: 113px;
  left: 184px;
	border: 1px solid #333;
}

.svg-wrapper-camp {
	position: absolute;
	top: 113px;
  left: 156px;
	border: 1px solid #333;
}

.svg-wrapper-charles {
	position: absolute;
	top: 113px;
  left: 126px;
	border: 1px solid #333;
}

.svg-wrapper-davis {
	position: absolute;
	top: 275px;
  left: 126px;
	border: 1px solid #333;
	max-width: 50px;
	max-height: 26px;
}

.svg-wrapper-well {
	position: absolute;
	top: 260px;
  left: 158px;
	border: 1px solid #333;
	max-width: 50px;
	max-height: 42px;
}

.svg-wrapper-fris {
	position: absolute;
	top: 282px;
  left: 188px;
	border: 1px solid #333;
	max-width: 53px;
	max-height: 22px;
}

.svg-wrapper-grey {
	position: absolute;
	top: 260px;
  left: 188px;
	border: 1px solid #333;
	max-width: 53px;
	max-height: 20px;
}


.svg-wrapper-guad {
	position: absolute;
	top: 260px;
  left: 230px;
	border: 1px solid #333;
	max-width: 53px;
	max-height: 42px;
}

.svg-wrapper-high {
	position: absolute;
	top: 260px;
  left: 322px;
	border: 1px solid #333;
	max-width: 53px;
	max-height: 42px;
}

.svg-wrapper-jeri {
	position: absolute;
	top: 260px;
  left: 418px;
	border: 1px solid #333;
	max-width: 60px;
	max-height: 42px;
}

.svg-wrapper-katahdin {
	position: absolute;
	top: 268px;
  left: 478px;
	border: 1px solid #333;
	max-width: 36px;
	max-height: 34px;
}

.svg-wrapper-mans {
	position: absolute;
	top: 235px;
  left: 478px;
	border: 1px solid #333;
	max-width: 36px;
	max-height: 30px;
}

.svg-wrapper-mitch {
	position: absolute;
	top: 202px;
	left: 478px;
	border: 1px solid #333;
	max-width: 36px;
	max-height: 30px;
}

.svg-wrapper-tims {
	position: absolute;
	top: 168px;
	left: 478px;
	border: 1px solid #333;
	max-width: 36px;
	max-height: 30px;
}

.svg-wrapper-wash {
	position: absolute;
	top: 108px;
	left: 482px;
	border: 1px solid #333;
	max-width: 35px;
	max-height: 27px;
}

.svg-wrapper-whit {
	position: absolute;
	top: 108px;
	left: 448px;
	border: 1px solid #333;
	max-width: 35px;
	max-height: 27px;
}






.free {
	fill: #59A96A;
	opacity: 0.8;
	transition: .8s ease-in-out;
}

.occupied {
	fill: #EE6352;
	opacity: 0.8;
	transition: .8s ease-in-out;
}





              
            
!

JS

              
                //OFFLINE VERSION
function showRooms () {
	
var confRooms = ["arvon", "brass", "brit", "camp", "charles", "davis", "well", "fris", "grey", "guad", "high", "jeri", "katahdin", "mans", "mitch", "tims", "wash", "whit"];
var numbs = [];

for (var i = 0; i < confRooms.length; i++) {
	numbs.push(Math.round(Math.random() * 10))
}
	console.log("NUMBS " + numbs);
for (var r = 0; r < confRooms.length; r++) {
		var currentID = "svg-"+confRooms[r];
		var roomSVG = document.getElementById(currentID);

		if (numbs[r] > 5) {
			roomSVG.classList.toggle("occupied");
		} 
	}
}

const bttn = document.getElementById("button-1").addEventListener("click", showRooms);
//for each room
// for each random num
//		if num < 10
//			set free
//		else set occupied
              
            
!
999px

Console