diff --git a/README.md b/README.md index e843001..5d1edee 100755 --- a/README.md +++ b/README.md @@ -53,23 +53,25 @@ - - + # About The Project -[![CovidTH][product-screenshot]](https://covidth.info/) +Thailand Covid-19 Daily Tests Dashboard -*** ฝากเติมหน่อยนะครับ ^ ^ +[![CovidTH][product-screenshot]](https://covidth.info/) + +\*\*\* ฝากเติมหน่อยนะครับ ^ ^ + ## Getting Started To get a local copy up and running follow these simple steps. ### Prerequisites -* Node.js +- Node.js ### Installation @@ -94,7 +96,9 @@ Use this space to show useful examples of how a project can be used. Additional _For more examples, please refer to the [Documentation](https://example.com)_ --> ## Built With + ### Svelte + Vite + This template should help get you started developing with Svelte in Vite. ### Recommended IDE Setup @@ -146,8 +150,8 @@ export default writable(0) See the [open issues](https://github.com/thananon/covidth/issues) for a list of proposed features (and known issues). - + ## Contributing Contributions are what make the Website Covid data, inspire, and create. Any contributions you make are **greatly appreciated**. @@ -164,21 +168,22 @@ Contributions are what make the Website Covid data, inspire, and create. Any con Distributed under the MIT License. See `LICENSE` for more information. --> - + ## CONTACT + Name - [@9ARM](https://www.youtube.com/channel/UCoiEtD4v1qMAqHV5MDI5Qpg) - Youtube Project Link: [https://github.com/thananon/covidth](https://github.com/thananon/covidth) -## Acknowledgements -* [Svelte](https://svelte.dev/) -* [vite](https://vitejs.dev/) -* [chart.js](https://www.chartjs.org/) -* [SvelteStrap](https://sveltestrap.js.org/) +## Acknowledgements +- [Svelte](https://svelte.dev/) +- [vite](https://vitejs.dev/) +- [chart.js](https://www.chartjs.org/) +- [SvelteStrap](https://sveltestrap.js.org/) [contributors-shield]: https://img.shields.io/github/contributors/thananon/covidth.svg?style=for-the-badge [contributors-url]: https://github.com/thananon/covidth/graphs/contributors diff --git a/index.html b/index.html index 1449ac4..24f7c82 100755 --- a/index.html +++ b/index.html @@ -1,26 +1,36 @@ - + - - + + covidth - ข้อมูลโควิดแบบกูทำเองก็ได้ + + + + + +
diff --git a/src/App.svelte b/src/App.svelte index b32604d..3ee47e7 100755 --- a/src/App.svelte +++ b/src/App.svelte @@ -4,11 +4,13 @@ import covtest from "./covtest.json" import Cards from "./Cards.svelte" - Chart.defaults.font.family = '"Anakotmai", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif' + Chart.defaults.font.family = + '"Anakotmai", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif' - let recordNumber = 30 let myChart let selectedList = [false, false, true] + let recordNumber = 30 + const options = [3, 7, 30] if (screen.width < 768) { recordNumber = 3 @@ -84,17 +86,16 @@ ) } - const onSelectChange = () => { - let value = document.getElementById("getShowDate").value + const onSelectChange = (e) => { + const value = e.target.value if (recordNumber != value) { recordNumber = value myChart.destroy() loadChart() - if(value === '30'){ - document.getElementById("chartInner").style.minWidth = '750px' - } - else if(value === '7'){ - document.getElementById("chartInner").style.minWidth = '500px' + if (value === "30") { + document.getElementById("chartInner").style.minWidth = "750px" + } else if (value === "7") { + document.getElementById("chartInner").style.minWidth = "500px" } } } @@ -110,7 +111,7 @@
-

เราตรวจโควิดกันวันละกี่เคส?

+

เราตรวจโควิดกันวันละกี่เคส ?

@@ -119,10 +120,21 @@
- onSelectChange(e)} + on:blur={(e) => onSelectChange(e)} + > + {#each options as option} + + {/each}
@@ -140,6 +152,10 @@
diff --git a/src/Cards.svelte b/src/Cards.svelte index 5340c03..ddf5bf3 100644 --- a/src/Cards.svelte +++ b/src/Cards.svelte @@ -1,21 +1,23 @@