Browse Source

Made skrollr on homepage mobile-friendly

pull/180/head
Matthew Holt 10 years ago
parent
commit
e09fb87a99
  1. 61
      index.html

61
index.html

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
<script src="/resources/js/home.js"></script>
</head>
<body>
<div id="skrollr-body">
<div id="top" data-top="bottom: 0px; opacity: 1;" data-top-bottom="bottom: -350px; opacity: .3;">
<div class="grid-container">
<div class="grid-100">
@ -38,25 +39,25 @@ @@ -38,25 +39,25 @@
<div id="title-code">
<pre><code class="language-javascript">// Parse CSV string
var data = Papa.parse(csv);
var data = Papa.parse(csv);
// Convert back to CSV
var csv = Papa.unparse(data);
// Convert back to CSV
var csv = Papa.unparse(data);
// Parse local CSV file
Papa.parse(file, {
// Parse local CSV file
Papa.parse(file, {
complete: function(results) {
console.log("Finished:", results.data);
}
});
});
// Stream big file in worker thread
Papa.parse(bigFile, {
// Stream big file in worker thread
Papa.parse(bigFile, {
worker: true,
step: function(results) {
console.log("Row:", results.data);
}
});</code></pre>
});</code></pre>
</div>
</div>
</div>
@ -211,13 +212,13 @@ Papa.parse(bigFile, { @@ -211,13 +212,13 @@ Papa.parse(bigFile, {
<p>Heavens, no. Papa does it right. Just pass in the CSV string with an optional <a href="/docs#config">configuration</a>.</p>
<pre><code class="language-javascript">var results = Papa.parse(csvString, <a href="/docs#config">config</a>);
/*
/*
results = {
data: [ ... ], // parsed data
errors: [ ... ], // errors encountered
meta: { ... } // extra parse info
}
*/</code></pre>
*/</code></pre>
</div>
</div>
</section>
@ -233,8 +234,8 @@ Papa.parse(bigFile, { @@ -233,8 +234,8 @@ Papa.parse(bigFile, {
<p>That's okay. Papa will scan the first few rows to find the right delimiter.</p>
<pre><code class="language-javascript">var results = Papa.parse(csvString);
console.log(results.meta.delimiter);
// "\t"</code></pre>
console.log(results.meta.delimiter);
// "\t"</code></pre>
</div>
</div>
</section>
@ -253,7 +254,7 @@ console.log(results.meta.delimiter); @@ -253,7 +254,7 @@ console.log(results.meta.delimiter);
complete: function(results) {
console.log(results);
}
});</code></pre>
});</code></pre>
</div>
</div>
</section>
@ -275,7 +276,7 @@ console.log(results.meta.delimiter); @@ -275,7 +276,7 @@ console.log(results.meta.delimiter);
complete: function(results) {
console.log(results);
}
});</code></pre>
});</code></pre>
</div>
</div>
</section>
@ -302,7 +303,7 @@ console.log(results.meta.delimiter); @@ -302,7 +303,7 @@ console.log(results.meta.delimiter);
complete: function() {
console.log("All done!");
}
});</code></pre>
});</code></pre>
</div>
</div>
</section>
@ -325,7 +326,7 @@ console.log(results.meta.delimiter); @@ -325,7 +326,7 @@ console.log(results.meta.delimiter);
complete: function() {
console.log("All done!");
}
});</code></pre>
});</code></pre>
</div>
</div>
</section>
@ -342,9 +343,9 @@ console.log(results.meta.delimiter); @@ -342,9 +343,9 @@ console.log(results.meta.delimiter);
<p>If you tell Papa there is a header row, each row will be organized by field name instead of index.</p>
<pre><code class="language-javascript">// Key data by field name instead of index/position
var results = Papa.parse(csv, {
var results = Papa.parse(csv, {
header: true
});</code></pre>
});</code></pre>
</div>
</div>
</section>
@ -361,9 +362,9 @@ var results = Papa.parse(csv, { @@ -361,9 +362,9 @@ var results = Papa.parse(csv, {
<p><i>Everything</i> is parsed as strings. If you want numbers and booleans, you can enable dynamic typing to do the conversion for you.</p>
<pre><code class="language-javascript">// Converts numeric/boolean data
var results = Papa.parse(csv, {
var results = Papa.parse(csv, {
dynamicTyping: true
});</code></pre>
});</code></pre>
</div>
</div>
</section>
@ -382,10 +383,10 @@ var results = Papa.parse(csv, { @@ -382,10 +383,10 @@ var results = Papa.parse(csv, {
<p>Okay, first off: that's really weird. But fortunately, you can skip those lines... just specify the comment string.</p>
<pre><code class="language-javascript">// Mostly found in academia, some CSV files
// may have commented lines in them
var results = Papa.parse(csv, {
// may have commented lines in them
var results = Papa.parse(csv, {
comments: "#"
});</code></pre>
});</code></pre>
</div>
</div>
</section>
@ -403,12 +404,12 @@ var results = Papa.parse(csv, { @@ -403,12 +404,12 @@ var results = Papa.parse(csv, {
<p>Papa handles errors pretty well. The <a href="http://tools.ietf.org/html/rfc4180">CSV standard</a> is somewhat <strike>loose</strike> ambiguous, so Papa is designed for edge cases. For example, mismatched fields won't break parsing.</p>
<pre><code class="language-javascript">// Example error:
{
{
type: "FieldMismatch",
code: "TooManyFields",
message: "Expected 3 fields, but parsed 4",
row: 1
}</code></pre>
}</code></pre>
</div>
</div>
</section>
@ -433,7 +434,7 @@ var results = Papa.parse(csv, { @@ -433,7 +434,7 @@ var results = Papa.parse(csv, {
complete: function() {
console.log("All files done!");
}
});</code></pre>
});</code></pre>
</div>
</div>
</section>
@ -450,8 +451,8 @@ var results = Papa.parse(csv, { @@ -450,8 +451,8 @@ var results = Papa.parse(csv, {
<p>Call <code>unparse()</code> instead of <code>parse()</code>, passing in your array of arrays or array of objects. Papa will figure it out.</p>
<pre><code class="language-javascript">// Output is a properly-formatted CSV string.
// See <a href="/docs#json-to-csv">the docs</a> for more configurability.
var csv = Papa.unparse(yourData);</code></pre>
// See <a href="/docs#json-to-csv">the docs</a> for more configurability.
var csv = Papa.unparse(yourData);</code></pre>
</div>
</div>
</section>
@ -539,6 +540,6 @@ var csv = Papa.unparse(yourData);</code></pre> @@ -539,6 +540,6 @@ var csv = Papa.unparse(yourData);</code></pre>
</div>
</div>
</footer>
</div>
</body>
</html>

Loading…
Cancel
Save