Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplemented example using CRA #94

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions examples/basic/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
8 changes: 3 additions & 5 deletions examples/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ Run the [Basic](https://github.com/loktar00/react-lazy-load/tree/master/examples
git clone https://github.com/loktar00/react-lazy-load.git

cd react-lazy-load
npm install
yarn install

cd ./examples/basic
npm install
npm start

open http://localhost:3000/
yarn install
yarn start
```
9 changes: 0 additions & 9 deletions examples/basic/initializers/client/index.js

This file was deleted.

11 changes: 0 additions & 11 deletions examples/basic/initializers/config.js

This file was deleted.

26 changes: 0 additions & 26 deletions examples/basic/initializers/server/index.js

This file was deleted.

5 changes: 0 additions & 5 deletions examples/basic/initializers/server/render.js

This file was deleted.

14 changes: 0 additions & 14 deletions examples/basic/initializers/server/template.ejs

This file was deleted.

4 changes: 0 additions & 4 deletions examples/basic/initializers/server/webpackAsset.js

This file was deleted.

61 changes: 0 additions & 61 deletions examples/basic/initializers/webpack/common.js

This file was deleted.

38 changes: 0 additions & 38 deletions examples/basic/initializers/webpack/development.js

This file was deleted.

37 changes: 10 additions & 27 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,20 @@
"name": "react-lazy-load-basic-example",
"version": "0.0.0",
"description": "React Lazy Load basic example",
"scripts": {
"start": "node -r 'babel-core/register' ./initializers/server/index.js"
},
"license": "MIT",
"bugs": "https://github.com/loktar00/react-lazy-load/issues",
"engines": {
"node": "^4.0.0",
"npm": "^3.0.0"
},
"dependencies": {
"react": "^0.14.0",
"react-dom": "^0.14.0"
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-lazy-load": "^3.0.12"
},
"devDependencies": {
"babel-core": "^6.4.0",
"babel-plugin-react-transform": "^2.0.0",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"css-loader": "^0.23.1",
"ejs": "^2.3.4",
"express": "^4.13.3",
"morgan": "^1.6.1",
"postcss-bem": "^0.4.1",
"postcss-loader": "^0.8.0",
"postcss-nested": "^1.0.0",
"react-transform-catch-errors": "^1.0.1",
"react-transform-hmr": "^1.0.1",
"redbox-react": "^1.2.0",
"style-loader": "^0.13.0",
"webpack": "^1.12.10",
"webpack-dev-middleware": "^1.4.0",
"webpack-hot-middleware": "^2.6.0"
"react-scripts": "1.0.7"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Binary file added examples/basic/public/favicon.ico
Binary file not shown.
40 changes: 40 additions & 0 deletions examples/basic/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
15 changes: 15 additions & 0 deletions examples/basic/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
60 changes: 60 additions & 0 deletions examples/basic/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.filler {
height: 150px;
}

.ScrollableContainer {
height: 200px;
overflow: scroll;
background-color: grey;
}

/* override default styles */
.LazyLoad {
background: #ccc;
}

.LazyLoad img {
transition: all 2s ease-in-out;
}

.LazyLoad .spinner {
width: 40px;
height: 40px;
position: absolute;
top: 50%;
left: 50%;
margin: -20px -20px 0 0;
background-color: #fff;
border-radius: 100%;
-webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
animation: sk-scaleout 1.0s infinite ease-in-out;
}

@-webkit-keyframes sk-scaleout {
0% { -webkit-transform: scale(0) }
100% {
-webkit-transform: scale(1.0);
opacity: 0;
}
}

@keyframes sk-scaleout {
0% {
-webkit-transform: scale(0);
transform: scale(0);
} 100% {
-webkit-transform: scale(1.0);
transform: scale(1.0);
opacity: 0;
}
}

.LazyLoad .offline {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: no-repeat center center url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiB4PSIwcHgiIHk9IjBweCI+PHBhdGggZD0iTTg4LjE3LDY5LjMyQTIyLDIyLDAsMCwwLDc3Ljc5LDM3Ljc3YTIyLDIyLDAsMCwwLTIxLjkxLTIwLjIsMjAuMjksMjAuMjksMCwwLDAtMTMuNjcsNC44MWw0LjU3LDUuM2ExMy4zMSwxMy4zMSwwLDAsMSw5LjEtMy4xMSwxNSwxNSwwLDAsMSwxNSwxNWMwLC4wNiwwLC4xMywwLC4xOXMwLC4yNiwwLC4zOWwtLjEsMi43NSwyLjY1Ljc1YTE1LDE1LDAsMCwxLDguNzksMjIuMVoiLz48cGF0aCBkPSJNMjguNzYsODBINjAuNDRWNzNIMjguNzZhMTUsMTUsMCwwLDEtMTUtMTVBMTcsMTcsMCwwLDEsMjMuNiw0Mi43bC0yLjc5LTYuNDJBMjMuOTEsMjMuOTEsMCwwLDAsNi43OCw1OCwyMiwyMiwwLDAsMCwyOC43Niw4MFoiLz48cmVjdCB4PSI0NS41MyIgeT0iLTQuNTgiIHdpZHRoPSI3IiBoZWlnaHQ9IjEwNi43NSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTIwLjE0IDQ4Ljk2KSByb3RhdGUoLTQ1KSIvPjwvc3ZnPgo=);
background-size: 100px 100px;
}
Loading