diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4895fd2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +_gitignore/ \ No newline at end of file diff --git a/demo.html b/demo.html index 5a7c41d..6c9389a 100644 --- a/demo.html +++ b/demo.html @@ -5,206 +5,250 @@ - + - + -
-
-
+

Choose a Demo

+ +
+
String
+
Local File(s)
+
Remote File
+
JSON to CSV
+
-
-
-

Try Papa Parse

+ +
+ + + + + + + + +
-
-
-
-
String
-
-
-
Local file(s)
-
-
-
Remote file
-
-
-
JSON to CSV
-
+
-
+
+ -
+ -
+ - +
+
+ +
+ Choose one or more delimited text files for Papa to parse.
-
-

Choose one or more delimited text files for Papa to parse.

- + + + Sample files: -

- Or use one of these: -
- Normal file -
- Large file -
- Malformed file -
-
-

- Type the URL of the file to be downloaded and parsed. -
(cross-origin requests must receive Access-Control-Allow-Origin header) -

- - -

- Or use one of these: -
- Normal file -
- Large file + +
+
+ +
+ Type the URL of the file to be downloaded and parsed.
- Malformed file + (cross-origin requests require Access-Control-Allow-Origin header)
-
-

Paste a valid JSON string to convert to CSV.

- -
- Results will show up in the console of your browser's inspector tools. -
+
+ Results will appear in the console of your browser's inspector tools +
- - -
- - The file is loaded in chunks and results are delivered row-by-row during parsing. Saves memory and prevents crashes. - - - Runs the parser in a separate thread so the web page doesn't lock up. - - - Keys data by field name rather than an ordered array. - - - Turns numeric data into numbers and true/false into booleans. - - - Make sure your input doesn't have quoted fields! - - - The delimiting character. Usually comma or tab. Default is comma. - - - If > 0, stops parsing after this many rows. - - - Only applies when reading local files. Default is specified by the browser (usually UTF-8). - - - If specified, skips lines starting with this character. -
- -
- - -
+ diff --git a/docs.html b/docs.html index 36d006d..dac87b9 100644 --- a/docs.html +++ b/docs.html @@ -5,56 +5,57 @@ - + + + + -
-
-
+

Documentation

-
-

Documentation

-
-

Contents

-
    +
    1. Convert CSV to JSON
-
- - - - - - - - - - - - +
+
+
+
+

Convert CSV to JSON

+

+ Delimited data can be parsed out of strings or files. Files that are parsed can be local or remote. Local files are opened with FileReader, and remote files are downloaded with XMLHttpRequest. +

+
-
+
+
Parse string
+
-
-

Convert CSV to JSON

+
+
Papa.parse(csvString[, config])
+
-

Delimited data can be parsed out of strings or files. Files that are parsed can be local or remote. Local files are opened with FileReader, and remote files are downloaded with XMLHttpRequest.

-
+
+
    +
  • csvString is a string of delimited text to be parsed.
  • +
  • config is an optional config object.
  • +
  • Returns a parse results object (if not streaming or using worker).
  • +
+
+
-
-

Parse string

- Papa.parse(csvString[, config]) -
-
-
    -
  • csvString is a string of delimited text to be parsed.
  • -
  • config is an optional config object.
  • -
  • Returns a parse results object (if not streaming or using worker).
  • -
-
-
+
+
Parse local files
+
+
+
Papa.parse(file, config)
+
+
+
    +
  • file is a File object obtained from the DOM.
  • +
  • config is a config object which contains a callback.
  • +
  • Doesn't return anything. Results are provided asynchronously to a callback function.
  • +
+
+
-
-

Parse local file

- Papa.parse(file, config) -
-
-
    -
  • file is a File object obtained from the DOM.
  • -
  • config is a config object which contains a callback.
  • -
  • Doesn't return anything. Results are provided asynchronously to a callback function.
  • -
-
-
+
+
Parse remote file
+
-
-

Parse remote file

-Papa.parse(url, { - download: true - // config ... -}) -
-
-
    -
  • url is the path or URL to the file to download.
  • -
  • The second argument is a config object where download: true is set.
  • -
  • Doesn't return anything. Results are provided asynchronously to a callback function.
  • -
-
-
+
+
Papa.parse(url, {
+	download: true,
+	// rest of config ...
+})
+
+
+
    +
  • url is the path or URL to the file to download.
  • +
  • The second argument is a config object where download: true is set.
  • +
  • Doesn't return anything. Results are provided asynchronously to a callback function.
  • +
+
+
+
+
Using jQuery to select files
+
-
-

Using jQuery to select files

-$('input[type=file]').parse({ +
+
$('input[type=file]').parse({
 	config: {
 		// base config to use for each file
 	},
@@ -175,25 +175,26 @@
 	{
 		// executed after all files are complete
 	}
-});
-				
-
-
    -
  • Select the file input elements containing files you want to parse.
  • -
  • - before is an optional callback that lets you inspect each file before parsing begins. Return an object like: -{ +}); +
+
+
    +
  • Select the file input elements with files you want to parse.
  • +
  • + before is an optional callback that lets you inspect each file before parsing begins. Return an object like: +
    {
     	action: "abort",
     	reason: "Some reason",
     	config: // altered config...
    -}
    -							to alter the flow of parsing. Actions can be "abort" to skip this and all other files in the queue, "skip" to skip just this file, or "continue" to carry on (equivalent to returning nothing). reason can be a reason for aborting. config can be a modified configuration for parsing just this file.
    -						
  • -
  • The complete callback shown here is executed after all files are finished and does not receive any data. Use the complete callback in config for per-file results. -
+}
+ to alter the flow of parsing. Actions can be "abort" to skip this and all other files in the queue, "skip" to skip just this file, or "continue" to carry on (equivalent to returning nothing). reason can be a reason for aborting. config can be a modified configuration for parsing just this file. + +
  • The complete callback shown here is executed after all files are finished and does not receive any data. Use the complete callback in config for per-file results.
  • + +
    +
    -
    - +
    @@ -209,31 +210,65 @@ +
    +
    +
    +

    Convert JSON to CSV

    +

    + Papa's unparse utility writes out correct delimited text strings given an array of arrays or an array of objects. +

    +
    -
    - +
    +
    Unparse
    +
    -
    -

    Convert JSON to CSV

    -

    Papa's unparse utility correctly writes out delimited text strings given an array of arrays or an array of objects.

    -
    +
    +
    Papa.unparse(data[, config])
    +
    +
    +
      +
    • Returns the resulting delimited text as a string.
    • +
    • + data can be one of: +
        +
      • An array of arrays
      • +
      • An array of objects
      • +
      • An object explicitly defining fields and data
      • +
      +
    • +
    • + config is an optional object with any of these properties: +
      // defaults shown
      +{
      +	quotes: false,
      +	delimiter: ",",
      +	newline: "\r\n"
      +}
      + Set quotes to true to always enclose each field in quotes, or an array of true/false values correlating to specific to columns to force-quote. The delimiter can be any valid delimiting character. The newline character(s) may also be customized. +
    • +
    +
    +
    -
    -

    Unparse

    - Papa.unparse(data[, config]) +
    +
    Examples
    +
    -

    Examples

    -// Two-line, comma-delimited file +
    +
    // Two-line, comma-delimited file
     var csv = Papa.unparse([
     	["1-1", "1-2", "1-3"],
     	["2-1", "2-2", "2-3"]
    -]);
    +]);
    +
    -// With header row (all objects should look alike) +
    +
    // With implicit header row
     var csv = Papa.unparse([
     	{
     		"Column 1": "foo",
    @@ -243,42 +278,23 @@ var csv = Papa.unparse([
     		"Column 1": "abc",
     		"Column 2": "def"
     	}
    -]);
    +]);
    +
    -// Specifying fields and data manually +
    +
    // Specifying fields and data explicitly
     var csv = Papa.unparse({
     	fields: ["Column 1", "Column 2"],
     	data: [
     		["foo", "bar"],
     		["abc", "def"]
     	]
    -});
    -
    -				
    -
    -
      -
    • Returns the resulting delimited text as a string.

    • -
    • - data can be one of: -
        -
      • An array of arrays
      • -
      • An array of objects
      • -
      • An object with fields and data
      • -

      -
    • -
    • - config is an object with any of these properties: -// defaults shown -{ - quotes: false, - delimiter: ",", - newline: "\r\n" -} - Set quotes to true to force enclosing each datum around quotes, or an array of true/false values correlating to specific to columns to force-quote. The delimiter can be any valid delimiting character. The newline character(s) may also be customized. -
    • -
    +});
    +
    +
    +
    -
    +
    @@ -295,19 +311,25 @@ var csv = Papa.unparse({ -
    +
    +
    -
    -

    The Config Object

    +
    +

    The Parse Config Object

    -

    Every call to parse receives a configuration object. Its properties define settings, behavior, and callbacks used during parsing.

    -
    +

    + The parse function may be passed a configuration object. It defines settings, behavior, and callbacks used during parsing. Any properties left unspecified will resort to their default values. +

    +
    +
    +
    Default Config With All Options
    +
    -
    -

    Default config

    -{ + +
    +
    {
     	delimiter: "",	// auto-detect
     	newline: "",	// auto-detect
     	header: false,
    @@ -323,46 +345,154 @@ var csv = Papa.unparse({
     	skipEmptyLines: false,
     	chunk: undefined,
     	fastMode: false
    -}
    -					

    Config options

    - -
      -
    • delimiter The delimiting character. Leave blank to auto-detect. If specified, it must be a string of length 1, and cannot be found in Papa.BAD_DELIMITERS.
    • -
    • newline The newline sequence. Leave blank to auto-detect. Must be one of \r, \n, or \r\n.
    • -
    • header If true, the first row of parsed data will be interpreted as field names. Fields will be returned in the meta, and each row will be an object of data keyed by field name. If false, the parser simply returns an array of arrays, including the first row.
    • -
    • dynamicTyping If true, numeric and boolean data will be converted to their type instead of remaining strings.
    • -
    • preview If > 0, only that many rows will be parsed.
    • -
    • encoding The encoding to use when opening files locally.
    • -
    • worker Whether or not to use a worker thread. Using a worker will keep your page reactive, but may be slightly slower.
    • -
    • comments Specify a string that indicates a comment (like "#" or "//"). If your CSV file has commented lines, and Papa will skip them. This feature is disabled by default.
    • -
    -
    -
    -
      -
    • - step To stream the input, define a callback function to receive results row-by-row rather than together at the end: -step: function(results, handle) { +} +
    +
    + +
    +
    Config Options
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionExplanation
    + delimiter + + The delimiting character. Leave blank to auto-detect. If specified, it must be a string of length 1 which cannot be found in Papa.BAD_DELIMITERS. +
    + newline + + The newline sequence. Leave blank to auto-detect. Must be one of \r, \n, or \r\n. +
    + header + + If true, the first row of parsed data will be interpreted as field names. Fields will be returned in the meta, and each row will be an object of data keyed by field name. If false, the parser simply returns an array of arrays, including the first row. +
    + dynamicTyping + + If true, numeric and boolean data will be converted to their type instead of remaining strings. +
    + preview + + If > 0, only that many rows will be parsed. +
    + encoding + + The encoding to use when opening local files. If specified, it must be a value supported by the FileReader API. +
    + worker + + Whether or not to use a worker thread. Using a worker will keep your page reactive, but may be slightly slower. +
    + comments + + A string that indicates a comment (for example, "#" or "//"). When Papa encounters a line starting with this string, it will skip the line. +
    + step + + To stream the input, define a callback function: +
    step: function(results, handle) {
     	console.log("Row data:", results.data);
     	console.log("Row errors:", results.errors);
    -}
    -							Except when using a worker, you can call handle.abort() to stop parsing, handle.pause() to pause it, or handle.resume() to resume.
    -						
    -						
  • - complete A callback to execute when parsing is complete. Results are passed in, and if parsing a file, the file is, too: -complete: function(results, file) { +}
  • + Streaming is necessary for large files which would otherwise crash the browser. Except when using a Web Worker, you can call handle.abort() to stop parsing, handle.pause() to pause it, or handle.resume() to resume. +
    + complete + + The callback to execute when parsing is complete. It receives the parse results. If parsing a local file, the File is passed in, too: + +
    complete: function(results, file) {
     	console.log("Parsing complete:", results, file);
    -}
    -
    -							If streaming, results will not be available in this function.
    -						
    -						
  • error A callback to execute if FileReader encounters an error. The function should receive two arguments: the error and the File.
  • -
  • download If true, this indicates that the string you passed in is actually a URL from which to download a file and parse it.
  • -
  • skipEmptyLines If true, lines that are completely empty will be skipped. An empty line is defined to be one which evaluates to empty string.
  • -
  • chunk A callback, much like step, which activates streaming and is executed after every whole chunk of the file is loaded and parsed, rather than every row. Works only with local and remote files. Do not use both chunk and step callbacks together. As arguments, it receives the results, the streamer, and if parsing a local file, the File object. You can pause, resume, and abort parsing from within this function.
  • -
  • fastMode When enabled, fast mode executes parsing much more quickly. Only use this if you know your input won't have quoted fields. - +}
  • + When streaming, parse results are not available in this callback. +
    + error + + A callback to execute if FileReader encounters an error. The function is passed two arguments: the error and the File. +
    + download + + If true, this indicates that the string you passed as the first argument to parse() is actually a URL from which to download a file and parse its contents. +
    + skipEmptyLines + + If true, lines that are completely empty will be skipped. An empty line is defined to be one which evaluates to empty string. +
    + chunk + + A callback function, identical to step, which activates streaming. However, this function is executed after every chunk of the file is loaded and parsed rather than every row. Works only with local and remote files. Do not use both chunk and step callbacks together. For the function signature, see the documentation for the step function. +
    + fastMode + + When enabled, fast mode executes parsing much more quickly. However, this only works for input without quoted fields. If you cannot guarantee that, do not enable fast mode. +
    +
    -
    +
    @@ -385,45 +515,55 @@ var csv = Papa.unparse({ -
    +
    +
    -
    -

    The Results Object

    +
    +

    The Parse Result Object

    -

    Parse results are always (even when streaming) provided in a roughly consistent format: an object with data, errors, and meta. When streaming, results.data contains only one row.

    -
    +

    + A parse result always contains three objects: data, errors, and meta. Data and errors are arrays, and meta is an object. In the step callback, the data array will only contain one element. +

    +
    -
    -

    Results structure

    -{ - data: // array of parse results - errors: // array of errors - meta: // object with extra info -} -
    -
    -
      -
    • data is an array of rows. Rows are either arrays (if header: false) or objects (if header: true). Inside a step function, data will only contain one row.
    • -
    • errors is an array of errors.
    • -
    • meta contains extra information about the parse, such as delimiter used, number of lines, whether the process was aborted, etc. -
    -
    -
    +
    +
    Result Structure
    +
    + +
    +
    {
    +	data:   // array of parsed data
    +	errors: // array of errors
    +	meta:   // object with extra info
    +}
    +
    +
    +
      +
    • data is an array of rows. If header is false, rows are arrays; otherwise they are objects of data keyed by the field name.
    • +
    • errors is an array of errors.
    • +
    • meta contains extra information about the parse, such as delimiter used, the newline sequence, whether the process was aborted, etc. Properties in this object are not guaranteed to exist in all situations.
    • +
    +
    +
    + +
    +
    Data
    +
    -
    -

    results.data

    -// Example (without header) + +
    +
    // Example (header: false)
     [
     	["Column 1", "Column 2"],
     	["foo", "bar"],
     	["abc", "def"]
     ]
     
    -// Example (with header)
    +// Example (header: true)
     [
     	{
     		"Column 1": "foo",
    @@ -433,55 +573,63 @@ var csv = Papa.unparse({
     		"Column 1": "abc",
     		"Column 2": "def"
     	}
    -]
    -				
    -
    -
      -
    • If header row is enabled, and more fields are found on a row of data than in the header row, an extra field will appear in the results called __parsed_extra. It contains an array of all data parsed from that row that was wider than the header row.
    • -
    • Using dynamicTyping: true will turn numeric and boolean data into number and boolean types, respectively. Otherwise, all parsed data is string.
    • -
    -
    -
    +]
    +
    +
    +
      +
    • If header row is enabled and more fields are found on a row of data than in the header row, an extra field will appear in that row called __parsed_extra. It contains an array of all data parsed from that row that extended beyond the header row.
    • +
    +
    +
    + +
    +
    Errors
    +
    -
    -

    results.errors

    -// Error structure +
    +
    // Error structure
     {
    -	type: "",     // A generalization of the error
    -	code: "",     // Standardized error code
    -	message: "",  // Human-readable details
    -	row: 0,       // Row index of parsed data where error is
    -	
    -}
    -				
    -
    -
      -
    • The error type will be one of "Quotes", "Delimiter", or "FieldMismatch".
    • -
    • The code may be "MissingQuotes", "UndetectableDelimiter", "TooFewFields", or "TooManyFields" (depending on the error type).
    • - -
    • Just because errors are generated does not necessarily mean that parsing failed! Papa is strong, and usually parsing only bombs hard if the input has sloppy quotes. In other words, MissingQuotes is usually a bad sign.
    • -
    -
    -
    - - -
    -

    results.meta

    -{ - delimiter: // Delimiter used - linebreak: // Line break sequence used - aborted: // Whether process was aborted - fields: // Array of field names - truncated: // Whether preview consumed all input -} -
    -
    -
      -
    • Not all meta properties will always be available. For instance, fields is only given when header: true is set.
    • -
    + type: "", // A generalization of the error + code: "", // Standardized error code + message: "", // Human-readable details + row: 0, // Row index of parsed data where error is + +}
    +
    +
    +
      +
    • The error type will be one of "Quotes", "Delimiter", or "FieldMismatch".
    • +
    • The code may be "MissingQuotes", "UndetectableDelimiter", "TooFewFields", or "TooManyFields" (depending on the error type).
    • + +
    • Just because errors are generated does not necessarily mean that parsing failed. The worst error you can get is probably MissingQuotes.
    • +
    +
    +
    + +
    +
    Meta
    +
    + + +
    +
    {
    +	delimiter: // Delimiter used
    +	linebreak: // Line break sequence used
    +	aborted:   // Whether process was aborted
    +	fields:    // Array of field names
    +	truncated: // Whether preview consumed all input
    +}
    +
    +
    +
      +
    • Not all meta properties will always be available. For instance, fields is only given when header row is enabled.
    • +
    +
    +
    +
    -
    +
    @@ -495,93 +643,185 @@ var csv = Papa.unparse({ -
    +
    +
    -
    -

    Extras

    +
    +

    Extras

    -

    There's a few other things that Papa exposes for you that weren't explained above.

    -
    +

    + There's a few other things that Papa exposes to you that weren't explained above. +

    +
    +
    +
    Read-Only
    +
    -
    -

    - These are provided as a convenience and should remain read-only, but feel free to use them: -

    -
      -
    • - Papa.BAD_DELIMITERS   - An array of characters that are not allowed as delimiters (or comment characters). -
    • -
    • - Papa.RECORD_SEP   - The true delimiter. Invisible. ASCII code 30. Should be doing the job we strangely rely upon commas and tabs for. -
    • -
    • - Papa.UNIT_SEP   - Also sometimes used as a delimiting character. ASCII code 31. -
    • -
    • - Papa.WORKERS_SUPPORTED   - Whether or not the browser supports HTML5 Web Workers. If false, worker: true will have no effect. -
    • -
    -

    - Some settings you may change: -

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Read-Only PropertyExplanation
    Papa.BAD_DELIMITERS + An array of characters that are not allowed as delimiters. +
    Papa.RECORD_SEP + The true delimiter. Invisible. ASCII code 30. Should be doing the job we strangely rely upon commas and tabs for. +
    Papa.UNIT_SEP + Also sometimes used as a delimiting character. ASCII code 31. +
    Papa.WORKERS_SUPPORTED + Whether or not the browser supports HTML5 Web Workers. If false, worker: true will have no effect. +
    Papa.SCRIPT_PATH + The relative path to Papa Parse. This is automatically detected when Papa Parse is loaded synchronously. However, if you load Papa Parse asynchronously (e.g. with RequireJS), you need to set this variable manually in order to use Web Workers. +
    +
    -
      -
    • - Papa.LocalChunkSize   - The size in bytes of each file chunk. Used when streaming files obtained from the DOM that exist on the local computer. Default 10 MB. -
    • -
    • - Papa.RemoteChunkSize   - Same as LocalChunkSize, but for downloading files from remote locations. Default 5 MB. -
    • -
    • - Papa.DefaultDelimiter   - The delimiter used when one is not specified and it cannot be detected automatically. Default is comma ",". -
    • -
    -
    -

    - The following items are for internal use and testing only. It is not recommended that you use them unless you're familiar with the underlying code base: -

    -
      -
    • - Papa.Parser   - The core parsing component. Careful, it's fast. -
    • -
    • - Papa.ParserHandle   - A wrapper over the Parser which provides dynamic typing and header row support. -
    • -
    • - Papa.NetworkStreamer   - Facilitates downloading and parsing files in chunks over the network with XMLHttpRequest. -
    • -
    • - Papa.FileStreamer   - Similar to NetworkStreamer, but for local files, and using the HTML5 FileReader. -
    • -
    -
    -
    +
    +
    Configurable
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    Configurable PropertyExplanation
    Papa.LocalChunkSize + The size in bytes of each file chunk. Used when streaming files obtained from the DOM that exist on the local computer. Default 10 MB. +
    Papa.RemoteChunkSize + Same as LocalChunkSize, but for downloading files from remote locations. Default 5 MB. +
    Papa.DefaultDelimiter + The delimiter used when one is not specified and it cannot be detected automatically. Default is comma. +
    Papa.WORKERS_SUPPORTED + Whether or not the browser supports HTML5 Web Workers. If false, worker: true will have no effect. +
    +
    + +
    +
    For Internal Use Only
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +
    Internal PropertyExplanation
    Papa.Parser + The core parsing component. Careful, it's fast and under rigorous test. +
    Papa.ParserHandle + A wrapper over the Parser which provides dynamic typing and header row support. +
    Papa.NetworkStreamer + Facilitates downloading and parsing files in chunks over the network with XMLHttpRequest. +
    Papa.FileStreamer + Similar to NetworkStreamer, but for local files, and using the HTML5 FileReader. +
    +
    +
    + +
    +
    -
    + diff --git a/faq.html b/faq.html index bacb1ba..2e99e2f 100644 --- a/faq.html +++ b/faq.html @@ -5,59 +5,63 @@ - + + + + -
    -
    +

    FAQ

    -
    -
    -

    FAQ

    -
    +
    +
    -

    General

    +

    General

    -

    Why use Papa Parse?

    +
    Why use Papa Parse?

    There's a thousand CSV libraries for Javascript. Papa is different. It's written with correctness and performance in mind. Papa is the first (and so far only) multi-threaded CSV parser that runs on web pages. It can parse files gigabytes in size without crashing the browser. It correctly handles malformed or edge-case CSV text. It can parse files on the local file system or download them over the Internet. Papa is boss.

    @@ -68,38 +72,43 @@ As of version 4, Papa Parse is the fastest CSV parser for the browser, whereas it used to be the slowest.

    -

    Can I use Papa Parse server-side with Node.js?

    +
    Can I use Papa Parse server-side with Node.js?

    There's a fork of Papa called Baby Parse which is published on npm. Some features are unavailable (like worker threads and file opening/downloading), but the core parser is functional.

    -

    Does Papa Parse have any dependencies?

    +
    Does Papa Parse have any dependencies?

    No. Papa Parse has no dependencies. If jQuery is present, however, it plugs in to make it easier to select files from the DOM.

    -

    Which browsers is it compatible with?

    +
    Which browsers is it compatible with?

    All modern, competent browsers should support all of the features. However, as usual, use IE at your own risk. It looks like IE 10+ and Safari 6+ should support all the features. Firefox and Chrome should work with all features back to versions 3 and 4. Opera 11 and up should be fine. If you really need to use Papa in old IE or Opera, then keep the fancy features off and you may be in luck.

    -

    Can Papa Parse be loaded asynchronously (after the page loads)?

    +
    Can Papa Parse be loaded asynchronously (after the page loads)?

    - Not without some minor modifications. When Papa Parse loads, it has to obtain the script's relative path in order to facilitate worker threads. If you don't need this feature, Papa can be loaded asynchronously by removing or commenting a couple lines. If you do need workers, you can just hardcode the script's path. See issue 69 and issue 87 for more information. + Yes. But if you want to use Web Workers, you'll need to specify the relative path to Papa Parse. To do this, set Papa.SCRIPT_PATH to the relative path of the Papa Parse file. In synchronous loading, this is automatically detected. +

    + +
    Can I build Papa Parse into the same file with other JS dependencies?
    +

    + Yes, but then don't use the Web Worker feature unless your other dependencies are battle-hardened for worker threads.

    -

    Is it open source? (Can I contribute something?)

    +
    Is it open source? (Can I contribute something?)

    Yes, please! I don't want to do this all by myself. Head over to the GitHub project page and hack away. If you're making a significant change, open an issue first so we can talk about it.

    -

    Why wouldn't I always enable fast mode?

    +
    Why wouldn't I always enable fast mode?

    Fast mode makes Papa Parse screaming fast, but you wouldn't want to use it if there are (or may be) quoted fields in your input. Fast mode is fast because it makes one major assumption: no quoted fields. But if you know that your input has no quotes, turn that sucker on. With fast mode on, 1 GB files can be parsed in about 20 seconds.

    @@ -112,28 +121,26 @@ +

    +

    Streaming

    - -
    -

    Streaming

    - -

    Can Papa load and parse huge files?

    +
    Can Papa load and parse huge files?

    Yes. Parsing huge text files is facilitated by streaming, where the file is loaded a little bit at a time, parsed, and the results are sent to your step callback function, row-by-row.

    -

    How do I stream my input?

    +
    How do I stream my input?

    Just specify a step callback function. Results will not be available after parsing is finished, however. You have to inspect the results one row at a time.

    -

    What is a stream and when should I stream files?

    +
    What is a stream and when should I stream files?

    A stream is a unique data structure which, given infinite time, gives you infinite space. So if you're short on memory (as browsers often are), use a stream.

    -

    Wait, does that mean streaming takes more time?

    +
    Wait, does that mean streaming takes more time?

    Yes and no. Typically, when we gain speed, we pay with space. The opposite is true, too. Streaming uses significantly less memory with large inputs, but since the reading happens in chunks and results are processed at each row instead of at the very end, yes, it can be slower.

    @@ -144,26 +151,26 @@ So unless your clients have a fiber line and you have a scalable cloud application, local parsing by streaming is nearly guaranteed to be faster.

    -

    How do I get all the results together after streaming?

    +
    How do I get all the results together after streaming?

    You don't. Unless you assemble it manually. And really, don't do that... it defeats the purpose of using a stream. Just take the parts you need as they come through.

    -

    Does Papa use a true stream?

    +
    Does Papa use a true stream?

    Papa uses HTML5's FileReader API which uses a stream. FileReader doesn't technically allow us to hook into the underlying stream, but it does let us load the file in pieces. But fortunately you don't have to worry about that; it's all taken care of for you. Just take the results one row at a time.

    -

    Can I stream files over a network or the Internet?

    +
    Can I stream files over a network or the Internet?

    Yes, Papa Parse supports this. It will download a file in pieces using HTTP's standard Range header, then pass the parsed results to your step function just like a local file. However, these requests may not work cross-origin (different domain/hostname), depending on the server's configuration.

    - Streaming remote files also requires the Content-Range header in the server's response. Most production-ready servers support this header, but Python's SimpleHTTPServer does not. If you need a quick and easy server, spark will do the trick. ./spark . -port=4100 + Streaming remote files also requires the Content-Range header in the server's response. Most production-ready servers support this header, but Python's SimpleHTTPServer does not. If you need a quick and easy server, spark will do the trick: $ ./spark

    -

    Can I pause and resume parsing?

    +
    Can I pause and resume parsing?

    Yes, as long as you are streaming and not using a worker. Your step callback is passed a ParserHandle which has pause, resume, and abort functions.

    @@ -173,23 +180,20 @@ +

    +

    Multi-Threading (Workers)

    - - -
    -

    Multi-threading (Workers)

    - -

    What is a web worker? Why use one?

    +
    What is a web worker? Why use one?

    HTML5 Web Workers facilitate basic multi-threading in the browser. This means that a web page can spawn a new thread in the operating system that runs Javascript code. This is highly beneficial for long-running scripts that would otherwise lock up the web page.

    -

    How do I use a worker?

    +
    How do I use a worker?

    Just specify worker: true in your config. You'll also need to make a complete callback (unless you're streaming) so that you can get the results, because using a worker makes the parse function asynchronous.

    -

    When should I use a worker?

    +
    When should I use a worker?

    That's up to you. The most typical reason to use a web worker is if your web page becomes unresponsive during parsing. In other words, if it freezes and you can't click things or the scrolling becomes choppy. If that happens, some browsers (like Firefox) will warn the user that a script has become unresponsive or is taking a long time (even if it's working properly). If this happens to you or some of your users, consider using a web worker, at least for the large inputs.

    @@ -197,7 +201,7 @@ However, read the next answer for more info. Using workers has performance implications (both good and bad).

    -

    What are the performance implications of using a worker thread?

    +
    What are the performance implications of using a worker thread?

    Using a worker will be a little slower. In Javascript, threads don't share memory. That's really annoying because sharing memory is the primary reason for multi-threading. As such, all parse results in a worker thread need to be copied to the main thread. And if you're parsing a string in a worker thread, that string also needs to be copied into the worker in the first place. (Files will be opened or downloaded by the worker itself, so the input doesn't need to be copied from the main thread in those cases.)

    @@ -209,26 +213,57 @@

    -

    Can I stream and use a worker at the same time?

    +
    Can I stream and use a worker at the same time?

    Yup. If the input is too large to fit in memory (or large enough to crash the browser), streaming is always the answer, even in a worker thread. Workers keep the page reactive. Streaming makes it able to fit in memory. Use both if you need to.

    -
    -


    - + \ No newline at end of file diff --git a/favicon.ico b/favicon.ico index 3f56dd1..13b625a 100644 Binary files a/favicon.ico and b/favicon.ico differ diff --git a/index.html b/index.html index a91f5aa..4da1e0c 100644 --- a/index.html +++ b/index.html @@ -1,250 +1,300 @@ - Papa Parse - Powerful CSV parser for Javascript + Papa Parse - Powerful CSV Parser for JavaScript - + + + + + -
    -
    -
    -

    Papa Parse

    -

    A powerful, in-browser CSV parser for big boys and girls

    +
    +
    +
    +
    +

    Papa Parse

    +

    The powerful, in-browser CSV parser for big boys and girls

    + + +   Download + + +   Demo + + +   Documentation + +
    + +
    +
    // Parse CSV string
    +var data = Papa.parse(csv);
    +
    +// Convert back to CSV
    +var csv = Papa.unparse(data);
    +
    +// Parse local CSV file
    +Papa.parse(file, {
    +	complete: function(results) {
    +		console.log("Finished:", results.data);
    +	}
    +});
    +
    +// Stream big file in worker thread
    +Papa.parse(bigFile, {
    +	worker: true,
    +	step: function(results) {
    +		console.log("Row:", results.data);
    +	}
    +});
    +
    +
    +
    -
    -
    -
    + +
    +
    Version
    4.0
    +
    + +
    -
    -

    -
    - Now the fastest JavaScript CSV parser for the browser -
    -
    - The world's first multi-threaded CSV parser for the browser -
    -
    - Use Papa when performance, privacy, and correctness matter to you -
    -
    - Papa is easy to use: -
    - var results = Papa.parse(csv); -
    -
    - Convert JSON to CSV: -
    - var csv = Papa.unparse(json); -
    -
    - Companies trust Papa to help alleviate privacy concerns related to uploading files. -
    -
    - Malformed CSV is handled gracefully with a detailed error report. -
    -

    -
    +

    Features

    +
    -
    +
    +
    + Now the fastest JavaScript CSV parser for the browser +
    +
    + The world's first multi-threaded CSV parser for the browser +
    +
    + Papa can handle files gigabytes in size without crashing +
    +
    + Use Papa when performance, privacy, and correctness matter to you +
    +
    + Papa alleviates privacy concerns related to uploading files +
    +
    + Malformed CSV is handled gracefully with a detailed error report +
    +
    -
    -

    Features

    - - And Papa's blazing fast! -
    - -
    - // Convert CSV to JSON -var results = Papa.parse(csv); - -// Parse local CSV files -$('input[type=file]').parse({ - config: { - complete: function(results) { - console.log("Parse results:", results.data); - } - } -}); - -// In a worker thread -Papa.parse(fileOrString, { - worker: true, - complete: function(results) { - console.log("Parse results:", results.data); - } -}); +
    +
    +
  • CSV→JSON and JSON→CSV
  • +
  • Auto-detect delimiter
  • +
  • Open local files
  • +
  • Download remote files
  • +
    +
    +
  • Stream local and remote files
  • +
  • Multi-threaded
  • +
  • Header row support
  • +
  • Type conversion
  • +
    +
    +
  • Skip commented lines
  • +
  • Fast mode
  • +
  • Graceful error handling
  • +
  • Optional sprinkle of jQuery
  • +
    +
    -
    -
    -
    - People Papa -
    - -
    - If you love your Papa, let me know and we'll get your logo added to this page. -
    -
    - + -
    +
    +
    +
    +
    +
    +

    People Papa

    +
    -
    -
    Delimeter auto-detect
    -

    "I don't know the delimiter..."

    -

    - That's okay. Papa will scan the first few rows of input to find the right delimiter for you. You can also set the delimiting character manually. Either way, the delimiter used is returned with every result set. +

    +

    + SmartyStreets verifies addresses, many of which are in CSV files. Papa Parse can process huge files in the browser. "We rapidly built an awesome client-side file processor with Papa Parse."

    -
    - var results = Papa.parse(csvString); -console.log(results); -/* - { - data: [ ... ] - errors: [ ... ] - meta: { - delimiter: "\t", - ... - } - } -*/ +
    +

    + MetaReader helps you see your data from a meta level before you start detailed analysis. "Papa Parse made it very easy to load and ready user CSV files in the browser on the client side." +

    +
    +

    + EpiML is an agent-based mathematical model for the web, still in its early stages of development. "Papa makes it so easy to use CSV, which is good for scientists." +

    +
    +
    -
    + +
    +
    + + +
    +
    +
    +

    CSV Parsing

    +
    "Isn't parsing CSV just String.split(',')?"
    +

    Heavens, no. Papa does it right. Just pass in the CSV string with an optional configuration.

    -
    -
    Parse local files
    -

    "Great, but I have a file to parse."

    -

    - Just give Papa a File instead of a string. And a callback. -

    +
    var results = Papa.parse(csvString, config);
    +/*
    +	results = {
    +		data: [ ... ],    // parsed data
    +		errors: [ ... ],  // errors encountered
    +		meta: {	... }     // extra parse info
    +	}
    +*/
    +
    +
    +
    + + + +
    +
    +
    +

    Delimiter Detection

    +
    "But I don't know the delimiter..."
    + +

    That's okay. Papa will scan the first few rows to find the right delimiter.

    + +
    var results = Papa.parse(csvString);
    +console.log(results.meta.delimiter);
    +// "\t"
    -
    - Papa.parse(file, { +
    +
    + + + +
    +
    +
    +

    Local Files

    +
    "Great, but I have a file to parse."
    + +

    Then give Papa a File instead of a string. Since file parsing is asynchronous, don't forget a callback.

    + +
    var results = Papa.parse(fileInput.files[0], {
     	complete: function(results) {
     		console.log(results);
     	}
    -});
    +});
    -
    -
    +
    +
    -
    -
    Parse remote files
    -

    "No, you don't understand. The file isn't local."

    -

    - Well then just give Papa the URL and—of course—a callback. -

    -
    -
    - Papa.parse("http://example.com/foo.csv", { + +
    +
    +
    +

    Remote Files

    +
    "No—I mean, the file isn't on my computer."
    + +

    Oh, well then just pass in the URL and—of course—a callback.

    + +
    Papa.parse("http://example.com/file.csv", {
     	download: true,
     	complete: function(results) {
    -		console.log("Remote file parsed!", results);
    +		console.log(results);
     	}
    -});
    +});
    -
    -
    +
    +
    -
    -
    Streaming
    -

    "Did I mention the file is huge?"

    -

    - That's what streaming is for. Specify a step callback to receive the results row-by-row. This way, you won't load the whole file into memory and crash the browser. -

    -
    -
    - Papa.parse("http://example.com/bigfoo.csv", { + + + + + +
    +
    +
    +

    Streaming

    +
    "Did I mention the file is huge?"
    + +

    That's what streaming is for. Specify a step callback to receive the results row-by-row. This way, you won't load the whole file into memory and crash the browser.

    + +
    Papa.parse("http://example.com/big.csv", {
     	download: true,
     	step: function(row) {
     		console.log("Row:", row.data);
    @@ -252,23 +302,22 @@ console.log(results);
     	complete: function() {
     		console.log("All done!");
     	}
    -});
    +});
    -
    -
    +
    +
    +
    +
    +
    +

    Multi-Threading

    +
    "Lovely. Now my web page locked up."
    -
    -
    Multi-threading
    -

    "Lovely. Now my web page locked up."

    -

    - Oh. Yeah, that happens when a long-running script is executing in the same thread. Use a Worker thread by specifying worker: true. It may take slightly longer, but your page will stay reactive. -

    -
    -
    - Papa.parse(bigFile, { +

    That happens when a long-running script is executing in the same thread as the page. Use a Worker thread by specifying worker: true. It may take slightly longer, but your page will stay reactive.

    + +
    Papa.parse(bigFile, {
     	worker: true,
     	step: function(row) {
     		console.log("Row:", row.data);
    @@ -276,174 +325,220 @@ console.log(results);
     	complete: function() {
     		console.log("All done!");
     	}
    -});
    +});
    -
    -
    +
    +
    -
    - -

    "Great! Now I want data keyed by field name."

    -

    - You can tell Papa that there is a header row. -

    -
    -
    - // Key data by field name instead of index/position + + -
    -
    Type Conversion
    -

    "Hey, these numbers are all parsed as strings."

    -

    - Everything is parsed as strings. If you need the convenience, you can have numeric and boolean data automatically converted to number and boolean types. -

    -
    -
    - // All parsed data is normally returned as a string. -// Dynamic typing converts numbers to numbers -// and booleans to booleans. + +
    +
    +
    +

    Type Conversion

    +
    "Hey, these numbers are parsed as strings."
    + +

    Everything is parsed as strings. If you want numbers and booleans, you can enable dynamic typing to do the conversion for you.

    + +
    // Converts numeric/boolean data
     var results = Papa.parse(csv, {
     	dynamicTyping: true
    -});
    +});
    -
    -
    +
    +
    -
    -
    Comments
    -

    "I forgot to mention: my CSV files have comments in them."

    -

    - Okay, first off: that's really weird. But you can skip those lines... just specify the comment character. -

    -
    -
    - // Mostly found in academia, some CSV files -// may have commented lines in them + + +
    +
    +
    +

    Comments

    +
    "I forgot to mention: my CSV files have comments in them."
    + +

    Okay, first off: that's really weird. But fortunately, you can skip those lines... just specify the comment string.

    + +
    // Mostly found in academia, some CSV files
    +// may have commented lines in them
     var results = Papa.parse(csv, {
     	comments: "#"
    -});
    +});
    -
    -
    +
    +
    -
    -
    Error handling
    -

    "I'm getting tired, are we done—aw, shoot. Errors."

    -

    - Yeah, almost done. Fortunately, Papa handles errors pretty well. The CSV standard is somewhat loose ambiguous, so Papa tries to consider the edge cases. For example, mismatched fields aren't always the end of the world. -

    -
    -
    - // Example error: + +
    +
    +
    +

    Error Handling

    +
    "Aw, shoot. Errors."
    + +

    Papa handles errors pretty well. The CSV standard is somewhat loose ambiguous, so Papa is designed for edge cases. For example, mismatched fields won't break parsing.

    + +
    // Example error:
     {
     	type: "FieldMismatch",
     	code: "TooManyFields",
     	message: "Expected 3 fields, but parsed 4",
     	row: 1
    -}
    +}
    -
    -
    +
    +
    -
    -
    jQuery Plugin
    -

    "Can I use Papa with jQuery?"

    -

    - Sure, but it's not required. You can use jQuery to select file input elements and then parse their files. Papa exposes its file parsing API as a jQuery plugin only when jQuery is defined. Papa Parse has no dependencies. -

    -
    -
    - $("input[type=file]").parse({ + +
    +
    +
    +

    jQuery Plugin

    +
    "Can I use Papa with jQuery?"
    + +

    Sure, but it's not required. You can use jQuery to select file input elements and then parse their files. Papa exposes its file parsing API as a jQuery plugin only when jQuery is defined. Papa Parse has no dependencies.

    + +
    $("input[type=file]").parse({
     	config: {
     		complete: function(results, file) {
    -			console.log("File done:", file, results);
    +			console.log("This file done:", file, results);
     		}
     	},
     	complete: function() {
     		console.log("All files done!");
     	}
    -});
    +});
    -
    -
    +
    +
    -
    -
    JSON to CSV
    -

    "Last thing: what about converting JSON to CSV?"

    -

    - Call unparse() instead of parse(), passing in your array of arrays or array of objects. Papa will figure it out. -

    -
    -
    - // Output is a properly-formatted CSV string. -// See the docs for more configurability. -var csv = Papa.unparse(yourData); -
    -
    -
    +
    +
    +
    +

    JSON to CSV

    +
    "Last thing: what about converting JSON to CSV?"
    + +

    Call unparse() instead of parse(), passing in your array of arrays or array of objects. Papa will figure it out.

    +
    // Output is a properly-formatted CSV string.
    +// See the docs for more configurability.
    +var csv = Papa.unparse(yourData);
    +
    +
    +
    +
    +
    -

    Who's your Papa?

    +

    Who's Your Papa?

    - Mini Papa for production use +

    + Lil' Papa + (minified) for production use +

    - Fat Papa for debug and development +

    + Fat Papa + (un-minified) for development +

    -
    -
    -
    + -
    +
    + + diff --git a/resources/css/common.css b/resources/css/common.css index fbbb6de..e8e0c4f 100644 --- a/resources/css/common.css +++ b/resources/css/common.css @@ -3,22 +3,25 @@ html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abb body, main { - background: #F0F0F0; + background: #FFF; } body { - font: 18px/1.5em 'Source Sans Pro', 'Lato', 'Open Sans', 'Helvetica Neue', sans-serif; - font-size: 18px; + font: 18px/1.5em 'Source Sans Pro', 'Helvetica Neue', sans-serif; color: #333; height: 100%; } +main { + padding-top: 100px; +} + a { color: #1D58B1; } a:hover { - color: #2D81FF; + color: #2AACFC; } b { @@ -29,33 +32,32 @@ i { font-style: italic; } -p { - margin: 25px 0; +p, +li { + line-height: 1.75em; } -small { - font-size: 14px; +p { + margin-bottom: 25px; } -h1 { - font-family: Arvo; - font-size: 120px; - line-height: 1em; - margin-bottom: 50px; - text-align: center; +small { + font-size: 12px; } +h1, h2, h3, h4, -h5, -h6 { - font-family: Lato, sans-serif; +h5 { + text-align: center; } -h2, -h3 { - text-align: center; +h1 { + font-family: Lato; + font-weight: 300; + font-size: 40px; + margin-bottom: 50px; } h2 { @@ -64,23 +66,34 @@ h2 { } h3 { - font-size: 34px; - font-weight: bold; - margin: 40px auto 30px; - color: #000; - line-height: 1.25em; + font-size: 48px; + margin-bottom: 30px; + line-height: 1.5em; } h4 { - font-size: 20px; - font-weight: 900; + font-size: 28px; + margin-bottom: 50px; + line-height: 1.25em; } -h3:first-child, -h4:first-child { - margin-top: 15px; +h5, +footer h4 { + font-size: 12px; + letter-spacing: 2px; + text-transform: uppercase; + color: #A1B2C2; /* darker alternative: #698EB0 */ + line-height: 1em; + margin: 50px auto; +} + +h6 { + font-weight: bold; + text-align: left; + margin: 40px auto 5px; } + /* Neat hack! http://css-tricks.com/hash-tag-links-padding/ So when you navigate in-page, the sticky header doesn't cover it up @@ -88,29 +101,17 @@ h4:first-child { h2[id]:before, h3[id]:before, h4[id]:before, -.note:before { - display: block; - content: " "; - margin-top: -75px; - height: 75px; - visibility: hidden; -} - -.note { - color: #AAA; - text-transform: uppercase; - font-size: 12px; +h5[id]:before, +h6[id]:before { + display: block; + content: " "; + margin-top: -75px; + height: 75px; + visibility: hidden; } ul, ol { - margin: 30px 0 30px 2em; -} - -ul ul, -ol ul, -ol ol, -ul ol { margin: 0 0 0 2em; } @@ -122,20 +123,31 @@ ol { list-style-type: decimal; } +header, +main, +footer { + position: relative; + z-index: 1; +} + header, .insignia { - background: #253C50; + background: #FFF; + border-color: #CCC; + border-style: solid; + box-shadow: 0 -4px 20px -3px rgba(0, 0, 0, 0.2); } header { position: fixed; top: 0; width: 100%; - z-index: 1; + border-bottom-width: 1px; } -main { - padding-top: 100px; +section { + padding: 100px 0; + border-bottom: 1px solid #E3E3E3; } main h2 { @@ -145,54 +157,61 @@ main h2 { margin: 0px 0 50px; } +main pre { + padding: 10px; + background: #F5F5F5; +} + .text-logo, -.links a { +header .links a { display: inline-block; - padding: 15px 10px; - color: #FFF; + color: #777; } .text-logo { font-family: Arvo, sans-serif; + letter-spacing: -1px; + color: #1D80AB; font-size: 24px; text-decoration: none; + padding: 15px 10px; } .text-logo:hover { color: #66B0E2; } -.links a { - font-size: 16px; +header .links a { + font-size: 14px; + padding: 15px 25px; text-decoration: none; - transition: background .2s; } -.links a:hover { - background: #66B0E2; +header .links a:hover { + color: #000; +} + +header .links a:first-child { + padding-left: 10px; } -.links a .fa { +header .links a .fa { margin-right: 5px; } .donate { - background: #58AA38; + background: #D9FFD1; } .donate:hover { - background: #67C941 !important; -} - -.ticker .ticker-statement:not(:first-child) { - display: none; + background: #A1FF87 !important; } code { - font: 13px/1em 'Liberation Mono', 'Consolas', 'Monaco', 'Menlo', 'Courier New', monospace; - background: #FFF; + font: 75%/1em 'Liberation Mono', 'Consolas', 'Monaco', 'Menlo', 'Courier New', monospace; color: #000; padding: 5px; + background: #F5F5F5; } h2 code { @@ -200,25 +219,13 @@ h2 code { background: none; } -code.block { - color: #000; - padding: 10px; +pre > code { display: block; - white-space: pre; - overflow-x: auto; - line-height: 1.4em; - margin: 15px auto; + line-height: 1.5em; + font-size: 14px; tab-size: 4; } -.grid-55 code { - margin-top: 25px !important; -} - -code .comment { - color: #999; -} - .button, button, input[type=button], @@ -234,6 +241,7 @@ button[type=submit] { border-radius: 50px; cursor: pointer; outline: none; + line-height: 1.5em; font-size: 18px; } @@ -260,7 +268,7 @@ button.red { .button.red:hover, button.red:hover { - background: #BE1717; + background: #DD2222; } .button.green, @@ -273,32 +281,45 @@ button.green:hover { background: #4DB43F; } +.button.gray, +button.gray { + background: #666; +} + +.button.gray:hover, +button.gray:hover { + background: #999; +} + hr { border: 0; border-top: 1px solid #D0D0D0; - margin: 35px auto 50px; } -.clear { - border: 0; - clear: both; - background: 0; - margin: 0; +table { + border-collapse: collapse; + width: 100%; } -.pad-50 { - padding-top: 50px; - padding-bottom: 50px; +th, +td { + padding: 20px; + font-size: 16px; + border-bottom: 1px solid #E0E0E0; } -.pad-75 { - padding-top: 75px; - padding-bottom: 75px; +th { + font-weight: bold; + text-align: left; } -.pad-100 { - padding-top: 100px; - padding-bottom: 100px; +table pre code { + font-size: 12px; +} + +table pre, +li pre { + margin: 10px 0; } .text-center { @@ -309,49 +330,168 @@ hr { text-align: right; } -.mini-papa { - text-align: right; +footer { + z-index: 0; + background: #263A49; + box-shadow: 0 0 50px rgba(0, 0, 0, 0.5); + border-bottom: 0; + padding: 0; + font-weight: 300; + font-size: 15px; + color: #EFEFEF; + line-height: 1.5em; + margin-top: 75px; +} + +footer a { + color: #EFEFEF; + text-decoration: underline; +} +/* +footer .footer-top { + padding: 20px; + background: #2C4252; +} +*/ +footer .footer-main { + font-family: Lato; + padding: 65px 0; +} + +footer .links a { + color: #A1B2C2; + text-decoration: none; + transition: color .2s; + display: block; + font-size: 14px; + font-weight: 300; + line-height: 2em; +} + +footer .links a:hover { + color: #ACD7FF; + text-decoration: none; } +footer h3 { + color: #FFF; + font-size: 22px; + margin: 0; +} + +footer h4 { + margin: 0; +} + +footer h4 a { + color: #A1B2C2; + text-decoration: underline; +} + +footer h5 { + color: #FFF; + text-transform: uppercase; + font-size: 16px; + margin: 0 0 10px 0; + font-weight: normal; + text-align: left; +} + +footer hr { + border: 0; + border-top: 1px solid #3E5566; + width: 60%; + min-width: 50px; + margin: 10px 0; +} + +.logo { + display: inline-block; + color: #263A49; + font-family: Arvo; + font-size: 90px; + line-height: 1em; + background: #EFEFEF; + border-radius: 100px; + padding: 10px 30px; +} + + + + .stuck { position: fixed; top: 0; width: 100%; + border-top-width: 0; + border-bottom-width: 1px; } -footer { - padding: 25px 0; - background: #333; - color: #DDD; -} -footer a { - color: #CCC; -} + + + @media (max-width: 1100px) { .text-logo { - font-size: 16px; + font-size: 18px; + } + + p, + li { + line-height: 1.5em; + } +} + +@media (max-width: 970px) { + header .links a { + padding: 15px; + } + + header > .grid-container, + header .mobile-grid-50 { + padding: 0; + } +} + +@media (max-width: 840px) { + header .links a { + font-size: 12px; } } @media (max-width: 767px) { /* mobile */ + p, + li { + line-height: 1.5em; + } + header, .sticky-wrapper { position: static; margin-bottom: 50px !important; } - main { - padding-top: 0; + header > .grid-container, + header .mobile-grid-50 { + padding: 0; + } + + section { + padding: 50px 0; } - .links a { + header .links a { font-size: 16px; display: block; text-align: left; + padding: 15px 10% !important; + } + + main { + padding-top: 0; } main h2 { @@ -362,7 +502,13 @@ footer a { font-size: 30px; } - .mini-papa { - text-align: left; + td, + th { + font-size: 14px; + padding: 10px; + } + + footer h5 { + margin-top: 40px; } } \ No newline at end of file diff --git a/resources/css/demo.css b/resources/css/demo.css index fe9e9d7..12299ae 100644 --- a/resources/css/demo.css +++ b/resources/css/demo.css @@ -1,5 +1,47 @@ +.tabs, +.tab { + border-color: #B4E3FF; + border-style: solid; +} + +.tabs { + border-bottom-width: 1px; + padding: 0 5%; + margin-bottom: 30px; + text-align: center; +} + +.tab { + display: inline-block; + padding: 8px 20px; + border-bottom-width: 1px; + border-radius: 5px 5px 0 0; + z-index: 2; + cursor: pointer; + font-size: 14px; + color: #777; + background: #FFF; + margin-bottom: -1px; +} + +.tab.active { + border-width: 1px; + border-bottom-color: #FFF; + color: #000; +} + +.tab:not(.active):hover { + color: #007FB6; +} + label { display: block; + font-size: 14px; + line-height: 2em; +} + +input[type=checkbox] { + margin-right: 4px; } textarea, @@ -12,58 +54,61 @@ input[type=email] { tab-size: 4; } +input[type=text], +input[type=number], +input[type=password], +input[type=email] { + margin: 0 6px; +} + textarea { box-sizing: border-box; width: 100%; - height: 350px; + height: 320px; padding: 10px; resize: vertical; } -input[type=file] { - background: #FFF; - padding: 10px; -} - -.tab { - padding: 10px 0; - background: #DFDFDF; - font-size: 14px; - margin-bottom: 20px; - cursor: pointer; - color: #555; +dfn { + font-size: 12px; + color: #999; + display: block; + line-height: 1.2em; + margin-bottom: 15px; } -.tab.active { - background: #333; - color: #FFF; +input[type=checkbox] + dfn { + padding-left: 22px; } -.tab:not(.active):hover { - background: #C6D8E7; - color: #355A88; +input[type=file], +#url { + margin: 20px auto; + display: block; } -dfn { +input[type=file] { + padding: 10px; font-size: 12px; - color: #999; - display: block; - line-height: 1.2em; - border-bottom: 1px solid #CCC; - padding-bottom: 5px; - margin-bottom: 10px; + background: #F0F0F0; } #insert-tab { - font-size: 14px; + font-size: 12px; } -.config { +.input-area { + margin-bottom: 20px; + font-size: 16px; line-height: 1em; } -.input-area { - margin-bottom: 40px; +ul { + margin-top: 20px; +} + +li { + line-height: 1.5em; } #input-local, @@ -85,6 +130,11 @@ dfn { .see-results { color: #CC0000; + margin-bottom: 20px; + font-size: 12px; + text-transform: uppercase; + letter-spacing: 1px; + line-height: 1.5em; } @@ -93,4 +143,17 @@ dfn { textarea { height: 250px; } + + .tab { + border: 0; + background: #F0F0F0; + border-radius: 0; + margin: 10px; + display: block; + } + + .tab.active { + background: #3B9CE2; + color: #FFF; + } } \ No newline at end of file diff --git a/resources/css/home.css b/resources/css/home.css index a833d99..b1539d4 100644 --- a/resources/css/home.css +++ b/resources/css/home.css @@ -1,37 +1,80 @@ -#top-image { - position: fixed; - width: 100%; - height: 100%; - overflow: hidden; - top: 0; - left: 0; +#top { + padding: 6% 0 8%; + color: #1D80AB; + background: #FFF; + position: relative; z-index: 0; - background-image: url('../images/papers.jpg'); - background-repeat: no-repeat; - background-position: 50% -100px; - background-size: 100% 100%; + /* + For better performance, trigger 3D graphics acceleration. + This reduces lag/jitter considerably, esp. in Chrome. + */ + -webkit-transform: translateZ(0); + -webkit-backface-visibility: hidden; + + transform-origin: 100% 100%; } -.content { - position: relative; - z-index: 1; +#top code { + background: none; } -#top { - padding: 5% 0; - margin: 0 auto; - color: #FFF; - - text-shadow: 0 2px 1px rgba(0, 0, 0, .7); - background: rgba(0, 0, 0, .4); - max-width: 1200px; - box-shadow: 0 0 80px 50px rgba(0, 0, 0, .4); +h1 { + text-align: left; + font-family: Arvo; + font-size: 100px; + line-height: 1em; + margin-top: 8%; + margin-bottom: 40px; + letter-spacing: -5px; +} + +h2 { + font-size: 24px; + text-align: left; + margin-bottom: 50px; +} + + +/* Switch around h4 and h5 for homepage... */ +h4 { + font-size: 12px; + letter-spacing: 2px; + margin-bottom: 10px; + text-transform: uppercase; + color: #A1B2C2; + line-height: 1em; +} + +h5 { + font-size: 28px; + margin-bottom: 50px; + line-height: 1.25em; + text-transform: none; + color: inherit; + letter-spacing: 0; + margin-top: 0; +} + +#title-main { + float: left; +} + +#title-code { + float: right; +} + + +main { + padding-top: 0; } -#top h2 { - margin-bottom: 90px; - font-size: 42px; +.fa-heart { + color: #F00; +} + +header { + border-top-width: 1px; } header, @@ -44,6 +87,9 @@ header, margin-bottom: -150px; } +header .fa-heart { + color: inherit; +} .insignia { display: block; @@ -53,136 +99,147 @@ header, border-radius: 50%; margin: 0 auto; text-align: center; - font: 170px/250px Arvo, sans-serif; - text-shadow: 0 3px 2px rgba(0, 0, 0, .5); - color: #FFF; + color: #1D80AB; z-index: 2; margin-bottom: 30px; + border-width: 1px; } -main { - padding-top: 0; - box-shadow: 0 -2px 15px rgba(0, 0, 0, .5); -} - -.firefox-hack { +#version-intro { position: absolute; + font-size: 12px; + top: 18%; width: 100%; + font-family: 'Source Sans Pro', sans-serif; + text-transform: uppercase; + letter-spacing: 2px; } -h3 { - text-align: left; +#version { + text-shadow: 0 3px 2px rgba(169, 169, 169, 0.5); + font: 100px/250px Arvo, sans-serif; } -.showcase { - text-align: left; - margin-bottom: 40px; - background: #1D2933; - clear: both; -} -.showcase a { - color: #668B99; +.firefox-hack { + position: absolute; + width: 100%; } -.showcase-title { - color: #FFF; - font-size: 14px; - text-transform: uppercase; - padding: 10px 0; - background: #2C4252; - text-align: center; +.lover { + margin-bottom: 0; } -.showcase .fa-heart { - color: #F00; - margin: 0 2px; +.grid-container.narrow-grid { + max-width: 850px; } -.showcase-image img { - width: 90%; - vertical-align: middle; +.mini-papa { + text-align: right; } -.showcase-image .fa-plus { - padding: 20px 35px; - border: 4px dashed #2C4252; +#ticker { + width: 90%; + max-width: 800px; + margin: 0 auto; + height: 80px; + position: relative; } -.showcase-image { - width: 200px; - height: 100px; - line-height: 100px; +.ticker-item { + font-size: 24px; + color: #565656; text-align: center; - display: inline-block; - transition: background .4s; + font-family: Lato; + font-weight: 300; + line-height: 1.25em; + width: 100%; + position: absolute; + top: 0; + transition: transform .25s; + transform: scale(0); } -.showcase-image:hover { - background: #375A77; /* default */ +.ticker-item.current { + transform: scale(1); } - - - - -.showcase-image.smartystreets:hover { - background: #FFC200; -} - -.showcase-image.maxcdn:hover { - background: #F37121; +.add-lover-link { + text-decoration: none; } -.showcase-image.maxcdn img { - width: auto; - max-height: 20px; +footer { + margin-top: 0; } +@media (max-width: 1150px) { + #title-main h1 { + font-size: 85px; + } + #title-main h2 { + font-size: 20px; + margin-bottom: 30px; + } + #title-code code { + font-size: 12px; + } + button, + .button { + padding: 8px 20px; + font-size: 14px; + } -.showcase-add { - display: none; - color: #DDD; - padding: 10px 0; - font-size: 16px; - text-align: center; - border-top: 1px solid #337BAC; -} - - - - - -@media (max-width: 900px) { header, .sticky-wrapper { margin-bottom: -120px; } .insignia { - font-size: 100px; width: 175px; height: 175px; + } + + #version { + font-size: 70px; line-height: 175px; } } +@media (max-width: 950px) { + #title-code { + display: none; + } -@media (max-width: 767px) { - /* mobile */ + #top { + padding-top: 0; + } - #top-image { - background-position: 50% 50%; - background-size: auto 100%; + #title-main, + #title-main h1, + #title-main h2 { + width: 100%; + text-align: center; } + #title-main { + padding-bottom: 50px; + } +} + +@media (max-width: 767px) { + /* mobile */ + #top h2 { margin-bottom: 20px; } + + #title-main { + padding-bottom: 10px; + } .stuck { position: static; @@ -192,14 +249,15 @@ h3 { display: none; } + #ticker { + height: 120px; + } - - - .showcase-image { - width: 49%; + .lover { + margin-bottom: 25px; } - .showcase img { - max-width: 200px; + .mini-papa { + text-align: left; } -} \ No newline at end of file +} diff --git a/resources/css/tomorrow.highlight.css b/resources/css/tomorrow.highlight.css new file mode 100644 index 0000000..4b5052f --- /dev/null +++ b/resources/css/tomorrow.highlight.css @@ -0,0 +1,93 @@ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ + +/* Tomorrow Comment */ +.hljs-comment { + color: #8e908c; +} + + + +/* Tomorrow Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #c82829; +} + +/* Tomorrow Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #f5871f; +} + +/* Tomorrow Yellow */ +.ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #eab700; +} + +/* Tomorrow Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #718c00; +} + +/* Tomorrow Aqua */ +.css .hljs-hexcolor { + color: #3e999f; +} + +/* Tomorrow Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #4271ae; +} + +/* Tomorrow Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #8959a8; +} + +.hljs { + display: block; + overflow-x: auto; + /*background: white; + padding: 0.5em;*/ + color: #4d4d4c; + -webkit-text-size-adjust: none; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} \ No newline at end of file diff --git a/resources/js/common.js b/resources/js/common.js index ab39ab6..8c5df4d 100644 --- a/resources/js/common.js +++ b/resources/js/common.js @@ -1,12 +1,8 @@ - -$(function() +// Returns a random number between min and max (inclusive) +function randomInt(min, max) { - -}); - - - - + return Math.floor(Math.random() * (max - min + 1)) + min; +} // BEGIN GOOGLE ANALYTICS diff --git a/resources/js/highlight.min.js b/resources/js/highlight.min.js new file mode 100644 index 0000000..7f8a6dd --- /dev/null +++ b/resources/js/highlight.min.js @@ -0,0 +1 @@ +!function(e){"undefined"!=typeof exports?e(exports):(window.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return window.hljs}))}(function(e){function n(e){return e.replace(/&/gm,"&").replace(//gm,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0==t.index}function a(e){var n=(e.className+" "+(e.parentNode?e.parentNode.className:"")).split(/\s+/);return n=n.map(function(e){return e.replace(/^lang(uage)?-/,"")}),n.filter(function(e){return N(e)||/no(-?)highlight/.test(e)})[0]}function o(e,n){var t={};for(var r in e)t[r]=e[r];if(n)for(var r in n)t[r]=n[r];return t}function i(e){var n=[];return function r(e,a){for(var o=e.firstChild;o;o=o.nextSibling)3==o.nodeType?a+=o.nodeValue.length:1==o.nodeType&&(n.push({event:"start",offset:a,node:o}),a=r(o,a),t(o).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:o}));return a}(e,0),n}function c(e,r,a){function o(){return e.length&&r.length?e[0].offset!=r[0].offset?e[0].offset"}function c(e){l+=""}function u(e){("start"==e.event?i:c)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=o();if(l+=n(a.substr(s,g[0].offset-s)),s=g[0].offset,g==e){f.reverse().forEach(c);do u(g.splice(0,1)[0]),g=o();while(g==e&&g.length&&g[0].offset==s);f.reverse().forEach(i)}else"start"==g[0].event?f.push(g[0].node):f.pop(),u(g.splice(0,1)[0])}return l+n(a.substr(s))}function u(e){function n(e){return e&&e.source||e}function t(t,r){return RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var c={},u=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");c[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?u("keyword",a.k):Object.keys(a.k).forEach(function(e){u(e,a.k[e])}),a.k=c}a.lR=t(a.l||/\b[A-Za-z0-9_]+\b/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),void 0===a.r&&(a.r=1),a.c||(a.c=[]);var s=[];a.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"==e?a:e)}),a.c=s,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var l=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=l.length?t(l.join("|"),!0):{exec:function(){return null}}}}r(e)}function s(e,t,a,o){function i(e,n){for(var t=0;t";return o+=e+'">',o+n+i}function d(){if(!w.k)return n(y);var e="",t=0;w.lR.lastIndex=0;for(var r=w.lR.exec(y);r;){e+=n(y.substr(t,r.index-t));var a=g(w,r);a?(B+=a[1],e+=p(a[0],n(r[0]))):e+=n(r[0]),t=w.lR.lastIndex,r=w.lR.exec(y)}return e+n(y.substr(t))}function h(){if(w.sL&&!R[w.sL])return n(y);var e=w.sL?s(w.sL,y,!0,L[w.sL]):l(y);return w.r>0&&(B+=e.r),"continuous"==w.subLanguageMode&&(L[w.sL]=e.top),p(e.language,e.value,!1,!0)}function v(){return void 0!==w.sL?h():d()}function b(e,t){var r=e.cN?p(e.cN,"",!0):"";e.rB?(M+=r,y=""):e.eB?(M+=n(t)+r,y=""):(M+=r,y=t),w=Object.create(e,{parent:{value:w}})}function m(e,t){if(y+=e,void 0===t)return M+=v(),0;var r=i(t,w);if(r)return M+=v(),b(r,t),r.rB?0:t.length;var a=c(w,t);if(a){var o=w;o.rE||o.eE||(y+=t),M+=v();do w.cN&&(M+=""),B+=w.r,w=w.parent;while(w!=a.parent);return o.eE&&(M+=n(t)),y="",a.starts&&b(a.starts,""),o.rE?0:t.length}if(f(t,w))throw new Error('Illegal lexeme "'+t+'" for mode "'+(w.cN||"")+'"');return y+=t,t.length||1}var x=N(e);if(!x)throw new Error('Unknown language: "'+e+'"');u(x);for(var w=o||x,L={},M="",k=w;k!=x;k=k.parent)k.cN&&(M=p(k.cN,"",!0)+M);var y="",B=0;try{for(var C,j,I=0;;){if(w.t.lastIndex=I,C=w.t.exec(t),!C)break;j=m(t.substr(I,C.index-I),C[0]),I=C.index+j}m(t.substr(I));for(var k=w;k.parent;k=k.parent)k.cN&&(M+="");return{r:B,value:M,language:e,top:w}}catch(A){if(-1!=A.message.indexOf("Illegal"))return{r:0,value:n(t)};throw A}}function l(e,t){t=t||E.languages||Object.keys(R);var r={r:0,value:n(e)},a=r;return t.forEach(function(n){if(N(n)){var t=s(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}}),a.language&&(r.second_best=a),r}function f(e){return E.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,n){return n.replace(/\t/g,E.tabReplace)})),E.useBR&&(e=e.replace(/\n/g,"
    ")),e}function g(e,n,t){var r=n?x[n]:t,a=[e.trim()];return e.match(/(\s|^)hljs(\s|$)/)||a.push("hljs"),r&&a.push(r),a.join(" ").trim()}function p(e){var n=a(e);if(!/no(-?)highlight/.test(n)){var t;E.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):t=e;var r=t.textContent,o=n?s(n,r,!0):l(r),u=i(t);if(u.length){var p=document.createElementNS("http://www.w3.org/1999/xhtml","div");p.innerHTML=o.value,o.value=c(u,i(p),r)}o.value=f(o.value),e.innerHTML=o.value,e.className=g(e.className,n,o.language),e.result={language:o.language,re:o.r},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.r})}}function d(e){E=o(E,e)}function h(){if(!h.called){h.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",h,!1),addEventListener("load",h,!1)}function b(n,t){var r=R[n]=t(e);r.aliases&&r.aliases.forEach(function(e){x[e]=n})}function m(){return Object.keys(R)}function N(e){return R[e]||R[x[e]]}var E={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},R={},x={};return e.highlight=s,e.highlightAuto=l,e.fixMarkup=f,e.highlightBlock=p,e.configure=d,e.initHighlighting=h,e.initHighlightingOnLoad=v,e.registerLanguage=b,e.listLanguages=m,e.getLanguage=N,e.inherit=o,e.IR="[a-zA-Z][a-zA-Z0-9_]*",e.UIR="[a-zA-Z_][a-zA-Z0-9_]*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},e.CLCM={cN:"comment",b:"//",e:"$",c:[e.PWM]},e.CBCM={cN:"comment",b:"/\\*",e:"\\*/",c:[e.PWM]},e.HCM={cN:"comment",b:"#",e:"$",c:[e.PWM]},e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e});hljs.registerLanguage("coffeescript",function(e){var c={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",reserved:"case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf",built_in:"npm require console print module global window document"},n="[A-Za-z$_][0-9A-Za-z$_]*",t={cN:"subst",b:/#\{/,e:/}/,k:c},r=[e.BNM,e.inherit(e.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/"""/,e:/"""/,c:[e.BE,t]},{b:/"/,e:/"/,c:[e.BE,t]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[t,e.HCM]},{b:"//[gim]*",r:0},{b:/\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/}]},{cN:"property",b:"@"+n},{b:"`",e:"`",eB:!0,eE:!0,sL:"javascript"}];t.c=r;var i=e.inherit(e.TM,{b:n}),s="(\\(.*\\))?\\s*\\B[-=]>",o={cN:"params",b:"\\([^\\(]",rB:!0,c:[{b:/\(/,e:/\)/,k:c,c:["self"].concat(r)}]};return{aliases:["coffee","cson","iced"],k:c,i:/\/\*/,c:r.concat([{cN:"comment",b:"###",e:"###",c:[e.PWM]},e.HCM,{cN:"function",b:"^\\s*"+n+"\\s*=\\s*"+s,e:"[-=]>",rB:!0,c:[i,o]},{b:/[:\(,=]\s*/,r:0,c:[{cN:"function",b:s,e:"[-=]>",rB:!0,c:[o]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[i]},i]},{cN:"attribute",b:n+":",e:":",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage("xml",function(){var t="[A-Za-z0-9\\._:-]+",e={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"},c={eW:!0,i:/]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xsl","plist"],cI:!0,c:[{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[c],starts:{e:"",rE:!0,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[c],starts:{e:"",rE:!0,sL:"javascript"}},e,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"",c:[{cN:"title",b:/[^ \/><\n\t]+/,r:0},c]}]}});hljs.registerLanguage("markdown",function(){return{aliases:["md","mkdown","mkd"],c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:"^\\[.+\\]:",rB:!0,c:[{cN:"link_reference",b:"\\[",e:"\\]:",eB:!0,eE:!0,starts:{cN:"link_url",e:"$"}}]}]}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)\}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,e.NM,s,a,t]}});hljs.registerLanguage("javascript",function(r){return{aliases:["js"],k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document"},c:[{cN:"pi",r:10,v:[{b:/^\s*('|")use strict('|")/},{b:/^\s*('|")use asm('|")/}]},r.ASM,r.QSM,r.CLCM,r.CBCM,r.CNM,{b:"("+r.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[r.CLCM,r.CBCM,r.RM,{b:/;/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[r.inherit(r.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[r.CLCM,r.CBCM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+r.IR,r:0}]}});hljs.registerLanguage("json",function(e){var t={literal:"true false null"},i=[e.QSM,e.CNM],l={cN:"value",e:",",eW:!0,eE:!0,c:i,k:t},c={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:!0,eE:!0,c:[e.BE],i:"\\n",starts:l}],i:"\\S"},n={b:"\\[",e:"\\]",c:[e.inherit(l,{cN:null})],i:"\\S"};return i.splice(i.length,0,c,n),{c:i,k:t,i:"\\S"}});hljs.registerLanguage("http",function(){return{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:!0}}]}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",a={cN:"function",b:c+"\\(",rB:!0,eE:!0,e:"\\("};return{cI:!0,i:"[=/|']",c:[e.CBCM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[a,e.ASM,e.QSM,e.CSSNM]}]},{cN:"tag",b:c,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[e.CBCM,{cN:"rule",b:"[^\\s]",rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:!0,i:"[^\\s]",starts:{cN:"value",eW:!0,eE:!0,c:[a,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}}); \ No newline at end of file diff --git a/resources/js/home.js b/resources/js/home.js index 4d7dad8..63dd775 100644 --- a/resources/js/home.js +++ b/resources/js/home.js @@ -4,7 +4,7 @@ Copyright (c) 2011-2014 Caleb Troughton Licensed under the MIT license. https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt */ -(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e=0;s={horizontal:{},vertical:{}};f=1;c={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};this.element[u]=this.id;c[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||a)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(a&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete c[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=this.element[w])!=null?o:[];i.push(this.id);this.element[w]=i}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=t[w];if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;e=n.extend({},n.fn[g].defaults,e);if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=c[i[0][u]];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke.call(this,"disable")},enable:function(){return d._invoke.call(this,"enable")},destroy:function(){return d._invoke.call(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=c[n(t)[0][u]];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.on("load.waypoints",function(){return n[m]("refresh")})})}).call(this); +;(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e=0;s={horizontal:{},vertical:{}};f=1;c={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};this.element[u]=this.id;c[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||a)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(a&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete c[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=this.element[w])!=null?o:[];i.push(this.id);this.element[w]=i}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=t[w];if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;e=n.extend({},n.fn[g].defaults,e);if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=c[i[0][u]];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke.call(this,"disable")},enable:function(){return d._invoke.call(this,"enable")},destroy:function(){return d._invoke.call(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=c[n(t)[0][u]];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.on("load.waypoints",function(){return n[m]("refresh")})})}).call(this); /* Sticky Elements Shortcut for jQuery Waypoints - v2.0.5 @@ -12,31 +12,57 @@ Copyright (c) 2011-2014 Caleb Troughton Licensed under the MIT license. https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt */ -(function(){(function(t,n){if(typeof define==="function"&&define.amd){return define(["jquery","waypoints"],n)}else{return n(t.jQuery)}})(window,function(t){var n,i;n={wrapper:'
    ',stuckClass:"stuck",direction:"down right"};i=function(t,n){var i;t.wrap(n.wrapper);i=t.parent();return i.data("isWaypointStickyWrapper",true)};t.waypoints("extendFn","sticky",function(r){var e,a,s;a=t.extend({},t.fn.waypoint.defaults,n,r);e=i(this,a);s=a.handler;a.handler=function(n){var i,r;i=t(this).children(":first");r=a.direction.indexOf(n)!==-1;i.toggleClass(a.stuckClass,r);e.height(r?i.outerHeight():"");if(s!=null){return s.call(this,n)}};e.waypoint(a);return this.data("stuckClass",a.stuckClass)});return t.waypoints("extendFn","unsticky",function(){var t;t=this.parent();if(!t.data("isWaypointStickyWrapper")){return this}t.waypoint("destroy");this.unwrap();return this.removeClass(this.data("stuckClass"))})})}).call(this); +;(function(){(function(t,n){if(typeof define==="function"&&define.amd){return define(["jquery","waypoints"],n)}else{return n(t.jQuery)}})(window,function(t){var n,i;n={wrapper:'
    ',stuckClass:"stuck",direction:"down right"};i=function(t,n){var i;t.wrap(n.wrapper);i=t.parent();return i.data("isWaypointStickyWrapper",true)};t.waypoints("extendFn","sticky",function(r){var e,a,s;a=t.extend({},t.fn.waypoint.defaults,n,r);e=i(this,a);s=a.handler;a.handler=function(n){var i,r;i=t(this).children(":first");r=a.direction.indexOf(n)!==-1;i.toggleClass(a.stuckClass,r);e.height(r?i.outerHeight():"");if(s!=null){return s.call(this,n)}};e.waypoint(a);return this.data("stuckClass",a.stuckClass)});return t.waypoints("extendFn","unsticky",function(){var t;t=this.parent();if(!t.data("isWaypointStickyWrapper")){return this}t.waypoint("destroy");this.unwrap();return this.removeClass(this.data("stuckClass"))})})}).call(this); +// Code syntax highlighting by highlight.js +hljs.initHighlightingOnLoad(); + + $(function() { + // Initiate scroll effects + var s = skrollr.init({ + smoothScrolling: false, + forceHeight: false + }); + + // Keep header stuck to top after scrolling down $('header').waypoint('sticky'); + // Show 3 random lovers/users of Papa Parse from + // the list defined in lovers.js + $('.lover').each(function() + { + var i = randomInt(0, peopleLovePapa.length-1); + var lover = peopleLovePapa.splice(i, 1)[0]; + + var val = ""; + if (lover.link) + val += ''+lover.name+' '; + else + val += lover.name+' '; + val += lover.description; + if (lover.quote) + val += ' "'+lover.quote+'"'; + + $(this).html(val); + }); + + // Schedule the ticker to change every so often setInterval(function() { - var $current = $('.ticker-statement.current'); - var $next = $current.next('.ticker-statement'); + var $current = $('.ticker-item.current'); + var $next = $current.next('.ticker-item'); if (!$next.length) - $next = $current.siblings('.ticker-statement').first(); + $next = $current.siblings('.ticker-item').first(); - $current.fadeOut(1000, function() + $current.removeClass('current'); + setTimeout(function() { - $(this).removeClass('current'); - $next.fadeIn(500).addClass('current'); - }); + $next.addClass('current'); + }, 500); // at least as long as the CSS transition }, 7000); - - $('#showcase-add-link').click(function() - { - $('.showcase-add').slideToggle('fast'); - }); }); \ No newline at end of file diff --git a/resources/js/lovers.js b/resources/js/lovers.js new file mode 100644 index 0000000..3650fd4 --- /dev/null +++ b/resources/js/lovers.js @@ -0,0 +1,52 @@ +/** + INSTRUCTIONS + + If you use Papa Parse, add your site/project/company to the list + below. Here is a description of the fields: + + link: (optional) The URL to your web site + + name: The name of the site/project/company + + description: Say why Papa Parse is important to your + application. The name is prepended to this + description when rendered. Make sure that it + reads as a fluid sentence when the name is + concatenated with the description. + + quote: (optional) A short testimonial of what you think + of Papa Parse. + + Note that the name and description are required. Please + use English and keep the length similar to existing entries; + entries that are too long or extremely short should be + edited before being accepted. + + Thanks for being a part of Papa Parse! +**/ + +var peopleLovePapa = [ + { + link: "https://smartystreets.com", + name: "SmartyStreets", + description: "verifies addresses, many of which are submitted in CSV files. Papa Parse can process files with over a million addresses in the browser.", + quote: "Because of Papa Parse, we rapidly built an awesome client-side list processing service." + }, + { + link: "http://jannah.github.io/MetaReader", + name: "MetaReader", + description: "helps you see your data from a meta perspective before you start detailed analysis.", + quote: "Papa Parse made it very easy to load and ready user CSV files in the browser on the client side." + }, + { + link: "https://github.com/JamesJansson/EpiML", + name: "EpiML", + description: "is an agent-based mathematical model for the web, still in its early stages of development.", + quote: "Papa makes it so easy to use CSV, which is good for scientists." + }, + { + link: "https://wikipedia.org", + name: "Wikipedia", + description: "uses Papa Parse in VisualEditor to help article editors effortlessly build data tables from text files." + } +]; diff --git a/resources/js/skrollr.min.js b/resources/js/skrollr.min.js new file mode 100644 index 0000000..0b826cf --- /dev/null +++ b/resources/js/skrollr.min.js @@ -0,0 +1,2 @@ +/*! skrollr 0.6.27 (2014-09-28) | Alexander Prinzhorn - https://github.com/Prinzhorn/skrollr | Free to use under terms of MIT license */ +(function(e,t,r){"use strict";function n(r){if(o=t.documentElement,a=t.body,K(),it=this,r=r||{},ut=r.constants||{},r.easing)for(var n in r.easing)U[n]=r.easing[n];yt=r.edgeStrategy||"set",ct={beforerender:r.beforerender,render:r.render,keyframe:r.keyframe},ft=r.forceHeight!==!1,ft&&(Vt=r.scale||1),mt=r.mobileDeceleration||x,dt=r.smoothScrolling!==!1,gt=r.smoothScrollingDuration||E,vt={targetTop:it.getScrollTop()},Gt=(r.mobileCheck||function(){return/Android|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent||navigator.vendor||e.opera)})(),Gt?(st=t.getElementById("skrollr-body"),st&&at(),X(),Dt(o,[y,S],[T])):Dt(o,[y,b],[T]),it.refresh(),St(e,"resize orientationchange",function(){var e=o.clientWidth,t=o.clientHeight;(t!==$t||e!==Mt)&&($t=t,Mt=e,_t=!0)});var i=Y();return function l(){Z(),bt=i(l)}(),it}var o,a,i={get:function(){return it},init:function(e){return it||new n(e)},VERSION:"0.6.26"},l=Object.prototype.hasOwnProperty,s=e.Math,c=e.getComputedStyle,f="touchstart",u="touchmove",m="touchcancel",p="touchend",d="skrollable",g=d+"-before",v=d+"-between",h=d+"-after",y="skrollr",T="no-"+y,b=y+"-desktop",S=y+"-mobile",k="linear",w=1e3,x=.004,E=200,A="start",F="end",C="center",D="bottom",H="___skrollable_id",I=/^(?:input|textarea|button|select)$/i,P=/^\s+|\s+$/g,N=/^data(?:-(_\w+))?(?:-?(-?\d*\.?\d+p?))?(?:-?(start|end|top|center|bottom))?(?:-?(top|center|bottom))?$/,O=/\s*(@?[\w\-\[\]]+)\s*:\s*(.+?)\s*(?:;|$)/gi,V=/^(@?[a-z\-]+)\[(\w+)\]$/,z=/-([a-z0-9_])/g,q=function(e,t){return t.toUpperCase()},L=/[\-+]?[\d]*\.?[\d]+/g,M=/\{\?\}/g,$=/rgba?\(\s*-?\d+\s*,\s*-?\d+\s*,\s*-?\d+/g,_=/[a-z\-]+-gradient/g,B="",G="",K=function(){var e=/^(?:O|Moz|webkit|ms)|(?:-(?:o|moz|webkit|ms)-)/;if(c){var t=c(a,null);for(var n in t)if(B=n.match(e)||+n==n&&t[n].match(e))break;if(!B)return B=G="",r;B=B[0],"-"===B.slice(0,1)?(G=B,B={"-webkit-":"webkit","-moz-":"Moz","-ms-":"ms","-o-":"O"}[B]):G="-"+B.toLowerCase()+"-"}},Y=function(){var t=e.requestAnimationFrame||e[B.toLowerCase()+"RequestAnimationFrame"],r=Pt();return(Gt||!t)&&(t=function(t){var n=Pt()-r,o=s.max(0,1e3/60-n);return e.setTimeout(function(){r=Pt(),t()},o)}),t},R=function(){var t=e.cancelAnimationFrame||e[B.toLowerCase()+"CancelAnimationFrame"];return(Gt||!t)&&(t=function(t){return e.clearTimeout(t)}),t},U={begin:function(){return 0},end:function(){return 1},linear:function(e){return e},quadratic:function(e){return e*e},cubic:function(e){return e*e*e},swing:function(e){return-s.cos(e*s.PI)/2+.5},sqrt:function(e){return s.sqrt(e)},outCubic:function(e){return s.pow(e-1,3)+1},bounce:function(e){var t;if(.5083>=e)t=3;else if(.8489>=e)t=9;else if(.96208>=e)t=27;else{if(!(.99981>=e))return 1;t=91}return 1-s.abs(3*s.cos(1.028*e*t)/t)}};n.prototype.refresh=function(e){var n,o,a=!1;for(e===r?(a=!0,lt=[],Bt=0,e=t.getElementsByTagName("*")):e.length===r&&(e=[e]),n=0,o=e.length;o>n;n++){var i=e[n],l=i,s=[],c=dt,f=yt,u=!1;if(a&&H in i&&delete i[H],i.attributes){for(var m=0,p=i.attributes.length;p>m;m++){var g=i.attributes[m];if("data-anchor-target"!==g.name)if("data-smooth-scrolling"!==g.name)if("data-edge-strategy"!==g.name)if("data-emit-events"!==g.name){var v=g.name.match(N);if(null!==v){var h={props:g.value,element:i,eventType:g.name.replace(z,q)};s.push(h);var y=v[1];y&&(h.constant=y.substr(1));var T=v[2];/p$/.test(T)?(h.isPercentage=!0,h.offset=(0|T.slice(0,-1))/100):h.offset=0|T;var b=v[3],S=v[4]||b;b&&b!==A&&b!==F?(h.mode="relative",h.anchors=[b,S]):(h.mode="absolute",b===F?h.isEnd=!0:h.isPercentage||(h.offset=h.offset*Vt))}}else u=!0;else f=g.value;else c="off"!==g.value;else if(l=t.querySelector(g.value),null===l)throw'Unable to find anchor target "'+g.value+'"'}if(s.length){var k,w,x;!a&&H in i?(x=i[H],k=lt[x].styleAttr,w=lt[x].classAttr):(x=i[H]=Bt++,k=i.style.cssText,w=Ct(i)),lt[x]={element:i,styleAttr:k,classAttr:w,anchorTarget:l,keyFrames:s,smoothScrolling:c,edgeStrategy:f,emitEvents:u,lastFrameIndex:-1},Dt(i,[d],[])}}}for(Et(),n=0,o=e.length;o>n;n++){var E=lt[e[n][H]];E!==r&&(J(E),et(E))}return it},n.prototype.relativeToAbsolute=function(e,t,r){var n=o.clientHeight,a=e.getBoundingClientRect(),i=a.top,l=a.bottom-a.top;return t===D?i-=n:t===C&&(i-=n/2),r===D?i+=l:r===C&&(i+=l/2),i+=it.getScrollTop(),0|i+.5},n.prototype.animateTo=function(e,t){t=t||{};var n=Pt(),o=it.getScrollTop();return pt={startTop:o,topDiff:e-o,targetTop:e,duration:t.duration||w,startTime:n,endTime:n+(t.duration||w),easing:U[t.easing||k],done:t.done},pt.topDiff||(pt.done&&pt.done.call(it,!1),pt=r),it},n.prototype.stopAnimateTo=function(){pt&&pt.done&&pt.done.call(it,!0),pt=r},n.prototype.isAnimatingTo=function(){return!!pt},n.prototype.isMobile=function(){return Gt},n.prototype.setScrollTop=function(t,r){return ht=r===!0,Gt?Kt=s.min(s.max(t,0),Ot):e.scrollTo(0,t),it},n.prototype.getScrollTop=function(){return Gt?Kt:e.pageYOffset||o.scrollTop||a.scrollTop||0},n.prototype.getMaxScrollTop=function(){return Ot},n.prototype.on=function(e,t){return ct[e]=t,it},n.prototype.off=function(e){return delete ct[e],it},n.prototype.destroy=function(){var e=R();e(bt),wt(),Dt(o,[T],[y,b,S]);for(var t=0,n=lt.length;n>t;t++)ot(lt[t].element);o.style.overflow=a.style.overflow="",o.style.height=a.style.height="",st&&i.setStyle(st,"transform","none"),it=r,st=r,ct=r,ft=r,Ot=0,Vt=1,ut=r,mt=r,zt="down",qt=-1,Mt=0,$t=0,_t=!1,pt=r,dt=r,gt=r,vt=r,ht=r,Bt=0,yt=r,Gt=!1,Kt=0,Tt=r};var X=function(){var n,i,l,c,d,g,v,h,y,T,b,S;St(o,[f,u,m,p].join(" "),function(e){var o=e.changedTouches[0];for(c=e.target;3===c.nodeType;)c=c.parentNode;switch(d=o.clientY,g=o.clientX,T=e.timeStamp,I.test(c.tagName)||e.preventDefault(),e.type){case f:n&&n.blur(),it.stopAnimateTo(),n=c,i=v=d,l=g,y=T;break;case u:I.test(c.tagName)&&t.activeElement!==c&&e.preventDefault(),h=d-v,S=T-b,it.setScrollTop(Kt-h,!0),v=d,b=T;break;default:case m:case p:var a=i-d,k=l-g,w=k*k+a*a;if(49>w){if(!I.test(n.tagName)){n.focus();var x=t.createEvent("MouseEvents");x.initMouseEvent("click",!0,!0,e.view,1,o.screenX,o.screenY,o.clientX,o.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,0,null),n.dispatchEvent(x)}return}n=r;var E=h/S;E=s.max(s.min(E,3),-3);var A=s.abs(E/mt),F=E*A+.5*mt*A*A,C=it.getScrollTop()-F,D=0;C>Ot?(D=(Ot-C)/F,C=Ot):0>C&&(D=-C/F,C=0),A*=1-D,it.animateTo(0|C+.5,{easing:"outCubic",duration:A})}}),e.scrollTo(0,0),o.style.overflow=a.style.overflow="hidden"},j=function(){var e,t,r,n,a,i,l,c,f,u,m,p=o.clientHeight,d=At();for(c=0,f=lt.length;f>c;c++)for(e=lt[c],t=e.element,r=e.anchorTarget,n=e.keyFrames,a=0,i=n.length;i>a;a++)l=n[a],u=l.offset,m=d[l.constant]||0,l.frame=u,l.isPercentage&&(u*=p,l.frame=u),"relative"===l.mode&&(ot(t),l.frame=it.relativeToAbsolute(r,l.anchors[0],l.anchors[1])-u,ot(t,!0)),l.frame+=m,ft&&!l.isEnd&&l.frame>Ot&&(Ot=l.frame);for(Ot=s.max(Ot,Ft()),c=0,f=lt.length;f>c;c++){for(e=lt[c],n=e.keyFrames,a=0,i=n.length;i>a;a++)l=n[a],m=d[l.constant]||0,l.isEnd&&(l.frame=Ot-l.offset+m);e.keyFrames.sort(Nt)}},W=function(e,t){for(var r=0,n=lt.length;n>r;r++){var o,a,s=lt[r],c=s.element,f=s.smoothScrolling?e:t,u=s.keyFrames,m=u.length,p=u[0],y=u[u.length-1],T=p.frame>f,b=f>y.frame,S=T?p:y,k=s.emitEvents,w=s.lastFrameIndex;if(T||b){if(T&&-1===s.edge||b&&1===s.edge)continue;switch(T?(Dt(c,[g],[h,v]),k&&w>-1&&(xt(c,p.eventType,zt),s.lastFrameIndex=-1)):(Dt(c,[h],[g,v]),k&&m>w&&(xt(c,y.eventType,zt),s.lastFrameIndex=m)),s.edge=T?-1:1,s.edgeStrategy){case"reset":ot(c);continue;case"ease":f=S.frame;break;default:case"set":var x=S.props;for(o in x)l.call(x,o)&&(a=nt(x[o].value),0===o.indexOf("@")?c.setAttribute(o.substr(1),a):i.setStyle(c,o,a));continue}}else 0!==s.edge&&(Dt(c,[d,v],[g,h]),s.edge=0);for(var E=0;m-1>E;E++)if(f>=u[E].frame&&u[E+1].frame>=f){var A=u[E],F=u[E+1];for(o in A.props)if(l.call(A.props,o)){var C=(f-A.frame)/(F.frame-A.frame);C=A.props[o].easing(C),a=rt(A.props[o].value,F.props[o].value,C),a=nt(a),0===o.indexOf("@")?c.setAttribute(o.substr(1),a):i.setStyle(c,o,a)}k&&w!==E&&("down"===zt?xt(c,A.eventType,zt):xt(c,F.eventType,zt),s.lastFrameIndex=E);break}}},Z=function(){_t&&(_t=!1,Et());var e,t,n=it.getScrollTop(),o=Pt();if(pt)o>=pt.endTime?(n=pt.targetTop,e=pt.done,pt=r):(t=pt.easing((o-pt.startTime)/pt.duration),n=0|pt.startTop+t*pt.topDiff),it.setScrollTop(n,!0);else if(!ht){var a=vt.targetTop-n;a&&(vt={startTop:qt,topDiff:n-qt,targetTop:n,startTime:Lt,endTime:Lt+gt}),vt.endTime>=o&&(t=U.sqrt((o-vt.startTime)/gt),n=0|vt.startTop+t*vt.topDiff)}if(Gt&&st&&i.setStyle(st,"transform","translate(0, "+-Kt+"px) "+Tt),ht||qt!==n){zt=n>qt?"down":qt>n?"up":zt,ht=!1;var l={curTop:n,lastTop:qt,maxTop:Ot,direction:zt},s=ct.beforerender&&ct.beforerender.call(it,l);s!==!1&&(W(n,it.getScrollTop()),qt=n,ct.render&&ct.render.call(it,l)),e&&e.call(it,!1)}Lt=o},J=function(e){for(var t=0,r=e.keyFrames.length;r>t;t++){for(var n,o,a,i,l=e.keyFrames[t],s={};null!==(i=O.exec(l.props));)a=i[1],o=i[2],n=a.match(V),null!==n?(a=n[1],n=n[2]):n=k,o=o.indexOf("!")?Q(o):[o.slice(1)],s[a]={value:o,easing:U[n]};l.props=s}},Q=function(e){var t=[];return $.lastIndex=0,e=e.replace($,function(e){return e.replace(L,function(e){return 100*(e/255)+"%"})}),G&&(_.lastIndex=0,e=e.replace(_,function(e){return G+e})),e=e.replace(L,function(e){return t.push(+e),"{?}"}),t.unshift(e),t},et=function(e){var t,r,n={};for(t=0,r=e.keyFrames.length;r>t;t++)tt(e.keyFrames[t],n);for(n={},t=e.keyFrames.length-1;t>=0;t--)tt(e.keyFrames[t],n)},tt=function(e,t){var r;for(r in t)l.call(e.props,r)||(e.props[r]=t[r]);for(r in e.props)t[r]=e.props[r]},rt=function(e,t,r){var n,o=e.length;if(o!==t.length)throw"Can't interpolate between \""+e[0]+'" and "'+t[0]+'"';var a=[e[0]];for(n=1;o>n;n++)a[n]=e[n]+(t[n]-e[n])*r;return a},nt=function(e){var t=1;return M.lastIndex=0,e[0].replace(M,function(){return e[t++]})},ot=function(e,t){e=[].concat(e);for(var r,n,o=0,a=e.length;a>o;o++)n=e[o],r=lt[n[H]],r&&(t?(n.style.cssText=r.dirtyStyleAttr,Dt(n,r.dirtyClassAttr)):(r.dirtyStyleAttr=n.style.cssText,r.dirtyClassAttr=Ct(n),n.style.cssText=r.styleAttr,Dt(n,r.classAttr)))},at=function(){Tt="translateZ(0)",i.setStyle(st,"transform",Tt);var e=c(st),t=e.getPropertyValue("transform"),r=e.getPropertyValue(G+"transform"),n=t&&"none"!==t||r&&"none"!==r;n||(Tt="")};i.setStyle=function(e,t,r){var n=e.style;if(t=t.replace(z,q).replace("-",""),"zIndex"===t)n[t]=isNaN(r)?r:""+(0|r);else if("float"===t)n.styleFloat=n.cssFloat=r;else try{B&&(n[B+t.slice(0,1).toUpperCase()+t.slice(1)]=r),n[t]=r}catch(o){}};var it,lt,st,ct,ft,ut,mt,pt,dt,gt,vt,ht,yt,Tt,bt,St=i.addEvent=function(t,r,n){var o=function(t){return t=t||e.event,t.target||(t.target=t.srcElement),t.preventDefault||(t.preventDefault=function(){t.returnValue=!1,t.defaultPrevented=!0}),n.call(this,t)};r=r.split(" ");for(var a,i=0,l=r.length;l>i;i++)a=r[i],t.addEventListener?t.addEventListener(a,n,!1):t.attachEvent("on"+a,o),Yt.push({element:t,name:a,listener:n})},kt=i.removeEvent=function(e,t,r){t=t.split(" ");for(var n=0,o=t.length;o>n;n++)e.removeEventListener?e.removeEventListener(t[n],r,!1):e.detachEvent("on"+t[n],r)},wt=function(){for(var e,t=0,r=Yt.length;r>t;t++)e=Yt[t],kt(e.element,e.name,e.listener);Yt=[]},xt=function(e,t,r){ct.keyframe&&ct.keyframe.call(it,e,t,r)},Et=function(){var e=it.getScrollTop();Ot=0,ft&&!Gt&&(a.style.height=""),j(),ft&&!Gt&&(a.style.height=Ot+o.clientHeight+"px"),Gt?it.setScrollTop(s.min(it.getScrollTop(),Ot)):it.setScrollTop(e,!0),ht=!0},At=function(){var e,t,r=o.clientHeight,n={};for(e in ut)t=ut[e],"function"==typeof t?t=t.call(it):/p$/.test(t)&&(t=t.slice(0,-1)/100*r),n[e]=t;return n},Ft=function(){var e=st&&st.offsetHeight||0,t=s.max(e,a.scrollHeight,a.offsetHeight,o.scrollHeight,o.offsetHeight,o.clientHeight);return t-o.clientHeight},Ct=function(t){var r="className";return e.SVGElement&&t instanceof e.SVGElement&&(t=t[r],r="baseVal"),t[r]},Dt=function(t,n,o){var a="className";if(e.SVGElement&&t instanceof e.SVGElement&&(t=t[a],a="baseVal"),o===r)return t[a]=n,r;for(var i=t[a],l=0,s=o.length;s>l;l++)i=It(i).replace(It(o[l])," ");i=Ht(i);for(var c=0,f=n.length;f>c;c++)-1===It(i).indexOf(It(n[c]))&&(i+=" "+n[c]);t[a]=Ht(i)},Ht=function(e){return e.replace(P,"")},It=function(e){return" "+e+" "},Pt=Date.now||function(){return+new Date},Nt=function(e,t){return e.frame-t.frame},Ot=0,Vt=1,zt="down",qt=-1,Lt=Pt(),Mt=0,$t=0,_t=!1,Bt=0,Gt=!1,Kt=0,Yt=[];"function"==typeof define&&define.amd?define([],function(){return i}):"undefined"!=typeof module&&module.exports?module.exports=i:e.skrollr=i})(window,document); \ No newline at end of file