├── .prettierignore ├── .eslintignore ├── static ├── map.jpg ├── favicon.ico ├── favicon.png ├── avatars │ ├── kay.jpg │ ├── koji.jpg │ ├── mark.jpg │ ├── mert.jpg │ ├── gilles.png │ ├── hinano.jpg │ ├── leonard.jpg │ ├── shane.jpg │ ├── vlumi.jpg │ └── alastair.jpg ├── japan-static.png └── icons │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── mstile-150x150.png │ ├── apple-touch-icon.png │ ├── android-chrome-192x192.png │ ├── android-chrome-512x512.png │ ├── browserconfig.xml │ ├── site.webmanifest │ └── safari-pinned-tab.svg ├── .github └── PULL_REQUEST_TEMPLATE.md ├── src ├── _type.scss ├── components │ ├── LanguagePicker │ │ ├── index.js │ │ └── LanguagePicker.js │ ├── DailyIncreaseChart │ │ ├── index.js │ │ └── DailyIncrease.js │ ├── OutbreakMap │ │ ├── ApiKey.js │ │ ├── index.js │ │ ├── DrawMap.js │ │ ├── drawLegend.js │ │ ├── _map.scss │ │ └── DrawMapPrefectures.js │ ├── PrefectureTable │ │ ├── index.js │ │ ├── _prefectureTable.scss │ │ └── PrefectureTable.js │ ├── Header │ │ ├── UpdatePageDirectionClass.js │ │ ├── index.js │ │ ├── DrawPageTitleCount.js │ │ ├── UpdateTooltipLang.js │ │ └── DrawLastUpdated.js │ ├── Loader │ │ └── index.js │ ├── KpiReact │ │ ├── linearGradient.js │ │ ├── Kpi.js │ │ └── index.js │ └── RegionalCharts │ │ └── _regional.scss ├── _loader.scss ├── embed.js ├── _layout.scss ├── data │ ├── scaling.js │ ├── helper.js │ └── constants.js ├── _colors.scss ├── i18n │ ├── index.js │ ├── de.json │ ├── zh.json │ ├── ja.json │ ├── hi.json │ ├── bn.json │ ├── cs.json │ ├── pt.json │ ├── tr.json │ ├── pl.json │ ├── fr.json │ ├── fa.json │ ├── th.json │ ├── en.json │ ├── uk.json │ ├── it.json │ ├── id.json │ ├── ru.json │ ├── es.json │ ├── np.json │ ├── ph.json │ ├── fi.json │ └── ar.json ├── index.scss └── _kpi.scss ├── .gitignore ├── postcss.config.js ├── webpack.dev.js ├── webpack.prod.js ├── server.js ├── babel.config.js ├── .eslintrc.json ├── server.webpack.js ├── LICENSE ├── webpack.common.js ├── package.json └── README.md /.prettierignore: -------------------------------------------------------------------------------- 1 | docs/ 2 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /docs/** 2 | 3 | -------------------------------------------------------------------------------- /static/map.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/map.jpg -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/favicon.ico -------------------------------------------------------------------------------- /static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/favicon.png -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | // Please include a screenshot of any visual changes you've made 2 | -------------------------------------------------------------------------------- /src/_type.scss: -------------------------------------------------------------------------------- 1 | $font-weight-extra-bold: 800; 2 | $font-weight-bold: 700; 3 | $font-weight-normal: 400; -------------------------------------------------------------------------------- /static/avatars/kay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/avatars/kay.jpg -------------------------------------------------------------------------------- /static/avatars/koji.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/avatars/koji.jpg -------------------------------------------------------------------------------- /static/avatars/mark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/avatars/mark.jpg -------------------------------------------------------------------------------- /static/avatars/mert.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/avatars/mert.jpg -------------------------------------------------------------------------------- /static/japan-static.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/japan-static.png -------------------------------------------------------------------------------- /static/avatars/gilles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/avatars/gilles.png -------------------------------------------------------------------------------- /static/avatars/hinano.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/avatars/hinano.jpg -------------------------------------------------------------------------------- /static/avatars/leonard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/avatars/leonard.jpg -------------------------------------------------------------------------------- /static/avatars/shane.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/avatars/shane.jpg -------------------------------------------------------------------------------- /static/avatars/vlumi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/avatars/vlumi.jpg -------------------------------------------------------------------------------- /static/avatars/alastair.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/avatars/alastair.jpg -------------------------------------------------------------------------------- /static/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/icons/favicon-16x16.png -------------------------------------------------------------------------------- /static/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/icons/favicon-32x32.png -------------------------------------------------------------------------------- /static/icons/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/icons/mstile-150x150.png -------------------------------------------------------------------------------- /static/icons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/icons/apple-touch-icon.png -------------------------------------------------------------------------------- /src/components/LanguagePicker/index.js: -------------------------------------------------------------------------------- 1 | import LanguagePicker from "./LanguagePicker"; 2 | 3 | export default LanguagePicker; 4 | -------------------------------------------------------------------------------- /static/icons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/icons/android-chrome-192x192.png -------------------------------------------------------------------------------- /static/icons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reustle/covid19japan/HEAD/static/icons/android-chrome-512x512.png -------------------------------------------------------------------------------- /src/components/DailyIncreaseChart/index.js: -------------------------------------------------------------------------------- 1 | import drawDailyIncreaseChart from "./DailyIncrease"; 2 | 3 | export default drawDailyIncreaseChart; 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | _site/ 3 | *.sqlite3 4 | docs/ 5 | 6 | .idea 7 | .vscode 8 | node_modules 9 | .jekyll-cache/ 10 | 11 | .eslintcache 12 | -------------------------------------------------------------------------------- /src/components/OutbreakMap/ApiKey.js: -------------------------------------------------------------------------------- 1 | export const MAPBOX_API_KEY = 2 | "pk.eyJ1IjoicmV1c3RsZSIsImEiOiJjazZtaHE4ZnkwMG9iM3BxYnFmaDgxbzQ0In0.nOiHGcSCRNa9MD9WxLIm7g"; 3 | -------------------------------------------------------------------------------- /src/components/PrefectureTable/index.js: -------------------------------------------------------------------------------- 1 | import { 2 | drawAllPrefectureTable, 3 | drawTopPrefectureTable, 4 | } from "./PrefectureTable"; 5 | 6 | export default { drawAllPrefectureTable, drawTopPrefectureTable }; 7 | -------------------------------------------------------------------------------- /src/components/Header/UpdatePageDirectionClass.js: -------------------------------------------------------------------------------- 1 | const updatePageDirectionClass = (direction) => { 2 | const bodyEl = document.querySelector("body"); 3 | 4 | bodyEl.dataset.direction = direction; 5 | }; 6 | 7 | export default updatePageDirectionClass; 8 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | if (process.env.NODE_ENV === 'production') { 2 | module.exports = { 3 | plugins: [ 4 | require('autoprefixer'), 5 | require('cssnano'), 6 | // More postCSS modules here if needed 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/components/OutbreakMap/index.js: -------------------------------------------------------------------------------- 1 | import drawMap from "./DrawMap"; 2 | import drawMapPrefectures from "./DrawMapPrefectures"; 3 | import { drawLegend } from "./drawLegend"; 4 | 5 | export default { 6 | drawMap, 7 | drawMapPrefectures, 8 | drawLegend, 9 | }; 10 | -------------------------------------------------------------------------------- /webpack.dev.js: -------------------------------------------------------------------------------- 1 | const merge = require("webpack-merge"); 2 | const common = require("./webpack.common.js"); 3 | 4 | module.exports = merge(common, { 5 | mode: "development", 6 | devtool: "source-map", 7 | devServer: { 8 | contentBase: "./docs", 9 | }, 10 | }); 11 | -------------------------------------------------------------------------------- /static/icons/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #8ecafb 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /webpack.prod.js: -------------------------------------------------------------------------------- 1 | const merge = require("webpack-merge"); 2 | const TerserPlugin = require("terser-webpack-plugin"); 3 | 4 | const common = require("./webpack.common.js"); 5 | 6 | module.exports = merge(common, { 7 | mode: "production", 8 | devtool: "source-map", 9 | optimization: { 10 | minimize: true, 11 | minimizer: [new TerserPlugin()], 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | const express = require('express') 3 | 4 | const app = express() 5 | app.use(express.static('docs')) 6 | 7 | let port = process.env.PORT || 4000 8 | 9 | var listener = app.listen(port, function () { 10 | console.log('listening on port ' + listener.address().port); 11 | console.log('http://localhost:' + listener.address().port); 12 | }); 13 | -------------------------------------------------------------------------------- /src/components/Header/index.js: -------------------------------------------------------------------------------- 1 | import updateTooltipLang from "./UpdateTooltipLang"; 2 | import drawPageTitleCount from "./DrawPageTitleCount"; 3 | import drawLastUpdated from "./DrawLastUpdated"; 4 | import updatePageDirectionClass from "./UpdatePageDirectionClass"; 5 | 6 | export default { 7 | updateTooltipLang, 8 | drawPageTitleCount, 9 | drawLastUpdated, 10 | updatePageDirectionClass, 11 | }; 12 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function (api) { 2 | api.cache(false); 3 | return { 4 | plugins: ["date-fns", "@babel/plugin-transform-runtime"], 5 | presets: [ 6 | [ 7 | "@babel/preset-env", 8 | { 9 | useBuiltIns: "usage", 10 | targets: { chrome: "58", ie: "11" }, 11 | }, 12 | ], 13 | ["@babel/preset-react"], 14 | ], 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /src/components/Loader/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { bool } from "prop-types"; 3 | 4 | const Loader = ({ isLoaded }) => { 5 | if (!isLoaded) return null; 6 | 7 | return ( 8 |
9 |
10 |
11 | ); 12 | }; 13 | 14 | Loader.propTypes = { 15 | isLoaded: bool.isRequired, 16 | }; 17 | 18 | export default Loader; 19 | -------------------------------------------------------------------------------- /src/components/Header/DrawPageTitleCount.js: -------------------------------------------------------------------------------- 1 | import { PAGE_TITLE } from "../../data/constants"; 2 | import { maybeIntlNumberFormat } from "../../i18n"; 3 | 4 | const drawPageTitleCount = (confirmed, lang) => { 5 | // Update the number of confirmed cases in the title 6 | const formatNumber = maybeIntlNumberFormat(lang); 7 | document.title = `(${formatNumber(confirmed)}) ${PAGE_TITLE}`; 8 | }; 9 | 10 | export default drawPageTitleCount; 11 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es6": true, 5 | "node": true 6 | }, 7 | "extends": ["plugin:prettier/recommended", "plugin:react/recommended"], 8 | "globals": { 9 | "Atomics": "readonly", 10 | "SharedArrayBuffer": "readonly" 11 | }, 12 | "parserOptions": { 13 | "ecmaVersion": 2018, 14 | "sourceType": "module" 15 | }, 16 | "plugins": ["react", "react-hooks"], 17 | "rules": { 18 | "react-hooks/rules-of-hooks": "error", 19 | "react-hooks/exhaustive-deps": "warn" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /static/icons/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Japan COVID-19", 3 | "short_name": "Japan COVID-19", 4 | "icons": [ 5 | { 6 | "src": "/static/icons/android-chrome-192x192.png?v=1586005472", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "/static/icons/android-chrome-512x512.png?v=1586005472", 12 | "sizes": "512x512", 13 | "type": "image/png" 14 | } 15 | ], 16 | "theme_color": "#8ecafb", 17 | "background_color": "#8ecafb", 18 | "display": "standalone" 19 | } 20 | -------------------------------------------------------------------------------- /src/_loader.scss: -------------------------------------------------------------------------------- 1 | 2 | // Loading Icon 3 | .loader { 4 | padding: 20px; 5 | text-align: center; 6 | } 7 | 8 | .lds-dual-ring { 9 | display: inline-block; 10 | width: 24px; 11 | height: 24px; 12 | } 13 | .lds-dual-ring:after { 14 | content: " "; 15 | display: block; 16 | width: 16px; 17 | height: 16px; 18 | border-radius: 50%; 19 | border: 4px solid #f44336; 20 | border-color: #f44336 transparent #f44336 transparent; 21 | animation: lds-dual-ring 1.6s linear infinite; 22 | } 23 | @keyframes lds-dual-ring { 24 | 0% { 25 | transform: rotate(0deg); 26 | } 27 | 100% { 28 | transform: rotate(360deg); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server.webpack.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const webpack = require('webpack') 3 | const webpackDevMiddleware = require('webpack-dev-middleware'); 4 | const config = require('./webpack.dev.js') 5 | 6 | const app = express(); 7 | const compiler = webpack(config); 8 | 9 | app.use(webpackDevMiddleware(compiler, { 10 | publicPath: config.output.publicPath 11 | })); 12 | 13 | app.use(express.static('docs')); 14 | 15 | var listener = app.listen(4000, function () { 16 | console.log("****************************************"); 17 | console.log('**** http://localhost:' + listener.address().port + "/"); 18 | console.log("****************************************"); 19 | console.log("\n"); 20 | }); 21 | -------------------------------------------------------------------------------- /src/embed.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Embed covid19japan.com into your web app 3 | */ 4 | 5 | // configure embed 6 | const element = document.getElementById("covid19japan-embed"); 7 | const style = ` 8 | border: 0; 9 | width: 100%; 10 | height: 100%; 11 | `; 12 | const src = "https://covid19japan.com/embed"; 13 | 14 | // populate embed html 15 | element.innerHTML = `