├── .env ├── preview.png ├── public ├── robots.txt ├── images │ ├── cover.png │ ├── favicon.ico │ ├── logo192.png │ ├── logo512.png │ └── favicon.svg ├── manifest.json └── index.html ├── src ├── contexts │ ├── settings.util.js │ └── settings.context.js ├── App.js ├── components │ ├── comparison │ │ ├── icons │ │ │ ├── nl.svg │ │ │ ├── dk.svg │ │ │ ├── sw.svg │ │ │ ├── fi.svg │ │ │ ├── clean.svg │ │ │ ├── dark.svg │ │ │ ├── za.svg │ │ │ ├── in.svg │ │ │ ├── pk.svg │ │ │ ├── ca.svg │ │ │ ├── ir.svg │ │ │ ├── eu.svg │ │ │ └── us.svg │ │ └── comparison.componenet.jsx │ ├── footer │ │ ├── heart.svg │ │ └── footer.component.jsx │ ├── products │ │ ├── eco.svg │ │ ├── products.component.jsx │ │ └── products.js │ ├── options │ │ ├── icons │ │ │ ├── car.svg │ │ │ ├── warning.svg │ │ │ ├── tree.svg │ │ │ ├── factory.svg │ │ │ └── earth.svg │ │ ├── options.styles.css │ │ └── options.component.jsx │ ├── facts │ │ ├── know.svg │ │ ├── facts.component.jsx │ │ └── facts.js │ ├── ngo │ │ ├── heart.svg │ │ ├── ngo.component.jsx │ │ └── ngo.js │ ├── tips │ │ ├── tips.components.jsx │ │ ├── tips-data.js │ │ └── images │ │ │ ├── home.svg │ │ │ └── change.svg │ ├── stats │ │ ├── images │ │ │ ├── th.svg │ │ │ ├── thermometer.svg │ │ │ ├── thaw.svg │ │ │ ├── ice-sheets.svg │ │ │ ├── cold-ice-cubes.svg │ │ │ ├── sunset.svg │ │ │ ├── carbon-dioxide.svg │ │ │ ├── sea.svg │ │ │ └── beach.svg │ │ └── stats.component.jsx │ ├── challenge │ │ ├── challenge.component.jsx │ │ └── icons │ │ │ └── users.svg │ └── results │ │ ├── results.styles.css │ │ ├── result.svg │ │ └── results.component.jsx ├── index.js ├── pages │ └── home │ │ ├── home.component.jsx │ │ └── home.styles.css └── serviceWorker.js ├── .gitignore ├── README.md ├── package.json └── now.json /.env: -------------------------------------------------------------------------------- 1 | SKIP_PREFLIGHT_CHECK=true 2 | -------------------------------------------------------------------------------- /preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PJijin/Save-Earth/HEAD/preview.png -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | -------------------------------------------------------------------------------- /public/images/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PJijin/Save-Earth/HEAD/public/images/cover.png -------------------------------------------------------------------------------- /public/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PJijin/Save-Earth/HEAD/public/images/favicon.ico -------------------------------------------------------------------------------- /public/images/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PJijin/Save-Earth/HEAD/public/images/logo192.png -------------------------------------------------------------------------------- /public/images/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PJijin/Save-Earth/HEAD/public/images/logo512.png -------------------------------------------------------------------------------- /src/contexts/settings.util.js: -------------------------------------------------------------------------------- 1 | export const defaultSettings = { 2 | trees: 0, 3 | vehicles: 0, 4 | industry: 0 5 | }; 6 | -------------------------------------------------------------------------------- /src/contexts/settings.context.js: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react'; 2 | import { defaultSettings } from './settings.util'; 3 | 4 | const SettingsContext = createContext(defaultSettings); 5 | 6 | export default SettingsContext; 7 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Home from './pages/home/home.component'; 3 | 4 | function App() { 5 | return ( 6 |
7 | 8 |
9 | ); 10 | } 11 | 12 | export default App; 13 | -------------------------------------------------------------------------------- /src/components/comparison/icons/nl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/comparison/icons/dk.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/comparison/icons/sw.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/comparison/icons/fi.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/footer/heart.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | import * as serviceWorker from './serviceWorker'; 5 | 6 | ReactDOM.render(, document.getElementById('root')); 7 | 8 | // If you want your app to work offline and load faster, you can change 9 | // unregister() to register() below. Note this comes with some pitfalls. 10 | // Learn more about service workers: https://bit.ly/CRA-PWA 11 | serviceWorker.unregister(); 12 | -------------------------------------------------------------------------------- /src/components/products/eco.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/options/icons/car.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/facts/know.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/options/icons/warning.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Save Earth", 3 | "name": "Spread Awareness Save Earth", 4 | "icons": [ 5 | { 6 | "src": "images/favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "images/logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "images/logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /src/components/comparison/icons/clean.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/comparison/icons/dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 🌍 Save-Earth 2 | 3 | 4 | 5 | [![ClimateStrike](https://digital.globalclimatestrike.net/wp-content/uploads/sites/71/2019/08/FacebookShareImage-1024x536.png 'Save Earth')](https://digital.globalclimatestrike.net/) 6 | 7 | 8 | [![ClimateStrike](https://github.com/PJijin/Save-Earth/blob/master/preview.png?raw=true 'Save Earth')]() 9 | 10 | Project URL: http://save-earth.now.sh 11 | 12 | Fixathon.io Project 13 | 14 | ## 🤝 Contributing 15 | 16 | Contributions, issues and feature requests are welcome! 😍 17 | 18 | ## Show your support 19 | 20 | Give a ⭐️ if you like this project and join in #SaveEarthChallenge! 🥰 21 | -------------------------------------------------------------------------------- /src/components/comparison/icons/za.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/ngo/heart.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/tips/tips.components.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import tipsData from './tips-data.js'; 3 | import { ReactComponent as Change } from './images/change.svg'; 4 | import { ReactComponent as House } from './images/home.svg'; 5 | 6 | export default function Tips() { 7 | return ( 8 |
9 | 10 |
11 |
12 | Take Action, Save Home 13 |
14 |
    15 | {Object.entries(tipsData).map(tip => { 16 | return ( 17 |
  • 18 | {tip[0]} 19 |
    {tip[1]}
    20 |
  • 21 | ); 22 | })} 23 |
24 |
25 |
26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /src/components/comparison/icons/in.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/products/products.component.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import productsList from './products'; 3 | import { ReactComponent as Eco } from './eco.svg'; 4 | 5 | export default function Products() { 6 | return ( 7 |
8 |
9 | Eco-friendly Products for Your Daily Life 10 |
11 |
12 | {Object.entries(productsList).map(item => { 13 | return ( 14 |
15 | 16 | {item[0]} 17 |

{item[0]}

18 |
19 |
20 | ); 21 | })} 22 |
23 |
24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /src/components/footer/footer.component.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { GitHub } from 'react-feather'; 3 | import { ReactComponent as Heart } from './heart.svg'; 4 | export default function Footer() { 5 | return ( 6 |
7 |
8 | Made on Earth by Humans with 9 | 10 | @JP1016v1 11 | 12 | & 13 | 14 | @Pjijin 15 | 16 |
17 |
18 | 19 | Source 20 | 21 |
22 |
23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "saveearth", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "react": "^16.9.0", 7 | "react-dom": "^16.9.0", 8 | "react-feather": "^2.0.3", 9 | "react-input-range": "^1.3.0", 10 | "react-scripts": "3.1.1", 11 | "use-dark-mode": "^2.3.1" 12 | }, 13 | "scripts": { 14 | "start": "react-scripts start", 15 | "build": "react-scripts build", 16 | "test": "react-scripts test", 17 | "eject": "react-scripts eject", 18 | "now-build": "react-scripts build" 19 | }, 20 | "eslintConfig": { 21 | "extends": "react-app" 22 | }, 23 | "browserslist": { 24 | "production": [ 25 | ">0.2%", 26 | "not dead", 27 | "not op_mini all" 28 | ], 29 | "development": [ 30 | "last 1 chrome version", 31 | "last 1 firefox version", 32 | "last 1 safari version" 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/components/tips/tips-data.js: -------------------------------------------------------------------------------- 1 | const tipsData = { 2 | 'Use Fluorescent Bulbs': '⚡️ You can save energy and money too.', 3 | 'Turn off your computer at night': '💻 Save 40 watts a day.', 4 | Recycle: "♻️ You'll help reduce pollution.", 5 | 'Use fewer Tissues': '🤧 Or use half - do you really need one whole piece?', 6 | 'Use Both Sides Of Paper': "📄 Set your printer's default option to print double-sided.", 7 | 'Take the Stairs': "🚶‍♂️ Healthier for you and kinder to the planet. Why use the lift if it's only a few flights?", 8 | 'Be Creative and Reuse': '🛍 Things like bags, bows and paper can be turned into a present or something useful.', 9 | 'Take Shorter Showers, Skip Baths': "🛀 You'll save water and electricity on heating.", 10 | 'Switch off the light': "💡Not just for Earth hour but whenever you don't need it." 11 | }; 12 | 13 | export default tipsData; 14 | -------------------------------------------------------------------------------- /src/components/options/icons/tree.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/products/products.js: -------------------------------------------------------------------------------- 1 | const productsList = { 2 | 'Biodegradable Garbage Bags': { 3 | image: 'https://images-na.ssl-images-amazon.com/images/I/71d6wCqMj4L._SX466_.jpg', 4 | url: 'https://amzn.to/2L8mFYE' 5 | }, 6 | 'Wooden Spoon and Fork': { 7 | image: 'https://images-na.ssl-images-amazon.com/images/I/71Ek41a7USL._SX342_.jpg', 8 | url: 'https://amzn.to/2NvwJxF' 9 | }, 10 | 'Disposable Party Plates': { 11 | image: 'https://images-na.ssl-images-amazon.com/images/I/616a89NP-TL._SL1000_.jpg', 12 | url: 'https://amzn.to/2L7Ffjv' 13 | }, 14 | Bowls: { 15 | image: 'https://images-na.ssl-images-amazon.com/images/I/41wOAQ6MT7L.jpg', 16 | url: 'https://amzn.to/340dHW0' 17 | }, 18 | 'Food Bag': { 19 | image: 'https://images-na.ssl-images-amazon.com/images/I/81WvkJB-WiL._SX679_.jpg', 20 | url: 'https://amzn.to/2MB1qBS' 21 | } 22 | }; 23 | 24 | export default productsList; 25 | -------------------------------------------------------------------------------- /src/components/comparison/icons/pk.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/ngo/ngo.component.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { ReactComponent as Heart } from './heart.svg'; 3 | import ngoList from './ngo'; 4 | 5 | export default function NGO() { 6 | const [details, setDetails] = useState(Object.entries(ngoList)[0]); 7 | return ( 8 |
9 |
10 | 11 | {' '} 12 | 13 | Environmental NGOs 14 |
15 |
16 |
17 | {Object.entries(ngoList).map(item => { 18 | return ( 19 |

setDetails(item)}> 20 | {item[0]} 21 |

22 | ); 23 | })} 24 |
25 |
26 |
{details[0]}
27 |

{details[1]}

28 |
29 |
30 |
31 | ); 32 | } 33 | -------------------------------------------------------------------------------- /src/components/comparison/icons/ca.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/comparison/icons/ir.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/facts/facts.component.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { ChevronUp, ChevronDown } from 'react-feather'; 3 | import { ReactComponent as Know } from './know.svg'; 4 | 5 | import fact from './facts'; 6 | 7 | export default function Facts() { 8 | const [factId, setFactId] = useState(0); 9 | 10 | const setFaceIdValue = val => { 11 | if (val < 0) return setFactId(fact.length - 1); 12 | if (val > fact.length) return setFactId(0); 13 | return setFactId(val); 14 | }; 15 | 16 | return ( 17 |
18 |
19 | 20 | Did you know? 21 | 22 | 23 |
24 | { 26 | e.preventDefault(); 27 | setFaceIdValue(factId - 1); 28 | }} 29 | /> 30 | { 32 | e.preventDefault(); 33 | setFaceIdValue(factId + 1); 34 | }} 35 | /> 36 |
37 |
38 |
{fact[factId]}
39 |
40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /now.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "name": "save-earth", 4 | "builds": [ 5 | { 6 | "src": "package.json", 7 | "use": "@now/static-build", 8 | "config": { 9 | "distDir": "build" 10 | } 11 | } 12 | ], 13 | "routes": [ 14 | { 15 | "src": "/static/(.*)", 16 | "headers": { 17 | "cache-control": "s-maxage=31536000,immutable" 18 | }, 19 | "dest": "/static/$1" 20 | }, 21 | { 22 | "src": "/images/(.*)", 23 | "headers": { 24 | "cache-control": "s-maxage=31536000,immutable" 25 | }, 26 | "dest": "/images/$1" 27 | }, 28 | { 29 | "src": "/favicon.ico", 30 | "dest": "/favicon.ico" 31 | }, 32 | { 33 | "src": "/asset-manifest.json", 34 | "dest": "/asset-manifest.json" 35 | }, 36 | { 37 | "src": "/manifest.json", 38 | "dest": "/manifest.json" 39 | }, 40 | { 41 | "src": "/precache-manifest.(.*)", 42 | "dest": "/precache-manifest.$1" 43 | }, 44 | { 45 | "src": "/service-worker.js", 46 | "headers": { 47 | "cache-control": "s-maxage=0" 48 | }, 49 | "dest": "/service-worker.js" 50 | }, 51 | { 52 | "src": "/(.*)", 53 | "headers": { 54 | "cache-control": "s-maxage=0" 55 | }, 56 | "dest": "/index.html" 57 | } 58 | ] 59 | } 60 | -------------------------------------------------------------------------------- /src/components/comparison/icons/eu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/options/icons/factory.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/tips/images/home.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/components/options/options.styles.css: -------------------------------------------------------------------------------- 1 | .industryOptions .input-range__track--active { 2 | background: #aab8c1; 3 | } 4 | 5 | .industryOptions .input-range__slider { 6 | background: url('./icons/factory.svg') no-repeat; 7 | border: 0px; 8 | padding: 7px; 9 | border-radius: 0; 10 | margin-top: -25px; 11 | } 12 | 13 | .vehicleOptions .input-range__track--active { 14 | background: #646b70; 15 | } 16 | 17 | .vehicleOptions .input-range__slider { 18 | background: url('./icons/car.svg') no-repeat; 19 | transform: scaleX(-1); 20 | -webkit-transform: scaleX(-1); 21 | 22 | border: 0px; 23 | padding: 7px; 24 | border-radius: 0; 25 | margin-top: -25px; 26 | } 27 | 28 | .treeOptions .input-range__track--active { 29 | background: #662113; 30 | } 31 | 32 | .treeOptions .input-range__slider { 33 | background: url('./icons/tree.svg') no-repeat; 34 | border: 0px; 35 | border-radius: 0; 36 | padding: 7px; 37 | margin-top: -18px; 38 | } 39 | .input-range__label-container { 40 | left: 0; 41 | } 42 | 43 | .input-range__label--value { 44 | position: absolute; 45 | top: 1rem; 46 | } 47 | .input-range__slider-container > .input-range__label .input-range__label--value > .input-range__label-container { 48 | left: 0; 49 | top: 50px; 50 | } 51 | 52 | .input-range__label--min .input-range__label-container { 53 | top: -23px; 54 | left: -28px; 55 | } 56 | 57 | .input-range__label--max .input-range__label-container { 58 | top: -23px; 59 | left: 59px; 60 | } 61 | -------------------------------------------------------------------------------- /src/components/stats/images/th.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/components/stats/images/thermometer.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/stats/stats.component.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { ArrowUp, ArrowDown } from 'react-feather'; 4 | 5 | import { ReactComponent as CO2 } from './images/carbon-dioxide.svg'; 6 | import { ReactComponent as THM } from './images/th.svg'; 7 | import { ReactComponent as IC1 } from './images/cold-ice-cubes.svg'; 8 | import { ReactComponent as IC2 } from './images/ice-sheets.svg'; 9 | import { ReactComponent as BH } from './images/sea.svg'; 10 | 11 | export default function Stats() { 12 | return ( 13 |
14 |
15 | 16 | 17 |
18 | Carbon Dioxide
411 parts per million
19 |
20 |
21 |
22 | 23 |
24 | Global Temperature
1.9 F
25 |
26 |
27 |
28 | 29 |
30 | Arctic Ice Minimum
12.8 percent per decade
31 |
32 |
33 |
34 | 35 | 36 |
37 | Ice Sheets
413 Gigatonnes per year
38 |
39 |
40 | 41 |
42 | 43 | 44 |
45 | Sea Level
3.3 millimeters per year
46 |
47 |
48 |
49 | ); 50 | } 51 | -------------------------------------------------------------------------------- /src/pages/home/home.component.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import useDarkMode from 'use-dark-mode'; 3 | 4 | import Options from '../../components/options/options.component'; 5 | import Results from '../../components/results/results.component'; 6 | import Stats from '../../components/stats/stats.component'; 7 | 8 | import SettingsContext from '../../contexts/settings.context'; 9 | import { defaultSettings } from '../../contexts/settings.util'; 10 | 11 | import Facts from '../../components/facts/facts.component'; 12 | import Footer from '../../components/footer/footer.component'; 13 | import Products from '../../components/products/products.component'; 14 | import NGO from '../../components/ngo/ngo.component'; 15 | import './home.styles.css'; 16 | import Tips from '../../components/tips/tips.components'; 17 | import Comparison from '../../components/comparison/comparison.componenet'; 18 | import Challenge from '../../components/challenge/challenge.component'; 19 | 20 | export default function Home() { 21 | const [settings, setSettings] = useState(defaultSettings); 22 | const darkMode = useDarkMode(false); 23 | 24 | const updateSettings = (set, value) => { 25 | setSettings({ ...settings, [set]: value }); 26 | }; 27 | return ( 28 | 29 |
30 | 31 |
32 |
33 | 34 | 35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |