Skip to content

Commit 40b1b49

Browse files
committed
Initial Commit
1 parent da1ba1a commit 40b1b49

Some content is hidden

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

43 files changed

+9484
-2580
lines changed

.babelrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
[
4+
"babel-preset-gatsby",
5+
{
6+
"targets": {
7+
"browsers": [">0.25%", "not dead"]
8+
}
9+
}
10+
]
11+
]
12+
}

.eslintrc.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
parser: 'babel-eslint',
3+
parserOptions: { ecmaFeatures: { jsx: true } },
4+
plugins: ['jest', 'import', 'react-hooks', 'prettier'],
5+
extends: [
6+
'eslint:recommended',
7+
'plugin:import/errors',
8+
'plugin:import/warnings',
9+
'plugin:react/recommended',
10+
'plugin:jest/recommended'
11+
],
12+
env: {
13+
browser: true,
14+
node: true,
15+
'jest/globals': true
16+
},
17+
settings: {
18+
react: {
19+
version: 'detect'
20+
}
21+
},
22+
rules: {
23+
'react/display-name': 0,
24+
'react/prop-types': 0,
25+
'no-console': 0,
26+
'prettier/prettier': 'error'
27+
}
28+
};

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,6 @@ yarn-error.log
6767
.pnp.js
6868
# Yarn Integrity file
6969
.yarn-integrity
70+
71+
# library dist
72+
dist

.prettierignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.cache
2-
package.json
2+
dist
33
package-lock.json
4-
public
4+
package.json
5+
public

.prettierrc

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"endOfLine": "lf",
3-
"semi": false,
4-
"singleQuote": false,
52
"tabWidth": 2,
6-
"trailingComma": "es5"
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"useTabs": false
76
}

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 gatsbyjs
3+
Copyright (c) 2020 Steve Meredith
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+6-92
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,11 @@
1-
<!-- AUTO-GENERATED-CONTENT:START (STARTER) -->
2-
<p align="center">
3-
<a href="https://www.gatsbyjs.org">
4-
<img alt="Gatsby" src="https://www.gatsbyjs.org/monogram.svg" width="60" />
5-
</a>
6-
</p>
7-
<h1 align="center">
8-
Gatsby's default starter
9-
</h1>
1+
# react-css-3d
102

11-
Kick off your project with this default boilerplate. This starter ships with the main Gatsby configuration files you might need to get up and running blazing fast with the blazing fast app generator for React.
3+
A React library for creating 3D objects and scenes without WebGL.
124

13-
_Have another more specific idea? You may want to check out our vibrant collection of [official and community-created starters](https://www.gatsbyjs.org/docs/gatsby-starters/)._
5+
### Motivation
146

15-
## 🚀 Quick start
7+
Over the years I have created a number of 3D scenes using only `CSS` / `HTML` so I decided to publish a library to make this easier for me. The library is `CSS` / `HTML` based, for this reason its capabilities are limited. You shouldn’t expect the same levels of fidelity as a WebGL based solution.
168

17-
1. **Create a Gatsby site.**
9+
### Browser Support
1810

19-
Use the Gatsby CLI to create a new site, specifying the default starter.
20-
21-
```shell
22-
# create a new Gatsby site using the default starter
23-
gatsby new my-default-starter https://github.com/gatsbyjs/gatsby-starter-default
24-
```
25-
26-
1. **Start developing.**
27-
28-
Navigate into your new site’s directory and start it up.
29-
30-
```shell
31-
cd my-default-starter/
32-
gatsby develop
33-
```
34-
35-
1. **Open the source code and start editing!**
36-
37-
Your site is now running at `http://localhost:8000`!
38-
39-
_Note: You'll also see a second link: _`http://localhost:8000/___graphql`_. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the [Gatsby tutorial](https://www.gatsbyjs.org/tutorial/part-five/#introducing-graphiql)._
40-
41-
Open the `my-default-starter` directory in your code editor of choice and edit `src/pages/index.js`. Save your changes and the browser will update in real time!
42-
43-
## 🧐 What's inside?
44-
45-
A quick look at the top-level files and directories you'll see in a Gatsby project.
46-
47-
.
48-
├── node_modules
49-
├── src
50-
├── .gitignore
51-
├── .prettierrc
52-
├── gatsby-browser.js
53-
├── gatsby-config.js
54-
├── gatsby-node.js
55-
├── gatsby-ssr.js
56-
├── LICENSE
57-
├── package-lock.json
58-
├── package.json
59-
└── README.md
60-
61-
1. **`/node_modules`**: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed.
62-
63-
2. **`/src`**: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template. `src` is a convention for “source code”.
64-
65-
3. **`.gitignore`**: This file tells git which files it should not track / not maintain a version history for.
66-
67-
4. **`.prettierrc`**: This is a configuration file for [Prettier](https://prettier.io/). Prettier is a tool to help keep the formatting of your code consistent.
68-
69-
5. **`gatsby-browser.js`**: This file is where Gatsby expects to find any usage of the [Gatsby browser APIs](https://www.gatsbyjs.org/docs/browser-apis/) (if any). These allow customization/extension of default Gatsby settings affecting the browser.
70-
71-
6. **`gatsby-config.js`**: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the [config docs](https://www.gatsbyjs.org/docs/gatsby-config/) for more detail).
72-
73-
7. **`gatsby-node.js`**: This file is where Gatsby expects to find any usage of the [Gatsby Node APIs](https://www.gatsbyjs.org/docs/node-apis/) (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process.
74-
75-
8. **`gatsby-ssr.js`**: This file is where Gatsby expects to find any usage of the [Gatsby server-side rendering APIs](https://www.gatsbyjs.org/docs/ssr-apis/) (if any). These allow customization of default Gatsby settings affecting server-side rendering.
76-
77-
9. **`LICENSE`**: Gatsby is licensed under the MIT license.
78-
79-
10. **`package-lock.json`** (See `package.json` below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. **(You won’t change this file directly).**
80-
81-
11. **`package.json`**: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is how npm knows which packages to install for your project.
82-
83-
12. **`README.md`**: A text file containing useful reference information about your project.
84-
85-
## 🎓 Learning Gatsby
86-
87-
Looking for more guidance? Full documentation for Gatsby lives [on the website](https://www.gatsbyjs.org/). Here are some places to start:
88-
89-
- **For most developers, we recommend starting with our [in-depth tutorial for creating a site with Gatsby](https://www.gatsbyjs.org/tutorial/).** It starts with zero assumptions about your level of ability and walks through every step of the process.
90-
91-
- **To dive straight into code samples, head [to our documentation](https://www.gatsbyjs.org/docs/).** In particular, check out the _Guides_, _API Reference_, and _Advanced Tutorials_ sections in the sidebar.
92-
93-
## 💫 Deploy
94-
95-
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/gatsbyjs/gatsby-starter-default)
96-
97-
<!-- AUTO-GENERATED-CONTENT:END -->
11+
The library is supported by most evergreen browsers, however as each browser handles css-transformations differently you may experience varying frame rates and quality. **The library makes heavy use of the `preserve-3d` transform-style which is not supported by any version of IE.**

gatsby-browser.js

-7
This file was deleted.

gatsby-config.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
module.exports = {
22
siteMetadata: {
3-
title: `Gatsby Default Starter`,
4-
description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
5-
author: `@gatsbyjs`,
3+
title: `react-css-3d`,
4+
description: `A React library for creating 3D objects and scenes without WebGL.`,
5+
author: `@steveeeie`
66
},
77
plugins: [
8-
`gatsby-plugin-react-helmet`,
98
{
109
resolve: `gatsby-source-filesystem`,
1110
options: {
1211
name: `images`,
13-
path: `${__dirname}/src/images`,
14-
},
12+
path: `${__dirname}/src/docs/images`
13+
}
1514
},
16-
`gatsby-transformer-sharp`,
17-
`gatsby-plugin-sharp`,
1815
{
19-
resolve: `gatsby-plugin-manifest`,
16+
resolve: `gatsby-plugin-page-creator`,
2017
options: {
21-
name: `gatsby-starter-default`,
22-
short_name: `starter`,
23-
start_url: `/`,
24-
background_color: `#663399`,
25-
theme_color: `#663399`,
26-
display: `minimal-ui`,
27-
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
28-
},
18+
path: `${__dirname}/src/docs/pages`
19+
}
2920
},
30-
// this (optional) plugin enables Progressive Web App + Offline functionality
31-
// To learn more, visit: https://gatsby.dev/offline
32-
// `gatsby-plugin-offline`,
33-
],
34-
}
21+
{
22+
resolve: `gatsby-plugin-mdx`,
23+
options: {
24+
defaultLayouts: {
25+
default: require.resolve(`./src/docs/components/layout.js`)
26+
}
27+
}
28+
},
29+
`gatsby-plugin-react-helmet`,
30+
`gatsby-plugin-sharp`,
31+
`gatsby-plugin-styled-components`,
32+
`gatsby-transformer-sharp`
33+
]
34+
};

gatsby-node.js

-7
This file was deleted.

gatsby-ssr.js

-7
This file was deleted.

jest-preprocess.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const babelOptions = {
2+
presets: ['babel-preset-gatsby']
3+
};
4+
5+
module.exports = require('babel-jest').createTransformer(babelOptions);

jest.config.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
transform: {
3+
'^.+\\.jsx?$': `<rootDir>/jest-preprocess.js`
4+
},
5+
moduleNameMapper: {
6+
'.+\\.(css|styl|less|sass|scss)$': `identity-obj-proxy`,
7+
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': `<rootDir>/__mocks__/file-mock.js`
8+
},
9+
testPathIgnorePatterns: [`node_modules`, `.cache`, `public`],
10+
transformIgnorePatterns: [`node_modules/(?!(gatsby)/)`],
11+
globals: {
12+
__PATH_PREFIX__: ``
13+
},
14+
testURL: `http://localhost`,
15+
setupFiles: [`<rootDir>/loadershim.js`],
16+
collectCoverage: true,
17+
collectCoverageFrom: ['src/lib/**/*.js'],
18+
coverageDirectory: './reports/coverage',
19+
coverageThreshold: {
20+
global: {
21+
branches: 100,
22+
functions: 100,
23+
lines: 95,
24+
statements: 95
25+
}
26+
},
27+
setupFilesAfterEnv: ['./setupTests.js']
28+
};

loadershim.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
global.___loader = {
2+
enqueue: jest.fn()
3+
};

0 commit comments

Comments
 (0)