Skip to content

Commit 105d07e

Browse files
committed
first real commit
1 parent 7a7f1c0 commit 105d07e

File tree

443 files changed

+125613
-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.

443 files changed

+125613
-0
lines changed

.gitattributes

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
* text eol=lf
2+
3+
*.md text
4+
*.css text
5+
*.js text
6+
*.html text
7+
8+
*.png binary
9+
*.jpg binary
10+
*.gif binary
11+
*.bin binary
12+
*.dds binary
13+
*.wasm binary
14+

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.pyc
2+
.DS_Store
3+
node_modules
4+
out
5+

.travis.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
language: node_js
2+
node_js:
3+
- "8.4"
4+
script:
5+
- npm run build
6+
env:
7+
global:
8+
- COMMIT_AUTHOR_EMAIL: "[email protected]"
9+
10+
deploy:
11+
provider: pages
12+
skip-cleanup: true
13+
github-token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
14+
keep-history: true
15+
local-dir: out
16+
on:
17+
branch: master
18+

3rdparty/jquery-3.3.1.slim.min.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gruntfile.js

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
"use strict";
2+
3+
const path = require('path');
4+
const fs = require('fs');
5+
6+
module.exports = function(grunt) {
7+
8+
require('load-grunt-tasks')(grunt);
9+
10+
const s_ignoreRE = /\.(md|py|sh|enc)$/i;
11+
function noMds(filename) {
12+
return !s_ignoreRE.test(filename);
13+
}
14+
15+
function notFolder(filename) {
16+
return !fs.statSync(filename).isDirectory();
17+
}
18+
19+
function noMdsNoFolders(filename) {
20+
return noMds(filename) && notFolder(filename);
21+
}
22+
23+
grunt.initConfig({
24+
eslint: {
25+
lib: {
26+
src: [
27+
'threejs/resources/*.js',
28+
],
29+
options: {
30+
config: 'build/conf/eslint.json',
31+
//rulesdir: ['build/rules'],
32+
},
33+
},
34+
examples: {
35+
src: [
36+
'threejs/*.html',
37+
],
38+
options: {
39+
configFile: 'build/conf/eslint-examples.json',
40+
},
41+
},
42+
},
43+
copy: {
44+
main: {
45+
files: [
46+
{ expand: false, src: '*', dest: 'out/', filter: noMdsNoFolders, },
47+
{ expand: true, src: 'threejs/**', dest: 'out/', filter: noMds, },
48+
{ expand: true, src: 'monaco-editor/**', dest: 'out/', },
49+
{ expand: true, src: '3rdparty/**', dest: 'out/', },
50+
],
51+
},
52+
},
53+
clean: [
54+
'out/**/*',
55+
],
56+
});
57+
58+
grunt.registerTask('buildlessons', function() {
59+
var buildStuff = require('./build/js/build');
60+
var finish = this.async();
61+
buildStuff().then(function() {
62+
finish();
63+
}).done();
64+
});
65+
66+
grunt.registerTask('build', ['clean', 'copy', 'buildlessons']);
67+
68+
grunt.registerTask('default', ['eslint', 'build']);
69+
};
70+

LICENSE

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2018, Google Inc.
2+
# All rights reserved.
3+
#
4+
# Redistribution and use in source and binary forms, with or without
5+
# modification, are permitted provided that the following conditions are
6+
# met:
7+
#
8+
# * Redistributions of source code must retain the above copyright
9+
# notice, this list of conditions and the following disclaimer.
10+
#
11+
# * Redistributions in binary form must reproduce the above
12+
# copyright notice, this list of conditions and the following disclaimer
13+
# in the documentation and/or other materials provided with the
14+
# distribution.
15+
#
16+
# * Neither the name of Google Inc. nor the names of their
17+
# contributors may be used to endorse or promote products derived from
18+
# this software without specific prior written permission.
19+
#
20+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+

README.md

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
Three.js Fundamentals
2+
=====================
3+
4+
This is [a series of lessons or tutorials about three.js](http://threejsfundamentals.org/).
5+
6+
This is work in progress. Feel free to contribute, especially localizations
7+
8+
## Contributing
9+
10+
Of course bug fixes are always welcome.
11+
12+
If you'd like to write a new article please try to always take
13+
one step at a time. Don't do 2 or more things in a single step.
14+
Explain any new math in the simplest terms possible. Ideally
15+
with diagrams where possible. Also it's probably best to
16+
ask to make sure someone else isn't already working on a similar
17+
article.
18+
19+
### Translating
20+
21+
Each translation goes in a folder under `threejs/lessons/<country-code>`.
22+
23+
Required files are
24+
25+
langinfo.hanson
26+
index.md
27+
toc.html
28+
29+
#### `langinfo.hanson`
30+
31+
Defines various language specific options.
32+
[Hanson](https://github.com/timjansen/hanson) is a JSON like format but allows comments.
33+
34+
Current fields are
35+
36+
{
37+
// The language (will show up in the language selection menu)
38+
language: 'English',
39+
40+
// Phrase that appears under examples
41+
defaultExampleCaption: "click here to open in a separate window",
42+
43+
// Title that appears on each page
44+
title: 'Three Fundamentals',
45+
46+
// Basic description that appears on each page
47+
description: 'Learn Three.js',
48+
49+
// Link to the language root.
50+
link: 'http://threejsfundamentals.org/threejs/lessons/ja', // replace `ja` with country code
51+
52+
// html that appears after the article and before the comments
53+
commentSectionHeader: '<div>Questions? <a href="http://stackoverflow.com/questions/tagged/three.js">Ask on stackoverflow</a>.</div>\n <div>Issue/Bug? <a href="http://github.com/greggman/threefundamentals/issues">Create an issue on github</a>.</div>',
54+
55+
// markdown that appears for untranslated articles
56+
missing: "Sorry this article has not been translated yet. [Translations Welcome](https://github.com/greggman/threejsfundamentals)! 😄\n\n[Here's the original English article for now]({{{origLink}}}).",
57+
58+
// the phrase "Table of Contents"
59+
toc: "Table of Contents",
60+
}
61+
62+
#### `index.md`
63+
64+
This is the template for the main page for each language
65+
66+
#### `toc.html`
67+
68+
This is the table of contents for the language. It is included on both the index
69+
and on each article. It's up to if you want to link to English articles for non-translated articles.
70+
The build system will create a placeholder for every English article for which there is no
71+
corresponding article in that langauge. It will be filled the `missing` message from above.
72+
73+
#### Translation notes
74+
75+
The build process will make a placeholder html file for each article has an english .md file in
76+
`threejs/lessons` but no corresponding .md file for the language. This is to make it easy to include
77+
links in one article that links to another article but that other article has not yet been translated.
78+
This way you don't have to go back and fix already translated articles. Just translate one article
79+
at a time and leave the links as is. They'll link to placeholders until someone translates the missing
80+
articles.
81+
82+
### To build
83+
84+
The site is built into the `out` folder
85+
86+
Steps
87+
88+
git clone https://github.com/greggman/threejsfundamentals.git
89+
npm install
90+
npm run build
91+
npm start
92+
93+
now open your browser to `http://localhost:8080`
94+
95+
96+

build/conf/eslint-examples.json

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true
5+
},
6+
"plugins": [
7+
"eslint-plugin-html",
8+
"eslint-plugin-optional-comma-spacing",
9+
"eslint-plugin-one-variable-per-var",
10+
"eslint-plugin-require-trailing-comma"
11+
],
12+
"extends": "eslint:recommended",
13+
"rules": {
14+
"no-alert": 2,
15+
"no-array-constructor": 2,
16+
"no-caller": 2,
17+
"no-catch-shadow": 2,
18+
"no-const-assign": 2,
19+
"no-eval": 2,
20+
"no-extend-native": 2,
21+
"no-extra-bind": 2,
22+
"no-implied-eval": 2,
23+
"no-iterator": 2,
24+
"no-label-var": 2,
25+
"no-labels": 2,
26+
"no-lone-blocks": 0,
27+
"no-loop-func": 2,
28+
"no-multi-str": 2,
29+
"no-native-reassign": 2,
30+
"no-new": 2,
31+
"no-new-func": 2,
32+
"no-new-object": 2,
33+
"no-new-wrappers": 2,
34+
"no-octal-escape": 2,
35+
"no-process-exit": 2,
36+
"no-proto": 2,
37+
"no-return-assign": 2,
38+
"no-script-url": 2,
39+
"no-sequences": 2,
40+
"no-shadow-restricted-names": 2,
41+
"no-spaced-func": 2,
42+
"no-trailing-spaces": 2,
43+
"no-undef-init": 2,
44+
"no-underscore-dangle": 2,
45+
"no-unused-expressions": 2,
46+
"no-use-before-define": 0,
47+
"no-with": 2,
48+
"consistent-return": 2,
49+
"curly": [2, "all"],
50+
"no-extra-parens": [2, "functions"],
51+
"eqeqeq": 2,
52+
"new-cap": 2,
53+
"new-parens": 2,
54+
"semi-spacing": [2, {"before": false, "after": true}],
55+
"space-infix-ops": 2,
56+
"space-unary-ops": [2, { "words": true, "nonwords": false }],
57+
"yoda": [2, "never"],
58+
59+
"brace-style": [2, "1tbs", { "allowSingleLine": false }],
60+
"camelcase": [0],
61+
"comma-spacing": 0,
62+
"comma-dangle": 0,
63+
"comma-style": [2, "last"],
64+
"optional-comma-spacing/optional-comma-spacing": [2, {"after": true}],
65+
"dot-notation": 0,
66+
"eol-last": [0],
67+
"global-strict": [0],
68+
"key-spacing": [0],
69+
"no-comma-dangle": [0],
70+
"no-irregular-whitespace": 2,
71+
"no-multi-spaces": [0],
72+
"no-obj-calls": 2,
73+
"no-redeclare": [0],
74+
"no-shadow": [0],
75+
"no-undef": [0],
76+
"no-unreachable": 2,
77+
"one-variable-per-var/one-variable-per-var": [2],
78+
"quotes": [2, "single"],
79+
"require-trailing-comma/require-trailing-comma": [2],
80+
"semi": [2, "always"],
81+
"strict": [2, "global"],
82+
"space-before-function-paren": [2, "never"],
83+
"keyword-spacing": [1, {"before": true, "after": true, "overrides": {}} ]
84+
}
85+
}

0 commit comments

Comments
 (0)