Permalink
Browse files

Added personal funcationality and more styling

  • Loading branch information...
NateBarnes committed May 1, 2012
1 parent b683231 commit 22194164f5499abbd6fa91636c2f1468420ffe6e
@@ -7,6 +7,7 @@ total = 0
factor = 2.0
med_rate = 16
cap = 50
+personal = 49445.0
window.showNValue = (newValue) ->
factor = parseFloat(newValue).toFixed(1)
@@ -36,13 +37,22 @@ window.calculate = ->
$("#total_revenue").addClass("success")
else
$("#total_revenue").removeClass("success")
+ per_of_median = personal/med
+ per_of_median = ((per_of_median - 1) / factor ) + 1 if per_of_median > 1
+ rate = per_of_median * med_rate
+ rate = cap if rate > cap
+ $("#personal_rate").html(rate.toFixed(4).toString()+"%")
true
window.gatherNums = ->
factor = parseFloat($("#range_value").html())
med_rate = parseFloat($("#med_rate").val())
+ personal = parseFloat($("#personal_income").val())
cap = parseFloat($("#cap").val())
if cap > 50
$("#cap").val("50")
cap = 50
- true
+ true
+
+window.onload = ->
+ calculate()
@@ -12,6 +12,10 @@ body {
padding: 15px;
}
+.no_underline {
+ text-decoration: none;
+}
+
.failure {
color: red;
}
@@ -27,10 +31,46 @@ body {
border-radius: 15px;
}
+div.side_header {
+ font-size: 17px;
+ font-weight: bold;
+ margin-bottom: 15px;
+}
+
#total_revenue {
font-size: 32px;
}
+div.settings {
+ text-align: center;
+}
+
+div.personal {
+ margin-top: 20px;
+ text-align: center;
+}
+
+#personal_rate {
+ font-size: 32px;
+}
+
+.about {
+ font-family: Gill Sans, Verdana;
+ font-size: 11px;
+ line-height: 14px;
+ text-transform: uppercase;
+ letter-spacing: 2px;
+ font-weight: bold;
+}
+
+a.about {
+ text-decoration: none;
+}
+
+div.top {
+ margin-bottom: 15px;
+}
+
div.totals {
margin-bottom: 20px;
}
@@ -1,6 +1,9 @@
class PagesController < ApplicationController
def index
@means = [1249,7927,12338,17278,22165,27186,32085,37183,42013,47198,51984,57154,61941,67095,72042,77007,81979,87142,92009,97115,101830,107162,111973,117204,121842,127026,132066,137202,141989,146959,151788,157072,162151,167076,171948,177161,181956,187307,192029,197119,219377,398194]
+ end
+
+ def about
end
@@ -8,10 +8,15 @@
</head>
<body>
<div class="container_16">
- <div class="grid_16">
- Logo
+ <div class="top">
+ <div class="grid_15">
+ <%= link_to "Logo", "/", :class => "no_underline" %>
+ </div>
+ <div class="grid_1 about">
+ <%= link_to "About", "/about", :class => "no_underline" %>
+ </div>
+ <div class="clear"></div>
</div>
- <div class="clear"></div>
<div class="grid_16">
<%= yield %>
</div>
@@ -0,0 +1,12 @@
+<div class="grid_16 panel round_corners">
+ SlidingTax is an interactive proposal to replace the current federal tax system.<br />
+ <br />
+ The idea sprung from a series of office political conversations, further sparked by an article on the Freakonomics blog concerning the federal tax rate, how to make it scale more fairly while ensuring that everyone has some skin in the game.<br />
+ <br />
+ <b>How It Works:</b><br />
+ The system is built to replace the entire federal tax system. It has no deductions and no brackets (the brackets you see at the bottom are a visual guide). Moreover it has no corporate tax (as long as a company reinvests in themselves, they are not taxed) however all payouts are taxed at the appropriate income level (so if the company gives it's CEO 5 million dollars of stock, the taxes are assessed on the value of the payout at the rate of the payee's total income). Capital gains are also assessed at the rate of the payee. The individual rate is determined based on based on the payee's percentage of income above the median income for the United States as a whole the year before. Based on these numbers, this site was constructed to allow people to fiddle around with the percentages, caps, and rates of growth inherent in the system. This is obviously not a complete tax proposal, however hopefully it will facilitate an understanding or discussion about the rates of taxation and how to implement a system that is best for all involved.<br />
+ <br />
+ <b>How to Use the Site:</b><br />
+ There are three settings on the left to tweak the system. Changing the Median Tax Rate changes the tax rate paid by someone who has exactly the median income for the country. Altering the Growth Rate changes how quickly the tax rate rises as income rises above the median (smaller growth rates mean the tax rate increases faster as you get away from median income, larger growth rates mean the opposite). Lastly the cap is the highest tax rate that can be assessed by the system. This rate cannot be set higher than 50%, as it would cause a disincentive to work (as the rate climbs above 50% you're losing more of your income than you're making, thus you'd be better off making less).<br />
+ <br />
+</div>
@@ -1,16 +1,29 @@
-<div class="settings panel round_corners grid_3 alpha">
- <div class="n_value">
- <input type="range" min="0.1" max="4.01" step="0.1" value="2.0" onchange="showNValue(this.value)"></input><br />
- <span>N Value = <span id="range_value">2.0</span></span>
+<div class="grid_3 alpha">
+ <div class="settings panel round_corners">
+ <div class="n_value">
+ <input type="range" min="0.1" max="6.01" step="0.1" value="2.0" onchange="showNValue(this.value)"></input><br />
+ <span>&nbsp;Growth Rate = <span id="range_value">2.0</span></span>
+ </div>
+ <br />
+ <div class="tax_rate">
+ <input type="textfield" id="med_rate" value="16" onchange="calculate()"></input><br />
+ <span>Median Tax Rate</span>
+ </div><br />
+ <div class="tax_cap">
+ <input type="textfield" id="cap" value="50" onchange="calculate()"></input><br />
+ <span>Tax Rate Cap</span>
+ </div>
</div>
- <br />
- <div class="tax_rate">
- <input type="textfield" id="med_rate" value="16" onchange="calculate()"></input><br />
- <span>Median Tax Rate</span>
- </div><br />
- <div class="tax_cap">
- <input type="textfield" id="cap" value="50" onchange="calculate()"></input><br />
- <span>Tax Rate Cap</span>
+ <div class="personal panel round_corners">
+ <div>
+ <div class="side_header">What's My Rate?</div>
+ <input type="textfield" id="personal_income" value="49445.00" onchange="calculate()"></input><br />
+ <span>Personal Income</span>
+ </div>
+ <br />
+ <div>
+ <span id="personal_rate">0%</span>
+ </div>
</div>
</div>
<div class="results panel round_corners grid_12 omega">
@@ -29,7 +42,7 @@
<% @means.each_with_index do |mean, index| %>
<tr class="<%=(index%2).even? ? "even_row" : "odd_row" %>">
<td><%= index+1 %></td>
- <td><%= number_with_delimiter mean, :delimiter => ',' %></td>
+ <td>$<%= number_with_delimiter mean, :delimiter => ',' %></td>
<td id="rate_<%=index%>">&nbsp;</td>
<td id="burden_<%=index%>">&nbsp;</td>
</tr>
View
@@ -1,4 +1,8 @@
Slidingtax::Application.routes.draw do
root :to => "pages#index"
+
get "pages/index"
+ get "pages/about"
+
+ match "/about", :to => "pages#about"
end

0 comments on commit 2219416

Please sign in to comment.