Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding remaining files

  • Loading branch information...
commit 2b898f10e32cd6a3871138c049ffc433f3841810 1 parent 08e01af
@blackant blackant authored
View
1  .gitignore
@@ -0,0 +1 @@
+.sass-cache
View
24 config.rb
@@ -0,0 +1,24 @@
+# Require any additional compass plugins here.
+
+# Set this to the root of your project when deployed:
+http_path = "/"
+css_dir = "css"
+sass_dir = "css/sass"
+images_dir = "images"
+javascripts_dir = "js"
+
+# You can select your preferred output style here (can be overridden via the command line):
+# output_style = :expanded or :nested or :compact or :compressed
+
+# To enable relative paths to assets via compass helper functions. Uncomment:
+# relative_assets = true
+
+# To disable debugging comments that display the original location of your selectors. Uncomment:
+# line_comments = false
+
+
+# If you prefer the indented syntax, you might want to regenerate this
+# project again passing --syntax sass, or you can uncomment this:
+# preferred_syntax = :sass
+# and then run:
+# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
View
5 css/ie.css
@@ -0,0 +1,5 @@
+/* Welcome to Compass. Use this file to write IE specific override styles.
+ * Import this file using the following HTML or equivalent:
+ * <!--[if IE]>
+ * <link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
+ * <![endif]--> */
View
5 css/sass/ie.scss
@@ -0,0 +1,5 @@
+/* Welcome to Compass. Use this file to write IE specific override styles.
+ * Import this file using the following HTML or equivalent:
+ * <!--[if IE]>
+ * <link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
+ * <![endif]--> */
View
146 css/sass/screen.scss
@@ -0,0 +1,146 @@
+@import "compass/reset";
+@import "compass/utilities/general/clearfix";
+@import "compass/css3/inline-block";
+
+// variables
+$highlight_color: #d7ec33;
+$text_color: #8f8f8f;
+$link_color: #dcdcdc;
+
+$golden_ratio_small: 38%;
+$golden_ratio_large: 62%;
+$gutter_size: 4%;
+
+body {
+ background: #232323 url(/images/bg/body.png) 0 0 repeat;
+ font-family: 'Inconsolata', 'Helvetica Neue', arial, serif;
+ color: $text_color;
+ font-size: 0.84em;
+ width: 90%;
+ margin: 3em auto;
+ @include clearfix;
+}
+
+p {
+ margin-bottom: 1em;
+}
+
+a {
+ color: $link_color;
+ text-decoration: none;
+ -webkit-transition-duration: .30s;
+ -webkit-transition-property: background-color, color;
+
+ &:hover {
+ color: #fff;
+ }
+}
+
+h1 {
+ font-family: 'Oswald', 'Helvetica Neue', arial, serif;
+ color: #dcdcdc;
+ font-size: 3.57em;
+ text-transform: uppercase;
+ margin-bottom: 0.4em;
+
+ b {
+ color: $highlight_color;
+ display: block;
+ }
+}
+
+dl {
+ dd {
+ margin-bottom: 1em;
+ }
+}
+
+// sidebar
+aside {
+ float: left;
+ width: $golden_ratio_small - ($gutter_size / 2);
+
+ p {
+ line-height: 1.1em;
+ }
+}
+
+footer {
+ margin-top: 2em;
+}
+
+// main section
+section {
+ line-height: 1.1em;
+ float: right;
+ width: $golden_ratio_large - ($gutter_size / 2);
+
+ h2 {
+ font-size: 3em;
+ line-height: 0.9;
+ color: #fefefe;
+ margin-bottom: 0.5em;
+ }
+
+ h6 {
+ font-size: 0.9em;
+ }
+}
+
+ol#chart {
+ margin-top: 0.4em;
+ li {
+ position: relative;
+ margin-bottom: 0.5em;
+ font-size: 1.1em;
+ line-height: 2;
+
+ .digit {
+ position: absolute;
+ left: -1em;
+ }
+
+ .fill {
+ @include inline-block;
+ height: 2em;
+ background-color: $highlight_color;
+ margin-right: 0.7em;
+ }
+ }
+}
+
+@media screen and (max-width: 600px),
+screen and (max-device-width: 480px) {
+ html {
+ -ms-text-size-adjust: none;
+ -webkit-text-size-adjust: none;
+ }
+}
+
+
+@media screen and (max-width: 600px) {
+ aside, section {
+ float: none;
+ width: auto;
+ max-width: 100%;
+ }
+
+ footer {
+ display: none;
+ }
+}
+
+@media screen and (max-width: 480px) {
+ body {
+ margin: 1em auto;
+ }
+ h1 { font-size: 2.4em; }
+}
+
+//iPhone 4, Opera Mobile 11 and other high pixel ratio devices -----------
+@media
+only screen and (-webkit-min-device-pixel-ratio: 1.5),
+only screen and (-o-min-device-pixel-ratio: 3/2),
+only screen and (min-device-pixel-ratio: 1.5) {
+}
+
View
211 css/screen.css
@@ -0,0 +1,211 @@
+/* line 17, ../../../../../../../usr/local/lib/ruby/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+
+/* line 20, ../../../../../../../usr/local/lib/ruby/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+body {
+ line-height: 1;
+}
+
+/* line 22, ../../../../../../../usr/local/lib/ruby/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+ol, ul {
+ list-style: none;
+}
+
+/* line 24, ../../../../../../../usr/local/lib/ruby/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+/* line 26, ../../../../../../../usr/local/lib/ruby/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+caption, th, td {
+ text-align: left;
+ font-weight: normal;
+ vertical-align: middle;
+}
+
+/* line 28, ../../../../../../../usr/local/lib/ruby/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+q, blockquote {
+ quotes: none;
+}
+/* line 101, ../../../../../../../usr/local/lib/ruby/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+q:before, q:after, blockquote:before, blockquote:after {
+ content: "";
+ content: none;
+}
+
+/* line 30, ../../../../../../../usr/local/lib/ruby/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+a img {
+ border: none;
+}
+
+/* line 115, ../../../../../../../usr/local/lib/ruby/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+article, aside, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section {
+ display: block;
+}
+
+/* line 14, sass/screen.scss */
+body {
+ background: #232323 url(/images/bg/body.png) 0 0 repeat;
+ font-family: 'Inconsolata', 'Helvetica Neue', arial, serif;
+ color: #8f8f8f;
+ font-size: 0.84em;
+ width: 90%;
+ margin: 3em auto;
+ overflow: hidden;
+ *zoom: 1;
+}
+
+/* line 24, sass/screen.scss */
+p {
+ margin-bottom: 1em;
+}
+
+/* line 28, sass/screen.scss */
+a {
+ color: #dcdcdc;
+ text-decoration: none;
+ -webkit-transition-duration: .30s;
+ -webkit-transition-property: background-color, color;
+}
+/* line 34, sass/screen.scss */
+a:hover {
+ color: #fff;
+}
+
+/* line 39, sass/screen.scss */
+h1 {
+ font-family: 'Oswald', 'Helvetica Neue', arial, serif;
+ color: #dcdcdc;
+ font-size: 3.57em;
+ text-transform: uppercase;
+ margin-bottom: 0.4em;
+}
+/* line 46, sass/screen.scss */
+h1 b {
+ color: #d7ec33;
+ display: block;
+}
+
+/* line 53, sass/screen.scss */
+dl dd {
+ margin-bottom: 1em;
+}
+
+/* line 59, sass/screen.scss */
+aside {
+ float: left;
+ width: 36%;
+}
+/* line 63, sass/screen.scss */
+aside p {
+ line-height: 1.1em;
+}
+
+/* line 68, sass/screen.scss */
+footer {
+ margin-top: 2em;
+}
+
+/* line 73, sass/screen.scss */
+section {
+ line-height: 1.1em;
+ float: right;
+ width: 60%;
+}
+/* line 78, sass/screen.scss */
+section h2 {
+ font-size: 3em;
+ line-height: 0.9;
+ color: #fefefe;
+ margin-bottom: 0.5em;
+}
+/* line 85, sass/screen.scss */
+section h6 {
+ font-size: 0.9em;
+}
+
+/* line 90, sass/screen.scss */
+ol#chart {
+ margin-top: 0.4em;
+}
+/* line 92, sass/screen.scss */
+ol#chart li {
+ position: relative;
+ margin-bottom: 0.5em;
+ font-size: 1.1em;
+ line-height: 2;
+}
+/* line 98, sass/screen.scss */
+ol#chart li .digit {
+ position: absolute;
+ left: -1em;
+}
+/* line 103, sass/screen.scss */
+ol#chart li .fill {
+ display: -moz-inline-box;
+ -moz-box-orient: vertical;
+ display: inline-block;
+ vertical-align: middle;
+ *vertical-align: auto;
+ height: 2em;
+ background-color: #d7ec33;
+ margin-right: 0.7em;
+}
+/* line 7, ../../../../../../../usr/local/lib/ruby/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/css3/_inline-block.scss */
+ol#chart li .fill {
+ *display: inline;
+}
+
+@media screen and (max-width: 600px),
+screen and (max-device-width: 480px) {
+ /* line 114, sass/screen.scss */
+ html {
+ -ms-text-size-adjust: none;
+ -webkit-text-size-adjust: none;
+ }
+}
+@media screen and (max-width: 600px) {
+ /* line 122, sass/screen.scss */
+ aside, section {
+ float: none;
+ width: auto;
+ max-width: 100%;
+ }
+
+ /* line 128, sass/screen.scss */
+ footer {
+ display: none;
+ }
+}
+@media screen and (max-width: 480px) {
+ /* line 134, sass/screen.scss */
+ body {
+ margin: 1em auto;
+ }
+
+ /* line 137, sass/screen.scss */
+ h1 {
+ font-size: 2.4em;
+ }
+}
View
BIN  images/bg/body.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/marker.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
103 index.html
@@ -0,0 +1,103 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <title>Testing Benford's Law</title>
+ <meta charset="utf-8" />
+ <meta name="description" content="An experiment to test Benford's Law against large, publicly available datasets." />
+ <meta name="author" content="Jason Long (@jasonlong) and Bryce Thornton (@brycethornton)" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
+ <link href="/css/screen.css" media="screen, projection" rel="stylesheet" type="text/css" />
+ <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
+ <link href='http://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
+ </head>
+
+ <body>
+ <aside>
+ <h1>Testing <b>Benford's Law</b></h1>
+
+ <p>Imagine a large dataset, say something like a list of every country
+ and its population.</p>
+
+ [TABLE HERE]
+
+ <p>If you counted how many times the leading digit was a 1, you’d
+ probably find that it was more than the number of 2s. And 2s would
+ probably occur more often than 3s and so on.</p>
+
+ <p>This is Benford’s Law. It states that the disbribution of leading
+ digits follows a logrithmic curve with 9s occuring least often. See the
+ <a href="http://en.wikipedia.org/wiki/Benfords_law">Wikipedia article</a>
+ for a more thorough discussion.</p>
+
+ <p>This is a simple examination of Benford’s Law to see how many large,
+ publicly accessible datasets satisfy the law.</p>
+
+ <footer>
+ <p>
+ <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="jasonlong" data-related="brycethornton">Tweet</a>
+ <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
+ </p>
+
+ <dl id="credits">
+ <dt>Concept, Design, &amp; Frontend Development</dt>
+ <dd><a href="http://twitter.com/jasonlong">@jasonlong</a></dd>
+
+ <dt>Backend &amp; Frontend Development</dt>
+ <dd><a href="http://twitter.com/brycethornton">@brycethornton</a></dd>
+ </dl>
+
+ <p>Code available on <a href="#">Github</a></p>
+ </footer>
+ </aside>
+
+ <section>
+ <h2>Twitter users by followers count</h2>
+
+ <h6>Leading digit frequency</h6>
+
+ <ol id="chart">
+ <li>
+ <span class="digit">1</span>
+ <span class="fill" data-value="39.7"></span>
+ </li>
+ <li>
+ <span class="digit">2</span>
+ <span class="fill" data-value="35.7"></span>
+ </li>
+ <li>
+ <span class="digit">3</span>
+ <span class="fill" data-value="31.7"></span>
+ </li>
+ <li>
+ <span class="digit">4</span>
+ <span class="fill" data-value="29.7"></span>
+ </li>
+ <li>
+ <span class="digit">5</span>
+ <span class="fill" data-value="25.7"></span>
+ </li>
+ <li>
+ <span class="digit">6</span>
+ <span class="fill" data-value="20.7"></span>
+ </li>
+ <li>
+ <span class="digit">7</span>
+ <span class="fill" data-value="15.7"></span>
+ </li>
+ <li>
+ <span class="digit">8</span>
+ <span class="fill" data-value="10.7"></span>
+ </li>
+ <li>
+ <span class="digit">9</span>
+ <span class="fill" data-value="5.7"></span>
+ </li>
+ </ol>
+ </section>
+ </body>
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
+ <script src="/js/app.js"></script>
+
+</html>
+
View
27 js/app.js
@@ -0,0 +1,27 @@
+(function() {
+ var adjustFooter, fillChart;
+ $(window).resize(function() {
+ return adjustFooter();
+ });
+ $(document).ready(function() {
+ adjustFooter();
+ return fillChart();
+ });
+ fillChart = function() {
+ return $('ol#chart li .fill').each(function(digit) {
+ var value;
+ value = $(this).attr('data-value');
+ $(this).width(value * 2 + '%');
+ return $('<span>' + value + '%</span>').insertAfter($(this));
+ });
+ };
+ adjustFooter = function() {
+ if ($('section').css('float') === "none" && $('body').hasClass('single-column') === false) {
+ $('footer').appendTo('body').show();
+ return $('body').addClass('single-column');
+ } else if ($('section').css('float') !== "none" && $('body').hasClass('single-column')) {
+ $('footer').appendTo('aside');
+ return $('body').removeClass('single-column');
+ }
+ };
+}).call(this);
View
22 js/coffee/app.coffee
@@ -0,0 +1,22 @@
+# coffee --watch -o js/ --compile js/coffee/*.coffee
+
+$(window).resize ->
+ adjustFooter()
+
+$(document).ready ->
+ adjustFooter()
+ fillChart()
+
+fillChart = ->
+ $('ol#chart li .fill').each (digit) ->
+ value = $(this).attr('data-value')
+ $(this).width(value*2 + '%')
+ $('<span>'+value+'%</span>').insertAfter($(this))
+
+adjustFooter = ->
+ if $('section').css('float') is "none" and $('body').hasClass('single-column') is false
+ $('footer').appendTo('body').show()
+ $('body').addClass('single-column')
+ else if $('section').css('float') isnt "none" and $('body').hasClass('single-column')
+ $('footer').appendTo('aside')
+ $('body').removeClass('single-column')
Please sign in to comment.
Something went wrong with that request. Please try again.