Skip to content

Commit f42c1ce

Browse files
committed
initial examples
0 parents  commit f42c1ce

File tree

9 files changed

+170
-0
lines changed

9 files changed

+170
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
16+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17+
.grunt
18+
19+
# node-waf configuration
20+
.lock-wscript
21+
22+
# Compiled binary addons (http://nodejs.org/api/addons.html)
23+
build/Release
24+
25+
# Dependency directory
26+
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
27+
node_modules
28+
29+
.DS_Store
30+
31+
dist
32+
bundle
33+
bundle.*

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 Scratch
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Scratch examples

index.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* scratch framework */
2+
@import 'node_modules/@nikoloza/scratch/lib/index.css';
3+
4+
/* scratch grid */
5+
@import 'node_modules/@nikoloza/scratch-grid/lib/index.css';
6+
7+
/* scratch ui */
8+
@import 'node_modules/@nikoloza/scratch-ui/lib/index.css';
9+
10+
/* scratch helpers */
11+
@import 'node_modules/@nikoloza/scratch-helpers/lib/index.css';
12+
13+
/* scratch animations */
14+
@import 'node_modules/@nikoloza/scratch-animations/lib/index.css';

index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html >
2+
<html lang="en-US">
3+
<head>
4+
<title>Scratch</title>
5+
<link rel="stylesheet" type="text/css" href="bundle.css">
6+
</head>
7+
<body>
8+
<div class="animation longer fade-in">Did this fade-in?</div>
9+
<br>
10+
<br>
11+
<h1>Do you see two columns below?</h1>
12+
<br>
13+
<div class="flexible row">
14+
<div class="cell">Yes</div>
15+
<div class="cell">Yes</div>
16+
</div>
17+
<br>
18+
<br>
19+
<h1>Do you see nice input field?</h1>
20+
<br>
21+
<input type="text" class="big field">
22+
<script type="text/javascript" src="bundle.js"></script>
23+
</body>
24+
</html>

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
'use strict'
2+
require('./index.css')

package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "@nikoloza/scratch-examples",
3+
"version": "0.1.0",
4+
"description": "",
5+
"main": "index.css",
6+
"scripts": {
7+
"start": "webpack-dev-server",
8+
"dev": "webpack-dev-server --watch",
9+
"build": "webpack",
10+
"test": "echo \"Error: no test specified\" && exit 1"
11+
},
12+
"author": "",
13+
"license": "",
14+
"dependencies": {
15+
"@nikoloza/scratch-all": "^0.2.0"
16+
},
17+
"devDependencies": {
18+
"babel-core": "^6.14.0",
19+
"babel-loader": "^6.2.5",
20+
"babel-plugin-transform-class-properties": "^6.11.5",
21+
"babel-preset-es2015": "^6.14.0",
22+
"css-loader": "^0.25.0",
23+
"extract-text-webpack-plugin": "^1.0.1",
24+
"postcss-cssnext": "^2.8.0",
25+
"postcss-import": "^8.1.2",
26+
"postcss-loader": "^0.13.0",
27+
"postcss-url": "^5.1.2",
28+
"precss": "^1.4.0",
29+
"style-loader": "^0.13.1",
30+
"webpack": "^1.13.2",
31+
"webpack-dev-server": "^1.15.1"
32+
}
33+
}

webpack.config.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
var precss = require('precss')
2+
var cssimport = require('postcss-import')
3+
var cssnext = require('postcss-cssnext')
4+
var ExtractTextPlugin = require('extract-text-webpack-plugin')
5+
6+
module.exports = {
7+
entry: './index.js',
8+
template: './index.html',
9+
output: {
10+
filename: 'bundle.js'
11+
},
12+
module: {
13+
loaders: [{
14+
test: /\.css$/,
15+
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader')
16+
}]
17+
},
18+
postcss: function (webpack) {
19+
return [
20+
precss,
21+
cssimport({
22+
addDependencyTo: webpack
23+
}),
24+
cssnext()
25+
]
26+
},
27+
plugins: [
28+
new ExtractTextPlugin('bundle.css')
29+
]
30+
}

0 commit comments

Comments
 (0)