Skip to content

Commit 040f68a

Browse files
committed
Init
1 parent 357edac commit 040f68a

17 files changed

+12164
-1
lines changed

.babelrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"presets": ["@babel/preset-env"],
3+
"plugins": [
4+
["@babel/plugin-transform-regenerator", {
5+
"asyncGenerators": true,
6+
"generators": true,
7+
"async": true
8+
}]
9+
]
10+
}

.editorconfig

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
# Change these settings to your own preference
10+
indent_style = space
11+
indent_size = 2
12+
13+
# We recommend you to keep these unchanged
14+
end_of_line = lf
15+
charset = utf-8
16+
trim_trailing_whitespace = true
17+
insert_final_newline = true
18+
19+
[*.md]
20+
trim_trailing_whitespace = false

.eslintrc

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"airbnb",
9+
"prettier",
10+
],
11+
"parserOptions": {
12+
"ecmaVersion": 2018,
13+
"sourceType": "module",
14+
},
15+
"plugins": [
16+
"prettier"
17+
],
18+
"globals": {
19+
"VERSION": false
20+
},
21+
"rules": {
22+
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
23+
"no-console": ["error", { "allow": ["warn", "error"] }],
24+
"no-plusplus": 0,
25+
"prefer-destructuring": 0
26+
}
27+
}

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
coverage
2+
*.seed
3+
*.log
4+
*.csv
5+
*.dat
6+
*.out
7+
*.pid
8+
*.gz
9+
*.DS_cache
10+
11+
pids
12+
logs
13+
results
14+
15+
dist/*
16+
dist.zip
17+
18+
npm-debug.log
19+
node_modules/*
20+
21+
docs
22+
stats.html

API.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ An array of dictionaries (objects) with two essential properties:
66

77
- `id`: the item identifier (has to be unique)
88
- `src`: the item data. this can be a URL or data object. the only requirement
9-
is that the renderer understands this object.
9+
is that the renderer understands this object.
1010

1111
_Note, mixed data types are currently not supported._
1212

@@ -24,3 +24,4 @@ _Note, mixed data types are currently not supported._
2424
}
2525
```
2626

27+
## Renderer

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Pile Me
2+
3+
A library for visual piling
4+
5+
## Get Started
6+
7+
```
8+
git clone https://github.com/flekschas/pile-me
9+
cd pile-me
10+
npm ci
11+
```

examples/index.html

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
3+
<html lang="en">
4+
<head>
5+
<meta charset="utf-8" />
6+
7+
<title>Pile Me</title>
8+
9+
<style type="text/css">
10+
html,
11+
body {
12+
padding: 0;
13+
margin: 0;
14+
width: 100%;
15+
height: 100%;
16+
font-family: sans-serif;
17+
text-rendering: optimizeLegibility;
18+
color: #888;
19+
background: black;
20+
}
21+
22+
#demo {
23+
position: absolute;
24+
top: 1rem;
25+
right: 1rem;
26+
bottom: 1rem;
27+
left: 1rem;
28+
}
29+
</style>
30+
</head>
31+
32+
<body>
33+
<div id="demo"></div>
34+
</body>
35+
</html>

examples/index.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import createPileMe from '../src/index';
2+
import imageRenderer from '../src/image-renderer';
3+
4+
const pileMe = createPileMe(document.getElementById('demo'));
5+
6+
pileMe.set('renderer', imageRenderer);
7+
pileMe.set('items', [
8+
{
9+
id: 'test',
10+
src:
11+
'http://pbs.twimg.com/profile_images/851447292120805376/y_RzZDR__normal.jpg'
12+
}
13+
]);

0 commit comments

Comments
 (0)