Skip to content

Instantly share code, notes, and snippets.

@chimericdream
Created July 31, 2012 13:55
Show Gist options
  • Save chimericdream/3217222 to your computer and use it in GitHub Desktop.
Save chimericdream/3217222 to your computer and use it in GitHub Desktop.
A web page created at CodePen.io.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Bill Calculator &middot; CodePen</title>
<!--
Copyright (c) 2012 Bill Parrott, http://codepen.io/chimericdream
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<link rel="stylesheet" href="http://codepen.io/stylesheets/css/normalize.css">
<style>
@import url(http://fonts.googleapis.com/css?family=Average);
.mi .c i:before {
content: "1145";
}
.mi .c b:before {
content: "1067";
}
.mi .c em:before {
content: "2212";
}
.mi .j i:before {
content: "895";
}
.mi .j b:before {
content: "915";
}
.mi .j em:before {
content: "1810";
}
.mi .a i:before {
content: "297";
}
.mi .a b:before {
content: "323";
}
.mi .a em:before {
content: "620";
}
.ptmi .c i:before {
content: "2212";
}
.ptmi .c b:before {
content: "4642";
}
.ptmi .c em:before {
content: "0.477";
}
.ptmi .j i:before {
content: "1810";
}
.ptmi .j b:before {
content: "4642";
}
.ptmi .j em:before {
content: "0.39";
}
.ptmi .a i:before {
content: "620";
}
.ptmi .a b:before {
content: "4642";
}
.ptmi .a em:before {
content: "0.134";
}
.rent h2 i:before {
content: "795";
}
.rent .r .c i:before {
content: "0.477";
}
.rent .r .c b:before {
content: "795";
}
.rent .r .c em:before {
content: "378.832";
}
.rent .r .j i:before {
content: "0.39";
}
.rent .r .j b:before {
content: "795";
}
.rent .r .j em:before {
content: "309.985";
}
.rent .r .a i:before {
content: "0.134";
}
.rent .r .a b:before {
content: "795";
}
.rent .r .a em:before {
content: "106.183";
}
.rent .tru {
font-weight: bold;
font-size: 150%;
}
.rent .tru .c i:before {
content: "379";
}
.rent .tru .j i:before {
content: "310";
}
.rent .tru .a i:before {
content: "106";
}
.electricity h2 i:before {
content: "198.73";
}
.electricity .r .c i:before {
content: "0.477";
}
.electricity .r .c b:before {
content: "198.73";
}
.electricity .r .c em:before {
content: "94.699";
}
.electricity .r .j i:before {
content: "0.39";
}
.electricity .r .j b:before {
content: "198.73";
}
.electricity .r .j em:before {
content: "77.488";
}
.electricity .r .a i:before {
content: "0.134";
}
.electricity .r .a b:before {
content: "198.73";
}
.electricity .r .a em:before {
content: "26.543";
}
.electricity .tru {
font-weight: bold;
font-size: 150%;
}
.electricity .tru .c i:before {
content: "95";
}
.electricity .tru .j i:before {
content: "77";
}
.electricity .tru .a i:before {
content: "27";
}
.internet h2 i:before {
content: "51.13";
}
.internet .r .c i:before {
content: "0.477";
}
.internet .r .c b:before {
content: "51.13";
}
.internet .r .c em:before {
content: "24.364";
}
.internet .r .j i:before {
content: "0.39";
}
.internet .r .j b:before {
content: "51.13";
}
.internet .r .j em:before {
content: "19.937";
}
.internet .r .a i:before {
content: "0.134";
}
.internet .r .a b:before {
content: "51.13";
}
.internet .r .a em:before {
content: "6.829";
}
.internet .tru {
font-weight: bold;
font-size: 150%;
}
.internet .tru .c i:before {
content: "24";
}
.internet .tru .j i:before {
content: "20";
}
.internet .tru .a i:before {
content: "7";
}
body {
background: url(https://twimg0-a.akamaihd.net/profile_background_images/230086378/bg.png);
font: 88% Arial;
}
.wrapper {
*zoom: 1;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-ms-border-radius: 10px;
-o-border-radius: 10px;
border-radius: 10px;
background: rgba(255, 255, 255, 0.3);
padding: 15px;
margin: 35px;
min-width: 900px;
}
.wrapper:after {
content: "";
display: table;
clear: both;
}
.wrapper i:before, .wrapper b:before, .wrapper em:before {
display: inline-block;
}
.wrapper h1 {
*zoom: 1;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-ms-border-radius: 10px;
-o-border-radius: 10px;
border-radius: 10px;
background: white;
font-family: "Average", serif;
font-weight: normal;
color: #c0fdfd;
padding: 1%;
margin: 0 0 15px;
position: relative;
}
.wrapper h1:after {
content: "";
display: table;
clear: both;
}
.wrapper h1 span {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-ms-border-radius: 10px;
-o-border-radius: 10px;
border-radius: 10px;
background: black;
padding: 1%;
display: block;
float: left;
}
.wrapper h1 i {
color: #fd00fd;
font-style: normal;
}
.wrapper h1 b {
color: white;
font-weight: normal;
}
.wrapper h1 a {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-ms-border-radius: 10px;
-o-border-radius: 10px;
border-radius: 10px;
background: black;
color: #c0fdfd;
text-decoration: none;
display: block;
padding: 1%;
float: right;
}
.wrapper h1 a:hover {
background: #444444;
}
.wrapper h2 {
background: #eeeeee;
font-family: "Average", serif;
font-size: 130%;
border: 1px #cccccc solid;
padding: 1%;
margin: 0 0 15px;
}
.wrapper ul {
margin: 0 0 15px;
padding: 0;
}
.wrapper ul li {
list-style: none;
padding: 3px 25px;
border-bottom: 1px #dddddd solid;
}
.wrapper b {
font-weight: normal;
}
.wrapper i, .wrapper em {
font-style: normal;
}
.income {
*zoom: 1;
margin: 0 0 15px;
}
.income:after {
content: "";
display: table;
clear: both;
}
.monthly-income, .percent {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-ms-border-radius: 10px;
-o-border-radius: 10px;
border-radius: 10px;
background: white;
width: 47.5%;
float: left;
padding: 1%;
margin: 0 1% 0 0;
}
.monthly-income h2 i:before, .percent h2 i:before {
float: right;
content: "Total: 4642";
}
.percent {
margin: 0;
}
.rent, .electricity, .internet {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-ms-border-radius: 10px;
-o-border-radius: 10px;
border-radius: 10px;
background: white;
float: left;
width: 30.66%;
padding: 1%;
margin: 0 1% 0 0;
}
.internet {
margin: 0;
}
</style>
<style>
#codepen-footer, #codepen-footer * {
-webkit-box-sizing: border-box !important;
-moz-box-sizing: border-box !important;
box-sizing: border-box !important;
}
#codepen-footer {
display: block !important;
position: fixed !important;
bottom: 0 !important;
left: 0 !important;
width: 100% !important;
padding: 0 10px !important;
margin: 0 !important;
height: 30px !important;
line-height: 30px !important;
font-size: 12px !important;
color: #eeeeee !important;
background-color: #505050 !important;
text-align: left !important;
background: -webkit-linear-gradient(top, #505050, #383838) !important;
background: -moz-linear-gradient(top, #505050, #383838) !important;
background: -ms-linear-gradient(top, #505050, #383838) !important;
background: -o-linear-gradient(top, #505050, #383838) !important;
border-top: 1px solid black !important;
border-bottom: 1px solid black !important;
border-radius: 0 !important;
border-image: none !important;
box-shadow: inset 0 1px 0 #6e6e6e, 0 2px 2px rgba(0, 0, 0, 0.4) !important;
z-index: 300 !important;
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, sans-serif !important;
letter-spacing: 0 !important;
word-spacing: normal !important;
word-spacing: 0 !important;
-webkit-transform: none !important;
-moz-transform: none !important;
-ms-transform: none !important;
-o-transform: none !important;
transform: none !important;
}
#codepen-footer a {
color: #a7a7a7 !important;
text-decoration: none !important;
text-shadow: none !important;
border: 0 !important;
}
#codepen-footer a:hover {
color: white !important;
}
</style>
<script>
// Kill alerts, confirmations and prompts
// window.alert = function(){}; we're going to allow alerts for now
window.confirm = function(){};
window.prompt = function(){};
window.open = function(){};
window.print = function(){};
</script>
</head>
<body>
<!doctype html>
<html>
<head>
<title>CSS/SASS Bill Calculator</title>
</head>
<body>
<div class="wrapper">
<h1><span><i>{</i> <b>CSS/SASS</b> Bill <b>Calculator</b> <i>}</i></span> <a href="http://twitter.com/thecssguru" target="_blank"><i>{</i> <b>the</b>CSS<b>guru</b> <i>}</i></a></h1>
<div class="income">
<div class="monthly-income">
<h2>Monthly Income <i></i></h2>
<ul class="mi">
<li class="c"><i></i> + <b></b> = <em></em> - Chris</li>
<li class="j"><i></i> + <b></b> = <em></em> - Jeremiah</li>
<li class="a"><i></i> + <b></b> = <em></em> - Adriane</li>
</ul>
</div>
<div class="percent">
<h2>% of Monthly Income</h2>
<ul class="ptmi">
<li class="c"><i></i> / <b></b> = <em></em> - Chris</li>
<li class="j"><i></i> / <b></b> = <em></em> - Jeremiah</li>
<li class="a"><i></i> / <b></b> = <em></em> - Adriane</li>
</ul>
</div>
</div>
<div class="rent">
<h2>$<i></i> Rent</h2>
<ul class="r">
<li class="c"><i></i> * <b></b> = <em></em> - Chris</li>
<li class="j"><i></i> * <b></b> = <em></em> - Jeremiah</li>
<li class="a"><i></i> * <b></b> = <em></em> - Adriane</li>
</ul>
<h2>Rounded</h2>
<ul class="tru">
<li class="c">$<i></i> - Chris</li>
<li class="j">$<i></i> - Jeremiah</li>
<li class="a">$<i></i> - Adriane</li>
</ul>
</div>
<div class="electricity">
<h2>$<i></i> Electricity Bill</h2>
<ul class="r">
<li class="c"><i></i> * <b></b> = <em></em> - Chris</li>
<li class="j"><i></i> * <b></b> = <em></em> - Jeremiah</li>
<li class="a"><i></i> * <b></b> = <em></em> - Adriane</li>
</ul>
<h2>Rounded</h2>
<ul class="tru">
<li class="c">$<i></i> - Chris</li>
<li class="j">$<i></i> - Jeremiah</li>
<li class="a">$<i></i> - Adriane</li>
</ul>
</div>
<div class="internet">
<h2>$<i></i> Internet Bill</h2>
<ul class="r">
<li class="c"><i></i> * <b></b> = <em></em> - Chris</li>
<li class="j"><i></i> * <b></b> = <em></em> - Jeremiah</li>
<li class="a"><i></i> * <b></b> = <em></em> - Adriane</li>
</ul>
<h2>Rounded</h2>
<ul class="tru">
<li class="c">$<i></i> - Chris</li>
<li class="j">$<i></i> - Jeremiah</li>
<li class="a">$<i></i> - Adriane</li>
</ul>
</div>
</div>
</body>
</html>
<script>
(function() {
/** Updated this to be SASS instead of SCSS for Readability **
<---- Play with the Bill Amounts in the SASS box
<---- Change the Paycheck Amounts as well
*************************************
** Why this came to be:
** My girlfriend, roommate and I needed a way to figure out, based on income, the fairest way to pay our townhouse bills, so I came up with this solution; which first started as a NotePad txt. As I looked at it more I figured I could use SASS to make it dynamic and use CSS to output it through the content: ""; feature, so that we could use it every month. SUCCESS!!! It splits all our bills evenly by what we make so that we can all save to our highest potential without anyone of us feeling overcharged. If you find yourself using this let me know via twitter: @thecssguru
** Thanks! **
*************************************
*/
})();
</script>
<div id="codepen-footer">
<a style="color: #f73535 !important;" href="https://codepen.wufoo.com/forms/m7x3r3/def/field14=" target="_blank">Report Abuse</a>
&nbsp;
<a href="/chimericdream/pen/aCluI" target="_blank">Edit this Pen</a>
</div>
</body>
</html>
/** Updated this to be SASS instead of SCSS for Readability **
<---- Play with the Bill Amounts in the SASS box
<---- Change the Paycheck Amounts as well
*************************************
** Why this came to be:
** My girlfriend, roommate and I needed a way to figure out, based on income, the fairest way to pay our townhouse bills, so I came up with this solution; which first started as a NotePad txt. As I looked at it more I figured I could use SASS to make it dynamic and use CSS to output it through the content: ""; feature, so that we could use it every month. SUCCESS!!! It splits all our bills evenly by what we make so that we can all save to our highest potential without anyone of us feeling overcharged. If you find yourself using this let me know via twitter: @thecssguru
** Thanks! **
*************************************
*/
<!doctype html>
<html>
<head>
<title>CSS/SASS Bill Calculator</title>
</head>
<body>
<div class="wrapper">
<h1><span><i>{</i> <b>CSS/SASS</b> Bill <b>Calculator</b> <i>}</i></span> <a href="http://twitter.com/thecssguru" target="_blank"><i>{</i> <b>the</b>CSS<b>guru</b> <i>}</i></a></h1>
<div class="income">
<div class="monthly-income">
<h2>Monthly Income <i></i></h2>
<ul class="mi">
<li class="c"><i></i> + <b></b> = <em></em> - Chris</li>
<li class="j"><i></i> + <b></b> = <em></em> - Jeremiah</li>
<li class="a"><i></i> + <b></b> = <em></em> - Adriane</li>
</ul>
</div>
<div class="percent">
<h2>% of Monthly Income</h2>
<ul class="ptmi">
<li class="c"><i></i> / <b></b> = <em></em> - Chris</li>
<li class="j"><i></i> / <b></b> = <em></em> - Jeremiah</li>
<li class="a"><i></i> / <b></b> = <em></em> - Adriane</li>
</ul>
</div>
</div>
<div class="rent">
<h2>$<i></i> Rent</h2>
<ul class="r">
<li class="c"><i></i> * <b></b> = <em></em> - Chris</li>
<li class="j"><i></i> * <b></b> = <em></em> - Jeremiah</li>
<li class="a"><i></i> * <b></b> = <em></em> - Adriane</li>
</ul>
<h2>Rounded</h2>
<ul class="tru">
<li class="c">$<i></i> - Chris</li>
<li class="j">$<i></i> - Jeremiah</li>
<li class="a">$<i></i> - Adriane</li>
</ul>
</div>
<div class="electricity">
<h2>$<i></i> Electricity Bill</h2>
<ul class="r">
<li class="c"><i></i> * <b></b> = <em></em> - Chris</li>
<li class="j"><i></i> * <b></b> = <em></em> - Jeremiah</li>
<li class="a"><i></i> * <b></b> = <em></em> - Adriane</li>
</ul>
<h2>Rounded</h2>
<ul class="tru">
<li class="c">$<i></i> - Chris</li>
<li class="j">$<i></i> - Jeremiah</li>
<li class="a">$<i></i> - Adriane</li>
</ul>
</div>
<div class="internet">
<h2>$<i></i> Internet Bill</h2>
<ul class="r">
<li class="c"><i></i> * <b></b> = <em></em> - Chris</li>
<li class="j"><i></i> * <b></b> = <em></em> - Jeremiah</li>
<li class="a"><i></i> * <b></b> = <em></em> - Adriane</li>
</ul>
<h2>Rounded</h2>
<ul class="tru">
<li class="c">$<i></i> - Chris</li>
<li class="j">$<i></i> - Jeremiah</li>
<li class="a">$<i></i> - Adriane</li>
</ul>
</div>
</div>
</body>
</html>
@import "compass"
//Bills
$r: 795 //Rent
$e: 198.73 //Electricity Bill
$i: 51.13 //Internet Bill
//Chris PayChecks
$cPayCheckOne: 1145
$cPayCheckTwo: 1067
$cMI: $cPayCheckOne + $cPayCheckTwo
//Jeremiah PayChecks
$jPayCheckOne: 895
$jPayCheckTwo: 915
$jMI: $jPayCheckOne + $jPayCheckTwo
//Adriane PayChecks
$aPayCheckOne: 297
$aPayCheckTwo: 323
$aMI: $aPayCheckOne + $aPayCheckTwo
//Total Monthly PayChecks
$tMI: $cMI + $jMI + $aMI
//Percent of Income
$cPTMI: $cMI / $tMI
$jPTMI: $jMI / $tMI
$aPTMI: $aMI / $tMI
//Rent
$rcP: $cPTMI * $r
$rjP: $jPTMI * $r
$raP: $aPTMI * $r
//Electricity
$ecB: $cPTMI * $e
$ejB: $jPTMI * $e
$eaB: $aPTMI * $e
//Internet
$icB: $cPTMI * $i
$ijB: $jPTMI * $i
$iaB: $aPTMI * $i
//Fonts
$headFont: 'Average', serif
//Monthly Income (after taxes)
.mi
.c
i:before
content: "#{$cPayCheckOne}"
b:before
content: "#{$cPayCheckTwo}"
em:before
content: "#{$cMI}"
.j
i:before
content: "#{$jPayCheckOne}"
b:before
content: "#{$jPayCheckTwo}"
em:before
content: "#{$jMI}"
.a
i:before
content: "#{$aPayCheckOne}"
b:before
content: "#{$aPayCheckTwo}"
em:before
content: "#{$aMI}"
//Percent of Total Monthly Income
.ptmi
.c
i:before
content: "#{$cMI}"
b:before
content: "#{$tMI}"
em:before
content: "#{$cPTMI}"
.j
i:before
content: "#{$jMI}"
b:before
content: "#{$tMI}"
em:before
content: "#{$jPTMI}"
.a
i:before
content: "#{$aMI}"
b:before
content: "#{$tMI}"
em:before
content: "#{$aPTMI}"
//Rent
.rent
h2 i:before
content: "#{$r}"
.r
.c
i:before
content: "#{$cPTMI}"
b:before
content: "#{$r}"
em:before
content: "#{$rcP}"
.j
i:before
content: "#{$jPTMI}"
b:before
content: "#{$r}"
em:before
content: "#{$rjP}"
.a
i:before
content: "#{$aPTMI}"
b:before
content: "#{$r}"
em:before
content: "#{$raP}"
.tru
font-weight: bold
font-size: 150%
.c
i:before
content: "#{round($rcP)}"
.j
i:before
content: "#{round($rjP)}"
.a
i:before
content: "#{round($raP)}"
//Electricity Bill
.electricity
h2 i:before
content: "#{$e}"
.r
.c
i:before
content: "#{$cPTMI}"
b:before
content: "#{$e}"
em:before
content: "#{$ecB}"
.j
i:before
content: "#{$jPTMI}"
b:before
content: "#{$e}"
em:before
content: "#{$ejB}"
.a
i:before
content: "#{$aPTMI}"
b:before
content: "#{$e}"
em:before
content: "#{$eaB}"
.tru
font-weight: bold
font-size: 150%
.c
i:before
content: "#{round($ecB)}"
.j
i:before
content: "#{round($ejB)}"
.a
i:before
content: "#{round($eaB)}"
//Internet Bill
.internet
h2 i:before
content: "#{$i}"
.r
.c
i:before
content: "#{$cPTMI}"
b:before
content: "#{$i}"
em:before
content: "#{$icB}"
.j
i:before
content: "#{$jPTMI}"
b:before
content: "#{$i}"
em:before
content: "#{$ijB}"
.a
i:before
content: "#{$aPTMI}"
b:before
content: "#{$i}"
em:before
content: "#{$iaB}"
.tru
font-weight: bold
font-size: 150%
.c
i:before
content: "#{round($icB)}"
.j
i:before
content: "#{round($ijB)}"
.a
i:before
content: "#{round($iaB)}"
//Imports
@import url(http://fonts.googleapis.com/css?family=Average)
//Layout
body
background: url(https://twimg0-a.akamaihd.net/profile_background_images/230086378/bg.png)
font: 88% Arial
.wrapper
+pie-clearfix
+border-radius(10px)
background: rgba(255,255,255,0.3)
padding: 15px
margin: 35px
min-width: 900px
i, b, em
&:before
display: inline-block
h1
+pie-clearfix
+border-radius(10px)
background: #fff
font-family: $headFont
font-weight: normal
color: #c0fdfd
padding: 1%
margin: 0 0 15px
position: relative
span
+border-radius(10px)
background: #000
padding: 1%
display: block
float: left
i
color: #fd00fd
font-style: normal
b
color: #fff
font-weight: normal
a
+border-radius(10px)
background: #000
color: #c0fdfd
text-decoration: none
display: block
padding: 1%
float: right
&:hover
background: #444
h2
background: #eee
font-family: $headFont
font-size: 130%
border: 1px #ccc solid
padding: 1%
margin: 0 0 15px
ul
margin: 0 0 15px
padding: 0
li
list-style: none
padding: 3px 25px
border-bottom: 1px #ddd solid
b
font-weight: normal
i, em
font-style: normal
.income
+pie-clearfix
margin: 0 0 15px
.monthly-income, .percent
+border-radius(10px)
background: #fff
width: 47.5%
float: left
padding: 1%
margin: 0 1% 0 0
h2 i:before
float: right
content: "Total: #{$tMI}"
.percent
margin: 0
.rent, .electricity, .internet
+border-radius(10px)
background: #fff
float: left
width: 30.66%
padding: 1%
margin: 0 1% 0 0
.internet
margin: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment