Skip to content

Commit 3da6d60

Browse files
committed
First commit
0 parents  commit 3da6d60

File tree

1,981 files changed

+411231
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,981 files changed

+411231
-0
lines changed
Binary file not shown.

Gruntfile.coffee

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
module.exports = (grunt) ->
2+
grunt.initConfig
3+
pkg: grunt.file.readJSON('package.json'),
4+
5+
watch:
6+
compass:
7+
files: ['**/*.sass']
8+
tasks: ['compass:dev']
9+
jade:
10+
files: ['**/*.jade']
11+
tasks: ['jade:compile']
12+
copy:
13+
files: ['bower.json', 'assets/images/**.*']
14+
task: ['copy:main']
15+
16+
compass:
17+
dev:
18+
options:
19+
sassDir: ['assets/stylesheets']
20+
cssDir: ['build/stylesheets']
21+
environment: 'development'
22+
23+
jade:
24+
compile:
25+
files: grunt.file.expandMapping ['**/*.jade', '!**/_*.jade'], 'build/'
26+
cwd: 'views'
27+
rename: (destBase, destPath) ->
28+
return destBase + destPath.replace /\.jade$/, '.html'
29+
30+
connect:
31+
server:
32+
options:
33+
port: 8000,
34+
base: 'build'
35+
36+
copy:
37+
main:
38+
files: [
39+
{ expand: true, cwd: 'bower_components', src: ['**'], dest: 'build/vendors' }
40+
{ expand: true, cwd: 'assets/images', src: ['**'], dest: 'build/images' }
41+
]
42+
43+
grunt.loadNpmTasks 'grunt-contrib-watch'
44+
grunt.loadNpmTasks 'grunt-contrib-compass'
45+
grunt.loadNpmTasks 'grunt-contrib-jade'
46+
grunt.loadNpmTasks 'grunt-contrib-connect'
47+
grunt.loadNpmTasks 'grunt-contrib-copy'
48+
49+
grunt.registerTask 'default', ['compass:dev', 'jade:compile', 'copy:main', 'connect', 'watch']
50+

assets/stylesheets/styles.sass

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
$color-primary: #f93f26
2+
3+
body
4+
background: #eee
5+
color: $color-primary

bower.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "starty",
3+
"version": "0.1.0",
4+
"authors": [
5+
"Daniel Duarte <[email protected]>"
6+
],
7+
"description": "a simple tiny framework for statics pages based in grunt",
8+
"license": "MIT",
9+
"ignore": [
10+
"**/.*",
11+
"node_modules",
12+
"bower_components",
13+
"test",
14+
"tests"
15+
],
16+
"dependencies": {
17+
"holderjs": "~2.3.2",
18+
"jquery": "~2.1.0"
19+
}
20+
}

bower_components/holderjs/.bower.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "holderjs",
3+
"version": "2.3.2",
4+
"main": "holder.js",
5+
"homepage": "https://github.com/imsky/holder",
6+
"_release": "2.3.2",
7+
"_resolution": {
8+
"type": "version",
9+
"tag": "v2.3.2",
10+
"commit": "f4fc0b4ac80f3bbb7502474ec1ea3f837b8b922d"
11+
},
12+
"_source": "git://github.com/imsky/holder.git",
13+
"_target": "~2.3.2",
14+
"_originalSource": "holderjs",
15+
"_direct": true
16+
}
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Automatically normalize line endings for all text-based files
2+
* text=auto

bower_components/holderjs/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
testing/
2+
.idea/
3+
node_modules/
4+
holder.min.js

bower_components/holderjs/.jshintrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"asi": true,
3+
"boss": true,
4+
"eqnull": true,
5+
"expr": true,
6+
"funcscope": true,
7+
"loopfunc": true,
8+
"shadow": true,
9+
"smarttabs": true,
10+
11+
"node": true
12+
}
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
'use strict';
2+
3+
module.exports = function(grunt) {
4+
5+
// Project configuration.
6+
grunt.initConfig({
7+
// Metadata.
8+
pkg: grunt.file.readJSON('package.json'),
9+
banner:
10+
'/*\n\n' +
11+
'<%= pkg.name %> - <%= pkg.version %> - <%= pkg.summary %>\n' +
12+
'(c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> / <%= pkg.author.url %>\n\n' +
13+
'Provided under the <%= pkg.license.type %> License: <%= pkg.license.url %>\n' +
14+
'Commercial use requires attribution.\n\n' +
15+
'*/\n',
16+
// Task configuration.
17+
jshint: {
18+
options: {
19+
jshintrc: '.jshintrc'
20+
},
21+
gruntfile: {
22+
src: 'Gruntfile.js'
23+
},
24+
src: {
25+
src: ['holder.js']
26+
}
27+
},
28+
uglify: {
29+
options: {
30+
banner: '<%= banner %>'
31+
},
32+
dist: {
33+
src: 'holder.js',
34+
dest: 'holder.min.js'
35+
}
36+
}
37+
});
38+
39+
// These plugins provide necessary tasks.
40+
grunt.loadNpmTasks('grunt-contrib-uglify');
41+
grunt.loadNpmTasks('grunt-contrib-jshint');
42+
43+
44+
// Default task.
45+
grunt.registerTask('default', ['jshint', 'uglify']);
46+
};

bower_components/holderjs/README.md

+218
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
Holder
2+
======
3+
4+
![](http://imsky.github.io/holder/images/header.png)
5+
6+
Holder uses SVG and `canvas` to render image placeholders on the client side.
7+
8+
[Bootstrap](http://getbootstrap.com) uses Holder in documentation.
9+
10+
You can install Holder using [Bower](http://bower.io/): `bower install holderjs`
11+
12+
How to use it
13+
-------------
14+
15+
Include ``holder.js`` in your HTML:
16+
17+
```html
18+
<script src="holder.js"></script>
19+
```
20+
21+
Holder will then process all images with a specific ``src`` attribute, like this one:
22+
23+
```html
24+
<img src="holder.js/200x300">
25+
```
26+
27+
The above tag will render as a placeholder 200 pixels wide and 300 pixels tall.
28+
29+
To avoid console 404 errors, you can use ``data-src`` instead of ``src``.
30+
31+
Theming
32+
-------
33+
34+
![](http://imsky.github.io/holder/images/holder_sky.png)![](http://imsky.github.io/holder/images/holder_vine.png)![](http://imsky.github.io/holder/images/holder_lava.png)
35+
36+
Holder includes support for themes, to help placeholders blend in with your layout.
37+
38+
There are 6 default themes: ``sky``, ``vine``, ``lava``, ``gray``, ``industrial``, and ``social``. Use them like so:
39+
40+
```html
41+
<img src="holder.js/200x300/sky">
42+
```
43+
44+
Customizing themes
45+
------------------
46+
47+
Themes have 4 properties: ``foreground``, ``background``, ``size``, and ``font``. The ``size`` property specifies the minimum font size for the theme. You can create a sample theme like this:
48+
49+
```js
50+
Holder.add_theme("dark", {background:"#000", foreground:"#aaa", size:11, font: "Monaco"})
51+
```
52+
53+
Using custom themes
54+
-------------------
55+
56+
There are two ways to use custom themes with Holder:
57+
58+
* Include theme at runtime to render placeholders already using the theme name
59+
* Include theme at any point and re-render placeholders that are using the theme name
60+
61+
The first approach is the easiest. After you include ``holder.js``, add a ``script`` tag that adds the theme you want:
62+
63+
```html
64+
<script src="holder.js"></script>
65+
<script> Holder.add_theme("bright", { background: "white", foreground: "gray", size: 12 })</script>
66+
```
67+
68+
The second approach requires that you call ``run`` after you add the theme, like this:
69+
70+
```js
71+
Holder.add_theme("bright", { background: "white", foreground: "gray", size: 12}).run()
72+
```
73+
74+
Using custom themes and domain on specific images
75+
-------------------------------------------------
76+
77+
You can use Holder in different areas on different images with custom themes:
78+
79+
```html
80+
<img data-src="example.com/100x100/simple" id="new">
81+
```
82+
83+
```js
84+
Holder.run({
85+
domain: "example.com",
86+
themes: {
87+
"simple":{
88+
background:"#fff",
89+
foreground:"#000",
90+
size:12
91+
}
92+
},
93+
images: "#new"
94+
})
95+
```
96+
97+
Using custom colors on specific images
98+
--------------------------------------
99+
100+
Custom colors on a specific image can be specified in the ``background:foreground`` format using hex notation, like this:
101+
102+
```html
103+
<img data-src="holder.js/100x200/#000:#fff">
104+
```
105+
106+
The above will render a placeholder with a black background and white text.
107+
108+
Custom text
109+
-----------
110+
111+
You can specify custom text using the ``text:`` operator:
112+
113+
```html
114+
<img data-src="holder.js/200x200/text:hello world">
115+
```
116+
117+
If you have a group of placeholders where you'd like to use particular text, you can do so by adding a ``text`` property to the theme:
118+
119+
```js
120+
Holder.add_theme("thumbnail", { background: "#fff", text: "Thumbnail" })
121+
```
122+
123+
Fluid placeholders
124+
------------------
125+
126+
Specifying a dimension in percentages creates a fluid placeholder that responds to media queries.
127+
128+
```html
129+
<img data-src="holder.js/100%x75/social">
130+
```
131+
132+
By default, the fluid placeholder will show its current size in pixels. To display the original dimensions, i.e. 100%x75, set the ``textmode`` flag to ``literal`` like so: `holder.js/100%x75/textmode:literal`.
133+
134+
Automatically sized placeholders
135+
--------------------------------
136+
137+
If you'd like to avoid Holder enforcing an image size, use the ``auto`` flag like so:
138+
139+
```html
140+
<img data-src="holder.js/200x200/auto">
141+
```
142+
143+
The above will render a placeholder without any embedded CSS for height or width.
144+
145+
To show the current size of an automatically sized placeholder, set the ``textmode`` flag to ``exact`` like so: `holder.js/200x200/auto/textmode:exact`.
146+
147+
Background placeholders
148+
-----------------------
149+
150+
Holder can render placeholders as background images for elements with the `holderjs` class, like this:
151+
152+
```css
153+
#sample {background:url(?holder.js/200x200/social) no-repeat}
154+
```
155+
156+
```html
157+
<div id="sample" class="holderjs"></div>
158+
```
159+
160+
The Holder URL in CSS should have a `?` in front. You can change the default class by specifying a selector as the `bgnodes` property when calling `Holder.run`.
161+
162+
Customizing only the settings you need
163+
--------------------------------------
164+
165+
Holder extends its default settings with the settings you provide, so you only have to include those settings you want changed. For example, you can run Holder on a specific domain like this:
166+
167+
```js
168+
Holder.run({domain:"example.com"})
169+
```
170+
171+
Using custom settings on load
172+
-----------------------------
173+
174+
You can prevent Holder from running its default configuration by executing ``Holder.run`` with your custom settings right after including ``holder.js``. However, you'll have to execute ``Holder.run`` again to render any placeholders that use the default configuration.
175+
176+
Inserting an image with optional custom theme
177+
---------------------------------------------
178+
179+
You can add a placeholder programmatically by chaining Holder calls:
180+
181+
```js
182+
Holder.add_theme("new",{foreground:"#ccc", background:"#000", size:10}).add_image("holder.js/200x100/new", "body").run()
183+
```
184+
185+
The first argument in ``add_image`` is the ``src`` attribute, and the second is a CSS selector of the parent element.
186+
187+
Changing rendering engine
188+
-------------------------
189+
190+
By default, Holder renders placeholders using SVG, however it has a fallback `canvas` engine that it uses in case the browser lacks SVG support. If you'd like to force `canvas` rendering, you can do it like so:
191+
192+
```js
193+
Holder.run({use_canvas:true})
194+
```
195+
196+
Using with ``lazyload.js``
197+
--------------------------
198+
199+
Holder is compatible with ``lazyload.js`` and works with both fluid and fixed-width images. For best results, run `.lazyload({skip_invisible:false})`.
200+
201+
Browser support
202+
---------------
203+
204+
* Chrome
205+
* Firefox 3+
206+
* Safari 4+
207+
* Internet Explorer 6+ (with fallback for older IE)
208+
* Android (with fallback)
209+
210+
License
211+
-------
212+
213+
Holder is provided under the [MIT License](http://opensource.org/licenses/MIT).
214+
215+
Credits
216+
-------
217+
218+
Holder is a project by [Ivan Malopinsky](http://imsky.co).

bower_components/holderjs/bower.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "holderjs",
3+
"version": "2.3.2",
4+
"main": "holder.js"
5+
}

0 commit comments

Comments
 (0)