Skip to content

Instantly share code, notes, and snippets.

@alanshaw
Last active December 23, 2015 05:19
Show Gist options
  • Save alanshaw/6586597 to your computer and use it in GitHub Desktop.
Save alanshaw/6586597 to your computer and use it in GitHub Desktop.
The official nodebot logo implemented purely in CSS. It uses percentages for internal elements so resizing is simply a case of overriding the width/height on the .nodebot class.
.nodebot {
width: 450px;
height: 450px;
background: #f3df49;
position: relative;
}
.nodebot div {
position: absolute;
background: #2e2e2c;
}
.nodebot .bobble {
width: 5.6%;
height: 5.6%;
border-radius: 100%;
bottom: 50%;
right: 27.6%;
}
.nodebot .antenna {
width: 3%;
height: 8%;
bottom: 43.4%;
right: 29%;
border-bottom-left-radius: 65% 25%;
border-bottom-right-radius: 65% 25%;
}
.nodebot .body {
width: 46%;
height: 25%;
bottom: 16.6%;
right: 8%;
border-top-left-radius: 15% 25%;
border-top-right-radius: 15% 25%;
}
.nodebot .eye {
background: #f3df49;
width: 8%;
height: 8%;
border-radius: 100%;
}
.nodebot .eye.left {
bottom: 27%;
right: 37%;
}
.nodebot .eye.right {
bottom: 27%;
right: 16%;
}
.nodebot .neck.top {
width: 32%;
height: 3%;
right: 15%;
bottom: 12.4%;
border-top-left-radius: 8% 90%;
border-top-right-radius: 8% 90%;
border-bottom-left-radius: 8% 90%;
border-bottom-right-radius: 8% 90%;
}
.nodebot .neck.bottom {
width: 22%;
height: 3%;
right: 20%;
bottom: 8%;
border-top-left-radius: 12% 90%;
border-top-right-radius: 12% 90%;
border-bottom-left-radius: 12% 90%;
border-bottom-right-radius: 12% 90%;
}
/***** Uncommment to overlay the official png ******/
/*
body {
margin: 0;
}
img {
display: block;
position: absolute;
top: 0;
left: 0;
opacity: 0.2
}
*/
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<div class="nodebot">
<div class="bobble"></div>
<div class="antenna"></div>
<div class="body"></div>
<div class="eye left"></div>
<div class="eye right"></div>
<div class="neck top"></div>
<div class="neck bottom"></div>
</div>
<hr/>
<img src="https://raw.github.com/nodebots/www/gh-pages/logo/nodebot-450x450.png"/>
</body>
</html>
@rossedman
Copy link

Really cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment