mirror of
https://github.com/RustyRaptor/git-guide.git
synced 2026-12-03 15:35:19 -07:00
initial work
This commit is contained in:
1 parent
d2f90c0963
commit
1ce700832b
6 files changed
+1026
-1
No files matched your search
Vendored
+439
@@ -0,0 +1,439 @@
|
||||
/*! normalize.css 2011-08-31T22:02 UTC · http://github.com/necolas/normalize.css */
|
||||
|
||||
/* =============================================================================
|
||||
HTML5 display definitions
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Corrects block display not defined in IE6/7/8/9 & FF3
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
nav,
|
||||
section {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Corrects inline-block display not defined in IE6/7/8/9 & FF3
|
||||
*/
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
video {
|
||||
display: inline-block;
|
||||
*display: inline;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevents modern browsers from displaying 'audio' without controls
|
||||
*/
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4
|
||||
* Known issue: no IE6 support
|
||||
*/
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Base
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units
|
||||
* http://clagnut.com/blog/348/#c790
|
||||
* 2. Keeps page centred in all browsers regardless of content height
|
||||
* 3. Prevents iOS text size adjust after orientation change, without disabling user zoom
|
||||
* www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
|
||||
*/
|
||||
|
||||
html {
|
||||
font-size: 100%; /* 1 */
|
||||
overflow-y: scroll; /* 2 */
|
||||
-webkit-text-size-adjust: 100%; /* 3 */
|
||||
-ms-text-size-adjust: 100%; /* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses margins handled incorrectly in IE6/7
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses font-family inconsistency between 'textarea' and other form elements.
|
||||
*/
|
||||
|
||||
body,
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Links
|
||||
========================================================================== */
|
||||
|
||||
a {
|
||||
color: #00e;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #551a8b;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses outline displayed oddly in Chrome
|
||||
*/
|
||||
|
||||
a:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Improves readability when focused and also mouse hovered in all browsers
|
||||
* people.opera.com/patrickl/experiments/keyboard/test
|
||||
*/
|
||||
|
||||
a:hover,
|
||||
a:active {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Typography
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Addresses styling not present in IE7/8/9, S5, Chrome
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: 1px dotted;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses style set to 'bolder' in FF3/4, S4/5, Chrome
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses styling not present in S5, Chrome
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/*
|
||||
* Addresses styling not present in IE6/7/8/9
|
||||
*/
|
||||
|
||||
mark {
|
||||
background: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/*
|
||||
* Corrects font family set oddly in IE6, S4/5, Chrome
|
||||
* en.wikipedia.org/wiki/User:Davidgothberg/Test59
|
||||
*/
|
||||
|
||||
pre,
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: monospace, serif;
|
||||
_font-family: 'courier new', monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/*
|
||||
* Improves readability of pre-formatted text in all browsers
|
||||
*/
|
||||
|
||||
pre {
|
||||
white-space: pre;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Addresses CSS quotes not supported in IE6/7
|
||||
* 2. Addresses quote property not supported in S4
|
||||
*/
|
||||
|
||||
/* 1 */
|
||||
|
||||
q {
|
||||
quotes: none;
|
||||
}
|
||||
|
||||
/* 2 */
|
||||
|
||||
q:before,
|
||||
q:after {
|
||||
content: '';
|
||||
content: none;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 75%;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevents sub and sup affecting line-height in all browsers
|
||||
* gist.github.com/413930
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Lists
|
||||
========================================================================== */
|
||||
|
||||
ul,
|
||||
ol {
|
||||
margin: 1em 0;
|
||||
padding: 0 0 0 40px;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0 0 0 40px;
|
||||
}
|
||||
|
||||
nav ul,
|
||||
nav ol {
|
||||
list-style: none;
|
||||
list-style-image: none;
|
||||
}
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* 1. Removes border when inside 'a' element in IE6/7/8/9, F3
|
||||
* 2. Improves image quality when scaled in IE7
|
||||
* code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
|
||||
*/
|
||||
|
||||
img {
|
||||
border: 0; /* 1 */
|
||||
-ms-interpolation-mode: bicubic; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Corrects overflow displayed oddly in IE9
|
||||
*/
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Figures
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Addresses margin not present in IE6/7/8/9, S5, O11
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Forms
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Corrects margin displayed oddly in IE6/7
|
||||
*/
|
||||
|
||||
form {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Define consistent margin and padding
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Corrects color not being inherited in IE6/7/8/9
|
||||
* 2. Corrects alignment displayed oddly in IE6/7
|
||||
*/
|
||||
|
||||
legend {
|
||||
border: 0; /* 1 */
|
||||
*margin-left: -7px; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Corrects font size not being inherited in all browsers
|
||||
* 2. Addresses margins set differently in IE6/7, F3/4, S5, Chrome
|
||||
* 3. Improves appearance and consistency in all browsers
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font-size: 100%; /* 1 */
|
||||
margin: 0; /* 2 */
|
||||
vertical-align: baseline; /* 3 */
|
||||
*vertical-align: middle; /* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Addresses FF3/4 setting line-height using !important in the UA stylesheet
|
||||
* 2. Corrects inner spacing displayed oddly in IE6/7
|
||||
*/
|
||||
|
||||
button,
|
||||
input {
|
||||
line-height: normal; /* 1 */
|
||||
*overflow: visible; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Corrects overlap and whitespace issue for buttons and inputs in IE6/7
|
||||
* Known issue: reintroduces inner spacing
|
||||
*/
|
||||
|
||||
table button,
|
||||
table input {
|
||||
*overflow: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Improves usability and consistency of cursor style between image-type 'input' and others
|
||||
* 2. Corrects inability to style clickable 'input' types in iOS
|
||||
*/
|
||||
|
||||
button,
|
||||
html input[type="button"],
|
||||
input[type="reset"],
|
||||
input[type="submit"] {
|
||||
cursor: pointer; /* 1 */
|
||||
-webkit-appearance: button; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Addresses box sizing set to content-box in IE8/9
|
||||
* 2. Addresses excess padding in IE8/9
|
||||
*/
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Addresses appearance set to searchfield in S5, Chrome
|
||||
* 2. Addresses box sizing set to border-box in S5, Chrome (include -moz to future-proof)
|
||||
*/
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box; /* 2 */
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
/*
|
||||
* Corrects inner padding displayed oddly in S5, Chrome on OSX
|
||||
*/
|
||||
|
||||
input[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/*
|
||||
* Corrects inner padding and border displayed oddly in FF3/4
|
||||
* www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. Removes default vertical scrollbar in IE6/7/8/9
|
||||
* 2. Improves readability and alignment in all browsers
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto; /* 1 */
|
||||
vertical-align: top; /* 2 */
|
||||
}
|
||||
|
||||
|
||||
/* =============================================================================
|
||||
Tables
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Remove most spacing between table cells
|
||||
*/
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
COLORS
|
||||
|
||||
Dark Blue #222438
|
||||
Medium Blue #69697A
|
||||
Light Blue #C5C3DE
|
||||
Yellow #FFB000
|
||||
Red #D92B00
|
||||
|
||||
*/
|
||||
|
||||
body {
|
||||
background: #FFF;
|
||||
font-family: Georgia, Times New Roman, Times, serif;
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
margin-top: 60px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 80px;
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
font-family: 'Cabin Condensed', sans-serif;
|
||||
color: #000;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 100px;
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
color: #FFB000;
|
||||
font-family: 'Cabin Condensed', sans-serif;
|
||||
text-transform: lowercase;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 40px;
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
color: #D92B00;
|
||||
text-shadow: 0 2px 1px #000;
|
||||
font-family: 'Alfa Slab One', cursive;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
p {
|
||||
width: 80%;
|
||||
margin: 40px auto;
|
||||
color: #000;
|
||||
line-height: 200%;
|
||||
}
|
||||
|
||||
a, a:visited {
|
||||
color: #D92B00;
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.download {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
pre {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
text-align: left;
|
||||
width: 720px;
|
||||
margin: 10px auto;
|
||||
background: #C5C3DE;
|
||||
border: solid 2px #69697A;
|
||||
padding: 0 40px;
|
||||
}
|
||||
|
||||
code {
|
||||
background-color: #000;
|
||||
font-style: normal;
|
||||
border-radius: 10px;
|
||||
color: white;
|
||||
padding: 5px 15px;
|
||||
font-family: menlo, monospace;
|
||||
}
|
||||
|
||||
/*---------------------------------------- BLOCKS */
|
||||
|
||||
.scrollblock {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
color: white;
|
||||
padding-top: 50px;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
.scrollblock h2 {
|
||||
|
||||
}
|
||||
|
||||
.block-title { background-color: #FFF; padding-bottom: 500px; }
|
||||
.block-title h2 { color: #000; }
|
||||
.block-setup { background-color: #348fd4; }
|
||||
.block-setup h2 { color: #06406c; }
|
||||
.block-setup a { color: #FFF; font-size: 40px; font-weight: normal;font-style: normal; background-color: #06406c; padding: 10px 15px; border-radius: 10px; text-decoration: none; }
|
||||
.block-setup a:hover { text-decoration: underline; }
|
||||
.block-create { background-color: #06406c; }
|
||||
.block-create h2 { color: #FFF; }
|
||||
.block-create p { color: #FFF; }
|
||||
.block-create code { background-color: #000; color: #FFF; }
|
||||
.block-checkout { background-color: #FFF; }
|
||||
.block-checkout h2 { color: #000; }
|
||||
.block-trees { background-color: #4c0d09; }
|
||||
.block-trees h2 { color: #d3b2af; }
|
||||
.block-trees p { color: #d3b2af; }
|
||||
.block-trees code { color: #000; background-color: white; }
|
||||
.block-add { background-color: #cc4037; }
|
||||
.block-add h2, .block-add p { color: #4c0d09; }
|
||||
.block-remote { background-color: #ffc19f; }
|
||||
.block-remote h2 { color: #cc4037; }
|
||||
.block-branching { background-color: #000; }
|
||||
.block-branching h2 { color: #FFF; }
|
||||
.block-branching p { color: #DDD; }
|
||||
.block-branching code { color: #000; background-color: white; }
|
||||
.block-merging { background-color: #F2F2F2; }
|
||||
.block-merging h2 { color: #666; }
|
||||
.block-tagging { background-color: #F2F2F2; }
|
||||
.block-tagging h2 { color: #FFF; }
|
||||
.block-hints { background-color: #F2F2F2; }
|
||||
.block-hints h2 { color: #FFF; }
|
||||
.block-resources { background-color: #F2F2F2; }
|
||||
.block-resources h2 { color: #FFF; }
|
||||
.block-tagging { background-color: #348fd4; }
|
||||
.block-tagging h2 { color: #06406c; }
|
||||
.block-hints { background-color: #06406c; }
|
||||
.block-hints h2 { color: #FFF; }
|
||||
.block-hints p { color: #FFF; }
|
||||
.block-hints code { background-color: #000; color: #FFF; }
|
||||
.block-revert { background-color: #fff8c9; }
|
||||
.block-revert h2 { color: #2d2700; }
|
||||
.block-revert p { color: #615400; }
|
||||
+136
-1
@@ -1 +1,136 @@
|
||||
My GitHub Page
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>scrollorama</title>
|
||||
<link href='http://fonts.googleapis.com/css?family=Alfa+Slab+One' rel='stylesheet' type='text/css'>
|
||||
<link href='http://fonts.googleapis.com/css?family=Cabin+Condensed:700' rel='stylesheet' type='text/css'>
|
||||
<link href='http://fonts.googleapis.com/css?family=Oldenburg' rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" href="css/normalize.css" type="text/css">
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||
<script src="js/jquery-1.7.1.min.js"></script>
|
||||
<script src="js/jquery.lettering-0.6.1.min.js"></script>
|
||||
<script src="js/jquery.scrollorama.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="scrollblock block-title">
|
||||
<h1>git - the simple guide</h1>
|
||||
<p>just a simple guide for getting started with git. no deep shit ;)</p>
|
||||
</div>
|
||||
<!-- setup -->
|
||||
<div class="scrollblock block-setup">
|
||||
<h2>setup</h2>
|
||||
<p>
|
||||
<a href="http://code.google.com/p/git-osx-installer/downloads/list?can=3">Download git for OSX</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://code.google.com/p/msysgit/downloads/list?can=3">Download git for Windows</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="scrollblock block-create">
|
||||
<h2>create a new repository</h2>
|
||||
<p>
|
||||
create a new directory, open it and perform a <br />
|
||||
<code>git init</code><br />
|
||||
to create a new git repository.
|
||||
</p>
|
||||
</div>
|
||||
<div class="scrollblock block-checkout">
|
||||
<h2>checkout a repository</h2>
|
||||
<p>
|
||||
create a working copy of a local repository by running the command<br />
|
||||
<code>git clone /tmp/example</code><br />
|
||||
when using a remote server, your command will be<br />
|
||||
<code>git clone username@host:/path/to/repo</code>
|
||||
</p>
|
||||
</div>
|
||||
<div class="scrollblock block-trees">
|
||||
<h2>theory</h2>
|
||||
<p>
|
||||
your local repository consists of three "trees" maintained by git.
|
||||
the first one is your <code>Working Directory</code> which holds the actual files.
|
||||
the second one is the <code>Index</code> which acts as a staging area and
|
||||
finally the <code>HEAD</code> which points to the last commit you've made.
|
||||
</p>
|
||||
</div>
|
||||
<div class="scrollblock block-add">
|
||||
<h2>add & commit</h2>
|
||||
<p>
|
||||
You can propose changes (add it to the <b>Index</b>) using<br />
|
||||
<code>git add <filename></code><br />
|
||||
This is the first step in the basic git workflow. To actually commit these changes use<br />
|
||||
<code>git commit -m "Commit message"</code><br />
|
||||
Now the file is committed to the <b>HEAD</b>, but not in your remote repository yet.
|
||||
</p>
|
||||
</div>
|
||||
<div class="scrollblock block-remote">
|
||||
<h2>pushing & pulling</h2>
|
||||
<p>
|
||||
Your changes are now in the <b>HEAD</b> of your local working copy. To send those changes to your remote repository, you need to perform a<br />
|
||||
<code>git push origin master</code><br />
|
||||
which is the equivalent to an <i>svn commit</i>. Change <i>master</i> to whatever branch you want to push your changes to.
|
||||
</p>
|
||||
</div>
|
||||
<div class="scrollblock block-branching">
|
||||
<h2>branching</h2>
|
||||
<p>
|
||||
Branches are used to develop features isolated from the <i>master</i> branch. You should <b>never</b> commit directly to the <i>master</i> branch. Use other branches and merge them back to the master branch. So, the master branch will be kept clean.
|
||||
</p>
|
||||
<p>
|
||||
create a new branch named "feature_x" using<br />
|
||||
<code>git checkout -b feature_x</code><br />
|
||||
rename it to "abc" using<br />
|
||||
<code>git branch -m feature_x abc</code><br />
|
||||
or delete it<br />
|
||||
<code>git branch -d feature_x</code><br />
|
||||
a branch is <i>not available to others</i> unless you push the branch to your remote repository<br />
|
||||
<code>git push origin <branch></code>
|
||||
</p>
|
||||
</div>
|
||||
<div class="scrollblock block-merging">
|
||||
<h2>update & merge</h2>
|
||||
<p>
|
||||
to update your local repository to the newest commit, execute <br />
|
||||
<code>git pull</code><br />
|
||||
in your working directory to <i>fetch</i> and <i>merge</i> remote changes.<br />
|
||||
to merge another branch into your active branch (e.g. master), use<br />
|
||||
<code>git merge <branch></code><br />
|
||||
in both cases git tries to auto-merge changes. Unfortunately, this is not always possible and results in <i>conflicts</i>.
|
||||
You are responsible to merge those <i>conflicts</i>
|
||||
manually by editing the files shown by git. After changing, you need to mark them as merged with<br />
|
||||
<code>git add <filename></code><br />
|
||||
before merging changes, you can also preview them by using<br />
|
||||
<code>git diff <source_branch> <target_branch></code>
|
||||
</p>
|
||||
</div>
|
||||
<div class="scrollblock block-tagging">
|
||||
<h2>tagging</h2>
|
||||
<p>
|
||||
it's recommended to create tags for software releases. this is a known concept, which also exists in SVN. You can create a new tag named <i>1.0.0</i> by executing<br />
|
||||
<code>git tag 1.0.0 1b2e1d63ff</code><br />
|
||||
the <i>1b2e1d63ff</i> stands for the first 10 characters of the commit id you want to reference with your tag. You can get the commit id with <br />
|
||||
<code>git log</code>
|
||||
</p>
|
||||
</div>
|
||||
<div class="scrollblock block-revert">
|
||||
<h2>reverting changes</h2>
|
||||
<p>
|
||||
In case you did something wrong (which for sure never happens ;) you can revert changes using the command<br />
|
||||
<code>git reset --hard HEAD</code><br />
|
||||
this reverts your local repository (working dir, index and HEAD) to the last remote version. if you want to keep your working version, use <i>--mixed</i> instead of <i>--hard</i>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="scrollblock block-hints">
|
||||
<h2>useful hints</h2>
|
||||
<p>
|
||||
use colorful git output<br />
|
||||
<code>git config color.ui</code><br />
|
||||
show log on just one line per commit<br />
|
||||
<code>git config format.pretty oneline</code><br />
|
||||
use interactive adding<br />
|
||||
<code>git add -i</code>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
/*! jQuery v1.7.1 jquery.com | jquery.org/license */
|
||||
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;iLine truncated
|
||||
f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.cLine truncated
|
||||
{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacitLine truncated
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
/* Lettering.JS 0.6.1 by Dave Rupert - http://daverupert.com */
|
||||
(function($){function injector(t,splitter,klass,after){var a=t.text().split(splitter),inject='';if(a.length){$(a).each(function(i,item){inject+='<span class="'+klass+(i+1)+'">'+item+'</span>'+after});t.empty().append(inject)}}var methods={init:function(){return this.each(function(){injector($(this),'','char','')})},words:function(){return this.each(function(){injector($(this),' ','word',' ')})},lines:function(){return this.each(function(){var r="eefec303079ad17405c889e092e105b0";injector($(this).children("br").replaceWith(r).end(),r,'line','')})}};$.fn.lettering=function(method){if(method&&methods[method]){return methods[method].apply(this,[].slice.call(arguments,1))}else if(method==='letters'||!method){return methods.init.apply(this,[].slice.call(arguments,0))}$.error('Method '+method+' does not exist on jQuery.lettering');return this}})(jQuery);
|
||||
@@ -0,0 +1,299 @@
|
||||
/*
|
||||
scrollorama - The jQuery plugin for doing cool scrolly stuff
|
||||
by John Polacek (@johnpolacek)
|
||||
|
||||
Dual licensed under MIT and GPL.
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.scrollorama = function(options) {
|
||||
|
||||
// PRIVATE VARS
|
||||
var blocks = [],
|
||||
browserPrefix = '',
|
||||
onBlockChange = function() {};
|
||||
|
||||
var scrollorama = this;
|
||||
|
||||
var defaults = {offset:0};
|
||||
|
||||
scrollorama.settings = $.extend({}, defaults, options);
|
||||
scrollorama.blockIndex = 0;
|
||||
|
||||
if (options.blocks === undefined) alert('ERROR: Must assign blocks class selector to scrollorama plugin');
|
||||
|
||||
// PRIVATE FUNCTIONS
|
||||
function init() {
|
||||
if (typeof scrollorama.settings.blocks === 'string') scrollorama.settings.blocks = $(scrollorama.settings.blocks);
|
||||
|
||||
// set browser prefix
|
||||
if ($.browser.mozilla) browserPrefix = '-moz-';
|
||||
if ($.browser.webkit) browserPrefix = '-webkit-';
|
||||
if ($.browser.opera) browserPrefix = '-o-';
|
||||
if ($.browser.msie) browserPrefix = '-ms-';
|
||||
|
||||
// create blocks array to contain animation props
|
||||
$('body').css('position','relative');
|
||||
|
||||
var i;
|
||||
for (i=0; i<scrollorama.settings.blocks.length; i++) {
|
||||
var block = scrollorama.settings.blocks.eq(i);
|
||||
blocks.push({
|
||||
block: block,
|
||||
top: block.offset().top,
|
||||
pin: 0,
|
||||
animations:[]
|
||||
});
|
||||
}
|
||||
|
||||
// convert block elements to absolute position
|
||||
for (i=0; i<blocks.length; i++) {
|
||||
blocks[i].block
|
||||
.css('position', 'absolute')
|
||||
.css('top', blocks[i].top);
|
||||
}
|
||||
|
||||
$("body").prepend("<div id='scroll-wrap'></div>");
|
||||
|
||||
var didScroll = false;
|
||||
$(window).scroll(function(){
|
||||
didScroll = true;
|
||||
});
|
||||
setInterval(function(){
|
||||
if(didScroll){
|
||||
onScrollorama();
|
||||
didScroll = false;
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
|
||||
function onScrollorama() {
|
||||
var scrollTop = $(window).scrollTop();
|
||||
var currBlockIndex = getCurrBlockIndex(scrollTop);
|
||||
|
||||
// update all animations
|
||||
for (var i=0; i<blocks.length; i++) {
|
||||
|
||||
// go through the animations for each block
|
||||
if (blocks[i].animations.length) {
|
||||
for (var j=0; j<blocks[i].animations.length; j++) {
|
||||
var anim = blocks[i].animations[j];
|
||||
|
||||
// if above current block, settings should be at start value
|
||||
if (i > currBlockIndex) {
|
||||
if (currBlockIndex != i-1 && anim.baseline != 'bottom') {
|
||||
setProperty(anim.element, anim.property, anim.startVal);
|
||||
}
|
||||
if (blocks[i].pin) {
|
||||
blocks[i].block
|
||||
.css('position', 'absolute')
|
||||
.css('top', blocks[i].top);
|
||||
}
|
||||
}
|
||||
|
||||
// if below current block, settings should be at end value
|
||||
// unless on an element that gets animated when it hits the bottom of the viewport
|
||||
else if (i < currBlockIndex) {
|
||||
setProperty(anim.element, anim.property, anim.endVal);
|
||||
if (blocks[i].pin) {
|
||||
blocks[i].block
|
||||
.css('position', 'absolute')
|
||||
.css('top', (blocks[i].top + blocks[i].pin));
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise, set values per scroll position
|
||||
if (i == currBlockIndex || (currBlockIndex == i-1 && anim.baseline == 'bottom')) {
|
||||
// if block gets pinned, set position fixed
|
||||
if (blocks[i].pin && currBlockIndex == i) {
|
||||
blocks[i].block
|
||||
.css('position', 'fixed')
|
||||
.css('top', 0);
|
||||
}
|
||||
|
||||
// set start and end animation positions
|
||||
var startAnimPos = blocks[i].top + anim.delay;
|
||||
if (anim.baseline == 'bottom') startAnimPos -= $(window).height();
|
||||
var endAnimPos = startAnimPos + anim.duration;
|
||||
|
||||
// if scroll is before start of animation, set to start value
|
||||
if (scrollTop < startAnimPos) setProperty(anim.element, anim.property, anim.startVal);
|
||||
|
||||
// if scroll is after end of animation, set to end value
|
||||
else if (scrollTop > endAnimPos) {
|
||||
setProperty(anim.element, anim.property, anim.endVal);
|
||||
if (blocks[i].pin) {
|
||||
blocks[i].block
|
||||
.css('position', 'absolute')
|
||||
.css('top', (blocks[i].top + blocks[i].pin));
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise, set value based on scroll
|
||||
else {
|
||||
// calculate percent to animate
|
||||
var animPercent = (scrollTop - startAnimPos) / anim.duration;
|
||||
// then multiply the percent by the value range and calculate the new value
|
||||
var animVal = anim.startVal + (animPercent * (anim.endVal - anim.startVal));
|
||||
setProperty(anim.element, anim.property, animVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// update blockIndex and trigger event if changed
|
||||
if (scrollorama.blockIndex != currBlockIndex) {
|
||||
scrollorama.blockIndex = currBlockIndex;
|
||||
onBlockChange();
|
||||
}
|
||||
}
|
||||
|
||||
function getCurrBlockIndex(scrollTop) {
|
||||
var currBlockIndex = 0;
|
||||
for (var i=0; i<blocks.length; i++) {
|
||||
// check if block is in view
|
||||
if (blocks[i].top <= scrollTop - scrollorama.settings.offset) currBlockIndex = i;
|
||||
}
|
||||
return currBlockIndex;
|
||||
}
|
||||
|
||||
function setProperty(target, prop, val) {
|
||||
if (prop === 'rotate' || prop === 'zoom' || prop === 'scale') {
|
||||
if (prop === 'rotate') {
|
||||
target.css(browserPrefix+'transform', 'rotate('+val+'deg)');
|
||||
} else if (prop === 'zoom' || prop === 'scale') {
|
||||
var scaleCSS = 'scale('+val+')';
|
||||
if (browserPrefix !== '-ms-') {
|
||||
target.css(browserPrefix+'transform', scaleCSS);
|
||||
} else {
|
||||
target.css('zoom', scaleCSS);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
target.css(prop, val);
|
||||
}
|
||||
}
|
||||
|
||||
// PUBLIC FUNCTIONS
|
||||
scrollorama.animate = function(target) {
|
||||
/*
|
||||
target = animation target
|
||||
arguments = array of animation parameters
|
||||
|
||||
animation parameters:
|
||||
delay = amount of scrolling (in pixels) before animation starts
|
||||
duration = amount of scrolling (in pixels) over which the animation occurs
|
||||
property = css property being animated
|
||||
start = start value of the property
|
||||
end = end value of the property
|
||||
pin = pin block during animation duration (applies to all animations within block)
|
||||
baseline = top (default, when block reaches top of viewport) or bottom (when block first comies into view)
|
||||
*/
|
||||
|
||||
// if string, convert to DOM object
|
||||
if (typeof target === 'string') target = $(target);
|
||||
|
||||
// find block of target
|
||||
var targetIndex;
|
||||
var targetBlock;
|
||||
for (var i=0; i<blocks.length; i++) {
|
||||
if (blocks[i].block.has(target).length) {
|
||||
targetBlock = blocks[i];
|
||||
targetIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
// add each animation to the blocks animations array
|
||||
for (i=1; i<arguments.length; i++) {
|
||||
|
||||
var anim = arguments[i];
|
||||
|
||||
// for top/left/right/bottom, set relative positioning if static
|
||||
if (anim.property == 'top' || anim.property == 'left' || anim.property == 'bottom' || anim.property == 'right' ) {
|
||||
|
||||
if (target.css('position') == 'static') target.css('position','relative');
|
||||
|
||||
// set anim.start, anim.end defaults
|
||||
if (anim.start === undefined) anim.start = 0;
|
||||
else if (anim.end === undefined) anim.end = 0;
|
||||
}
|
||||
|
||||
// set anim.start/anim.end defaults for rotate, zoom/scale, letter-spacing
|
||||
if (anim.property == 'rotate') {
|
||||
if (anim.start === undefined) anim.start = 0;
|
||||
if (anim.end === undefined) anim.end = 0;
|
||||
} else if (anim.property == 'zoom' || anim.property == 'scale' ) {
|
||||
if (anim.start === undefined) anim.start = 1;
|
||||
if (anim.end === undefined) anim.end = 1;
|
||||
} else if (anim.property == 'letter-spacing' && target.css(anim.property)) {
|
||||
if (anim.start === undefined) anim.start = 1;
|
||||
if (anim.end === undefined) anim.end = 1;
|
||||
}
|
||||
|
||||
if (anim.baseline === undefined) {
|
||||
if (anim.pin || targetBlock.pin || targetIndex === 0) anim.baseline = 'top';
|
||||
else anim.baseline = 'bottom';
|
||||
}
|
||||
|
||||
if (anim.delay === undefined) anim.delay = 0;
|
||||
|
||||
targetBlock.animations.push({
|
||||
element: target,
|
||||
delay: anim.delay,
|
||||
duration: anim.duration,
|
||||
property: anim.property,
|
||||
startVal: anim.start !== undefined ? anim.start : parseInt(target.css(anim.property),10), // if undefined, use current css value
|
||||
endVal: anim.end !== undefined ? anim.end : parseInt(target.css(anim.property),10), // if undefined, use current css value
|
||||
baseline: anim.baseline !== undefined ? anim.baseline : 'bottom'
|
||||
});
|
||||
|
||||
if (anim.pin) {
|
||||
if (targetBlock.pin < anim.duration + anim.delay) {
|
||||
var offset = anim.duration + anim.delay - targetBlock.pin;
|
||||
targetBlock.pin += offset;
|
||||
|
||||
// adjust positions of blocks below target block
|
||||
for (var j=targetIndex+1; j<blocks.length; j++) {
|
||||
blocks[j].top += offset;
|
||||
blocks[j].block.css('top', blocks[j].top);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onScrollorama();
|
||||
};
|
||||
|
||||
// function for passing blockChange event callback
|
||||
scrollorama.onBlockChange = function(f) {
|
||||
onBlockChange = f;
|
||||
};
|
||||
|
||||
// function for getting an array of scrollpoints
|
||||
// (top of each animation block and animation element scroll start point)
|
||||
scrollorama.getScrollpoints = function() {
|
||||
var scrollpoints = [];
|
||||
for (var i=0; i<blocks.length; i++) {
|
||||
scrollpoints.push(blocks[i].top);
|
||||
// go through the animations for each block
|
||||
if (blocks[i].animations.length && blocks[i].pin > 0) {
|
||||
for (var j=0; j<blocks[i].animations.length; j++) {
|
||||
var anim = blocks[i].animations[j];
|
||||
scrollpoints.push(blocks[i].top + anim.delay + anim.duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
// make sure scrollpoints are in numeric order
|
||||
scrollpoints.sort(function(a,b){return a - b;});
|
||||
return scrollpoints;
|
||||
};
|
||||
|
||||
|
||||
// INIT
|
||||
init();
|
||||
|
||||
return scrollorama;
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
Reference in new issue
Block a user