Product Engineer, CTO & a Beer Enthusiast
Experiments, thoughts and scripts documented for posterity.
Oct, 2013
Download the code at https://github.com/karthik20522/TeacupUI
<link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz' rel='stylesheet' type='text/css'>
<link href='teacup.css' rel='stylesheet' type='text/css'>
<script type='text/javascript' src='http://www.google.com/jsapi'></script>
<script type = 'text/javascript' >
google.load('jquery', '1.7.1');
</script>
<script type = "text/javascript" src = "teacup.js" ></script>
<div id="Latte">
<a value="20" href="#">Milk Foam</a>
<a value="50" href="#">Steamed Milk</a>
<a value="30" href="#">Expresso</a>
</div>
Note that your values should add up to 100 to fill up the teacup. Your
value can be larger but it would look funny and if your value is
lesser than 100 that's OK as the plugin would fill the rest up with emptiness. Also note that each of the href's are clickable within the teacup.
$("#Latte").teacup();
<div id="Americano">
<a value="65" href="http://kufli.blogspot.com">Water</a>
<a value="35" href="http://github.com/karthik20522">Expresso</a>
</div>
<script>
$("#Americano").teacup({colors: ["#42749F", "#E2640F"] });
</script>
- How about multiple teacups on same page
<div class="parentDiv">
<div id="Mocha">
<a value="20" href="#">Whipped Cream</a>
<a value="35" href="#">Steamed Milk</a>
<a value="15" href="#">Chocolate Syrup</a>
<a value="30" href="#">Expresso</a>
</div>
<div class="note">Caffe Mocha</div>
</div>
<div class="parentDiv">
<div id="White">
<a value="50" href="#">Steamed Milk</a>
<a value="30" href="#">Expresso</a>
</div>
<div class="note">Flat White</div>
</div>
$("#Mocha").teacup();
$("#White").teacup({colors: ["#B9BC8D", "#E2640F"] });