├── .env.example
├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── custom.md
│ └── feature_request.md
├── .gitignore
├── .vite
└── deps_temp_da3ddc9a
│ └── package.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── components.json
├── index.html
├── jsconfig.json
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
├── Feature.png
├── Featurevid.mkv
├── Featurevid.mp4
├── Featurevid.webm
└── vite.png
├── src
├── App.css
├── App.jsx
├── Components
│ ├── AI
│ │ └── AIWritingAssistant.jsx
│ ├── Auth
│ │ ├── Login.jsx
│ │ ├── Logout.jsx
│ │ └── UserProfile.jsx
│ ├── Common
│ │ ├── ErrorBoundary.jsx
│ │ └── Loading.jsx
│ ├── Layout
│ │ ├── Footer.jsx
│ │ └── Header.jsx
│ ├── Logo
│ │ └── Logo.jsx
│ ├── Notes
│ │ ├── NoteEditor.jsx
│ │ ├── NoteList.jsx
│ │ ├── NoteView.jsx
│ │ └── SharedNote.jsx
│ ├── Text-Speach
│ │ └── TextToSpeech.jsx
│ ├── magicui
│ │ ├── border-beam.jsx
│ │ └── shimmer-button.jsx
│ └── ui
│ │ ├── Abouttext.jsx
│ │ ├── Features.jsx
│ │ ├── Geminie.jsx
│ │ ├── ReviewCard.jsx
│ │ ├── alert-dialog.jsx
│ │ ├── alert.jsx
│ │ ├── aurora-background.jsx
│ │ ├── avatar.jsx
│ │ ├── badge.jsx
│ │ ├── button.jsx
│ │ ├── card.jsx
│ │ ├── cover.jsx
│ │ ├── dialog.jsx
│ │ ├── dropdown-menu.jsx
│ │ ├── flip-words.jsx
│ │ ├── google-gemini-effect.jsx
│ │ ├── infinite-moving-cards.jsx
│ │ ├── input.jsx
│ │ ├── label.jsx
│ │ ├── macbook-scroll.jsx
│ │ ├── mode-toggle.jsx
│ │ ├── popover.jsx
│ │ ├── progress.jsx
│ │ ├── scroll-area.jsx
│ │ ├── select.jsx
│ │ ├── separator.jsx
│ │ ├── skeleton.jsx
│ │ ├── slider.jsx
│ │ ├── sparkles.jsx
│ │ ├── spotlight.jsx
│ │ ├── switch.jsx
│ │ ├── tabs.jsx
│ │ ├── text-generate-effect.jsx
│ │ ├── textarea.jsx
│ │ ├── toast.jsx
│ │ ├── toaster.jsx
│ │ ├── toggle.jsx
│ │ ├── tooltip.jsx
│ │ └── use-toast.js
├── Pages
│ ├── About.jsx
│ ├── Editor.jsx
│ └── Home.jsx
├── Services
│ ├── aiService.js
│ └── appwrite.js
├── assets
│ ├── logo1.png.png
│ └── toolpilot-badge-b.png
├── index.css
├── lib
│ ├── utils.js
│ └── utils.ts
└── main.jsx
├── tailwind.config.js
├── vercel.json
└── vite.config.js
/.env.example:
--------------------------------------------------------------------------------
1 | VITE_APPWRITE_URL="https://example.com/v1"
2 | VITE_APPWRITE_PROJECT_ID="your_project_id"
3 | VITE_APPWRITE_DATABASE_ID="your_database_id"
4 | VITE_APPWRITE_COLLECTION_ID="your_collection_id"
5 | VITE_APPWRITE_USERS_COLLECTION_ID="your_users_collection_id"
6 | VITE_APPWRITE_BUCKET_ID="your_bucket_id"
7 | VITE_GOOGLE_AI_API_KEY="your_google_ai_api_key"
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/custom.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Custom issue template
3 | about: Describe this issue template's purpose here.
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 | *.env
26 |
27 | .vercel
--------------------------------------------------------------------------------
/.vite/deps_temp_da3ddc9a/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "module"
3 | }
4 |
--------------------------------------------------------------------------------
/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 | .
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 | # NoteX Contributor Guidelines
2 |
3 | Welcome! Follow these guidelines for a smooth collaboration.
4 |
5 | ## Table of Contents
6 | 1. [Code of Conduct](#code-of-conduct)
7 | 2. [How to Contribute](#how-to-contribute)
8 | - Reporting Bugs
9 | - Feature Requests
10 | - Submitting Code
11 | 3. [Development Setup](#development-setup)
12 | 4. [Pull Request Guidelines](#pull-request-guidelines)
13 | 5. [Code Style Guidelines](#code-style-guidelines)
14 | 6. [Issue Management](#issue-management)
15 | 7. [Contact](#contact)
16 |
17 | ## Code of Conduct
18 |
19 | Adhere to the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/). Be respectful and inclusive.
20 |
21 | ## How to Contribute
22 |
23 | ### Reporting Bugs
24 |
25 | - Search [issues](https://github.com/soummyaanon/-noteX/issues) for existing reports.
26 | - Open a new issue with detailed reproduction steps if not found.
27 |
28 | ### Feature Requests
29 |
30 | - Open a feature request in the issues section with your idea and use cases.
31 |
32 | ### Submitting Code
33 |
34 | 1. Fork the repo and create a new branch (`git checkout -b feature-branch`).
35 | 2. Implement changes following code style guidelines.
36 | 3. Ensure all tests pass.
37 | 4. Commit with a clear message (`git commit -m "Add feature XYZ"`).
38 | 5. Push your branch (`git push origin feature-branch`).
39 | 6. Submit a pull request (PR) and reference relevant issues.
--------------------------------------------------------------------------------
/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 |
2 | ## Getting Started
3 |
4 | To get started with this template, follow these steps:
5 |
6 | 1. Clone the repository:
7 | ```sh
8 | git clone https://github.com/soummyaanon/-noteX
9 | ```
10 | 2. Navigate to the project directory:
11 | ```sh
12 | cd your-repo-name
13 | ```
14 | 3. Install the dependencies:
15 | ```sh
16 | npm install
17 | ```
18 | 4. Start the development server:
19 | ```sh
20 | npm run dev
21 | ```
22 |
23 | ## Contributing
24 |
25 | We welcome contributions to this project! If you'd like to contribute, please follow these guidelines:
26 |
27 | 1. **Fork the repository**: Click the "Fork" button at the top right of this page to create a copy of the repository on your GitHub account.
28 |
29 | 2. **Clone your fork**: Clone the forked repository to your local machine.
30 | ```sh
31 | git clone https://github.com/soummyaanon/-noteX
32 | ```
33 |
34 | 3. **Create a new branch**: Create a new branch for your feature or bugfix.
35 | ```sh
36 | git checkout -b my-feature-branch
37 | ```
38 |
39 | 4. **Make your changes**: Make the necessary changes to the codebase.
40 |
41 | 5. **Commit your changes**: Commit your changes with a descriptive commit message.
42 | ```sh
43 | git commit -m "Description of my changes"
44 | ```
45 |
46 | 6. **Push to your fork**: Push your changes to your forked repository.
47 | ```sh
48 | git push origin my-feature-branch
49 | ```
50 |
51 | 7. **Create a Pull Request**: Go to the original repository on GitHub and create a pull request from your forked repository. Provide a clear description of your changes and why they are necessary.
52 |
53 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Supported Versions
4 |
5 | Use this section to tell people about which versions of your project are
6 | currently being supported with security updates.
7 |
8 | | Version | Supported |
9 | | ------- | ------------------ |
10 | | 5.1.x | :white_check_mark: |
11 | | 5.0.x | :x: |
12 | | 4.0.x | :white_check_mark: |
13 | | < 4.0 | :x: |
14 |
15 | ## Reporting a Vulnerability
16 |
17 | Use this section to tell people how to report a vulnerability.
18 |
19 | Tell them where to go, how often they can expect to get an update on a
20 | reported vulnerability, what to expect if the vulnerability is accepted or
21 | declined, etc.
22 |
--------------------------------------------------------------------------------
/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "default",
4 | "rsc": false,
5 | "tsx": false,
6 | "tailwind": {
7 | "config": "tailwind.config.js",
8 | "css": "src/index.css",
9 | "baseColor": "slate",
10 | "cssVariables": true
11 | },
12 | "aliases": {
13 | "components": "@/components",
14 | "utils": "@/lib/utils"
15 | }
16 | }
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | noteX
11 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": ".",
4 | "paths": {
5 | "@/*": ["./src/*"]
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "notecolab",
3 | "private": true,
4 | "version": "0.0.0",
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "vite build",
9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
10 | "preview": "vite preview"
11 | },
12 | "dependencies": {
13 | "@fontsource/amatic-sc": "^5.1.0",
14 | "@fontsource/caveat": "^5.1.0",
15 | "@fontsource/dancing-script": "^5.1.0",
16 | "@fontsource/indie-flower": "^5.1.0",
17 | "@fontsource/pacifico": "^5.1.0",
18 | "@fontsource/permanent-marker": "^5.1.0",
19 | "@fontsource/shadows-into-light": "^5.1.0",
20 | "@google/generative-ai": "^0.17.1",
21 | "@radix-ui/react-alert-dialog": "^1.1.1",
22 | "@radix-ui/react-avatar": "^1.1.0",
23 | "@radix-ui/react-dialog": "^1.1.1",
24 | "@radix-ui/react-dropdown-menu": "^2.1.1",
25 | "@radix-ui/react-label": "^2.1.0",
26 | "@radix-ui/react-popover": "^1.1.1",
27 | "@radix-ui/react-progress": "^1.1.0",
28 | "@radix-ui/react-scroll-area": "^1.1.0",
29 | "@radix-ui/react-select": "^2.1.1",
30 | "@radix-ui/react-separator": "^1.1.0",
31 | "@radix-ui/react-slider": "^1.2.0",
32 | "@radix-ui/react-slot": "^1.1.0",
33 | "@radix-ui/react-switch": "^1.1.0",
34 | "@radix-ui/react-tabs": "^1.1.0",
35 | "@radix-ui/react-toast": "^1.2.1",
36 | "@radix-ui/react-toggle": "^1.1.0",
37 | "@radix-ui/react-tooltip": "^1.1.2",
38 | "@tabler/icons-react": "^3.17.0",
39 | "@tensorflow-models/universal-sentence-encoder": "^1.3.3",
40 | "@tensorflow/tfjs": "^4.20.0",
41 | "@tsparticles/engine": "^3.5.0",
42 | "@tsparticles/react": "^3.0.0",
43 | "@tsparticles/slim": "^3.5.0",
44 | "appwrite": "^15.0.0",
45 | "canvas-confetti": "^1.9.3",
46 | "class-variance-authority": "^0.7.0",
47 | "clsx": "^2.1.1",
48 | "docx": "^8.5.0",
49 | "file-saver": "^2.0.5",
50 | "framer-motion": "^11.5.4",
51 | "jspdf": "^3.0.1",
52 | "lodash.debounce": "^4.0.8",
53 | "lucide-react": "^0.439.0",
54 | "marked": "^13.0.2",
55 | "next-themes": "^0.3.0",
56 | "react": "^18.3.1",
57 | "react-dom": "^18.3.1",
58 | "react-hook-form": "^7.52.1",
59 | "react-icons": "^5.3.0",
60 | "react-router-dom": "^6.24.1",
61 | "react-spinners": "^0.14.1",
62 | "tailwind-merge": "^2.5.2",
63 | "tailwindcss-animate": "^1.0.7"
64 | },
65 | "devDependencies": {
66 | "@rollup/plugin-commonjs": "^26.0.1",
67 | "@types/node": "^22.5.2",
68 | "@types/offscreencanvas": "^2019.7.3",
69 | "@types/react": "^18.3.3",
70 | "@types/react-dom": "^18.3.0",
71 | "@types/webgl-ext": "^0.0.37",
72 | "@vitejs/plugin-react": "^4.3.4",
73 | "autoprefixer": "^10.4.19",
74 | "eslint": "^8.57.0",
75 | "eslint-plugin-react": "^7.34.2",
76 | "eslint-plugin-react-hooks": "^4.6.2",
77 | "eslint-plugin-react-refresh": "^0.4.7",
78 | "postcss": "^8.4.39",
79 | "tailwindcss": "^3.4.10",
80 | "typescript": "^5.5.4",
81 | "vite": "^6.3.4"
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/public/Feature.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soummyaanon/-noteX/061577f9bd93974097e42e11c9b99ccc770f4543/public/Feature.png
--------------------------------------------------------------------------------
/public/Featurevid.mkv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soummyaanon/-noteX/061577f9bd93974097e42e11c9b99ccc770f4543/public/Featurevid.mkv
--------------------------------------------------------------------------------
/public/Featurevid.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soummyaanon/-noteX/061577f9bd93974097e42e11c9b99ccc770f4543/public/Featurevid.mp4
--------------------------------------------------------------------------------
/public/Featurevid.webm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soummyaanon/-noteX/061577f9bd93974097e42e11c9b99ccc770f4543/public/Featurevid.webm
--------------------------------------------------------------------------------
/public/vite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soummyaanon/-noteX/061577f9bd93974097e42e11c9b99ccc770f4543/public/vite.png
--------------------------------------------------------------------------------
/src/App.css:
--------------------------------------------------------------------------------
1 | /* Common styles */
2 | #root {
3 | max-width: 1280px;
4 | margin: 0 auto;
5 | padding: 2rem;
6 | text-align: center;
7 | }
8 |
9 | /* Dark theme styles */
10 | .dark {
11 | background-color: #000000; /* Pure black background */
12 | color: #ffffff; /* White text */
13 | }
14 |
15 | .dark .logo {
16 | filter: drop-shadow(0 0 2em #ffffffaa); /* White glow on hover */
17 | }
18 |
19 | .dark .logo.react:hover {
20 | filter: drop-shadow(0 0 2em #61dafbaa); /* React blue glow on hover */
21 | }
22 |
23 | .dark .card {
24 | padding: 2em;
25 | background-color: #1a1a1a; /* Dark gray background for cards */
26 | border: 1px solid #333333; /* Darker border */
27 | border-radius: 8px;
28 | color: #ffffff; /* White text */
29 | }
30 |
31 | .dark .read-the-docs {
32 | color: #888888; /* Light gray text */
33 | }
34 |
35 | /* Light theme styles */
36 | .light {
37 | background-color: #ffffff; /* White background */
38 | color: #000000; /* Black text */
39 | }
40 |
41 | .light .logo {
42 | filter: drop-shadow(0 0 2em #000000aa); /* Black glow on hover */
43 | }
44 |
45 | .light .logo.react:hover {
46 | filter: drop-shadow(0 0 2em #61dafbaa); /* React blue glow on hover */
47 | }
48 |
49 | .light .card {
50 | padding: 2em;
51 | background-color: #f0f0f0; /* Light gray background for cards */
52 | border: 1px solid #cccccc; /* Lighter border */
53 | border-radius: 8px;
54 | color: #000000; /* Black text */
55 | }
56 |
57 | .light .read-the-docs {
58 | color: #555555; /* Dark gray text */
59 | }
60 |
61 | /* Animation and media query */
62 | @keyframes logo-spin {
63 | from {
64 | transform: rotate(0deg);
65 | }
66 | to {
67 | transform: rotate(360deg);
68 | }
69 | }
70 |
71 | @media (prefers-reduced-motion: no-preference) {
72 | a:nth-of-type(2) .logo {
73 | animation: logo-spin infinite 20s linear;
74 | }
75 | }
76 | .glow-cyan {
77 | box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
78 | }
--------------------------------------------------------------------------------
/src/App.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect, lazy, Suspense } from 'react';
2 | import { BrowserRouter as Router, Route, Routes, Navigate } from 'react-router-dom';
3 | import { ThemeProvider } from 'next-themes';
4 | import { getCurrentUser } from './Services/appwrite';
5 | import Header from './Components/Layout/Header';
6 | import Footer from './Components/Layout/Footer';
7 | import Loading from './Components/Common/Loading';
8 | import ErrorBoundary from './Components/Common/ErrorBoundary';
9 | import './App.css';
10 |
11 | // Lazy-loaded components
12 | const Login = lazy(() => import('./Components/Auth/Login'));
13 | const NoteList = lazy(() => import('./Components/Notes/NoteList'));
14 | const SharedNote = lazy(() => import('./Components/Notes/SharedNote'));
15 | const NoteEditor = lazy(() => import('./Components/Notes/NoteEditor'));
16 | const NoteView = lazy(() => import('./Components/Notes/NoteView'));
17 | const Home = lazy(() => import('./Pages/Home'));
18 | const Editor = lazy(() => import('./Pages/Editor'));
19 | const UserProfile = lazy(() => import('./Components/Auth/UserProfile'));
20 | const About = lazy(() => import('./Pages/About')); // Added About page
21 |
22 | export default function App() {
23 | const [user, setUser] = useState(null);
24 | const [loading, setLoading] = useState(true);
25 |
26 | useEffect(() => {
27 | const checkUser = async () => {
28 | try {
29 | const currentUser = await getCurrentUser();
30 | setUser(currentUser);
31 | } catch (error) {
32 | console.error('Error checking user:', error);
33 | setUser(null);
34 | } finally {
35 | setLoading(false);
36 | }
37 | };
38 | checkUser();
39 | }, []);
40 |
41 | if (loading) {
42 | return ;
43 | }
44 |
45 | return (
46 |
47 |
48 |
49 |
50 |
51 |
52 | }>
53 |
54 | } />
55 | : }
58 | />
59 | : }
62 | />
63 | : }
66 | />
67 | : }
70 | />
71 | : }
74 | />
75 | } />
76 | : }
79 | />
80 | } /> {/* Added About route */}
81 | } />
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | );
91 | }
--------------------------------------------------------------------------------
/src/Components/Auth/Logout.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { useNavigate } from 'react-router-dom';
3 | import { logout } from '../../Services/appwrite';
4 | import { FiLogOut } from 'react-icons/fi'; // Import the logout icon
5 |
6 | function Logout() {
7 | const navigate = useNavigate();
8 |
9 | const handleLogout = async () => {
10 | try {
11 | await logout();
12 | // Redirect to login page after successful logout
13 | navigate('/login');
14 | } catch (error) {
15 | console.error('Logout failed:', error);
16 | // You might want to show an error message to the user here
17 | }
18 | };
19 |
20 | return (
21 |
25 | {/* Add the icon here */}
26 | Logout
27 |
28 | );
29 | }
30 |
31 | export default Logout;
--------------------------------------------------------------------------------
/src/Components/Common/ErrorBoundary.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | class ErrorBoundary extends React.Component {
4 | constructor(props) {
5 | super(props);
6 | this.state = { hasError: false };
7 | }
8 |
9 | static getDerivedStateFromError(error) {
10 | return { hasError: true };
11 | }
12 |
13 | componentDidCatch(error, errorInfo) {
14 | console.error("Uncaught error:", error, errorInfo);
15 | }
16 |
17 | render() {
18 | if (this.state.hasError) {
19 | return (
20 |
21 |
Oops! Something went wrong.
22 |
We're sorry for the inconvenience. Please try refreshing the page or contact support if the problem persists.
23 |
window.location.reload()}
26 | >
27 | Refresh Page
28 |
29 |
30 | );
31 | }
32 |
33 | return this.props.children;
34 | }
35 | }
36 |
37 | export default ErrorBoundary;
--------------------------------------------------------------------------------
/src/Components/Common/Loading.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react';
2 | import { PuffLoader } from 'react-spinners';
3 | import { Progress } from "../ui/progress";
4 |
5 | const NoteXSimpleLoader = () => {
6 | const [progress, setProgress] = useState(0);
7 | const [isDarkMode, setIsDarkMode] = useState(true);
8 |
9 | useEffect(() => {
10 | const timer = setInterval(() => {
11 | setProgress((prevProgress) =>
12 | prevProgress < 100 ? prevProgress + 1 : 0
13 | );
14 | }, 300);
15 |
16 | const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
17 | setIsDarkMode(mediaQuery.matches);
18 | const handleChange = (e) => setIsDarkMode(e.matches);
19 | mediaQuery.addListener(handleChange);
20 |
21 | return () => {
22 | clearInterval(timer);
23 | mediaQuery.removeListener(handleChange);
24 | };
25 | }, []);
26 |
27 | const bgColor = isDarkMode ? 'bg-black' : 'bg-white';
28 | const textColor = isDarkMode ? 'text-white' : 'text-black';
29 | const subTextColor = isDarkMode ? 'text-gray-400' : 'text-gray-600';
30 |
31 | return (
32 |
33 |
34 | noteX
35 |
36 |
37 |
38 |
41 |
42 | Initializing AI-powered notes... {progress}%
43 |
44 |
45 | );
46 | };
47 |
48 | export default NoteXSimpleLoader;
--------------------------------------------------------------------------------
/src/Components/Layout/Footer.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Button } from "../ui/button";
3 | import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip";
4 | import { cn } from "../../lib/utils";
5 | import { Github, Linkedin } from 'lucide-react';
6 | import { RiTwitterXFill } from "react-icons/ri";
7 |
8 | export default function MinimalisticFooter() {
9 | const currentYear = new Date().getFullYear();
10 |
11 | const socialLinks = [
12 | { name: 'GitHub', icon: Github, url: 'https://github.com/soummyaanon' },
13 | { name: 'Twitter', icon: RiTwitterXFill, url: 'https://twitter.com/Thesourya2000' },
14 | { name: 'LinkedIn', icon: Linkedin, url: 'https://www.linkedin.com/in/soumyapanda12/' },
15 | ];
16 |
17 | return (
18 |
19 |
20 |
21 |
22 | {socialLinks.map((social) => (
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | Follow on {social.name}
34 |
35 |
36 |
37 | ))}
38 |
39 | FAQ
40 |
41 |
42 | About
43 |
44 |
45 |
55 |
56 |
57 |
58 | );
59 | }
--------------------------------------------------------------------------------
/src/Components/Layout/Header.jsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState, useCallback } from 'react'
2 | import { Link, useNavigate, useLocation } from 'react-router-dom'
3 | import { logout, getProfileImage } from '../../Services/appwrite'
4 | import { Button } from "../ui/button"
5 | import {
6 | DropdownMenu,
7 | DropdownMenuContent,
8 | DropdownMenuItem,
9 | DropdownMenuTrigger,
10 | } from "../ui/dropdown-menu"
11 | import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar"
12 | import { ModeToggle } from "../ui/mode-toggle"
13 | import { Menu } from "lucide-react"
14 | import { Progress } from "../ui/progress"
15 | import Logo from '../Logo/Logo'
16 | import { FiHome, FiLogIn, FiFileText, FiPlusSquare, FiUser, FiLogOut, FiInfo } from 'react-icons/fi'
17 | import { motion, AnimatePresence } from 'framer-motion'
18 |
19 |
20 |
21 |
22 | export default function Component({ user, setUser }) {
23 | const navigate = useNavigate()
24 | const location = useLocation()
25 | const [profileImageUrl, setProfileImageUrl] = useState(null)
26 | const [loading, setLoading] = useState(false)
27 | const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
28 | const [loadingProgress, setLoadingProgress] = useState(0)
29 |
30 | const fetchProfileImage = useCallback(async () => {
31 | if (user?.profileImageId) {
32 | try {
33 | const imageUrl = await getProfileImage(user.profileImageId)
34 | setProfileImageUrl(imageUrl)
35 | } catch (error) {
36 | console.error('Error fetching profile image:', error)
37 | }
38 | } else {
39 | setProfileImageUrl(null)
40 | }
41 | }, [user])
42 |
43 | useEffect(() => {
44 | fetchProfileImage()
45 | const refreshInterval = setInterval(fetchProfileImage, 1000) // Refresh every 5 seconds
46 | return () => clearInterval(refreshInterval)
47 | }, [fetchProfileImage])
48 |
49 | useEffect(() => {
50 | setLoading(true)
51 | setLoadingProgress(0)
52 | const timer = setInterval(() => {
53 | setLoadingProgress((oldProgress) => {
54 | if (oldProgress === 100) {
55 | clearInterval(timer)
56 | setLoading(false)
57 | return 100
58 | }
59 | const diff = Math.random() * 20
60 | return Math.min(oldProgress + diff, 100)
61 | })
62 | }, 50)
63 | return () => clearInterval(timer)
64 | }, [location])
65 |
66 | const handleLogout = useCallback(async () => {
67 | try {
68 | setLoading(true)
69 | await logout()
70 | setUser(null)
71 | navigate('/login')
72 | } catch (error) {
73 | console.error('Logout failed:', error)
74 | } finally {
75 | setLoading(false)
76 | }
77 | }, [navigate, setUser])
78 |
79 | const NavItem = useCallback(({ to, icon: Icon, label }) => (
80 |
81 |
82 |
83 | {label}
84 |
90 |
91 | {label}
92 |
93 | ), [location.pathname])
94 |
95 | const navItems = (
96 | <>
97 |
98 | {user ? (
99 | <>
100 |
101 |
102 | >
103 | ) : (
104 |
105 | )}
106 | >
107 | )
108 |
109 | return (
110 |
111 | {loading && (
112 |
113 | )}
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 | {navItems}
125 |
126 |
127 |
128 |
129 | {user && (
130 |
131 |
132 |
133 |
134 |
135 | {user.name.charAt(0)}
136 |
137 |
138 |
139 |
140 |
141 | navigate('/profile')}>
142 |
143 | Profile
144 |
145 | navigate('/about')}>
146 |
147 | About
148 |
149 |
150 |
151 | Logout
152 |
153 |
154 |
155 | )}
156 |
setMobileMenuOpen(!mobileMenuOpen)}>
157 |
158 | Toggle menu
159 |
160 |
161 |
162 |
163 |
164 |
165 | {mobileMenuOpen && (
166 |
173 |
174 | {navItems}
175 | {user && (
176 | <>
177 |
178 |
179 |
180 |
181 | Logout
182 |
183 | >
184 | )}
185 |
186 |
187 | )}
188 |
189 |
190 | )
191 | }
--------------------------------------------------------------------------------
/src/Components/Logo/Logo.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import logo from '../../assets/logo1.png.png'; // adjust the path to match your file structure
3 |
4 | function Logo() {
5 | return (
6 |
11 | );
12 | }
13 |
14 | export default Logo;
--------------------------------------------------------------------------------
/src/Components/Notes/NoteView.jsx:
--------------------------------------------------------------------------------
1 | 'use client'
2 |
3 | import React, { useState, useEffect, useCallback } from 'react'
4 | import { useParams, useNavigate } from 'react-router-dom'
5 | import { getDocument, deleteDocument, getCurrentUser } from '../../Services/appwrite'
6 | import { marked } from 'marked'
7 | import { Card, CardContent, CardFooter } from '../ui/card'
8 | import { Button } from '../ui/button'
9 | import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from '../ui/alert-dialog'
10 | import { Skeleton } from '../ui/skeleton'
11 | import { Alert, AlertDescription, AlertTitle } from '../ui/alert'
12 | import { ChevronLeft, Pencil, Trash2, Clock, Eye, Code, Volume2, Link, Maximize2, Minimize2, AlignLeft, AlignCenter, AlignRight } from 'lucide-react'
13 | import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip"
14 | import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs"
15 | import { Toggle } from "../ui/toggle"
16 | import { motion, AnimatePresence } from 'framer-motion'
17 | import TextToSpeech from '../Text-Speach/TextToSpeech'
18 |
19 | // Import Google Fonts
20 | import '@fontsource/caveat'
21 | import '@fontsource/dancing-script'
22 | import '@fontsource/indie-flower'
23 | import '@fontsource/pacifico'
24 | import '@fontsource/permanent-marker'
25 | import '@fontsource/shadows-into-light'
26 | import '@fontsource/amatic-sc'
27 |
28 | const NOTES_COLLECTION_ID = import.meta.env.VITE_APPWRITE_COLLECTION_ID
29 |
30 | export default function Component() {
31 | const { noteId } = useParams()
32 | const navigate = useNavigate()
33 | const [note, setNote] = useState(null)
34 | const [loading, setLoading] = useState(true)
35 | const [error, setError] = useState(null)
36 | const [currentUser, setCurrentUser] = useState(null)
37 | const [showTextToSpeech, setShowTextToSpeech] = useState(false)
38 | const [activeTab, setActiveTab] = useState('preview')
39 | const [zenMode, setZenMode] = useState(false)
40 | const [textAlignment, setTextAlignment] = useState('left')
41 | const [linkCopied, setLinkCopied] = useState(false)
42 |
43 | const fetchNoteAndUser = useCallback(async () => {
44 | try {
45 | const [fetchedNote, user] = await Promise.all([
46 | getDocument(NOTES_COLLECTION_ID, noteId),
47 | getCurrentUser()
48 | ])
49 | setNote(fetchedNote)
50 | setCurrentUser(user)
51 | } catch (err) {
52 | console.error('Error fetching note:', err)
53 | if (err.code === 404) {
54 | setError('Note not found. It may have been deleted or you may not have permission to view it.')
55 | } else {
56 | setError('An error occurred while fetching the note. Please try again later.')
57 | }
58 | } finally {
59 | setLoading(false)
60 | }
61 | }, [noteId])
62 |
63 | useEffect(() => {
64 | fetchNoteAndUser()
65 | }, [fetchNoteAndUser])
66 |
67 | const handleDelete = async () => {
68 | try {
69 | await deleteDocument(NOTES_COLLECTION_ID, noteId)
70 | navigate('/notes', { state: { message: 'Note deleted successfully' } })
71 | } catch (err) {
72 | setError('Failed to delete the note. Please try again.')
73 | console.error('Error deleting note:', err)
74 | }
75 | }
76 |
77 | const toggleZenMode = () => {
78 | setZenMode(!zenMode)
79 | }
80 |
81 | const handleAlignmentChange = (alignment) => {
82 | setTextAlignment(alignment)
83 | }
84 |
85 | const handleCopyLink = () => {
86 | const link = `${window.location.origin}/notes/${noteId}`
87 | navigator.clipboard.writeText(link)
88 | setLinkCopied(true)
89 | setTimeout(() => setLinkCopied(false), 2000)
90 | }
91 |
92 | if (loading) {
93 | return (
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | )
102 | }
103 |
104 | if (error) {
105 | return (
106 |
107 | Error
108 | {error}
109 | navigate('/notes')}
112 | className="mt-4 w-full transition-all duration-200 ease-in-out transform hover:scale-105 hover:bg-primary hover:text-primary-foreground"
113 | >
114 | Back to Notes
115 |
116 |
117 | )
118 | }
119 |
120 | if (!note) {
121 | return (
122 |
123 | Note not found
124 | The requested note could not be found.
125 | navigate('/notes')}
128 | className="mt-4 w-full transition-all duration-200 ease-in-out transform hover:scale-105 hover:bg-primary hover:text-primary-foreground"
129 | >
130 | Back to Notes
131 |
132 |
133 | )
134 | }
135 |
136 | return (
137 |
144 |
145 |
146 |
152 | {note.title}
153 |
154 |
155 |
156 |
157 | handleAlignmentChange('left')} aria-label="Align Left">
158 |
159 |
160 |
161 | Align Left
162 |
163 |
164 |
165 | handleAlignmentChange('center')} aria-label="Align Center">
166 |
167 |
168 |
169 | Align Center
170 |
171 |
172 |
173 | handleAlignmentChange('right')} aria-label="Align Right">
174 |
175 |
176 |
177 | Align Right
178 |
179 |
180 |
181 |
182 | {zenMode ? : }
183 |
184 |
185 |
186 | {zenMode ? 'Exit Zen Mode' : 'Enter Zen Mode'}
187 |
188 |
189 |
190 |
191 |
192 |
198 |
199 | Last updated: {new Date(note.$updatedAt).toLocaleString()}
200 |
201 |
207 |
208 |
209 |
210 | navigate(`/edit-note/${noteId}`)}>
211 | Edit
212 |
213 |
214 | Edit Note
215 |
216 |
217 |
218 | setShowTextToSpeech(!showTextToSpeech)}>
219 | Listen
220 |
221 |
222 | Text to Speech
223 |
224 |
225 |
226 |
227 | {linkCopied ? 'Copied!' : 'Copy Link'}
228 |
229 |
230 | Copy Link to Clipboard
231 |
232 |
233 |
234 |
235 |
236 |
237 | Delete
238 |
239 |
240 |
241 |
242 | Delete this note?
243 | This action cannot be undone.
244 |
245 |
246 | Cancel
247 | Delete
248 |
249 |
250 |
251 |
252 | Delete Note
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 | Preview
261 |
262 |
263 |
264 | Source
265 |
266 |
267 |
268 |
275 |
276 |
284 |
285 |
286 |
290 | {note.content || ''}
291 |
292 |
293 |
294 |
295 |
296 |
297 | {showTextToSpeech && (
298 |
305 |
306 |
307 | )}
308 |
309 |
310 |
311 | navigate('/notes')}
314 | className="w-full transition-all duration-200 ease-in-out transform hover:scale-105 hover:bg-primary hover:text-primary-foreground"
315 | >
316 | Back to Notes
317 |
318 |
319 |
320 |
321 | )
322 | }
--------------------------------------------------------------------------------
/src/Components/Notes/SharedNote.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react';
2 | import { useParams } from 'react-router-dom';
3 | import { getDocument } from '../../Services/appwrite';
4 | import { marked } from 'marked';
5 |
6 | const SharedNote = () => {
7 | const { noteId } = useParams();
8 | const [note, setNote] = useState(null);
9 | const [loading, setLoading] = useState(true);
10 | const [error, setError] = useState(null);
11 |
12 | useEffect(() => {
13 | fetchSharedNote();
14 | }, [noteId]);
15 |
16 | const fetchSharedNote = async () => {
17 | setLoading(true);
18 | try {
19 | const fetchedNote = await getDocument('notes', noteId);
20 | setNote(fetchedNote);
21 | } catch (error) {
22 | console.error('Error fetching shared note', error);
23 | setError('Failed to fetch the shared note. It may not exist or you may not have permission to view it.');
24 | } finally {
25 | setLoading(false);
26 | }
27 | };
28 |
29 | if (loading) return Loading shared note...
;
30 | if (error) return {error}
;
31 | if (!note) return Note not found.
;
32 |
33 | return (
34 |
35 |
{note.title}
36 |
42 |
43 | Last updated: {new Date(note.updated_at).toLocaleString()}
44 |
45 |
46 | );
47 | };
48 |
49 | export default SharedNote;
--------------------------------------------------------------------------------
/src/Components/Text-Speach/TextToSpeech.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react';
2 | import { Button } from '../ui/button';
3 | import { Slider } from '../ui/slider';
4 | import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select';
5 | import { Play, Pause, Sun } from 'lucide-react';
6 |
7 | const TextToSpeech = ({ text }) => {
8 | const [isPlaying, setIsPlaying] = useState(false);
9 | const [utterance, setUtterance] = useState(null);
10 | const [voice, setVoice] = useState(null);
11 | const [rate, setRate] = useState(1);
12 | const [voices, setVoices] = useState([]);
13 |
14 | useEffect(() => {
15 | const synth = window.speechSynthesis;
16 | const u = new SpeechSynthesisUtterance(text);
17 | setUtterance(u);
18 |
19 | const loadVoices = () => {
20 | const availableVoices = synth.getVoices();
21 | setVoices(availableVoices);
22 | setVoice(availableVoices[0]);
23 | };
24 |
25 | synth.onvoiceschanged = loadVoices;
26 | loadVoices();
27 |
28 | return () => {
29 | synth.cancel();
30 | };
31 | }, [text]);
32 |
33 | const handleTogglePlay = () => {
34 | const synth = window.speechSynthesis;
35 |
36 | if (isPlaying) {
37 | synth.pause();
38 | } else {
39 | if (synth.paused) {
40 | synth.resume();
41 | } else {
42 | utterance.voice = voice;
43 | utterance.rate = rate;
44 | synth.speak(utterance);
45 | }
46 | }
47 |
48 | setIsPlaying(!isPlaying);
49 | };
50 |
51 | const handleVoiceChange = (value) => {
52 | const selectedVoice = voices.find(v => v.name === value);
53 | setVoice(selectedVoice);
54 | };
55 |
56 | return (
57 |
58 |
59 |
63 | {isPlaying ? : }
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | {voices.map((voice) => (
72 |
73 | {voice.name}
74 |
75 | ))}
76 |
77 |
78 |
79 |
80 | Speed
81 | setRate(value)}
87 | className="w-full"
88 | />
89 | {rate.toFixed(1)}x
90 |
91 |
92 | );
93 | };
94 |
95 | export default TextToSpeech;
--------------------------------------------------------------------------------
/src/Components/magicui/border-beam.jsx:
--------------------------------------------------------------------------------
1 | import { cn } from "../../lib/utils.ts";
2 |
3 | export const BorderBeam = ({
4 | className,
5 | size = 200,
6 | duration = 15,
7 | anchor = 90,
8 | borderWidth = 1.5,
9 | colorFrom = "#85e61e", // Neon cyan start color
10 | colorTo = "#3bccea", // Neon cyan end color
11 | delay = 0
12 | }) => {
13 | return (
14 |
33 | );
34 | };
--------------------------------------------------------------------------------
/src/Components/magicui/shimmer-button.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { cn } from "../../lib/utils.ts";
4 |
5 | const ShimmerButton = React.forwardRef((
6 | {
7 | shimmerColor = "#89f7fe",
8 | shimmerSize = "0.10em",
9 | shimmerDuration = "4s",
10 | borderRadius = "110px",
11 | background = "rgba(0, 0, 0, 1)",
12 | className,
13 | children,
14 | ...props
15 | },
16 | ref,
17 | ) => {
18 | return (
19 | (
37 | {/* spark container */}
38 |
43 | {/* spark */}
44 |
46 | {/* spark before */}
47 |
49 |
50 |
51 | {children}
52 | {/* Highlight */}
53 |
64 | {/* backdrop */}
65 |
69 | )
70 | );
71 | });
72 |
73 | ShimmerButton.displayName = "ShimmerButton";
74 |
75 | export default ShimmerButton;
76 |
--------------------------------------------------------------------------------
/src/Components/ui/Abouttext.jsx:
--------------------------------------------------------------------------------
1 | "use client";
2 | import React from 'react';
3 | import { TextGenerateEffect } from "../ui/text-generate-effect";
4 |
5 | const words = `
6 | Welcome to NoteX, the ultimate note-taking application designed to enhance your productivity and streamline your workflow.
7 | Whether you're looking to organize your thoughts, get AI-powered assistance, or access your notes from anywhere, NoteX has got you covered.
8 | With features like Gemini Pro insights, Speech-to-Text, and Smart Semantic Search, NoteX offers a seamless and innovative experience.
9 | Crafted with care by Soumyaranjan Panda, NoteX is here to revolutionize the way you take notes.
10 |
11 | `;
12 |
13 | export function TextGenerateEffectDemo() {
14 | return (
15 |
16 |
17 |
18 | );
19 | }
20 |
21 | export default TextGenerateEffectDemo;
--------------------------------------------------------------------------------
/src/Components/ui/Features.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { MacbookScroll } from "../ui/macbook-scroll";
3 | import { FaGithub, FaLinkedin } from "react-icons/fa";
4 | import { FaSquareXTwitter } from "react-icons/fa6";
5 |
6 | const SocialLink = ({ href, icon: Icon }) => (
7 |
13 |
14 |
15 | );
16 |
17 | const Badge = () => (
18 |
19 |
20 |
21 |
22 |
23 | );
24 |
25 | export function Feature() {
26 | return (
27 |
28 |
31 | AI-Enhanced Note-Taking Revolution
32 |
33 | }
34 | badge={ }
35 | src={[
36 | { src: "/Featurevid.webm", type: "video/webm" },
37 | { src: "/Featurevid.mkv", type: "video/mp4" },
38 | { src: "/Featurevid.mp4", type: "video/mp4" }
39 | ]}
40 | showGradient={false}
41 | className="scale-[1.75] md:scale-150 lg:scale-[1.75]"
42 | isVideo={true}
43 | />
44 |
45 | );
46 | }
47 |
48 | export default Feature;
--------------------------------------------------------------------------------
/src/Components/ui/Geminie.jsx:
--------------------------------------------------------------------------------
1 | "use client";
2 | import { useScroll, useTransform } from "framer-motion";
3 | import React from "react";
4 | import { GoogleGeminiEffect } from "../ui/google-gemini-effect";
5 |
6 | export function GoogleGeminiEffectDemo() {
7 | const ref = React.useRef(null);
8 | const { scrollYProgress } = useScroll({
9 | target: ref,
10 | offset: ["start start", "end start"],
11 | });
12 |
13 | const pathLengthFirst = useTransform(scrollYProgress, [0, 0.8], [0.2, 1.2]);
14 | const pathLengthSecond = useTransform(scrollYProgress, [0, 0.8], [0.15, 1.2]);
15 | const pathLengthThird = useTransform(scrollYProgress, [0, 0.8], [0.1, 1.2]);
16 | const pathLengthFourth = useTransform(scrollYProgress, [0, 0.8], [0.05, 1.2]);
17 | const pathLengthFifth = useTransform(scrollYProgress, [0, 0.8], [0, 1.2]);
18 |
19 | return (
20 |
24 |
33 |
34 | );
35 | }
36 |
37 | export default GoogleGeminiEffectDemo;
--------------------------------------------------------------------------------
/src/Components/ui/ReviewCard.jsx:
--------------------------------------------------------------------------------
1 | "use client";
2 |
3 | import React from "react";
4 | import { InfiniteMovingCards } from "./infinite-moving-cards";
5 |
6 | export function InfiniteMovingCardsDemo() {
7 | return (
8 |
9 |
10 |
11 | );
12 | }
13 |
14 | const testimonials = [
15 | {
16 | quote:
17 | "The secure cloud storage is a huge plus. I can access my notes from anywhere and never worry about losing them..",
18 | name: "Siri Nana",
19 | title: "Producthunt User",
20 | },
21 | {
22 | quote:
23 | "This promising notes APP. I'll try it. Glad to see AI powered notes. Congrats on this launch @soumyaranjan2000",
24 | name: "Rupi",
25 | title: "Producthunt User",
26 | },
27 | {
28 | quote: "As it's AI-powered, it gives you an advantage and makes it unique over the other apps. Keep it up bro..",
29 | name: "Sumit Sharma",
30 | title: "Producthunt User",
31 | },
32 | {
33 | quote:
34 | "I’m excited to see if NoteX can handle my chaotic notes as well as it claims my idea pile needs a superhero!",
35 | name: "Shawn Idrees",
36 | title: "Producthunt User",
37 | },
38 | {
39 | quote:
40 | "Love how the app combines simplicity with powerful AI features. The integration of Gemini Pro makes the note taking experience more efficient, and with TailwindCSS, the interface looks incredibly friendly. Everything about NoteX feels geared toward making productivity a breeze..",
41 | name: "Ayla Reynolds",
42 | title: "Producthunt User",
43 | },
44 | ];
45 |
46 | export default InfiniteMovingCardsDemo;
--------------------------------------------------------------------------------
/src/Components/ui/alert-dialog.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
3 |
4 | import { cn } from "../../lib/utils"
5 | import { buttonVariants } from "./button"
6 |
7 | const AlertDialog = AlertDialogPrimitive.Root
8 |
9 | const AlertDialogTrigger = AlertDialogPrimitive.Trigger
10 |
11 | const AlertDialogPortal = AlertDialogPrimitive.Portal
12 |
13 | const AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => (
14 |
21 | ))
22 | AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
23 |
24 | const AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => (
25 |
26 |
27 |
34 |
35 | ))
36 | AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
37 |
38 | const AlertDialogHeader = ({
39 | className,
40 | ...props
41 | }) => (
42 |
45 | )
46 | AlertDialogHeader.displayName = "AlertDialogHeader"
47 |
48 | const AlertDialogFooter = ({
49 | className,
50 | ...props
51 | }) => (
52 |
55 | )
56 | AlertDialogFooter.displayName = "AlertDialogFooter"
57 |
58 | const AlertDialogTitle = React.forwardRef(({ className, ...props }, ref) => (
59 |
60 | ))
61 | AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
62 |
63 | const AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) => (
64 |
68 | ))
69 | AlertDialogDescription.displayName =
70 | AlertDialogPrimitive.Description.displayName
71 |
72 | const AlertDialogAction = React.forwardRef(({ className, ...props }, ref) => (
73 |
74 | ))
75 | AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
76 |
77 | const AlertDialogCancel = React.forwardRef(({ className, ...props }, ref) => (
78 |
82 | ))
83 | AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
84 |
85 | export {
86 | AlertDialog,
87 | AlertDialogPortal,
88 | AlertDialogOverlay,
89 | AlertDialogTrigger,
90 | AlertDialogContent,
91 | AlertDialogHeader,
92 | AlertDialogFooter,
93 | AlertDialogTitle,
94 | AlertDialogDescription,
95 | AlertDialogAction,
96 | AlertDialogCancel,
97 | }
98 |
--------------------------------------------------------------------------------
/src/Components/ui/alert.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import { cva } from "class-variance-authority";
3 |
4 | import { cn } from "../../lib/utils"
5 |
6 | const alertVariants = cva(
7 | "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
8 | {
9 | variants: {
10 | variant: {
11 | default: "bg-background text-foreground",
12 | destructive:
13 | "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
14 | },
15 | },
16 | defaultVariants: {
17 | variant: "default",
18 | },
19 | }
20 | )
21 |
22 | const Alert = React.forwardRef(({ className, variant, ...props }, ref) => (
23 |
28 | ))
29 | Alert.displayName = "Alert"
30 |
31 | const AlertTitle = React.forwardRef(({ className, ...props }, ref) => (
32 |
36 | ))
37 | AlertTitle.displayName = "AlertTitle"
38 |
39 | const AlertDescription = React.forwardRef(({ className, ...props }, ref) => (
40 |
44 | ))
45 | AlertDescription.displayName = "AlertDescription"
46 |
47 | export { Alert, AlertTitle, AlertDescription }
48 |
--------------------------------------------------------------------------------
/src/Components/ui/aurora-background.jsx:
--------------------------------------------------------------------------------
1 | 'use client'
2 |
3 | import { cn } from "../../lib/utils"
4 | import React from "react"
5 |
6 | export default function AuroraBackground({ className, children, ...props }) {
7 | return (
8 |
9 |
16 |
39 |
40 | {children}
41 |
42 |
43 |
44 | )
45 | }
--------------------------------------------------------------------------------
/src/Components/ui/avatar.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as AvatarPrimitive from "@radix-ui/react-avatar"
3 |
4 | import { cn } from "../../lib/utils"
5 |
6 | const Avatar = React.forwardRef(({ className, ...props }, ref) => (
7 |
11 | ))
12 | Avatar.displayName = AvatarPrimitive.Root.displayName
13 |
14 | const AvatarImage = React.forwardRef(({ className, ...props }, ref) => (
15 |
19 | ))
20 | AvatarImage.displayName = AvatarPrimitive.Image.displayName
21 |
22 | const AvatarFallback = React.forwardRef(({ className, ...props }, ref) => (
23 |
30 | ))
31 | AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
32 |
33 | export { Avatar, AvatarImage, AvatarFallback }
34 |
--------------------------------------------------------------------------------
/src/Components/ui/badge.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import { cva } from "class-variance-authority";
3 |
4 | import { cn } from "../../lib/utils"
5 |
6 | const badgeVariants = cva(
7 | "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
8 | {
9 | variants: {
10 | variant: {
11 | default:
12 | "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
13 | secondary:
14 | "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
15 | destructive:
16 | "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
17 | outline: "text-foreground",
18 | },
19 | },
20 | defaultVariants: {
21 | variant: "default",
22 | },
23 | }
24 | )
25 |
26 | function Badge({
27 | className,
28 | variant,
29 | ...props
30 | }) {
31 | return (
);
32 | }
33 |
34 | export { Badge, badgeVariants }
35 |
--------------------------------------------------------------------------------
/src/Components/ui/button.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import { Slot } from "@radix-ui/react-slot"
3 | import { cva } from "class-variance-authority";
4 |
5 | import { cn } from "../../lib/utils"
6 |
7 | const buttonVariants = cva(
8 | "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
9 | {
10 | variants: {
11 | variant: {
12 | default: "bg-primary text-primary-foreground hover:bg-primary/90",
13 | destructive:
14 | "bg-destructive text-destructive-foreground hover:bg-destructive/90",
15 | outline:
16 | "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
17 | secondary:
18 | "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19 | ghost: "hover:bg-accent hover:text-accent-foreground",
20 | link: "text-primary underline-offset-4 hover:underline",
21 | },
22 | size: {
23 | default: "h-10 px-4 py-2",
24 | sm: "h-9 rounded-md px-3",
25 | lg: "h-11 rounded-md px-8",
26 | icon: "h-10 w-10",
27 | },
28 | },
29 | defaultVariants: {
30 | variant: "default",
31 | size: "default",
32 | },
33 | }
34 | )
35 |
36 | const Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
37 | const Comp = asChild ? Slot : "button"
38 | return (
39 | ( )
43 | );
44 | })
45 | Button.displayName = "Button"
46 |
47 | export { Button, buttonVariants }
48 |
--------------------------------------------------------------------------------
/src/Components/ui/card.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | import { cn } from "../../lib/utils"
4 |
5 | const Card = React.forwardRef(({ className, ...props }, ref) => (
6 |
10 | ))
11 | Card.displayName = "Card"
12 |
13 | const CardHeader = React.forwardRef(({ className, ...props }, ref) => (
14 |
18 | ))
19 | CardHeader.displayName = "CardHeader"
20 |
21 | const CardTitle = React.forwardRef(({ className, ...props }, ref) => (
22 |
26 | ))
27 | CardTitle.displayName = "CardTitle"
28 |
29 | const CardDescription = React.forwardRef(({ className, ...props }, ref) => (
30 |
34 | ))
35 | CardDescription.displayName = "CardDescription"
36 |
37 | const CardContent = React.forwardRef(({ className, ...props }, ref) => (
38 |
39 | ))
40 | CardContent.displayName = "CardContent"
41 |
42 | const CardFooter = React.forwardRef(({ className, ...props }, ref) => (
43 |
47 | ))
48 | CardFooter.displayName = "CardFooter"
49 |
50 | export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
51 |
--------------------------------------------------------------------------------
/src/Components/ui/cover.jsx:
--------------------------------------------------------------------------------
1 | "use client";
2 | import React, { useEffect, useId, useState } from "react";
3 | import { AnimatePresence, motion } from "framer-motion";
4 | import { useRef } from "react";
5 | import { cn } from "../../lib/utils"
6 | import { SparklesCore } from "./sparkles";
7 |
8 | export const Cover = ({
9 | children,
10 | className
11 | }) => {
12 | const [hovered, setHovered] = useState(false);
13 |
14 | const ref = useRef(null);
15 |
16 | const [containerWidth, setContainerWidth] = useState(0);
17 | const [beamPositions, setBeamPositions] = useState([]);
18 |
19 | useEffect(() => {
20 | if (ref.current) {
21 | setContainerWidth(ref.current?.clientWidth ?? 0);
22 |
23 | const height = ref.current?.clientHeight ?? 0;
24 | const numberOfBeams = Math.floor(height / 10); // Adjust the divisor to control the spacing
25 | const positions = Array.from(
26 | { length: numberOfBeams },
27 | (_, i) => (i + 1) * (height / (numberOfBeams + 1))
28 | );
29 | setBeamPositions(positions);
30 | }
31 | }, [ref.current]);
32 |
33 | return (
34 | ( setHovered(true)}
36 | onMouseLeave={() => setHovered(false)}
37 | ref={ref}
38 | className="relative hover:bg-neutral-900 group/cover inline-block dark:bg-neutral-900 bg-neutral-100 px-2 py-2 transition duration-200 rounded-sm">
39 |
40 | {hovered && (
41 |
51 |
63 |
70 |
77 |
78 |
79 | )}
80 |
81 | {beamPositions.map((position, index) => (
82 |
91 | ))}
92 |
128 | {children}
129 |
130 |
131 |
132 |
133 |
134 |
)
135 | );
136 | };
137 |
138 | export const Beam = ({
139 | className,
140 | delay,
141 | duration,
142 | hovered,
143 | width = 600,
144 | ...svgProps
145 | }) => {
146 | const id = useId();
147 |
148 | return (
149 | (
157 |
158 |
159 |
182 |
183 |
184 |
185 |
186 |
187 | )
188 | );
189 | };
190 |
191 | export const CircleIcon = ({
192 | className,
193 | delay
194 | }) => {
195 | return (
196 | (
)
201 | );
202 | };
203 |
--------------------------------------------------------------------------------
/src/Components/ui/dialog.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as DialogPrimitive from "@radix-ui/react-dialog"
3 | import { X } from "lucide-react"
4 |
5 | import { cn } from "../../lib/utils"
6 |
7 | const Dialog = DialogPrimitive.Root
8 |
9 | const DialogTrigger = DialogPrimitive.Trigger
10 |
11 | const DialogPortal = DialogPrimitive.Portal
12 |
13 | const DialogClose = DialogPrimitive.Close
14 |
15 | const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (
16 |
23 | ))
24 | DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
25 |
26 | const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (
27 |
28 |
29 |
36 | {children}
37 |
39 |
40 | Close
41 |
42 |
43 |
44 | ))
45 | DialogContent.displayName = DialogPrimitive.Content.displayName
46 |
47 | const DialogHeader = ({
48 | className,
49 | ...props
50 | }) => (
51 |
54 | )
55 | DialogHeader.displayName = "DialogHeader"
56 |
57 | const DialogFooter = ({
58 | className,
59 | ...props
60 | }) => (
61 |
64 | )
65 | DialogFooter.displayName = "DialogFooter"
66 |
67 | const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (
68 |
72 | ))
73 | DialogTitle.displayName = DialogPrimitive.Title.displayName
74 |
75 | const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (
76 |
80 | ))
81 | DialogDescription.displayName = DialogPrimitive.Description.displayName
82 |
83 | export {
84 | Dialog,
85 | DialogPortal,
86 | DialogOverlay,
87 | DialogClose,
88 | DialogTrigger,
89 | DialogContent,
90 | DialogHeader,
91 | DialogFooter,
92 | DialogTitle,
93 | DialogDescription,
94 | }
95 |
--------------------------------------------------------------------------------
/src/Components/ui/dropdown-menu.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
3 | import { Check, ChevronRight, Circle } from "lucide-react"
4 | import { cn } from "../../lib/utils"
5 |
6 |
7 | const DropdownMenu = DropdownMenuPrimitive.Root
8 |
9 | const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
10 |
11 | const DropdownMenuGroup = DropdownMenuPrimitive.Group
12 |
13 | const DropdownMenuPortal = DropdownMenuPrimitive.Portal
14 |
15 | const DropdownMenuSub = DropdownMenuPrimitive.Sub
16 |
17 | const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
18 |
19 | const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (
20 |
28 | {children}
29 |
30 |
31 | ))
32 | DropdownMenuSubTrigger.displayName =
33 | DropdownMenuPrimitive.SubTrigger.displayName
34 |
35 | const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (
36 |
43 | ))
44 | DropdownMenuSubContent.displayName =
45 | DropdownMenuPrimitive.SubContent.displayName
46 |
47 | const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (
48 |
49 |
57 |
58 | ))
59 | DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
60 |
61 | const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (
62 |
70 | ))
71 | DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
72 |
73 | const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (
74 |
82 |
83 |
84 |
85 |
86 |
87 | {children}
88 |
89 | ))
90 | DropdownMenuCheckboxItem.displayName =
91 | DropdownMenuPrimitive.CheckboxItem.displayName
92 |
93 | const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (
94 |
101 |
102 |
103 |
104 |
105 |
106 | {children}
107 |
108 | ))
109 | DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
110 |
111 | const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (
112 |
116 | ))
117 | DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
118 |
119 | const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (
120 |
124 | ))
125 | DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
126 |
127 | const DropdownMenuShortcut = ({
128 | className,
129 | ...props
130 | }) => {
131 | return (
132 | ( )
135 | );
136 | }
137 | DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
138 |
139 | export {
140 | DropdownMenu,
141 | DropdownMenuTrigger,
142 | DropdownMenuContent,
143 | DropdownMenuItem,
144 | DropdownMenuCheckboxItem,
145 | DropdownMenuRadioItem,
146 | DropdownMenuLabel,
147 | DropdownMenuSeparator,
148 | DropdownMenuShortcut,
149 | DropdownMenuGroup,
150 | DropdownMenuPortal,
151 | DropdownMenuSub,
152 | DropdownMenuSubContent,
153 | DropdownMenuSubTrigger,
154 | DropdownMenuRadioGroup,
155 | }
156 |
--------------------------------------------------------------------------------
/src/Components/ui/flip-words.jsx:
--------------------------------------------------------------------------------
1 | "use client";
2 | import React, { useCallback, useEffect, useState } from "react";
3 | import { AnimatePresence, motion } from "framer-motion";
4 | import { cn } from "../../lib/utils";
5 |
6 | export const FlipWords = ({ words, duration = 3000, className }) => {
7 | const [currentWord, setCurrentWord] = useState(words[0]);
8 | const [isAnimating, setIsAnimating] = useState(false);
9 |
10 | const startAnimation = useCallback(() => {
11 | const word = words[words.indexOf(currentWord) + 1] || words[0];
12 | setCurrentWord(word);
13 | setIsAnimating(true);
14 | }, [currentWord, words]);
15 |
16 | useEffect(() => {
17 | if (!isAnimating)
18 | setTimeout(() => {
19 | startAnimation();
20 | }, duration);
21 | }, [isAnimating, duration, startAnimation]);
22 |
23 | return (
24 | {
26 | setIsAnimating(false);
27 | }}
28 | >
29 |
57 | {currentWord.split(" ").map((word, wordIndex) => (
58 |
68 | {word.split("").map((letter, letterIndex) => (
69 |
79 | {letter}
80 |
81 | ))}
82 |
83 |
84 | ))}
85 |
86 |
87 | );
88 | };
--------------------------------------------------------------------------------
/src/Components/ui/google-gemini-effect.jsx:
--------------------------------------------------------------------------------
1 | "use client";
2 | import { cn } from "../../lib/utils";
3 | import { motion } from "framer-motion";
4 | import React from "react";
5 |
6 | const transition = {
7 | duration: 0,
8 | ease: "linear",
9 | };
10 |
11 | export const GoogleGeminiEffect = ({
12 | pathLengths,
13 | title,
14 | description,
15 | className
16 | }) => {
17 | return (
18 | (
19 |
21 | {title || `Powered by Google Gemini Pro`}
22 |
23 |
25 | {description ||
26 | `Experience the power of AI-powered note-taking with noteX`}
27 |
28 |
30 |
32 | noteX
33 |
34 |
35 |
41 |
53 |
65 |
77 |
89 |
101 |
102 | {/* Gaussian blur for the background paths */}
103 |
104 |
111 |
118 |
125 |
132 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
)
147 | );
148 | };
--------------------------------------------------------------------------------
/src/Components/ui/infinite-moving-cards.jsx:
--------------------------------------------------------------------------------
1 | "use client";
2 |
3 | import { cn } from "../../lib/utils";
4 | import React, { useEffect, useState } from "react";
5 |
6 | export const InfiniteMovingCards = ({
7 | items,
8 | direction = "left",
9 | speed = "fast",
10 | pauseOnHover = true,
11 | className
12 | }) => {
13 | const containerRef = React.useRef(null);
14 | const scrollerRef = React.useRef(null);
15 |
16 | useEffect(() => {
17 | addAnimation();
18 | }, []);
19 |
20 | const [start, setStart] = useState(false);
21 |
22 | function addAnimation() {
23 | if (containerRef.current && scrollerRef.current) {
24 | const scrollerContent = Array.from(scrollerRef.current.children);
25 |
26 | scrollerContent.forEach((item) => {
27 | const duplicatedItem = item.cloneNode(true);
28 | if (scrollerRef.current) {
29 | scrollerRef.current.appendChild(duplicatedItem);
30 | }
31 | });
32 |
33 | getDirection();
34 | getSpeed();
35 | setStart(true);
36 | }
37 | }
38 |
39 | const getDirection = () => {
40 | if (containerRef.current) {
41 | if (direction === "left") {
42 | containerRef.current.style.setProperty("--animation-direction", "forwards");
43 | } else {
44 | containerRef.current.style.setProperty("--animation-direction", "reverse");
45 | }
46 | }
47 | };
48 |
49 | const getSpeed = () => {
50 | if (containerRef.current) {
51 | if (speed === "fast") {
52 | containerRef.current.style.setProperty("--animation-duration", "20s");
53 | } else if (speed === "normal") {
54 | containerRef.current.style.setProperty("--animation-duration", "40s");
55 | } else {
56 | containerRef.current.style.setProperty("--animation-duration", "80s");
57 | }
58 | }
59 | };
60 |
61 | return (
62 |
69 |
77 | {items.map((item, idx) => (
78 |
86 |
87 |
91 |
92 | {item.quote}
93 |
94 |
95 |
96 |
97 | {item.name}
98 |
99 |
100 | {item.title}
101 |
102 |
103 |
104 |
105 |
106 | ))}
107 |
108 |
109 | );
110 | };
--------------------------------------------------------------------------------
/src/Components/ui/input.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | import { cn } from "../../lib/utils"
4 |
5 | const Input = React.forwardRef(({ className, type, ...props }, ref) => {
6 | return (
7 | ( )
15 | );
16 | })
17 | Input.displayName = "Input"
18 |
19 | export { Input }
20 |
--------------------------------------------------------------------------------
/src/Components/ui/label.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as LabelPrimitive from "@radix-ui/react-label"
3 | import { cva } from "class-variance-authority";
4 |
5 | import { cn } from "../../lib/utils"
6 |
7 | const labelVariants = cva(
8 | "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
9 | )
10 |
11 | const Label = React.forwardRef(({ className, ...props }, ref) => (
12 |
13 | ))
14 | Label.displayName = LabelPrimitive.Root.displayName
15 |
16 | export { Label }
17 |
--------------------------------------------------------------------------------
/src/Components/ui/mode-toggle.jsx:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import { Moon, Sun } from "lucide-react"
3 | import { useTheme } from "next-themes"
4 |
5 | import { Button } from "./button"
6 | import {
7 | DropdownMenu,
8 | DropdownMenuContent,
9 | DropdownMenuItem,
10 | DropdownMenuTrigger,
11 | } from "./dropdown-menu"
12 |
13 | export function ModeToggle() {
14 | const { theme, setTheme } = useTheme()
15 |
16 | return (
17 |
18 |
19 |
20 |
21 |
22 | Toggle theme
23 |
24 |
25 |
26 | setTheme("light")}>
27 | Light
28 |
29 | setTheme("dark")}>
30 | Dark
31 |
32 | setTheme("system")}>
33 | System
34 |
35 |
36 |
37 | )
38 | }
--------------------------------------------------------------------------------
/src/Components/ui/popover.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as PopoverPrimitive from "@radix-ui/react-popover"
3 |
4 | import { cn } from "../../lib/utils";
5 |
6 | const Popover = PopoverPrimitive.Root
7 |
8 | const PopoverTrigger = PopoverPrimitive.Trigger
9 |
10 | const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
11 |
12 |
21 |
22 | ))
23 | PopoverContent.displayName = PopoverPrimitive.Content.displayName
24 |
25 | export { Popover, PopoverTrigger, PopoverContent }
26 |
--------------------------------------------------------------------------------
/src/Components/ui/progress.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as ProgressPrimitive from "@radix-ui/react-progress"
3 |
4 | import { cn } from "../../lib/utils"
5 |
6 | const Progress = React.forwardRef(({ className, value, ...props }, ref) => (
7 |
11 |
14 |
15 | ))
16 | Progress.displayName = ProgressPrimitive.Root.displayName
17 |
18 | export { Progress }
19 |
--------------------------------------------------------------------------------
/src/Components/ui/scroll-area.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
3 |
4 | import { cn } from "../../lib/utils"
5 |
6 | const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => (
7 |
11 |
12 | {children}
13 |
14 |
15 |
16 |
17 | ))
18 | ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
19 |
20 | const ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => (
21 |
33 |
34 |
35 | ))
36 | ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
37 |
38 | export { ScrollArea, ScrollBar }
39 |
--------------------------------------------------------------------------------
/src/Components/ui/select.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as SelectPrimitive from "@radix-ui/react-select"
3 | import { Check, ChevronDown, ChevronUp } from "lucide-react"
4 |
5 | import { cn } from "../../lib/utils"
6 |
7 | const Select = SelectPrimitive.Root
8 |
9 | const SelectGroup = SelectPrimitive.Group
10 |
11 | const SelectValue = SelectPrimitive.Value
12 |
13 | const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (
14 | span]:line-clamp-1",
18 | className
19 | )}
20 | {...props}>
21 | {children}
22 |
23 |
24 |
25 |
26 | ))
27 | SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
28 |
29 | const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (
30 |
34 |
35 |
36 | ))
37 | SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
38 |
39 | const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (
40 |
44 |
45 |
46 | ))
47 | SelectScrollDownButton.displayName =
48 | SelectPrimitive.ScrollDownButton.displayName
49 |
50 | const SelectContent = React.forwardRef(({ className, children, position = "popper", ...props }, ref) => (
51 |
52 |
62 |
63 |
66 | {children}
67 |
68 |
69 |
70 |
71 | ))
72 | SelectContent.displayName = SelectPrimitive.Content.displayName
73 |
74 | const SelectLabel = React.forwardRef(({ className, ...props }, ref) => (
75 |
79 | ))
80 | SelectLabel.displayName = SelectPrimitive.Label.displayName
81 |
82 | const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (
83 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | {children}
97 |
98 | ))
99 | SelectItem.displayName = SelectPrimitive.Item.displayName
100 |
101 | const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (
102 |
106 | ))
107 | SelectSeparator.displayName = SelectPrimitive.Separator.displayName
108 |
109 | export {
110 | Select,
111 | SelectGroup,
112 | SelectValue,
113 | SelectTrigger,
114 | SelectContent,
115 | SelectLabel,
116 | SelectItem,
117 | SelectSeparator,
118 | SelectScrollUpButton,
119 | SelectScrollDownButton,
120 | }
121 |
--------------------------------------------------------------------------------
/src/Components/ui/separator.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as SeparatorPrimitive from "@radix-ui/react-separator"
3 |
4 | import { cn } from "../../lib/utils"
5 |
6 | const Separator = React.forwardRef((
7 | { className, orientation = "horizontal", decorative = true, ...props },
8 | ref
9 | ) => (
10 |
20 | ))
21 | Separator.displayName = SeparatorPrimitive.Root.displayName
22 |
23 | export { Separator }
24 |
--------------------------------------------------------------------------------
/src/Components/ui/skeleton.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { cn } from "../../lib/utils";
3 |
4 | function Skeleton({ className, ...props }) {
5 | return (
6 |
7 | );
8 | }
9 |
10 | export { Skeleton };
--------------------------------------------------------------------------------
/src/Components/ui/slider.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as SliderPrimitive from "@radix-ui/react-slider"
3 |
4 | import { cn } from "../../lib/utils";
5 |
6 | const Slider = React.forwardRef(({ className, ...props }, ref) => (
7 |
11 |
13 |
14 |
15 |
17 |
18 | ))
19 | Slider.displayName = SliderPrimitive.Root.displayName
20 |
21 | export { Slider }
22 |
--------------------------------------------------------------------------------
/src/Components/ui/sparkles.jsx:
--------------------------------------------------------------------------------
1 | "use client";;
2 | import React, { useId } from "react";
3 | import { useEffect, useState } from "react";
4 | import Particles, { initParticlesEngine } from "@tsparticles/react";
5 | import { loadSlim } from "@tsparticles/slim";
6 | import { cn } from "../../lib/utils"
7 | import { motion, useAnimation } from "framer-motion";
8 |
9 | export const SparklesCore = (props) => {
10 | const {
11 | id,
12 | className,
13 | background,
14 | minSize,
15 | maxSize,
16 | speed,
17 | particleColor,
18 | particleDensity,
19 | } = props;
20 | const [init, setInit] = useState(false);
21 | useEffect(() => {
22 | initParticlesEngine(async (engine) => {
23 | await loadSlim(engine);
24 | }).then(() => {
25 | setInit(true);
26 | });
27 | }, []);
28 | const controls = useAnimation();
29 |
30 | const particlesLoaded = async (container) => {
31 | if (container) {
32 | console.log(container);
33 | controls.start({
34 | opacity: 1,
35 | transition: {
36 | duration: 1,
37 | },
38 | });
39 | }
40 | };
41 |
42 | const generatedId = useId();
43 | return (
44 | (
45 | {init && (
46 |
419 | )}
420 | )
421 | );
422 | };
423 |
--------------------------------------------------------------------------------
/src/Components/ui/spotlight.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { cn } from "../../lib/utils";
3 |
4 | export const Spotlight = ({
5 | className,
6 | fill
7 | }) => {
8 | return (
9 | (
17 |
18 |
26 |
27 |
28 |
36 |
37 |
38 |
39 |
40 |
41 | )
42 | );
43 | };
44 |
--------------------------------------------------------------------------------
/src/Components/ui/switch.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as SwitchPrimitives from "@radix-ui/react-switch"
3 |
4 | import { cn } from "../../lib/utils"
5 |
6 | const Switch = React.forwardRef(({ className, ...props }, ref) => (
7 |
14 |
18 |
19 | ))
20 | Switch.displayName = SwitchPrimitives.Root.displayName
21 |
22 | export { Switch }
23 |
--------------------------------------------------------------------------------
/src/Components/ui/tabs.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as TabsPrimitive from "@radix-ui/react-tabs"
3 |
4 | import { cn } from "../../lib/utils"
5 |
6 | const Tabs = TabsPrimitive.Root
7 |
8 | const TabsList = React.forwardRef(({ className, ...props }, ref) => (
9 |
16 | ))
17 | TabsList.displayName = TabsPrimitive.List.displayName
18 |
19 | const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => (
20 |
27 | ))
28 | TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
29 |
30 | const TabsContent = React.forwardRef(({ className, ...props }, ref) => (
31 |
38 | ))
39 | TabsContent.displayName = TabsPrimitive.Content.displayName
40 |
41 | export { Tabs, TabsList, TabsTrigger, TabsContent }
42 |
--------------------------------------------------------------------------------
/src/Components/ui/text-generate-effect.jsx:
--------------------------------------------------------------------------------
1 | "use client";
2 | import { useEffect } from "react";
3 | import { motion, stagger, useAnimate } from "framer-motion";
4 |
5 | import { cn } from "../../lib/utils";
6 |
7 | export const TextGenerateEffect = ({
8 | words,
9 | className,
10 | filter = true,
11 | duration = 0.5
12 | }) => {
13 | const [scope, animate] = useAnimate();
14 | let wordsArray = words.split(" ");
15 |
16 | useEffect(() => {
17 | animate(
18 | "span",
19 | {
20 | opacity: 1,
21 | filter: filter ? "blur(0px)" : "none",
22 | scale: [0.8, 1],
23 | },
24 | {
25 | duration: duration ? duration : 1,
26 | delay: stagger(0.2),
27 | ease: "easeOut",
28 | }
29 | );
30 | }, [scope.current]);
31 |
32 | const renderWords = () => {
33 | return (
34 |
35 | {wordsArray.map((word, idx) => {
36 | return (
37 |
44 | {word}{" "}
45 |
46 | );
47 | })}
48 |
49 | );
50 | };
51 |
52 | return (
53 |
54 |
55 |
56 | {renderWords()}
57 |
58 |
59 |
60 | );
61 | };
--------------------------------------------------------------------------------
/src/Components/ui/textarea.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | import { cn } from "../../lib/utils"
4 |
5 | const Textarea = React.forwardRef(({ className, ...props }, ref) => {
6 | return (
7 | ()
14 | );
15 | })
16 | Textarea.displayName = "Textarea"
17 |
18 | export { Textarea }
19 |
--------------------------------------------------------------------------------
/src/Components/ui/toast.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as ToastPrimitives from "@radix-ui/react-toast"
3 | import { cva } from "class-variance-authority";
4 | import { X } from "lucide-react"
5 |
6 | import { cn } from "@/lib/utils"
7 |
8 | const ToastProvider = ToastPrimitives.Provider
9 |
10 | const ToastViewport = React.forwardRef(({ className, ...props }, ref) => (
11 |
18 | ))
19 | ToastViewport.displayName = ToastPrimitives.Viewport.displayName
20 |
21 | const toastVariants = cva(
22 | "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
23 | {
24 | variants: {
25 | variant: {
26 | default: "border bg-background text-foreground",
27 | destructive:
28 | "destructive group border-destructive bg-destructive text-destructive-foreground",
29 | },
30 | },
31 | defaultVariants: {
32 | variant: "default",
33 | },
34 | }
35 | )
36 |
37 | const Toast = React.forwardRef(({ className, variant, ...props }, ref) => {
38 | return (
39 | ( )
43 | );
44 | })
45 | Toast.displayName = ToastPrimitives.Root.displayName
46 |
47 | const ToastAction = React.forwardRef(({ className, ...props }, ref) => (
48 |
55 | ))
56 | ToastAction.displayName = ToastPrimitives.Action.displayName
57 |
58 | const ToastClose = React.forwardRef(({ className, ...props }, ref) => (
59 |
67 |
68 |
69 | ))
70 | ToastClose.displayName = ToastPrimitives.Close.displayName
71 |
72 | const ToastTitle = React.forwardRef(({ className, ...props }, ref) => (
73 |
74 | ))
75 | ToastTitle.displayName = ToastPrimitives.Title.displayName
76 |
77 | const ToastDescription = React.forwardRef(({ className, ...props }, ref) => (
78 |
79 | ))
80 | ToastDescription.displayName = ToastPrimitives.Description.displayName
81 |
82 | export { ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction };
83 |
--------------------------------------------------------------------------------
/src/Components/ui/toaster.jsx:
--------------------------------------------------------------------------------
1 | import {
2 | Toast,
3 | ToastClose,
4 | ToastDescription,
5 | ToastProvider,
6 | ToastTitle,
7 | ToastViewport,
8 | } from "@/components/ui/toast"
9 | import { useToast } from "./use-toast"
10 |
11 | export function Toaster() {
12 | const { toasts } = useToast()
13 |
14 | return (
15 | (
16 | {toasts.map(function ({ id, title, description, action, ...props }) {
17 | return (
18 | (
19 |
20 | {title && {title} }
21 | {description && (
22 | {description}
23 | )}
24 |
25 | {action}
26 |
27 | )
28 | );
29 | })}
30 |
31 | )
32 | );
33 | }
34 |
--------------------------------------------------------------------------------
/src/Components/ui/toggle.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as TogglePrimitive from "@radix-ui/react-toggle"
3 | import { cva } from "class-variance-authority";
4 |
5 | import { cn } from "../../lib/utils"
6 |
7 | const toggleVariants = cva(
8 | "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
9 | {
10 | variants: {
11 | variant: {
12 | default: "bg-transparent",
13 | outline:
14 | "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
15 | },
16 | size: {
17 | default: "h-10 px-3",
18 | sm: "h-9 px-2.5",
19 | lg: "h-11 px-5",
20 | },
21 | },
22 | defaultVariants: {
23 | variant: "default",
24 | size: "default",
25 | },
26 | }
27 | )
28 |
29 | const Toggle = React.forwardRef(({ className, variant, size, ...props }, ref) => (
30 |
34 | ))
35 |
36 | Toggle.displayName = TogglePrimitive.Root.displayName
37 |
38 | export { Toggle, toggleVariants }
39 |
--------------------------------------------------------------------------------
/src/Components/ui/tooltip.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import * as TooltipPrimitive from "@radix-ui/react-tooltip"
3 |
4 | import { cn } from "../../lib/utils"
5 |
6 | const TooltipProvider = TooltipPrimitive.Provider
7 |
8 | const Tooltip = TooltipPrimitive.Root
9 |
10 | const TooltipTrigger = TooltipPrimitive.Trigger
11 |
12 | const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (
13 |
21 | ))
22 | TooltipContent.displayName = TooltipPrimitive.Content.displayName
23 |
24 | export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
25 |
--------------------------------------------------------------------------------
/src/Components/ui/use-toast.js:
--------------------------------------------------------------------------------
1 | // Inspired by react-hot-toast library
2 | import * as React from "react"
3 |
4 | const TOAST_LIMIT = 1
5 | const TOAST_REMOVE_DELAY = 1000000
6 |
7 | const actionTypes = {
8 | ADD_TOAST: "ADD_TOAST",
9 | UPDATE_TOAST: "UPDATE_TOAST",
10 | DISMISS_TOAST: "DISMISS_TOAST",
11 | REMOVE_TOAST: "REMOVE_TOAST"
12 | }
13 |
14 | let count = 0
15 |
16 | function genId() {
17 | count = (count + 1) % Number.MAX_SAFE_INTEGER
18 | return count.toString();
19 | }
20 |
21 | const toastTimeouts = new Map()
22 |
23 | const addToRemoveQueue = (toastId) => {
24 | if (toastTimeouts.has(toastId)) {
25 | return
26 | }
27 |
28 | const timeout = setTimeout(() => {
29 | toastTimeouts.delete(toastId)
30 | dispatch({
31 | type: "REMOVE_TOAST",
32 | toastId: toastId,
33 | })
34 | }, TOAST_REMOVE_DELAY)
35 |
36 | toastTimeouts.set(toastId, timeout)
37 | }
38 |
39 | export const reducer = (state, action) => {
40 | switch (action.type) {
41 | case "ADD_TOAST":
42 | return {
43 | ...state,
44 | toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
45 | };
46 |
47 | case "UPDATE_TOAST":
48 | return {
49 | ...state,
50 | toasts: state.toasts.map((t) =>
51 | t.id === action.toast.id ? { ...t, ...action.toast } : t),
52 | };
53 |
54 | case "DISMISS_TOAST": {
55 | const { toastId } = action
56 |
57 | // ! Side effects ! - This could be extracted into a dismissToast() action,
58 | // but I'll keep it here for simplicity
59 | if (toastId) {
60 | addToRemoveQueue(toastId)
61 | } else {
62 | state.toasts.forEach((toast) => {
63 | addToRemoveQueue(toast.id)
64 | })
65 | }
66 |
67 | return {
68 | ...state,
69 | toasts: state.toasts.map((t) =>
70 | t.id === toastId || toastId === undefined
71 | ? {
72 | ...t,
73 | open: false,
74 | }
75 | : t),
76 | };
77 | }
78 | case "REMOVE_TOAST":
79 | if (action.toastId === undefined) {
80 | return {
81 | ...state,
82 | toasts: [],
83 | }
84 | }
85 | return {
86 | ...state,
87 | toasts: state.toasts.filter((t) => t.id !== action.toastId),
88 | };
89 | }
90 | }
91 |
92 | const listeners = []
93 |
94 | let memoryState = { toasts: [] }
95 |
96 | function dispatch(action) {
97 | memoryState = reducer(memoryState, action)
98 | listeners.forEach((listener) => {
99 | listener(memoryState)
100 | })
101 | }
102 |
103 | function toast({
104 | ...props
105 | }) {
106 | const id = genId()
107 |
108 | const update = (props) =>
109 | dispatch({
110 | type: "UPDATE_TOAST",
111 | toast: { ...props, id },
112 | })
113 | const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id })
114 |
115 | dispatch({
116 | type: "ADD_TOAST",
117 | toast: {
118 | ...props,
119 | id,
120 | open: true,
121 | onOpenChange: (open) => {
122 | if (!open) dismiss()
123 | },
124 | },
125 | })
126 |
127 | return {
128 | id: id,
129 | dismiss,
130 | update,
131 | }
132 | }
133 |
134 | function useToast() {
135 | const [state, setState] = React.useState(memoryState)
136 |
137 | React.useEffect(() => {
138 | listeners.push(setState)
139 | return () => {
140 | const index = listeners.indexOf(setState)
141 | if (index > -1) {
142 | listeners.splice(index, 1)
143 | }
144 | };
145 | }, [state])
146 |
147 | return {
148 | ...state,
149 | toast,
150 | dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId }),
151 | };
152 | }
153 |
154 | export { useToast, toast }
155 |
--------------------------------------------------------------------------------
/src/Pages/About.jsx:
--------------------------------------------------------------------------------
1 | 'use client'
2 |
3 | import React, { useEffect, useState } from 'react'
4 | import { motion, useMotionValue, useTransform, useAnimation } from 'framer-motion'
5 | import { TextGenerateEffectDemo } from '../Components/ui/Abouttext'
6 | import { FaLinkedin, FaInstagram, FaGlobe, FaFileAlt, FaDiscord, FaGithub, FaStar } from 'react-icons/fa'
7 | import { useTheme } from 'next-themes'
8 |
9 |
10 |
11 | const About = () => {
12 | const githubUsername = 'soummyaanon'
13 | const { theme } = useTheme()
14 | const [mounted, setMounted] = useState(false)
15 |
16 | useEffect(() => {
17 | setMounted(true)
18 | }, [])
19 |
20 | const sectionVariants = {
21 | hidden: { opacity: 0, y: 20 },
22 | visible: { opacity: 1, y: 0, transition: { duration: 0.6 } }
23 | }
24 |
25 | const featuredPlatforms = [
26 | {
27 | name: 'Product Hunt',
28 | href: 'https://www.producthunt.com/posts/notex-2?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-notex-2',
29 | image: 'https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=487462&theme=dark'
30 | },
31 | {
32 | name: 'Top Free AI Tools',
33 | href: 'https://topfreeaitools.com/ai/notex',
34 | image: 'https://ff65dcf08ebd5eb1c022b44dd88016ac.cdn.bubble.io/f1724746116087x632750678197528400/badge%20white.png?_gl=1*1wvcbnr*_gcl_au*MTg3MzI0ODMyLjE3MjE2MjAzNjA.*_ga*NTIyODE4MzEyLjE3MDU5OTg0MTc.*_ga_BFPVR2DEE2*MTcyNDc0NTM2OS4yMjkuMS4xNzI0NzQ2MjY2LjYwLjAuMA..'
35 | },
36 | {
37 | name: 'AIPURE AI',
38 | href: 'https://aipure.ai/products/notex',
39 | image: 'https://via.placeholder.com/230x54.png?text=AIPURE+AI'
40 | },
41 | {
42 | name: 'Peerlist',
43 | href: 'https://peerlist.io/somyaranjan/project/notex',
44 | image: 'https://peerlist.io/images/Launch_Badge_Dark.svg'
45 | },
46 | {
47 | name: 'Product Hunt Top Post',
48 | href: 'https://www.producthunt.com/posts/notex-2?embed=true&utm_source=badge-top-post-topic-badge&utm_medium=badge&utm_souce=badge-notex-2',
49 | image: 'https://api.producthunt.com/widgets/embed-image/v1/top-post-topic-badge.svg?post_id=487462&theme=light&period=weekly&topic_id=237',
50 | width: 250,
51 | height: 54
52 | },
53 | {
54 | name: 'ToolPilot',
55 | href: 'https://www.toolpilot.ai/products/notex',
56 | image: 'https://www.toolpilot.ai/cdn/shop/files/toolpilot-badge-w.png',
57 | width: 230,
58 | height: 54
59 | }
60 | ]
61 |
62 | if (!mounted) return null
63 |
64 | return (
65 |
66 |
67 |
73 | About noteX
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
87 | Featured On
88 |
89 | {featuredPlatforms.map((platform, index) => (
90 |
98 |
105 |
106 | ))}
107 |
108 |
109 |
110 |
111 | )
112 | }
113 |
114 | const CreatorCard = ({ githubUsername }) => {
115 | const x = useMotionValue(0)
116 | const y = useMotionValue(0)
117 | const rotateX = useTransform(y, [-100, 100], [30, -30])
118 | const rotateY = useTransform(x, [-100, 100], [-30, 30])
119 |
120 | const handleMouseMove = (event) => {
121 | const rect = event.currentTarget.getBoundingClientRect()
122 | const width = rect.width
123 | const height = rect.height
124 | const mouseX = event.clientX - rect.left
125 | const mouseY = event.clientY - rect.top
126 | const xPct = (mouseX / width - 0.5) * 2
127 | const yPct = (mouseY / height - 0.5) * 2
128 | x.set(xPct * 100)
129 | y.set(yPct * 100)
130 | }
131 |
132 | const handleMouseLeave = () => {
133 | x.set(0)
134 | y.set(0)
135 | }
136 |
137 | return (
138 |
147 | Meet the Creator
148 |
158 |
159 |
164 |
165 |
Soumyaranjan Panda
166 |
Fullstack Developer / Tech Enthusiast
167 |
168 | } label="GitHub" />
169 | } label="LinkedIn" />
170 | } label="Instagram" />
171 | } label="Portfolio" />
172 | } label="Resume" />
173 |
174 |
175 |
183 |
184 |
185 | Contact Me on Discord
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 | )
195 | }
196 |
197 | const SocialLink = ({ href, icon, label }) => {
198 | return (
199 |
208 | {React.cloneElement(icon, { size: 32 })}
209 |
210 | )
211 | }
212 |
213 | const GiveStarButton = ({ username }) => {
214 | const controls = useAnimation()
215 |
216 | useEffect(() => {
217 | controls.start({
218 | rotate: [0, 360],
219 | transition: { duration: 2, repeat: Infinity, ease: "linear" }
220 | })
221 | }, [controls])
222 |
223 | return (
224 |
232 |
233 |
234 |
235 |
236 | Give Me A Star
237 |
238 |
239 | )
240 | }
241 |
242 | export default About
--------------------------------------------------------------------------------
/src/Pages/Editor.jsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState, Suspense, lazy } from 'react';
2 | import { useNavigate } from 'react-router-dom';
3 | import { getCurrentUser } from '../Services/appwrite';
4 | import { motion } from 'framer-motion';
5 |
6 | const NoteEditor = lazy(() => import('../Components/Notes/NoteEditor'));
7 |
8 | const EditorPage = () => {
9 | const [userId, setUserId] = useState(null);
10 | const navigate = useNavigate();
11 |
12 | useEffect(() => {
13 | let isMounted = true;
14 |
15 | const fetchUser = async () => {
16 | try {
17 | const user = await getCurrentUser();
18 | if (user && isMounted) {
19 | setUserId(user.$id);
20 | } else if (isMounted) {
21 | navigate('/login');
22 | }
23 | } catch (error) {
24 | console.error('Error fetching user:', error);
25 | // Consider adding a toast notification here for better user feedback
26 | }
27 | };
28 |
29 | fetchUser();
30 |
31 | return () => {
32 | isMounted = false;
33 | };
34 | }, [navigate]);
35 |
36 | if (!userId) {
37 | return null; // Or a loading spinner
38 | }
39 |
40 | return (
41 |
46 | Loading...}>
47 |
48 |
49 |
50 | );
51 | };
52 |
53 | export default EditorPage;
--------------------------------------------------------------------------------
/src/Pages/Home.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect, useCallback } from 'react';
2 | import { useNavigate } from 'react-router-dom';
3 | import { Button } from "../Components/ui/button";
4 | import { Card, CardContent, CardFooter, CardHeader, CardTitle } from "../Components/ui/card";
5 | import { Pencil, Bot, Lock, Share2, Zap, FileText, Search, Mic } from 'lucide-react';
6 | import { cn } from "../lib/utils";
7 | import { motion, AnimatePresence } from 'framer-motion';
8 | import AuroraBackground from '../Components/ui/aurora-background';
9 | import { FlipWords } from "../Components/ui/flip-words";
10 | import { getCurrentUser } from '../Services/appwrite';
11 | import { Cover } from "../Components/ui/cover";
12 | import { PulseLoader } from 'react-spinners';
13 | import InfiniteMovingCardsDemo from "../Components/ui/ReviewCard";
14 | import GoogleGeminiEffectDemo from "../Components/ui/Geminie";
15 | import Feature from '../Components/ui/Features';
16 |
17 | const FeatureIcon = React.memo(({ Icon }) => (
18 |
19 | ));
20 |
21 | const features = [
22 | { title: "noteX Bot", description: "AI-powered by Gemini Pro", Icon: Bot },
23 | { title: "Create Note", description: "Start fresh, write now", Icon: Pencil },
24 | { title: "Recent Notes", description: "Your latest work at a glance", Icon: FileText },
25 | { title: "Search", description: "Find anything instantly", Icon: Search },
26 | { title: "Speech-to-Text", description: "Transcribe your voice into text", Icon: Mic },
27 | { title: "Share Your Note", description: "Effortless sharing", Icon: Share2 },
28 | ];
29 |
30 | const notLoggedInFeatures = [
31 | { title: "noteX Bot", description: "AI assistance at your service", Icon: Bot },
32 | { title: "Smart Organization", description: "Keep thoughts in order", Icon: Zap },
33 | { title: "Secure and Private", description: "Your data, your control", Icon: Lock }
34 | ];
35 |
36 | const loggedInWords = [
37 | "Boost productivity",
38 | "Get AI-powered assistance",
39 | "Organize thoughts",
40 | "Gemini Pro insights",
41 | "Speech-to-Text",
42 | "Access anywhere"
43 | ];
44 |
45 | const notLoggedInWords = [
46 | "Organize your thoughts",
47 | "Secure your notes",
48 | "Gemini Pro assistance",
49 | "Smart Semantic Search",
50 | "Speech-to-Text",
51 | "Enhanced productivity",
52 | "Seamless experience",
53 | "Innovative features"
54 | ];
55 |
56 | const FeatureCard = React.memo(({ feature, onClick }) => (
57 |
62 |
63 |
64 |
65 |
66 |
67 |
{feature.title}
68 |
{feature.description}
69 |
70 |
71 |
72 | ));
73 |
74 | export default function HomePage() {
75 | const [authState, setAuthState] = useState({ isLoggedIn: false, isLoading: true, userName: '' });
76 | const navigate = useNavigate();
77 |
78 | const checkLoginStatus = useCallback(async () => {
79 | try {
80 | const user = await getCurrentUser();
81 | setAuthState({
82 | isLoggedIn: !!user,
83 | isLoading: false,
84 | userName: user ? user.name : ''
85 | });
86 | } catch (error) {
87 | console.error('Failed to authenticate', error);
88 | setAuthState({ isLoggedIn: false, isLoading: false, userName: '' });
89 | }
90 | }, []);
91 |
92 | useEffect(() => {
93 | checkLoginStatus();
94 | }, [checkLoginStatus]);
95 |
96 | const handleNavigation = useCallback((path) => () => navigate(path), [navigate]);
97 |
98 | const renderLoggedInContent = useCallback(() => (
99 |
105 |
106 | {features.map((feature, index) => (
107 |
113 |
117 |
118 | ))}
119 |
120 |
126 | Ready to boost your productivity?
127 | Start by creating a new note or accessing your recent work.
128 |
133 |
134 | Create New Note
135 |
136 |
137 |
138 | ), [handleNavigation]);
139 |
140 | const renderNotLoggedInContent = useCallback(() => (
141 |
147 |
148 | {notLoggedInFeatures.map((feature, index) => (
149 |
155 |
156 |
157 | ))}
158 |
159 |
165 |
166 | Experience the future of note-taking with AI-powered insights and the noteX Assistance Bot.
167 |
168 |
173 | Get Started
174 | →
175 |
176 |
177 |
178 | ), [handleNavigation]);
179 |
180 | return (
181 |
182 |
183 | {authState.isLoading ? (
184 |
191 |
192 |
193 | ) : (
194 |
201 |
202 |
203 |
204 |
205 |
206 | {authState.isLoggedIn ? `Welcome back, ${authState.userName}!` : "Welcome to noteX"}
207 |
208 |
209 |
210 |
211 | {authState.isLoggedIn ? renderLoggedInContent() : renderNotLoggedInContent()}
212 |
213 |
218 |
219 | Discover the power of AI-powered note-taking with noteX
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 | )}
230 |
231 |
232 | );
233 | }
--------------------------------------------------------------------------------
/src/Services/aiService.js:
--------------------------------------------------------------------------------
1 | import { GoogleGenerativeAI } from '@google/generative-ai';
2 |
3 | const MAX_CHARS = 3000;
4 | const MAX_TOKENS = 1000;
5 | const TITLE_MAX_CHARS = 155;
6 | const API_KEY = import.meta.env.VITE_GOOGLE_AI_API_KEY;
7 | const genAI = new GoogleGenerativeAI(API_KEY);
8 |
9 | const MODELS = {
10 | TEXT_GENERATION: 'gemini-pro',
11 | SUMMARIZATION: 'gemini-pro',
12 | TITLE_GENERATION: 'gemini-pro',
13 | TAG_SUGGESTION: 'gemini-pro',
14 | SENTIMENT_ANALYSIS: 'gemini-pro',
15 | LANGUAGE_TRANSLATION: 'gemini-pro',
16 | QUESTION_ANSWERING: 'gemini-pro',
17 | };
18 |
19 | const generateText = async (model, prompt, maxLength = MAX_CHARS, temperature = 0.7) => {
20 | try {
21 | const modelInstance = genAI.getGenerativeModel({ model });
22 | const result = await modelInstance.generateContent({
23 | contents: [{ role: 'user', parts: [{ text: prompt }] }],
24 | generationConfig: {
25 | maxOutputTokens: Math.min(maxLength, MAX_TOKENS),
26 | temperature,
27 | topP: 0.95,
28 | topK: 40,
29 | },
30 | });
31 | return result.response.text().slice(0, maxLength);
32 | } catch (error) {
33 | console.error('Error generating text:', error);
34 | throw new Error('Failed to generate text. Please try again.');
35 | }
36 | };
37 |
38 | export const calculateAndCreateNote = async (prompt) => {
39 | try {
40 | const modelInstance = genAI.getGenerativeModel({ model: MODELS.TEXT_GENERATION });
41 | const result = await modelInstance.generateContent({
42 | contents: [{ role: 'user', parts: [{ text: `
43 | Calculate the following and create a detailed note explaining the process and result:
44 | ${prompt}
45 |
46 | Please follow this format:
47 | 1. Restate the calculation request
48 | 2. Show the step-by-step calculation process
49 | 3. Provide the final result
50 | 4. Explain the significance or context of this calculation (if applicable)
51 | 5. Suggest any related calculations or further explorations
52 | ` }] }],
53 | generationConfig: {
54 | maxOutputTokens: MAX_TOKENS,
55 | temperature: 0.3, // Lower temperature for more deterministic results
56 | topP: 0.95,
57 | topK: 40,
58 | },
59 | });
60 | return result.response.text().slice(0, MAX_CHARS);
61 | } catch (error) {
62 | console.error('Error calculating and creating note:', error);
63 | throw new Error('Failed to calculate and create note. Please try again.');
64 | }
65 | };
66 |
67 | export const getAISuggestion = (prompt) =>
68 | generateText(MODELS.TEXT_GENERATION, `Generate a comprehensive and well-structured note outline based on this prompt. Include main topics and subtopics: ${prompt}`, MAX_CHARS, 0.8);
69 |
70 | export const getContentImprovements = (text) =>
71 | generateText(MODELS.TEXT_GENERATION, `Significantly enhance and restructure the following note, improving clarity, depth, and organization. Add relevant examples and insights where appropriate:\n\n${text.slice(0, 1500)}`, MAX_CHARS, 0.7);
72 |
73 | export const generateTitleSuggestion = (content) =>
74 | generateText(MODELS.TITLE_GENERATION, `Generate a concise, creative, and descriptive title (maximum 155 characters) that captures the essence of this note content: ${content.slice(0, 500)}`, TITLE_MAX_CHARS, 0.6);
75 |
76 | export const summarizeNote = (text) =>
77 | generateText(MODELS.SUMMARIZATION, `Provide a comprehensive summary of the following text, capturing all key points and main ideas:\n\n${text.slice(0, 1500)}`, MAX_CHARS, 0.6);
78 |
79 | export const suggestTags = (text) =>
80 | generateText(MODELS.TAG_SUGGESTION, `Suggest 5-7 highly relevant and specific tags for this note content, separated by commas. Consider both broad themes and specific topics:\n\n${text.slice(0, 500)}`, 150, 0.7);
81 |
82 | export const expandNote = (text) =>
83 | generateText(MODELS.TEXT_GENERATION, `Significantly expand on the following note by adding relevant details, examples, insights, and potential counterarguments. Ensure a logical flow of ideas:\n\n${text.slice(0, 1000)}`, MAX_CHARS, 0.8);
84 |
85 | export const getContentRecommendations = (text) => generateText(
86 | MODELS.TEXT_GENERATION,
87 | `Based on the following note content, suggest relevant additional information, facts, or insights to enrich the note. Consider different perspectives and potential areas for further exploration:
88 | ${text.slice(0, 1500)}
89 | Provide 5-7 concise but detailed recommendations, each starting with a bullet point (•).`,
90 | MAX_CHARS,
91 | 0.7
92 | );
93 |
94 | export const analyzeSentiment = (text) =>
95 | generateText(MODELS.SENTIMENT_ANALYSIS, `Conduct a nuanced sentiment analysis of the following text. Provide a detailed explanation of the overall sentiment, noting any shifts or complexities in tone:\n\n${text.slice(0, 1000)}`, 500, 0.5);
96 |
97 | export const translateText = (text, targetLanguage) =>
98 | generateText(MODELS.LANGUAGE_TRANSLATION, `Translate the following text to ${targetLanguage}, ensuring to maintain the original tone and nuances:\n\n${text.slice(0, 1500)}`, MAX_CHARS, 0.3);
99 |
100 | export const answerQuestion = (context, question) =>
101 | generateText(MODELS.QUESTION_ANSWERING, `Context: ${context.slice(0, 1500)}\n\nQuestion: ${question}\n\nProvide a comprehensive and well-reasoned answer:`, MAX_CHARS, 0.7);
102 |
103 | export const generateMindMap = (text) =>
104 | generateText(MODELS.TEXT_GENERATION, `Create a detailed mind map structure based on the following text. Use "-" for main topics, "*" for subtopics, and "+" for specific details or examples:\n\n${text.slice(0, 1000)}`, MAX_CHARS, 0.7);
105 |
106 | export const suggestRelatedTopics = (text) =>
107 | generateText(MODELS.TEXT_GENERATION, `Suggest 7-10 related topics or areas of study based on the following note content. For each suggestion, provide a brief explanation of its relevance:\n\n${text.slice(0, 1000)}`, MAX_CHARS, 0.8);
--------------------------------------------------------------------------------
/src/Services/appwrite.js:
--------------------------------------------------------------------------------
1 | import { Client, Account, Databases, Storage, ID, Query } from 'appwrite';
2 |
3 | // Initialize Appwrite client
4 | const client = new Client()
5 | .setEndpoint(import.meta.env.VITE_APPWRITE_URL) // Your Appwrite Endpoint
6 | .setProject(import.meta.env.VITE_APPWRITE_PROJECT_ID); // Your project ID
7 |
8 | // Initialize Appwrite services
9 | export const account = new Account(client);
10 | export const databases = new Databases(client);
11 | export const storage = new Storage(client);
12 |
13 | // Environment variables
14 | const DATABASE_ID = import.meta.env.VITE_APPWRITE_DATABASE_ID;
15 | const BUCKET_ID = import.meta.env.VITE_APPWRITE_BUCKET_ID;
16 | const USERS_COLLECTION_ID = import.meta.env.VITE_APPWRITE_USERS_COLLECTION_ID;
17 | const NOTES_COLLECTION_ID = import.meta.env.VITE_APPWRITE_COLLECTION_ID;
18 |
19 | // Auth functions
20 | /**
21 | * Initiate Email OTP authentication
22 | * @param {string} email - User's email
23 | * @param {boolean} enableSecurityPhrase - Whether to enable security phrase
24 | * @returns {Promise} - Session token object
25 | */
26 | export const initiateEmailOTP = async (email, enableSecurityPhrase = true) => {
27 | try {
28 | return await account.createEmailToken(ID.unique(), email, enableSecurityPhrase);
29 | } catch (error) {
30 | console.error('Detailed error:', error);
31 | if (error.response) {
32 | console.error('Response data:', error.response.data);
33 | console.error('Response status:', error.response.status);
34 | }
35 | throw error;
36 | }
37 | };
38 |
39 | /**
40 | * Create a session using Email OTP
41 | * @param {string} userId - User ID returned from initiateEmailOTP
42 | * @param {string} secret - OTP secret entered by the user
43 | * @returns {Promise} - Created session object
44 | */
45 | export const createSessionWithEmailOTP = async (userId, secret) => {
46 | try {
47 | return await account.createSession(userId, secret);
48 | } catch (error) {
49 | throw error;
50 | }
51 | };
52 |
53 | /**
54 | * Initiate Phone authentication
55 | * @param {string} phoneNumber - User's phone number
56 | * @returns {Promise} - Session token object
57 | */
58 | export const initiatePhoneAuth = async (phoneNumber) => {
59 | try {
60 | return await account.createPhoneToken(ID.unique(), phoneNumber);
61 | } catch (error) {
62 | console.error('Detailed error:', error);
63 | if (error.response) {
64 | console.error('Response data:', error.response.data);
65 | console.error('Response status:', error.response.status);
66 | }
67 | throw error;
68 | }
69 | };
70 |
71 | /**
72 | * Create a session using Phone authentication
73 | * @param {string} userId - User ID returned from initiatePhoneAuth
74 | * @param {string} secret - OTP secret entered by the user
75 | * @returns {Promise} - Created session object
76 | */
77 | export const createSessionWithPhoneAuth = async (userId, secret) => {
78 | try {
79 | return await account.createSession(userId, secret);
80 | } catch (error) {
81 | throw error;
82 | }
83 | };
84 |
85 | /**
86 | * Logout the current user
87 | * @returns {Promise}
88 | */
89 | export const logout = async () => {
90 | try {
91 | await account.deleteSession('current');
92 | } catch (error) {
93 | throw error;
94 | }
95 | };
96 |
97 | /**
98 | * Get the current authenticated user
99 | * @returns {Promise} - User object or null if not authenticated
100 | */
101 | export const getCurrentUser = async () => {
102 | try {
103 | const accountInfo = await account.get();
104 | try {
105 | const userDocument = await databases.getDocument(DATABASE_ID, USERS_COLLECTION_ID, accountInfo.$id);
106 | return { ...accountInfo, ...userDocument };
107 | } catch (dbError) {
108 | if (dbError.code === 404) {
109 | return accountInfo;
110 | }
111 | throw dbError;
112 | }
113 | } catch (error) {
114 | return null;
115 | }
116 | };
117 |
118 | /**
119 | * Delete the current session
120 | * @returns {Promise}
121 | */
122 | export const deleteCurrentSession = async () => {
123 | try {
124 | await account.deleteSession('current');
125 | } catch (error) {
126 | throw error;
127 | }
128 | };
129 |
130 | // Database functions
131 |
132 | /**
133 | * Create a new document in a collection
134 | * @param {string} collectionId - Collection ID
135 | * @param {object} data - Document data
136 | * @param {Array} permissions - Document permissions
137 | * @returns {Promise} - Created document object
138 | */
139 | export const createDocument = async (collectionId, data, permissions = []) => {
140 | try {
141 | await ensureAuthenticated();
142 | return await databases.createDocument(DATABASE_ID, collectionId, ID.unique(), data, permissions);
143 | } catch (error) {
144 | throw error;
145 | }
146 | };
147 |
148 | /**
149 | * List documents in a collection
150 | * @param {string} collectionId - Collection ID
151 | * @param {Array} queries - Query parameters
152 | * @returns {Promise} - List of documents
153 | */
154 | export const listDocuments = async (collectionId, queries = []) => {
155 | try {
156 | await ensureAuthenticated();
157 | return await databases.listDocuments(DATABASE_ID, collectionId, queries);
158 | } catch (error) {
159 | throw error;
160 | }
161 | };
162 |
163 | /**
164 | * Get a document by ID
165 | * @param {string} collectionId - Collection ID
166 | * @param {string} documentId - Document ID
167 | * @returns {Promise} - Document object
168 | */
169 | export const getDocument = async (collectionId, documentId) => {
170 | try {
171 | await ensureAuthenticated();
172 | return await databases.getDocument(DATABASE_ID, collectionId, documentId);
173 | } catch (error) {
174 | throw error;
175 | }
176 | };
177 |
178 | /**
179 | * Toggle the favorite status of a note
180 | * @param {string} noteId - The ID of the note to toggle
181 | * @returns {Promise} - Updated note object
182 | */
183 | export const toggleNoteFavorite = async (noteId) => {
184 | try {
185 | await ensureAuthenticated();
186 | const note = await databases.getDocument(DATABASE_ID, NOTES_COLLECTION_ID, noteId);
187 | const updatedNote = await databases.updateDocument(
188 | DATABASE_ID,
189 | NOTES_COLLECTION_ID,
190 | noteId,
191 | { isFavorite: !note.isFavorite }
192 | );
193 | return updatedNote;
194 | } catch (error) {
195 | console.error('Error toggling note favorite:', error);
196 | throw error;
197 | }
198 | };
199 |
200 | /**
201 | * Update a document by ID
202 | * @param {string} collectionId - Collection ID
203 | * @param {string} documentId - Document ID
204 | * @param {object} data - Updated document data
205 | * @returns {Promise} - Updated document object
206 | */
207 | export const updateDocument = async (collectionId, documentId, data) => {
208 | try {
209 | await ensureAuthenticated();
210 | return await databases.updateDocument(DATABASE_ID, collectionId, documentId, data);
211 | } catch (error) {
212 | throw error;
213 | }
214 | };
215 |
216 | /**
217 | * Delete a document by ID
218 | * @param {string} collectionId - Collection ID
219 | * @param {string} documentId - Document ID
220 | * @returns {Promise}
221 | */
222 | export const deleteDocument = async (collectionId, documentId) => {
223 | try {
224 | await ensureAuthenticated();
225 | await databases.deleteDocument(DATABASE_ID, collectionId, documentId);
226 | } catch (error) {
227 | throw error;
228 | }
229 | };
230 |
231 | // Profile management functions
232 |
233 | /**
234 | * Update user profile
235 | * @param {string} userId - User ID
236 | * @param {object} data - Profile data
237 | * @returns {Promise} - Updated or created profile document
238 | */
239 | export const updateUserProfile = async (userId, data) => {
240 | try {
241 | await ensureAuthenticated();
242 | const updateData = {
243 | name: data.name,
244 | username: data.username,
245 | profileImageId: data.profileImageId || ''
246 | };
247 | try {
248 | return await databases.updateDocument(DATABASE_ID, USERS_COLLECTION_ID, userId, updateData);
249 | } catch (updateError) {
250 | if (updateError.code === 404) {
251 | return await databases.createDocument(DATABASE_ID, USERS_COLLECTION_ID, userId, updateData);
252 | } else {
253 | throw updateError;
254 | }
255 | }
256 | } catch (error) {
257 | throw error;
258 | }
259 | };
260 |
261 | /**
262 | * Get profile image URL by file ID
263 | * @param {string} fileId - File ID
264 | * @returns {Promise} - Profile image URL
265 | */
266 | export const getProfileImage = async (fileId) => {
267 | try {
268 | const result = await storage.getFileView(BUCKET_ID, fileId);
269 | return result.href;
270 | } catch (error) {
271 | if (error.code === 404) {
272 | return '/path/to/placeholder-image.jpg'; // Replace with your placeholder image path
273 | }
274 | throw error;
275 | }
276 | };
277 |
278 | /**
279 | * Upload a profile image
280 | * @param {File} file - Profile image file
281 | * @returns {Promise} - Uploaded file object
282 | */
283 | export const uploadProfileImage = async (file) => {
284 | try {
285 | await ensureAuthenticated();
286 | return await storage.createFile(BUCKET_ID, ID.unique(), file);
287 | } catch (error) {
288 | throw error;
289 | }
290 | };
291 |
292 | /**
293 | * Delete a profile image by file ID
294 | * @param {string} fileId - File ID
295 | * @returns {Promise}
296 | */
297 | export const deleteProfileImage = async (fileId) => {
298 | try {
299 | await ensureAuthenticated();
300 | try {
301 | await storage.getFile(BUCKET_ID, fileId);
302 | } catch (error) {
303 | if (error.code === 404) {
304 | return;
305 | }
306 | throw error;
307 | }
308 | await storage.deleteFile(BUCKET_ID, fileId);
309 | } catch (error) {
310 | throw error;
311 | }
312 | };
313 |
314 | /**
315 | * Delete the current user's account
316 | * @returns {Promise}
317 | */
318 | export const deleteUserAccount = async () => {
319 | try {
320 | await ensureAuthenticated();
321 | const user = await getCurrentUser();
322 |
323 | // Delete user's profile image if it exists
324 | if (user.profileImageId) {
325 | await deleteProfileImage(user.profileImageId);
326 | }
327 |
328 | // Try to delete all user's notes
329 | try {
330 | const userNotes = await databases.listDocuments(DATABASE_ID, NOTES_COLLECTION_ID, [
331 | Query.equal('userId', user.$id)
332 | ]);
333 | for (const note of userNotes.documents) {
334 | await databases.deleteDocument(DATABASE_ID, NOTES_COLLECTION_ID, note.$id);
335 | }
336 | } catch (noteError) {
337 | console.error('Error deleting user notes:', noteError);
338 | // Continue with account deletion even if note deletion fails
339 | }
340 |
341 | // Delete user's profile document from the database
342 | await databases.deleteDocument(DATABASE_ID, USERS_COLLECTION_ID, user.$id);
343 |
344 | // Delete user's account
345 | await account.deleteSession('current');
346 | await account.delete();
347 |
348 | return true; // Indicate successful deletion
349 | } catch (error) {
350 | console.error('Error deleting account:', error);
351 | throw error;
352 | }
353 | };
354 |
355 | // Helper function
356 |
357 | /**
358 | * Ensure the user is authenticated
359 | * @returns {Promise}
360 | * @throws {Error} - If the user is not authenticated
361 | */
362 | const ensureAuthenticated = async () => {
363 | const user = await getCurrentUser();
364 | if (!user) {
365 | throw new Error('User is not authenticated');
366 | }
367 | };
--------------------------------------------------------------------------------
/src/assets/logo1.png.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soummyaanon/-noteX/061577f9bd93974097e42e11c9b99ccc770f4543/src/assets/logo1.png.png
--------------------------------------------------------------------------------
/src/assets/toolpilot-badge-b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soummyaanon/-noteX/061577f9bd93974097e42e11c9b99ccc770f4543/src/assets/toolpilot-badge-b.png
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | @layer base {
6 | :root {
7 | --background: 0 0% 100%;
8 | --foreground: 222.2 84% 4.9%;
9 | --card: 0 0% 100%;
10 | --card-foreground: 222.2 84% 4.9%;
11 | --popover: 0 0% 100%;
12 | --popover-foreground: 222.2 84% 4.9%;
13 | --primary: 222.2 47.4% 11.2%;
14 | --primary-foreground: 210 40% 98%;
15 | --secondary: 210 40% 96.1%;
16 | --secondary-foreground: 222.2 47.4% 11.2%;
17 | --muted: 210 40% 96.1%;
18 | --muted-foreground: 215.4 16.3% 46.9%;
19 | --accent: 210 40% 96.1%;
20 | --accent-foreground: 222.2 47.4% 11.2%;
21 | --destructive: 0 84.2% 60.2%;
22 | --destructive-foreground: 210 40% 98%;
23 | --border: 214.3 31.8% 91.4%;
24 | --input: 214.3 31.8% 91.4%;
25 | --ring: 222.2 84% 4.9%;
26 | --radius: 0.5rem;
27 | }
28 |
29 | .dark {
30 | --background: 0 0% 0%; /* AMOLED black */
31 | --foreground: 210 40% 98%;
32 | --card: 0 0% 4%; /* Slightly lighter than background for contrast */
33 | --card-foreground: 210 40% 98%;
34 | --popover: 0 0% 4%;
35 | --popover-foreground: 210 40% 98%;
36 | --primary: 210 40% 98%;
37 | --primary-foreground: 222.2 47.4% 11.2%;
38 | --secondary: 217.2 32.6% 17.5%;
39 | --secondary-foreground: 210 40% 98%;
40 | --muted: 217.2 32.6% 17.5%;
41 | --muted-foreground: 215 20.2% 65.1%;
42 | --accent: 217.2 32.6% 17.5%;
43 | --accent-foreground: 210 40% 98%;
44 | --destructive: 0 62.8% 30.6%;
45 | --destructive-foreground: 210 40% 98%;
46 | --border: 217.2 32.6% 17.5%;
47 | --input: 217.2 32.6% 17.5%;
48 | --ring: 212.7 26.8% 83.9%;
49 | /* Additional dark mode shades */
50 | --gray-900: 0 0% 10%;
51 | --gray-800: 0 0% 20%;
52 | --gray-700: 0 0% 30%;
53 | --gray-600: 0 0% 40%;
54 | --gray-500: 0 0% 50%;
55 | --gray-400: 0 0% 60%;
56 | --gray-300: 0 0% 70%;
57 | --gray-200: 0 0% 80%;
58 | --gray-100: 0 0% 90%;
59 | }
60 | }
61 |
62 | @layer base {
63 | * {
64 | @apply border-border;
65 | }
66 | body {
67 | @apply bg-background text-foreground transition-colors duration-300;
68 | }
69 | }
70 |
71 | @layer utilities {
72 | .transition-theme {
73 | transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
74 | transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
75 | transition-duration: 300ms;
76 | }
77 | }
--------------------------------------------------------------------------------
/src/lib/utils.js:
--------------------------------------------------------------------------------
1 | import { clsx } from "clsx";
2 | import { twMerge } from "tailwind-merge";
3 |
4 | export function cn(...inputs) {
5 | return twMerge(clsx(inputs));
6 | }
7 |
--------------------------------------------------------------------------------
/src/lib/utils.ts:
--------------------------------------------------------------------------------
1 | import { ClassValue, clsx } from "clsx";
2 | import { twMerge } from "tailwind-merge";
3 |
4 | export function cn(...inputs: ClassValue[]) {
5 | return twMerge(clsx(inputs));
6 | }
7 |
--------------------------------------------------------------------------------
/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import * as ReactDOM from 'react-dom/client';
3 | import App from './App.jsx';
4 | import './index.css';
5 |
6 |
7 | ReactDOM.createRoot(document.getElementById('root')).render(
8 |
9 |
10 |
11 |
12 |
13 |
14 | );
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | const defaultTheme = require("tailwindcss/defaultTheme");
2 | const colors = require("tailwindcss/colors");
3 | const { default: flattenColorPalette } = require("tailwindcss/lib/util/flattenColorPalette");
4 |
5 | /** @type {import('tailwindcss').Config} */
6 | module.exports = {
7 | darkMode: "class",
8 | content: [
9 | './pages/**/*.{js,jsx,ts,tsx}',
10 | './components/**/*.{js,jsx,ts,tsx}',
11 | './app/**/*.{js,jsx,ts,tsx}',
12 | './src/**/*.{js,jsx,ts,tsx}',
13 | ],
14 | theme: {
15 | container: {
16 | center: true,
17 | padding: "2rem",
18 | screens: {
19 | "2xl": "1400px",
20 | },
21 | },
22 | extend: {
23 | colors: {
24 | border: "hsl(var(--border))",
25 | input: "hsl(var(--input))",
26 | ring: "hsl(var(--ring))",
27 | background: {
28 | DEFAULT: "hsl(var(--background))",
29 | dark: "#000000",
30 | },
31 | foreground: "hsl(var(--foreground))",
32 | primary: {
33 | DEFAULT: "hsl(var(--primary))",
34 | foreground: "hsl(var(--primary-foreground))",
35 | },
36 | secondary: {
37 | DEFAULT: "hsl(var(--secondary))",
38 | foreground: "hsl(var(--secondary-foreground))",
39 | },
40 | destructive: {
41 | DEFAULT: "hsl(var(--destructive))",
42 | foreground: "hsl(var(--destructive-foreground))",
43 | },
44 | muted: {
45 | DEFAULT: "hsl(var(--muted))",
46 | foreground: "hsl(var(--muted-foreground))",
47 | },
48 | accent: {
49 | DEFAULT: "hsl(var(--accent))",
50 | foreground: "hsl(var(--accent-foreground))",
51 | },
52 | popover: {
53 | DEFAULT: "hsl(var(--popover))",
54 | foreground: "hsl(var(--popover-foreground))",
55 | },
56 | card: {
57 | DEFAULT: "hsl(var(--card))",
58 | foreground: "hsl(var(--card-foreground))",
59 | },
60 | },
61 | borderRadius: {
62 | lg: "var(--radius)",
63 | md: "calc(var(--radius) - 2px)",
64 | sm: "calc(var(--radius) - 4px)",
65 | },
66 | fontFamily: {
67 | 'honk': ['"Honk"', 'sans-serif'],
68 | 'suse': ['"SUSE"', 'sans-serif'],
69 | 'Orbitron': ['"Orbitron"', 'sans-serif'],
70 | },
71 | keyframes: {
72 | "accordion-down": {
73 | from: { height: 0 },
74 | to: { height: "var(--radix-accordion-content-height)" },
75 | },
76 | "accordion-up": {
77 | from: { height: "var(--radix-accordion-content-height)" },
78 | to: { height: 0 },
79 | },
80 | aurora: {
81 | from: { backgroundPosition: "50% 50%, 50% 50%" },
82 | to: { backgroundPosition: "350% 50%, 350% 50%" },
83 | },
84 | "border-beam": {
85 | "0%": { "offset-distance": "0%" },
86 | "100%": { "offset-distance": "100%" },
87 | },
88 | "spin-around": {
89 | "0%": { transform: "translateZ(0) rotate(0)" },
90 | "15%, 35%": { transform: "translateZ(0) rotate(90deg)" },
91 | "65%, 85%": { transform: "translateZ(0) rotate(270deg)" },
92 | "100%": { transform: "translateZ(0) rotate(360deg)" },
93 | },
94 | slide: {
95 | to: { transform: "translate(calc(100cqw - 100%), 0)" },
96 | },
97 | scroll: {
98 | to: { transform: "translate(calc(-50% - 0.5rem))" },
99 | },
100 | },
101 | animation: {
102 | "accordion-down": "accordion-down 0.2s ease-out",
103 | "accordion-up": "accordion-up 0.2s ease-out",
104 | aurora: "aurora 60s linear infinite",
105 | "border-beam": "border-beam calc(var(--duration)*1s) infinite linear",
106 | "spin-around": "spin-around calc(var(--speed) * 2) infinite linear",
107 | slide: "slide var(--speed) ease-in-out infinite alternate",
108 | scroll: "scroll var(--animation-duration, 40s) var(--animation-direction, forwards) linear infinite",
109 | },
110 | },
111 | },
112 | plugins: [
113 | require("tailwindcss-animate"),
114 | addVariablesForColors,
115 | ],
116 | };
117 |
118 | // This plugin adds each Tailwind color as a global CSS variable, e.g. var(--gray-200).
119 | function addVariablesForColors({ addBase, theme }) {
120 | let allColors = flattenColorPalette(theme("colors"));
121 | let newVars = Object.fromEntries(
122 | Object.entries(allColors).map(([key, val]) => [`--${key}`, val])
123 | );
124 | addBase({
125 | ":root": newVars,
126 | });
127 | }
--------------------------------------------------------------------------------
/vercel.json:
--------------------------------------------------------------------------------
1 | {
2 | "rewrites": [
3 | { "source": "/(.*)", "destination": "/index.html" }
4 | ],
5 | "headers": [
6 | {
7 | "source": "/assets/(.*)",
8 | "headers": [
9 | { "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }
10 | ]
11 | }
12 | ]
13 | }
--------------------------------------------------------------------------------
/vite.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import react from '@vitejs/plugin-react';
3 | import commonjs from '@rollup/plugin-commonjs';
4 |
5 | // https://vitejs.dev/config/
6 | export default defineConfig({
7 | plugins: [
8 | react(),
9 | commonjs() // Add the CommonJS plugin to handle CommonJS modules
10 | ],
11 | build: {
12 | outDir: 'dist', // Ensure the output directory is set to 'dist'
13 | commonjsOptions: {
14 | include: [/node_modules/], // Include node_modules in the CommonJS options
15 | },
16 | },
17 | resolve: {
18 | alias: {
19 | '@': '/src', // Optional: Set up path alias for easier imports
20 | },
21 | },
22 | optimizeDeps: {
23 | include: ['long'], // Ensure 'long' is included in the dependency optimization
24 | }
25 | });
--------------------------------------------------------------------------------