├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ └── issue-template.yml ├── .gitignore ├── .vscode └── settings.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── assets ├── History │ ├── History.md │ └── assets │ │ ├── mendeleev periodic table.jpg │ │ └── mendeleev.jfif ├── comingsoon.png ├── error404.png ├── notAvail.jpeg └── wikipedia.png ├── components ├── ExploreData.js ├── Footer.js ├── Header.js ├── Periodic_Table │ ├── AtomElement.module.css │ ├── Elements.js │ ├── FilterbyCategory.js │ └── PeriodicDetail.js └── RandomInfo.js ├── context └── userContext.js ├── next-env.d.ts ├── next.config.js ├── package.json ├── pages ├── 404.js ├── _app.js ├── api │ └── hello.ts ├── elementdata │ └── [elementdata].js ├── explore.js ├── history.js ├── index.js └── periodictable.js ├── postcss.config.js ├── public ├── Periodically-poster.gif ├── design_arc.png ├── mern.png ├── periodically-demo.gif ├── periodically_design.png └── periodically_favicon.png ├── styles └── globals.css ├── tailwind.config.js ├── tsconfig.json ├── utils ├── Debounce.js ├── SortData.js └── colorCode.js └── yarn.lock /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: HarshKumarraghav 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/issue-template.yml: -------------------------------------------------------------------------------- 1 | name: Issue - Issue Template 2 | description: Report a software bug on /learn, /news, Community Forum, Code Radio, or any of the platforms. 3 | labels: ['type: bug', 'status: waiting triage'] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: If you're reporting a security issue, don't create a GitHub issue. Instead, visit https://periodically.tech 8 | - type: textarea 9 | attributes: 10 | label: Describe the Issue 11 | description: A clear and concise description of the issue you encountered. 12 | validations: 13 | required: true 14 | - type: textarea 15 | attributes: 16 | label: Screenshots 17 | description: If applicable, add screenshots to help explain your problem. You can drag and drop `png`, `jpg`, `gif`, etc. in this box. 18 | validations: 19 | required: false 20 | - type: textarea 21 | attributes: 22 | label: System 23 | description: Please complete the following information. 24 | value: 25 | validations: 26 | required: false 27 | - type: textarea 28 | attributes: 29 | label: Additional context 30 | description: Add any other context about the problem here. 31 | validations: 32 | required: false 33 | -------------------------------------------------------------------------------- /.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 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | .pnpm-debug.log* 27 | 28 | # local env files 29 | .env.local 30 | .env.development.local 31 | .env.test.local 32 | .env.production.local 33 | 34 | # vercel 35 | .vercel 36 | 37 | # typescript 38 | *.tsbuildinfo 39 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5501, 3 | "githubPullRequests.ignoredPullRequestBranches": [ 4 | "main" 5 | ] 6 | } -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | raghavharsh068@gmail.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributing to periodically 3 | 4 | First off, thanks for taking the time to contribute! ❤️ 5 | 6 | All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉 7 | 8 | > And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: 9 | > - Star the project 10 | > - Tweet about it 11 | > - Refer this project in your project's readme 12 | > - Mention the project at local meetups and tell your friends/colleagues 13 | 14 | 15 | ## Table of Contents 16 | 17 | - [Code of Conduct](#code-of-conduct) 18 | - [I Have a Question](#i-have-a-question) 19 | - [I Want To Contribute](#i-want-to-contribute) 20 | - [Reporting Bugs](#reporting-bugs) 21 | - [Suggesting Enhancements](#suggesting-enhancements) 22 | - [Your First Code Contribution](#your-first-code-contribution) 23 | - [Improving The Documentation](#improving-the-documentation) 24 | - [Styleguides](#styleguides) 25 | - [Commit Messages](#commit-messages) 26 | - [Join The Project Team](#join-the-project-team) 27 | 28 | 29 | ## Code of Conduct 30 | 31 | This project and everyone participating in it is governed by the 32 | [periodically Code of Conduct](https://github.com/HarshKumarraghav/periodically_webappblob/master/CODE_OF_CONDUCT.md). 33 | By participating, you are expected to uphold this code. Please report unacceptable behavior 34 | to <>. 35 | 36 | 37 | ## I Have a Question 38 | 39 | > If you want to ask a question, we assume that you have read the available [Documentation](). 40 | 41 | Before you ask a question, it is best to search for existing [Issues](https://github.com/HarshKumarraghav/periodically_webapp/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. 42 | 43 | If you then still feel the need to ask a question and need clarification, we recommend the following: 44 | 45 | - Open an [Issue](https://github.com/HarshKumarraghav/periodically_webapp/issues/new). 46 | - Provide as much context as you can about what you're running into. 47 | - Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. 48 | 49 | We will then take care of the issue as soon as possible. 50 | 51 | 65 | 66 | ## I Want To Contribute 67 | 68 | > ### Legal Notice 69 | > When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. 70 | 71 | ### Reporting Bugs 72 | 73 | 74 | #### Before Submitting a Bug Report 75 | 76 | A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible. 77 | 78 | - Make sure that you are using the latest version. 79 | - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](). If you are looking for support, you might want to check [this section](#i-have-a-question)). 80 | - To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/HarshKumarraghav/periodically_webappissues?q=label%3Abug). 81 | - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue. 82 | - Collect information about the bug: 83 | - Stack trace (Traceback) 84 | - OS, Platform and Version (Windows, Linux, macOS, x86, ARM) 85 | - Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant. 86 | - Possibly your input and the output 87 | - Can you reliably reproduce the issue? And can you also reproduce it with older versions? 88 | 89 | 90 | #### How Do I Submit a Good Bug Report? 91 | 92 | > You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to . 93 | 94 | 95 | We use GitHub issues to track bugs and errors. If you run into an issue with the project: 96 | 97 | - Open an [Issue](https://github.com/HarshKumarraghav/periodically_webapp/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) 98 | - Explain the behavior you would expect and the actual behavior. 99 | - Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. 100 | - Provide the information you collected in the previous section. 101 | 102 | Once it's filed: 103 | 104 | - The project team will label the issue accordingly. 105 | - A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. 106 | - If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution). 107 | 108 | 109 | 110 | 111 | ### Suggesting Enhancements 112 | 113 | This section guides you through submitting an enhancement suggestion for periodically, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. 114 | 115 | 116 | #### Before Submitting an Enhancement 117 | 118 | - Make sure that you are using the latest version. 119 | - Read the [documentation]() carefully and find out if the functionality is already covered, maybe by an individual configuration. 120 | - Perform a [search](https://github.com/HarshKumarraghav/periodically_webapp/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. 121 | - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. 122 | 123 | 124 | #### How Do I Submit a Good Enhancement Suggestion? 125 | 126 | Enhancement suggestions are tracked as [GitHub issues](https://github.com/HarshKumarraghav/periodically_webapp/issues). 127 | 128 | - Use a **clear and descriptive title** for the issue to identify the suggestion. 129 | - Provide a **step-by-step description of the suggested enhancement** in as many details as possible. 130 | - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. 131 | - You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. 132 | - **Explain why this enhancement would be useful** to most periodically users. You may also want to point out the other projects that solved it better and which could serve as inspiration. 133 | 134 | 135 | 136 | ### Your First Code Contribution 137 | 141 | 142 | ### Improving The Documentation 143 | 147 | 148 | ## Styleguides 149 | ### Commit Messages 150 | 153 | 154 | ## Join The Project Team 155 | 156 | 157 | 158 | ## Attribution 159 | This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)! 160 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### [Periodically - The Periodic table](https://periodically.tech) 2 | 3 | We all remember the times when we used to struggle to remember the names, properties, groups, etc. of periodic elements. Those sweet-saur nostalgic school memories of memorizing the whole periodic table for our upcoming Unit test used to be a nightmare for many of us! The periodic table is the heart of chemistry and to make its learning more fun and engaging, the idea to build **"Periodically-The Periodic Table"** was born. 4 | 5 |

6 | 7 |

8 | 9 | ![Periodically](public/Periodically-poster.gif) 10 | 11 | ## ⚛️ Why a periodic table 12 | 13 | In the **Periodically** web application you will find a huge amount of data about chemical elements for free. You will learn a lot of new and are useful for yourself, no matter if you are a schoolboy, student, engineer, housewife, or a person of any other provisions that do not have a refresher in Chemistry. 14 | 15 | The chemistry falls into to a number of the most important sciences and is one of the main school objects. 16 | Its studying begins with the Periodic Table. An interactive approach to a training material is more effective than a classical one. As in it 17 | technologies which became the family for the modern pupils are used. 18 | 19 | ## Periodically Demo 20 | 21 | ![Video](public/periodically-demo.gif) 22 | 23 | ## 📌 Description 24 | 25 | **Periodically** - is a free web application that displays the entire Periodic Table at the startup interface. The table has a long- 26 | form approved by the International Union of Pure and Applied Chemistry (IUPAC) as the core. Besides the Periodic Table of 27 | chemical elements, you can use the Table of solubility. 28 | 29 | The chemistry falls into to a number of the most important sciences and is one of the main school objects. 30 | Its studying begins with the Periodic Table. An interactive approach to a training material is more effective than a classical one. As in it 31 | technologies which became the family for the modern pupils are used. 32 | 33 | ## ✨ Features 34 | 35 | - Displays the entire Periodic Table at the startup interface. 36 | - Thought of the day. 37 | - When you click on any element provides information that is constantly updated. 38 | - For most of the items have an image. 39 | - For more information, there are direct links to Wikipedia for each item 40 | - Table solubility 41 | - To find any element you can use the search. The search engine is not choosy to the registry or writing style search. 42 | - You can sort the items into 10 categories: 43 | • Alkaline earth metals 44 | • Other nonmetals 45 | Alkali metals 46 | • Halogens 47 | • Transition metals 48 | • Noble gases 49 | • Semiconductor 50 | • Lanthanides 51 | • Metalloids 52 | • Actinides 53 | Elements of the selected category will be listed in the search results and are highlighted in the table on the main application 54 | screen. 55 | 56 | ## 🛠️ Design Architecture 57 | 58 | ![Periodically](public/design_arc.png) 59 | 60 | ## 🛠️ Periodically_golang_servers (API) 61 | 62 | A simple Golang API for **Periodic Table Elements** returns in JSON format. 63 | You can access the data by using this link: 64 | [Periodically](https://periodically-golang-server.herokuapp.com) 65 | 66 | ## 💡 Upcoming Feature 67 | 68 | - Authentication 69 | - Periodical Table - History 70 | - Subscription-based data 71 | - payment system (stripe or Paytm) 72 | - Newsletter 73 | - Contact us page 74 | 75 | ## Expected JSON Data Format 76 | 77 | ```JSON 78 | { 79 | "name": "Hydrogen", 80 | "appearance": "colorless gas", 81 | "atomic_mass": 1.008, 82 | "boil": 20.271, 83 | "category": "diatomic nonmetal", 84 | "color": null, 85 | "density": 0.08988, 86 | "discovered_by": "Henry Cavendish", 87 | "melt": 13.99, 88 | "molar_heat": 28.836, 89 | "named_by": "Antoine Lavoisier", 90 | "number": 1, 91 | "period": 1, 92 | "phase": "Gas", 93 | "source": "https://en.wikipedia.org/wiki/Hydrogen", 94 | "spectral_img": "https://upload.wikimedia.org/wikipedia/commons/e/e4/Hydrogen_Spectra.jpg", 95 | "summary": "Hydrogen is a chemical element with chemical symbol H and atomic number 1. With an atomic weight of 1.00794 u, hydrogen is the lightest element on the periodic table. Its monatomic form (H) is the most abundant chemical substance in the Universe, constituting roughly 75% of all baryonic mass.", 96 | "symbol": "H", 97 | ":": 1, 98 | "ypos": 1, 99 | "shells": [1], 100 | "electron_configuration": "1s1", 101 | "electron_configuration_semantic": "1s1", 102 | "electron_affinity": 72.769, 103 | "electronegativity_pauling": 2.2, 104 | "ionization_energies": [1312], 105 | "cpk-hex": "ffffff" 106 | } 107 | ``` 108 | 109 | --- 110 | 111 | ## 💻 Development 112 | 113 | ### Install Repository 114 | 115 | ```git 116 | git clone https://github.com/HarshKumarraghav/periodically_webapp 117 | ``` 118 | 119 | ### Run Project 120 | 121 | Install node modules and run the project. 122 | 123 | ``` 124 | npm install 125 | or 126 | yarn install 127 | ``` 128 | 129 | ``` 130 | npm run dev 131 | or 132 | yarn run dev 133 | ``` 134 | 135 | ### Finish 136 | 137 | ``` 138 | Your project is running on https://localhost:3000. 139 | ``` 140 | -------------------------------------------------------------------------------- /assets/History/History.md: -------------------------------------------------------------------------------- 1 | # History 2 | 3 | - **Metals and Non-Metals** 4 | _Antoine Lavoisier_, a French chemist, attempted to classify elements as metals and non-metals in 1789. 5 | 6 | - **Döbereiner Triads** 7 | _Johann Wolfgang Döbereiner_, a German physicist, discovered similarities in the physical and chemical properties of certain elements forty years later after Lavoisier's classification. He grouped the similar elements into groups of three in **increasing atomic weight** and named then **triads**, properties of middle element like atomic weight, density were approximately equal to the average of the properties of other two elements. The triads were: 8 | 9 | - Lithium, Sodium, Potassium 10 | - Calcium, Strontium, Barium 11 | - Chlorine, Bromine, Iodine 12 | 13 | For example, lithium(6.9), potassium(39.1) -> average = 23 which is sodium's atomic mass. 14 | 15 | So it can be seen that average atomic masses of first and last element will approximately result in the atomic mass of second element. 16 | 17 | - **Law of Octaves** 18 | _John Newlands_, a British scientist, organised the 62 known elements into the periodic table in the increasing order of their atomic masses. He discovered that every 8th element had similar properties. 19 | He compared the similarity between the elements with the octaves of music where every 8th note is comparable to the first, hence the name. 20 | 21 | - Sodium is one of lithium's eight elements. 22 | - Chlorine is the 8th element after Fluorine. 23 | 24 | But this was only applicable till calcium and not to the elements with higher atomic masses than calcium. Also, few dissimilar elements were grouped together like halogens with metals such as Cobalt(Co), Nickel(Ni) and Platinum(Pt). 25 | 26 | 27 | 28 | # About Mendeleev - Father of Periodic Table 29 | mendeleev 30 | 31 | _Dmriti Ivanovich Mendeleev_, a Russian chemist, who is best known for developing the **Periodic Law** and creating a version of **periodic table of elements**. He was born in 1783 near Tobolsk in Siberia. He faced a lot of problems from financial issues to health problems like tuberculosis and the demise of his parents. 32 | 33 | In his professional life, he worked on **capillarity of liquids** and the workings of **spectroscope**. He also published a textbook named **Principles of Chemistry** which made him won **Demidov Prize**. This book dealt with the elasticity of gases and a major formula for their deviation from Boyle’s law, the principle that the volume of a gas varies inversely with its pressure. After this he studied the thermal expansion too. While working on this book, he accidently discovered the periodic law. Later, he became Doctor of Science for his dissertion on the "Combinations of Water with Alcohol". 34 | He was honored with Noble prize in 1906 for his Periodic Table. 35 | 36 |
37 |
38 | 39 | # Mendeleev's Periodic Table 40 |
41 |

42 | mendeleev periodic table 43 |

44 |
45 | 46 | Mendeleev arranged all 63 elements known at that time in the form of a table i.e. **Mendeleev's Periodic Table**. The elements were arranged in the order of their increasing atomic weights. These series were divided into 7 horizontal columns(periods) and 8 vertical columns(groups). He proposed a Periodic Law: 47 | 48 | ` "The physical and chemical properties of the elements are the periodic function of their atomic weights." ` 49 | 50 | One of the major property of his table was that **he left some gaps for the undiscovered elements** which were later found to be correct like Germanium, Scandium and Gallium which were known as Eka - silicon, Eka - boron and Eka - aluminium respectively in the table. 51 | 52 | Another important characteristic is that noble gases were placed in a separate group called **Zero Group**, after VIII group without making disturbance to the initial arrangement. -------------------------------------------------------------------------------- /assets/History/assets/mendeleev periodic table.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarshKumarraghav/periodically/3694d529621dd138e32f92189e32dab70edb71d9/assets/History/assets/mendeleev periodic table.jpg -------------------------------------------------------------------------------- /assets/History/assets/mendeleev.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarshKumarraghav/periodically/3694d529621dd138e32f92189e32dab70edb71d9/assets/History/assets/mendeleev.jfif -------------------------------------------------------------------------------- /assets/comingsoon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarshKumarraghav/periodically/3694d529621dd138e32f92189e32dab70edb71d9/assets/comingsoon.png -------------------------------------------------------------------------------- /assets/error404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarshKumarraghav/periodically/3694d529621dd138e32f92189e32dab70edb71d9/assets/error404.png -------------------------------------------------------------------------------- /assets/notAvail.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarshKumarraghav/periodically/3694d529621dd138e32f92189e32dab70edb71d9/assets/notAvail.jpeg -------------------------------------------------------------------------------- /assets/wikipedia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarshKumarraghav/periodically/3694d529621dd138e32f92189e32dab70edb71d9/assets/wikipedia.png -------------------------------------------------------------------------------- /components/ExploreData.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from "react"; 2 | import Link from "next/link"; 3 | import Classes from "../components/Periodic_Table/AtomElement.module.css"; 4 | import { ArrowBack, GitHub } from "@mui/icons-material"; 5 | import { useRouter } from "next/router"; 6 | import { SortExplore } from "../utils/SortData"; 7 | const ExploreData = ({ filterData, tableData, setFilterData, handleClick }) => { 8 | const router = useRouter(); 9 | const [sortingData, setSortingData] = useState("number"); 10 | const colorMap = { 11 | "noble gas": "#3AB0FF", 12 | "polyatomic nonmetal": "#F00699", 13 | "alkaline earth metal": "#01708F", 14 | "diatomic nonmetal": "#FF5F00", 15 | "alkali metal": "#3E00FF", 16 | "transition metal": "#BF1A2F", 17 | "post-transition metal": "#890596", 18 | lanthanide: "#7868E6", 19 | actinide: "#FF8C32", 20 | metalloid: "#3EC70B", 21 | }; 22 | // sorting by name 23 | useEffect(() => { 24 | if (sortingData === "") { 25 | setFilterData(tableData); 26 | } else if (sortingData === "name") { 27 | const sortedData = [...tableData].sort((a, b) => 28 | a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1 29 | ); 30 | setFilterData(sortedData); 31 | } 32 | }, [sortingData, tableData]); 33 | 34 | // sorting by symbol 35 | useEffect(() => { 36 | if (sortingData === "") { 37 | setFilterData(tableData); 38 | } else if (sortingData === "symbol") { 39 | const sortedData = [...tableData].sort((a, b) => 40 | a.symbol.toLowerCase() < b.symbol.toLowerCase() ? -1 : 1 41 | ); 42 | setFilterData(sortedData); 43 | } 44 | }, [sortingData, tableData]); 45 | 46 | // sorting by atomic number 47 | useEffect(() => { 48 | if (sortingData === "") { 49 | setFilterData(tableData); 50 | } else if (sortingData === "number") { 51 | const sortedData = [...tableData].sort((a, b) => 52 | a.number < b.number ? -1 : 1 53 | ); 54 | setFilterData(sortedData); 55 | } 56 | }, [sortingData, tableData]); 57 | // sorting by category 58 | useEffect(() => { 59 | if (sortingData === "") { 60 | setFilterData(tableData); 61 | } else if (sortingData === "category") { 62 | const sortedData = [...tableData].sort((a, b) => 63 | a.category.toLowerCase() < b.category.toLowerCase() ? -1 : 1 64 | ); 65 | setFilterData(sortedData); 66 | } 67 | }, [sortingData, tableData]); 68 | // sorting by Appearence 69 | useEffect(() => { 70 | if (sortingData === "") { 71 | setFilterData(tableData); 72 | } else if (sortingData === "appearance") { 73 | const sortedData = [...tableData].sort((a, b) => 74 | a.phase.toLowerCase() < b.phase.toLowerCase() ? -1 : 1 75 | ); 76 | setFilterData(sortedData); 77 | } 78 | }, [sortingData, tableData]); 79 | return ( 80 |
81 |
82 |
83 |
router.push("/periodictable")}> 84 | 85 |
86 | 87 | 88 | 89 |
90 | 91 |
92 |
93 | 94 |
95 |
96 |
97 |
98 |
99 |

100 | Sort the element on the basis of:{" "} 101 |

102 |
    103 |
  • - Atomic Number
  • 104 |
  • - Name
  • 105 |
  • - Symbol
  • 106 |
  • 107 | - Category(Alkali metal, Alkaline earth metal, Nobel gas ...) 108 |
  • 109 |
  • - Phase (Gas Liquid , Solid)
  • 110 |
111 |
112 |
113 | 114 |
115 | {SortExplore?.map((data) => ( 116 | 127 | ))} 128 |
129 |
130 | {filterData.map((item) => ( 131 |
{ 135 | router.push(`/elementdata/${item.number}`); 136 | }} 137 | > 138 |
139 |
143 |
{item.number}
144 |
{item.symbol}
145 |
{item.name}
146 |
147 |
148 |
149 |

153 | {item.number}.{item.name} 154 |

155 |

156 | Discovered by:{item.discovered_by} 157 |

158 |
159 |
160 |

161 | Nature:{item.category.toUpperCase()} 162 |

163 |
164 |
165 |

Electron

166 |

{item.number}

167 |
168 |
169 |

Proton

170 |

{item.number}

171 |
172 |
173 |

Neutron

174 |

175 | {Math.round(item.atomic_mass - item.number)} 176 |

177 |
178 |
179 |
180 |
181 | ))} 182 |
183 |
184 |
router.push("/periodictable")}> 185 |

186 | Explore the random Element: 187 |

188 |
189 | 190 |
191 | 194 |
195 |
196 |
197 |
198 | ); 199 | }; 200 | 201 | export default ExploreData; 202 | -------------------------------------------------------------------------------- /components/Footer.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Link from "next/link"; 3 | import { 4 | GitHub, 5 | Instagram, 6 | LinkedIn, 7 | Public, 8 | Twitter, 9 | } from "@mui/icons-material"; 10 | const Footer = () => { 11 | return ( 12 | <> 13 |
14 |
15 |

16 | Periodically 17 |

18 |

19 | "The place where you can learn anything and everything about 20 | elements by which our universe is made of." 21 |

22 |
23 |
24 |
25 | Social 26 |
27 |
28 | 29 | 30 |
31 | 32 |
33 |
34 | 35 | 39 | 40 |
41 | 42 |
43 |
44 | 45 | 46 | 47 |
48 | 49 |
50 |
51 | 52 | 53 | 54 |
55 | 56 |
57 |
58 | 59 | 63 | 64 |
65 | 66 |
67 |
68 | 69 |
70 |
71 | 72 |
73 |
74 | About Me 75 |
76 |

77 | Front-end Developer intern at 78 | 82 | 83 | Bots Fusion AI 84 | 85 | 86 | 87 | , Skilled at Algorithms, C (Programming Language), C++, and Video Editing. 88 | Strong media and communication professional with a Bachelor's degree 89 | focused in Information Technology from Gautam buddha University. 90 |

91 |
92 |
93 |
94 |
Create with ❤️ by "Harsh Raghav"
95 |
Ⓒ2022 Raghav inc. All rights reserved.
96 |
97 | 98 | ); 99 | }; 100 | 101 | export default Footer; 102 | -------------------------------------------------------------------------------- /components/Header.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from "react"; 2 | import { SearchIcon } from "@heroicons/react/solid"; 3 | import Link from "next/link"; 4 | import Classes from "../components/Periodic_Table/AtomElement.module.css"; 5 | import { GitHub, HistoryEdu, Explore } from "@mui/icons-material"; 6 | import { useRouter } from "next/router"; 7 | import { usePeriodicTable } from "../context/userContext"; 8 | import { MyDebounce } from "../utils/Debounce"; 9 | import { colorMap } from "../utils/colorCode"; 10 | import { SortHeader } from "../utils/SortData"; 11 | const Header = () => { 12 | const router = useRouter(); 13 | const [tableData] = usePeriodicTable(); 14 | const [filterData, setFilterData] = useState(""); 15 | const [sortingData, setSortingData] = useState("number"); 16 | useEffect(() => { 17 | setFilterData(tableData); 18 | }, [tableData]); 19 | 20 | const [searchInput, setSearchInput] = useState(""); 21 | const [active, setActive] = useState(false); 22 | 23 | // sorting by name 24 | useEffect(() => { 25 | if (sortingData === "") { 26 | setFilterData(tableData); 27 | } else if (sortingData === "name") { 28 | const sortedData = [...tableData].sort((a, b) => 29 | a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1 30 | ); 31 | setFilterData(sortedData); 32 | } 33 | }, [sortingData, tableData]); 34 | 35 | // sorting by symbol 36 | useEffect(() => { 37 | if (sortingData === "") { 38 | setFilterData(tableData); 39 | } else if (sortingData === "symbol") { 40 | const sortedData = [...tableData].sort((a, b) => 41 | a.symbol.toLowerCase() < b.symbol.toLowerCase() ? -1 : 1 42 | ); 43 | setFilterData(sortedData); 44 | } 45 | }, [sortingData, tableData]); 46 | 47 | // sorting by atomic number 48 | useEffect(() => { 49 | if (sortingData === "") { 50 | setFilterData(tableData); 51 | } else if (sortingData === "number") { 52 | const sortedData = [...tableData].sort((a, b) => 53 | a.number < b.number ? -1 : 1 54 | ); 55 | setFilterData(sortedData); 56 | } 57 | }, [sortingData, tableData]); 58 | const handleClose = (e) => { 59 | if (e.target.id === "handle") { 60 | setActive(false); 61 | } 62 | }; 63 | const SetInputString = (value) => { 64 | setSearchInput(value); 65 | }; 66 | /* `const DebouncedSetInputString = MyDebounce(SetInputString, 3000);` is creating a debounced version 67 | of the `SetInputString` function using the `MyDebounce` utility function. This means that when 68 | `DebouncedSetInputString` is called, it will wait for 3000 milliseconds (3 seconds) before actually 69 | executing the `SetInputString` function. This is useful for handling user input in real-time without 70 | overwhelming the system with too many requests. */ 71 | const DebouncedSetInputString = MyDebounce(SetInputString, 300); 72 | return ( 73 |
78 | {/* left div */} 79 |
router.push("/periodictable")} 81 | className="relative my-auto flex h-10 cursor-pointer sm:items-center sm:justify-start items-center" 82 | > 83 |

84 | Periodically 85 |

86 |
87 | {/* middle div - search*/} 88 |
setActive(true)} 91 | > 92 | { 94 | DebouncedSetInputString(e.target.value); 95 | }} 96 | type="text" 97 | placeholder={"Search your element by name || symbol || number"} 98 | className=" flex-grow bg-transparent pl-5 outline-none text-primary-white" 99 | /> 100 | 101 |
102 |
router.push("/explore")} 105 | > 106 | 107 | 108 |
109 | {/* right div */} 110 |
111 |
router.push("/explore")} 114 | > 115 | 116 | 117 |
118 |
router.push("/history")} 121 | > 122 | 123 | 126 |
127 | 132 | 133 |
134 | 135 |

Api-docs

136 |
137 |
138 | 139 |
140 | {active && ( 141 |
142 |
143 | {SortHeader?.map((data) => ( 144 | 155 | ))} 156 |
157 |
158 | {filterData 159 | .filter((value) => { 160 | if (searchInput === "") { 161 | return value; 162 | } else { 163 | return ( 164 | value.name 165 | .toLowerCase() 166 | .includes(searchInput.toLowerCase()) || 167 | value.symbol 168 | .toLowerCase() 169 | .includes(searchInput.toLowerCase()) || 170 | value.number.toString().includes(searchInput) 171 | ); 172 | } 173 | }) 174 | .map((item) => ( 175 |
{ 179 | router.push(`/elementdata/${item.number}`), 180 | setActive(false); 181 | }} 182 | > 183 |
184 |
188 |
{item.number}
189 |
{item.symbol}
190 |
{item.name}
191 |
192 |
193 |
194 |

198 | {item.number}.{item.name} 199 |

200 |

201 | Discovered by:{item.discovered_by} 202 |

203 |
204 |
205 |

206 | Nature:{item.category.toUpperCase()} 207 |

208 |
209 |
210 |

Electron

211 |

{item.number}

212 |
213 |
214 |

Proton

215 |

{item.number}

216 |
217 |
218 |

Neutron

219 |

220 | {Math.round(item.atomic_mass - item.number)} 221 |

222 |
223 |
224 |
225 |
226 | ))} 227 |
228 |
229 | )} 230 |
231 | ); 232 | }; 233 | 234 | export default Header; 235 | -------------------------------------------------------------------------------- /components/Periodic_Table/AtomElement.module.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Cormorant+Garamond:wght@400;500&family=Montserrat:wght@400;500&display=swap"); 2 | .periodictable { 3 | display: grid; 4 | grid-template-columns: repeat(18, 68px); 5 | grid-template-rows: repeat(10, 68px); 6 | grid-gap: 8px; 7 | } 8 | 9 | .element { 10 | background: #ffffff26; 11 | box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.2); 12 | border-radius: 5px; 13 | position: relative; 14 | text-align: center; 15 | display: flex; 16 | flex-direction: column; 17 | cursor: pointer; 18 | z-index: 1; 19 | } 20 | .element:hover { 21 | box-shadow: -12px -12px 12px 0 rgba(58, 58, 58, 0.3), 22 | 12px 12px 12px 0 rgba(0, 0, 0, 0.2); 23 | transform: scale3d(1.1, 1.1, 1.1); 24 | transition: all 250ms ease-in-out; 25 | } 26 | .number { 27 | font-family: "Cormorant Garamond", serif; 28 | font-weight: 400; 29 | font-size: 14px; 30 | position: absolute; 31 | top: 7px; 32 | left: 7px; 33 | display: table; 34 | flex: 0 1; 35 | } 36 | .symbol { 37 | font-size: 25px; 38 | padding-top: 7px; 39 | font-weight: 700; 40 | padding-top: 15px; 41 | flex: 6 1; 42 | font-family: "Cormorant Garamond", serif; 43 | } 44 | 45 | .name { 46 | font-size: 10px; 47 | letter-spacing: 0.54px; 48 | flex: 3 1; 49 | text-transform: capitalize; 50 | font-family: "Cormorant Garamond", serif; 51 | } 52 | 53 | .ptlegend { 54 | position: absolute; 55 | top: 1%; 56 | left: 250px; 57 | display: grid; 58 | grid-template-columns: repeat(2, 1fr); 59 | grid-gap: 12px; 60 | color: #eeeeee; 61 | } 62 | .elementDetail { 63 | width: 150px; 64 | height: 150px; 65 | background: #ffffff26; 66 | box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.2); 67 | border-radius: 5px; 68 | position: relative; 69 | text-align: center; 70 | display: flex; 71 | justify-content: space-evenly; 72 | flex-direction: column; 73 | cursor: pointer; 74 | z-index: 1; 75 | } 76 | .numberDetail { 77 | font-family: "Cormorant Garamond", serif; 78 | font-weight: 400; 79 | position: absolute; 80 | top: 7px; 81 | left: 7px; 82 | display: table; 83 | flex: 0 1; 84 | } 85 | .symbolDetail { 86 | padding-top: 7px; 87 | font-weight: 700; 88 | padding-top: 15px; 89 | font-family: "Cormorant Garamond", serif; 90 | } 91 | 92 | .nameDetail { 93 | padding-top: 7px; 94 | letter-spacing: 0.54px; 95 | text-transform: capitalize; 96 | font-family: "Cormorant Garamond", serif; 97 | } 98 | -------------------------------------------------------------------------------- /components/Periodic_Table/Elements.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from "react"; 2 | import { motion, AnimatePresence } from "framer-motion"; 3 | import Classes from "./AtomElement.module.css"; 4 | import { usePeriodicTable } from "../../context/userContext"; 5 | import FilterbyCategory from "../../components/Periodic_Table/FilterbyCategory"; 6 | import Link from "next/link"; 7 | import { Rings } from "react-loader-spinner"; 8 | import { colorMap } from "../../utils/colorCode"; 9 | 10 | const Elements = () => { 11 | const [tableData] = usePeriodicTable(); 12 | const [loadingTable] = usePeriodicTable(); 13 | const [filterData, setFilterData] = useState([]); 14 | const [activeCategory, setActiveCategory] = useState(""); 15 | useEffect(() => { 16 | setFilterData(tableData); 17 | }, [tableData]); 18 | 19 | return ( 20 | <> 21 | {loadingTable == false ? ( 22 |
23 | 32 |

Loading....

33 |
34 | ) : ( 35 |
36 |
37 | 44 |
48 | 49 | {filterData?.map((element, i) => ( 50 | 55 | 70 |
{element.number}
71 |
{element.symbol}
72 |
{element.name}
73 |
74 | 75 | ))} 76 |
77 |
78 |
82 |
83 |
84 | )} 85 | 86 | ); 87 | }; 88 | 89 | export default Elements; 90 | -------------------------------------------------------------------------------- /components/Periodic_Table/FilterbyCategory.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from "react"; 2 | import { usePeriodicTable } from "../../context/userContext"; 3 | import { color, motion } from "framer-motion"; 4 | import { buttonDataMap, colorMap } from "../../utils/colorCode"; 5 | 6 | const FilterbyCategory = ({ 7 | setFilterData, 8 | activeCategory, 9 | setActiveCategory, 10 | }) => { 11 | const [tableData] = usePeriodicTable(); 12 | useEffect(() => { 13 | setFilterData( 14 | tableData.map((element) => 15 | element.category === activeCategory 16 | ? { ...element, bgColor: colorMap[activeCategory] } 17 | : activeCategory === "" 18 | ? { 19 | ...element, 20 | bgColor: colorMap[element.category], 21 | } 22 | : { 23 | ...element, 24 | bgColor: "#ffffff26", 25 | } 26 | ) 27 | ); 28 | }, [activeCategory, tableData]); 29 | return ( 30 | 36 |
37 | Filter the Elements 38 |
39 | setActiveCategory("")} 41 | className="w-40 h-8 font-bold p-1 rounded-md shadow-light-card text-[10px] font-custom active:scale-90 hover:scale-95 transition text-gray-300" 42 | whileHover={{ scale: 1.05 }} 43 | whileTap={{ scale: 0.95 }} 44 | > 45 | ALL ELEMENTS 46 | 47 | {buttonDataMap?.map((buttonData) => ( 48 | setActiveCategory(buttonData.name)} 52 | style={{ color: buttonData.color }} 53 | whileHover={{ scale: 1.05 }} 54 | whileTap={{ scale: 0.95 }} 55 | > 56 | {buttonData.name.toUpperCase()} 57 | 58 | ))} 59 |
60 | ); 61 | }; 62 | 63 | export default FilterbyCategory; 64 | -------------------------------------------------------------------------------- /components/Periodic_Table/PeriodicDetail.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from "react"; 2 | import { useRouter } from "next/router"; 3 | import Image from "next/image"; 4 | import Head from "next/head"; 5 | import Classes from "./AtomElement.module.css"; 6 | import { 7 | ArrowBack, 8 | Book, 9 | ContentPasteSearch, 10 | Analytics, 11 | Biotech, 12 | ArrowForward, 13 | } from "@mui/icons-material"; 14 | import Wiki from "../../assets/wikipedia.png"; 15 | import notAvail from "../../assets/notAvail.jpeg"; 16 | import Link from "next/link"; 17 | 18 | const PeriodicDetail = ({ elementDataDetail }) => { 19 | const [elementData, setElementData] = useState([]); 20 | const router = useRouter(); 21 | /* The above code is defining a JavaScript object called `colorMap` which maps different types of 22 | chemical elements to specific colors. Each chemical element type is represented as a key in the 23 | object, and its corresponding color is represented as the value associated with that key. */ 24 | const colorMap = { 25 | "noble gas": "#3AB0FF", 26 | "polyatomic nonmetal": "#F00699", 27 | "alkaline earth metal": "#01708F", 28 | "diatomic nonmetal": "#FF5F00", 29 | "alkali metal": "#3E00FF", 30 | "transition metal": "#BF1A2F", 31 | "post-transition metal": "#890596", 32 | lanthanide: "#7868E6", 33 | actinide: "#FF8C32", 34 | metalloid: "#3EC70B", 35 | }; 36 | /* The above code is using the `useEffect` hook in React to update the state of `elementData` whenever 37 | `elementDataDetail` changes. It creates an empty array `Data`, pushes the value of 38 | `elementDataDetail` into it, and then sets the state of `elementData` to `Data`. */ 39 | useEffect(() => { 40 | const Data = []; 41 | Data.push(elementDataDetail); 42 | setElementData(Data); 43 | }, [elementDataDetail]); 44 | 45 | return ( 46 | <> 47 | {elementData?.map((element, i) => ( 48 |
49 | 50 | 51 | {element.number}. || {element.name} 52 | 53 | 54 | 55 | {/* nav seaction */} 56 | {/* The above code is a JSX code snippet written in React. It is 57 | rendering a header component with a background color of "primary", 58 | containing an arrow back icon, a category label with the element 59 | number, and a link to the element's source page. The category label's 60 | background color is determined by a color map based on the element's 61 | category. The component is also using React Router to navigate to the 62 | periodic table page when the arrow back icon is clicked. */} 63 |
64 |
65 |
router.push("/periodictable")}> 66 | 67 |
68 |
72 | {element.number}. 73 | {element.category.toUpperCase()} 74 |
75 | 76 | 77 | 78 |
79 | 80 |
81 |
82 | 83 |
84 |
85 | {/* header seaction */} 86 |
87 |
88 |
89 |
90 | {element.number === 1 ? ( 91 |
92 | No element exists 93 |
94 | ) : ( 95 |
98 | router.push(`/elementdata/${element.number - 1}`) 99 | } 100 | > 101 | 102 |

103 | Atomic Number-{element.number - 1} 104 |

105 |
106 | )} 107 | {element.number === 119 ? ( 108 |
109 | No element exists 110 |
111 | ) : ( 112 |
115 | router.push(`/elementdata/${element.number + 1}`) 116 | } 117 | > 118 |

119 | Atomic Number-{element.number + 1} 120 |

121 | 122 |
123 | )} 124 |
125 |
126 |
133 |
134 |
137 | {element.number} 138 |
139 |
140 | {element.symbol} 141 |
142 |
143 | {element.name} 144 |
145 |
146 |
147 | 148 |
149 |
150 | {element.number === 1 ? ( 151 |
152 | No element exists 153 |
154 | ) : ( 155 |
158 | router.push(`/elementdata/${element.number - 1}`) 159 | } 160 | > 161 | 162 |

163 | Atomic Number-{element.number - 1} 164 |

165 |
166 | )} 167 | {element.number === 119 ? ( 168 |
169 | No element exists 170 |
171 | ) : ( 172 |
175 | router.push(`/elementdata/${element.number + 1}`) 176 | } 177 | > 178 |

179 | Atomic Number-{element.number + 1} 180 |

181 | 182 |
183 | )} 184 |
185 |
186 | 187 |

188 | Overview 189 |

190 |
191 |
192 |

196 | Atomic Number: 197 |

198 |

199 | {element.number} 200 |

201 |
202 |
203 |
204 |

208 | Name: 209 |

210 |

211 | {element.name} 212 |

213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |

225 | Summary: 226 |

227 |

228 | {element.summary} 229 |

230 |
231 |
232 | 233 |
234 |

238 | Discovered By: 239 |

240 |

241 | {element.discovered_by || "Unknown"} 242 |

243 |
244 |
245 | 246 |
247 |

251 | Named By: 252 |

253 |

254 | {element.named_by || "Unknown"}{" "} 255 |

256 |
257 |
258 |
259 |

263 | Appearance: 264 |

265 |

266 | {element.appearance || "Unknown"} 267 |

268 |
269 |
270 |
271 |

275 | Color: 276 |

277 |

278 | {element.color || "Unknown"} 279 |

280 |
281 |
282 |
283 | 284 |

285 | Properties 286 |

287 |
288 |
289 |

293 | Atomic Mass: 294 |

295 |

296 | {Math.round(element.atomic_mass) || "Unknown"}g/mol 297 |

298 |
299 |
300 |
301 |

305 | Density: 306 |

307 |

308 | {Math.round(element.density) || "Unknown"}g/cm³ 309 |

310 |
311 |
312 |
313 |

317 | Phase 318 |

319 |

320 | {element.phase || "Unknown"} 321 |

322 |
323 |
324 | 325 |
326 |

330 | Electron Shells 331 |

332 |

333 | {element.shells.map((data, i) => ( 334 | {`${data}, `} 335 | ))} 336 |

337 |
338 |
339 | 340 |
341 |
342 |

346 | Electron 347 |

348 |

349 | {element.number} 350 |

351 |
352 |
353 |

357 | Protron 358 |

359 |

360 | {element.number} 361 |

362 |
363 |
364 |

368 | Neutron 369 |

370 |

371 | {Math.round(element.atomic_mass - element.number)} 372 |

373 |
374 |
375 |
376 |
377 | 378 |

379 | Physical Properties 380 |

381 |
382 |
383 |

387 | Period: 388 |

389 |

390 | {element.period || "Unknown"} 391 |

392 |
393 |
394 |
395 |

399 | Melting Point 400 |

401 |

402 | {Math.round(element.melt)} 403 | °K ={" "} 404 | {Math.round(element.melt - 273.15)} 405 | °C ={" "} 406 | {Math.round((element.melt - 273.15) * 1.8) + 32} 407 | °F 408 |

409 |
410 |
411 |
412 |

416 | Boiling Point 417 |

418 |

419 | {Math.round(element.boil)} 420 | °K = 421 | {Math.round(element.boil - 273.15)} 422 | °C = 423 | {Math.round((element.boil - 273.15) * 1.8) + 32} 424 | °F 425 |

426 |
427 |
428 |
429 |

433 | Molar Heat: 434 |

435 |

436 | {Math.round(element.molar_heat) || "Unknown"} J/mol·K 437 |

438 |
439 |
440 |
441 |

445 | Spectrals Line: 446 |

447 |
448 | 453 |
454 |
455 |
456 | 457 |

458 | Atomic Properties 459 |

460 |
461 |
462 |

466 | Electronic Configuration: 467 |

468 |

469 | {element.electron_configuration} 470 |

471 |
472 |
473 |
474 |

478 | Electronic Configuration Semantic: 479 |

480 |

481 | {element.electron_configuration_semantic} 482 |

483 |
484 |
485 |
486 |

490 | Electronic Affenity: 491 |

492 |

493 | {element.electron_affinity} kJ/mol 494 |

495 |
496 |
497 |
498 |

502 | Electronegativity Paulingy: 503 |

504 |

505 | {element.electronegativity_pauling} 506 |

507 |
508 |
509 |
510 |

514 | Ionization Energies 515 |

516 |

517 | {element?.ionization_energies?.map((data, i) => ( 518 | {`${data}, `} 519 | ))} 520 |

521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 | ))} 529 | 530 | ); 531 | }; 532 | export default PeriodicDetail; 533 | -------------------------------------------------------------------------------- /components/RandomInfo.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from "react"; 2 | import { useRouter } from "next/router"; 3 | import Image from "next/image"; 4 | import Classes from "./Periodic_Table/AtomElement.module.css"; 5 | import { 6 | ArrowBack, 7 | Book, 8 | ContentPasteSearch, 9 | Analytics, 10 | Biotech, 11 | ArrowForward, 12 | } from "@mui/icons-material"; 13 | import Wiki from "../assets/wikipedia.png"; 14 | import notAvail from "../assets/notAvail.jpeg"; 15 | import Link from "next/link"; 16 | const RandomInfo = ({ elementData, handleClick }) => { 17 | const [elementDataDetail, setElementDataDetail] = useState([]); 18 | const router = useRouter(); 19 | const colorMap = { 20 | "noble gas": "#3AB0FF", 21 | "polyatomic nonmetal": "#F00699", 22 | "alkaline earth metal": "#01708F", 23 | "diatomic nonmetal": "#FF5F00", 24 | "alkali metal": "#3E00FF", 25 | "transition metal": "#BF1A2F", 26 | "post-transition metal": "#890596", 27 | lanthanide: "#7868E6", 28 | actinide: "#FF8C32", 29 | metalloid: "#3EC70B", 30 | }; 31 | useEffect(() => { 32 | setElementDataDetail(elementData); 33 | }, [elementData]); 34 | 35 | return ( 36 | <> 37 | {elementDataDetail.map((element) => ( 38 |
39 | {/* header seaction */} 40 |
41 |
42 |
43 |
44 | {element.number === 1 ? ( 45 |
46 | No element exists 47 |
48 | ) : ( 49 |
52 | router.push(`/elementdata/${element.number - 1}`) 53 | } 54 | > 55 | 56 |

57 | Atomic Number-{element.number - 1} 58 |

59 |
60 | )} 61 | {element.number === 119 ? ( 62 |
63 | No element exists 64 |
65 | ) : ( 66 |
69 | router.push(`/elementdata/${element.number + 1}`) 70 | } 71 | > 72 |

73 | Atomic Number-{element.number + 1} 74 |

75 | 76 |
77 | )} 78 |
79 |
80 |
87 |
88 |
91 | {element.number} 92 |
93 |
94 | {element.symbol} 95 |
96 |
97 | {element.name} 98 |
99 |
100 |
101 | 102 |
103 |
104 | {element.number === 1 ? ( 105 |
106 | No element exists 107 |
108 | ) : ( 109 |
112 | router.push(`/elementdata/${element.number - 1}`) 113 | } 114 | > 115 | 116 |

117 | Atomic Number-{element.number - 1} 118 |

119 |
120 | )} 121 | {element.number === 119 ? ( 122 |
123 | No element exists 124 |
125 | ) : ( 126 |
129 | router.push(`/elementdata/${element.number + 1}`) 130 | } 131 | > 132 |

133 | Atomic Number-{element.number + 1} 134 |

135 | 136 |
137 | )} 138 |
139 |
140 | 141 |

142 | Overview 143 |

144 |
145 |
146 |

150 | Atomic Number: 151 |

152 |

153 | {element.number} 154 |

155 |
156 |
157 |
158 |

162 | Name: 163 |

164 |

165 | {element.name} 166 |

167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |

179 | Summary: 180 |

181 |

182 | {element.summary} 183 |

184 |
185 |
186 | 187 |
188 |

192 | Discovered By: 193 |

194 |

195 | {element.discovered_by || "Unknown"} 196 |

197 |
198 |
199 | 200 |
201 |

205 | Named By: 206 |

207 |

208 | {element.named_by || "Unknown"}{" "} 209 |

210 |
211 |
212 |
213 |

217 | Appearance: 218 |

219 |

220 | {element.appearance || "Unknown"} 221 |

222 |
223 |
224 |
225 |

229 | Color: 230 |

231 |

232 | {element.color || "Unknown"} 233 |

234 |
235 |
236 |
237 | 238 |

239 | Properties 240 |

241 |
242 |
243 |

247 | Atomic Mass: 248 |

249 |

250 | {Math.round(element.atomic_mass) || "Unknown"}g/mol 251 |

252 |
253 |
254 |
255 |

259 | Density: 260 |

261 |

262 | {Math.round(element.density) || "Unknown"}g/cm³ 263 |

264 |
265 |
266 |
267 |

271 | Phase 272 |

273 |

274 | {element.phase || "Unknown"} 275 |

276 |
277 |
278 | 279 |
280 |

284 | Electron Shells 285 |

286 |

287 | {element.shells.map((data, i) => ( 288 | {`${data}, `} 289 | ))} 290 |

291 |
292 |
293 | 294 |
295 |
296 |

300 | Electron 301 |

302 |

303 | {element.number} 304 |

305 |
306 |
307 |

311 | Protron 312 |

313 |

314 | {element.number} 315 |

316 |
317 |
318 |

322 | Neutron 323 |

324 |

325 | {Math.round(element.atomic_mass - element.number)} 326 |

327 |
328 |
329 |
330 |
331 | 332 |

333 | Physical Properties 334 |

335 |
336 |
337 |

341 | Period: 342 |

343 |

344 | {element.period || "Unknown"} 345 |

346 |
347 |
348 |
349 |

353 | Melting Point 354 |

355 |

356 | {Math.round(element.melt)} 357 | °K ={" "} 358 | {Math.round(element.melt - 273.15)} 359 | °C ={" "} 360 | {Math.round((element.melt - 273.15) * 1.8) + 32} 361 | °F 362 |

363 |
364 |
365 |
366 |

370 | Boiling Point 371 |

372 |

373 | {Math.round(element.boil)} 374 | °K = 375 | {Math.round(element.boil - 273.15)} 376 | °C = 377 | {Math.round((element.boil - 273.15) * 1.8) + 32} 378 | °F 379 |

380 |
381 |
382 |
383 |

387 | Molar Heat: 388 |

389 |

390 | {Math.round(element.molar_heat) || "Unknown"} J/mol·K 391 |

392 |
393 |
394 |
395 |

399 | Spectrals Line: 400 |

401 |
402 | 407 |
408 |
409 |
410 | 411 |

412 | Atomic Properties 413 |

414 |
415 |
416 |

420 | Electronic Configuration: 421 |

422 |

423 | {element.electron_configuration} 424 |

425 |
426 |
427 |
428 |

432 | Electronic Configuration Semantic: 433 |

434 |

435 | {element.electron_configuration_semantic} 436 |

437 |
438 |
439 |
440 |

444 | Electronic Affenity: 445 |

446 |

447 | {element.electron_affinity} kJ/mol 448 |

449 |
450 |
451 |
452 |

456 | Electronegativity Paulingy: 457 |

458 |

459 | {element.electronegativity_pauling} 460 |

461 |
462 |
463 |
464 |

468 | Ionization Energies 469 |

470 |

471 | {element.ionization_energies.map((data, i) => ( 472 | {`${data}, `} 473 | ))} 474 |

475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 | ))} 483 | 484 | ); 485 | }; 486 | export default RandomInfo; 487 | -------------------------------------------------------------------------------- /context/userContext.js: -------------------------------------------------------------------------------- 1 | import React, { createContext, useContext, useEffect, useState } from "react"; 2 | export const tableContext = createContext(); 3 | 4 | export const TableProvider = ({ children }) => { 5 | const [tableData, setTableData] = useState([]); 6 | const [loadingTable, setLoadingTable] = useState(true); 7 | const periodictableData = async () => { 8 | await fetch("https://periodically-go-servers.onrender.com/", { 9 | method: "GET", 10 | }) 11 | .then((res) => res.json()) 12 | .then((data) => { 13 | setTableData(data); 14 | setLoadingTable(false); 15 | }) 16 | .catch((err) => console.log(err)); 17 | }; 18 | 19 | useEffect(() => { 20 | periodictableData(); 21 | }, []); 22 | return ( 23 | 24 | {children} 25 | 26 | ); 27 | }; 28 | export function usePeriodicTable() { 29 | return useContext(tableContext); 30 | } 31 | -------------------------------------------------------------------------------- /next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | target: "serverless", 3 | serverless: { 4 | timeout: 30, 5 | }, 6 | images: { 7 | domains: [ 8 | "upload.wikimedia.org", 9 | "en.wikipedia.org", 10 | "material-properties.org", 11 | "assets/", 12 | ], 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "next dev", 5 | "build": "next build", 6 | "start": "next start" 7 | }, 8 | "dependencies": { 9 | "@badrap/bar-of-progress": "^0.2.1", 10 | "@emotion/react": "^11.9.3", 11 | "@emotion/styled": "^11.9.3", 12 | "@heroicons/react": "^1.0.6", 13 | "@mui/icons-material": "^5.8.4", 14 | "@mui/lab": "^5.0.0-alpha.90", 15 | "@mui/material": "^5.9.0", 16 | "framer-motion": "^10.12.17", 17 | "next": "latest", 18 | "next-share": "^0.16.0", 19 | "react": "18.1.0", 20 | "react-dom": "18.1.0", 21 | "react-loader-spinner": "^5.1.7-beta.1", 22 | "react-loading": "^2.0.3", 23 | "tailwind-scrollbar-hide": "^1.1.7" 24 | }, 25 | "devDependencies": { 26 | "@types/node": "17.0.35", 27 | "@types/react": "18.0.9", 28 | "@types/react-dom": "18.0.5", 29 | "autoprefixer": "^10.4.7", 30 | "postcss": "^8.4.14", 31 | "tailwindcss": "^3.1.2", 32 | "typescript": "4.7.2" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /pages/404.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Image from "next/image"; 3 | import Head from "next/head"; 4 | import error404 from "../assets/error404.png"; 5 | const Custom404 = () => { 6 | return ( 7 | <> 8 | 9 | ERROR-404 10 | 11 | 12 |
13 |
14 | 15 |
16 |
17 | 18 | ); 19 | }; 20 | 21 | export default Custom404; 22 | -------------------------------------------------------------------------------- /pages/_app.js: -------------------------------------------------------------------------------- 1 | import "../styles/globals.css"; 2 | import ProgressBar from "@badrap/bar-of-progress"; 3 | import Router from "next/router"; 4 | import { TableProvider } from "../context/userContext"; 5 | const progress = new ProgressBar({ 6 | size: 4, 7 | color: "#D82148", 8 | className: "z-50", 9 | delay: 100, 10 | }); 11 | Router.events.on("routeChangeStart", progress.start); 12 | Router.events.on("routeChangeComplete", progress.finish); 13 | Router.events.on("routeChangeError", progress.finish); 14 | function MyApp({ Component, pageProps }) { 15 | return ( 16 | 17 | 18 | 19 | ); 20 | } 21 | 22 | export default MyApp; 23 | -------------------------------------------------------------------------------- /pages/api/hello.ts: -------------------------------------------------------------------------------- 1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction 2 | import type { NextApiRequest, NextApiResponse } from 'next' 3 | 4 | type Data = { 5 | name: string 6 | } 7 | 8 | export default function handler( 9 | req: NextApiRequest, 10 | res: NextApiResponse 11 | ) { 12 | res.status(200).json({ name: 'John Doe' }) 13 | } 14 | -------------------------------------------------------------------------------- /pages/elementdata/[elementdata].js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Header from "../../components/Header"; 3 | import Footer from "../../components/Footer"; 4 | import PeriodicDetail from "../../components/Periodic_Table/PeriodicDetail"; 5 | 6 | const ElementDataPage = ({ elementDataDetail }) => { 7 | return ( 8 |
9 |
10 | 11 |
12 |
13 | ); 14 | }; 15 | 16 | export async function getServerSideProps(context) { 17 | try { 18 | const { elementdata } = context.query; 19 | const response = await fetch( 20 | `https://periodically-go-servers.onrender.com/number/${elementdata}`, 21 | { 22 | method: "GET", 23 | } 24 | ); 25 | 26 | if (!response.ok) { 27 | throw new Error("Failed to fetch data"); 28 | } 29 | 30 | const data = await response.json(); 31 | 32 | return { 33 | props: { 34 | elementDataDetail: data, 35 | }, 36 | }; 37 | } catch (error) { 38 | console.error("Error fetching data:", error); 39 | 40 | return { 41 | props: { 42 | elementDataDetail: null, 43 | error: "Error fetching data", 44 | }, 45 | }; 46 | } 47 | } 48 | 49 | export default ElementDataPage; 50 | -------------------------------------------------------------------------------- /pages/explore.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from "react"; 2 | import ExploreData from "../components/ExploreData"; 3 | import Header from "../components/Header"; 4 | import Head from "next/head"; 5 | import RandomInfo from "../components/RandomInfo"; 6 | import { usePeriodicTable } from "../context/userContext"; 7 | import Footer from "../components/Footer"; 8 | const explore = () => { 9 | const [data, setData] = useState([]); 10 | const dataFetch = async () => { 11 | const response = await fetch( 12 | "https://periodically-go-servers.onrender.com/random" 13 | ); 14 | const arr = []; 15 | const Data = await response.json(); 16 | arr.push(Data); 17 | setData(arr); 18 | }; 19 | useEffect(() => { 20 | dataFetch(); 21 | }, []); 22 | const handleClick = (e) => { 23 | e.preventDefault(); 24 | dataFetch(); 25 | }; 26 | const [tableData, randomData] = usePeriodicTable(); 27 | const [filterData, setFilterData] = useState([]); 28 | useEffect(() => { 29 | setFilterData(tableData); 30 | }, []); 31 | return ( 32 | <> 33 | 34 | Periodically-explore 35 | 36 | 37 |
38 | 44 | 45 |