├── postcss.config.js
├── vite.config.js
├── src
├── index.css
├── App.jsx
├── main.jsx
├── components
│ ├── Background.jsx
│ ├── ParentComponent.jsx
│ ├── Foreground.jsx
│ └── Card.jsx
├── App.css
└── assets
│ └── react.svg
├── tailwind.config.js
├── README.md
├── .gitignore
├── index.html
├── .eslintrc.cjs
├── package.json
└── public
└── vite.svg
/postcss.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/vite.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite'
2 | import react from '@vitejs/plugin-react'
3 |
4 | // https://vitejs.dev/config/
5 | export default defineConfig({
6 | plugins: [react()],
7 | })
8 |
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | *{
6 | font-family:Arial, Helvetica, sans-serif;
7 | }
8 |
9 |
10 | ::selection{
11 | color: rgb(232, 145, 47);
12 | }
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | export default {
3 | content: [
4 | "./index.html",
5 | "./src/**/*.{js,ts,jsx,tsx}",
6 | ],
7 | theme: {
8 | extend: {},
9 | },
10 | plugins: [],
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/src/App.jsx:
--------------------------------------------------------------------------------
1 |
2 | import React from 'react';
3 | import ParentComponent from './components/ParentComponent';
4 |
5 | function App() {
6 | return (
7 |
10 | );
11 | }
12 |
13 | export default App;
14 |
--------------------------------------------------------------------------------
/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App.jsx'
4 | import './index.css'
5 |
6 | ReactDOM.createRoot(document.getElementById('root')).render(
7 |
8 |
9 | ,
10 | )
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | =======
3 | # Doc-Notes
4 | Doc-Notes is a sleek and interactive React application designed to streamline your note-taking experience. With its intuitive user interface and dynamic features, organizing your thoughts has never been easier.
5 | >>>>>>> 3ec5fdd975883cbe04946863e844bec834d46dd7
6 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/components/Background.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | function Background() {
4 | return (
5 | <>
6 |
7 |
8 | Notes
9 |
10 |
11 | Docs.
12 |
13 |
14 | >
15 | );
16 | }
17 |
18 | export default Background;
19 |
--------------------------------------------------------------------------------
/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:react/recommended',
7 | 'plugin:react/jsx-runtime',
8 | 'plugin:react-hooks/recommended',
9 | ],
10 | ignorePatterns: ['dist', '.eslintrc.cjs'],
11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12 | settings: { react: { version: '18.2' } },
13 | plugins: ['react-refresh'],
14 | rules: {
15 | 'react-refresh/only-export-components': [
16 | 'warn',
17 | { allowConstantExport: true },
18 | ],
19 | },
20 | }
21 |
--------------------------------------------------------------------------------
/src/App.css:
--------------------------------------------------------------------------------
1 | #root {
2 | max-width: 1280px;
3 | margin: 0 auto;
4 | padding: 2rem;
5 | text-align: center;
6 | }
7 |
8 | .logo {
9 | height: 6em;
10 | padding: 1.5em;
11 | will-change: filter;
12 | transition: filter 300ms;
13 | }
14 | .logo:hover {
15 | filter: drop-shadow(0 0 2em #646cffaa);
16 | }
17 | .logo.react:hover {
18 | filter: drop-shadow(0 0 2em #61dafbaa);
19 | }
20 |
21 | @keyframes logo-spin {
22 | from {
23 | transform: rotate(0deg);
24 | }
25 | to {
26 | transform: rotate(360deg);
27 | }
28 | }
29 |
30 | @media (prefers-reduced-motion: no-preference) {
31 | a:nth-of-type(2) .logo {
32 | animation: logo-spin infinite 20s linear;
33 | }
34 | }
35 |
36 | .card {
37 | padding: 2em;
38 | }
39 |
40 | .read-the-docs {
41 | color: #888;
42 | }
43 |
--------------------------------------------------------------------------------
/src/components/ParentComponent.jsx:
--------------------------------------------------------------------------------
1 | // ParentComponent.js
2 | import React, { useState } from 'react';
3 | import Background from './Background';
4 | import Foreground from './Foreground';
5 | import Card from './Card';
6 |
7 | function ParentComponent() {
8 |
9 | const [cards, setCards] = useState([]);
10 |
11 |
12 | const addCard = () => {
13 | const id = Date.now();
14 | const newCard = { id, data: cardData };
15 | setCards([...cards, newCard]);
16 | };
17 |
18 | const deleteCard = (id) => {
19 | setCards(cards.filter(card => card.id !== id));
20 | };
21 |
22 | return (
23 |
24 |
25 |
26 |
27 | {cards.map(card => (
28 |
29 | deleteCard(card.id)} />
30 |
31 | ))}
32 |
33 |
34 | );
35 | }
36 |
37 | export default ParentComponent;
38 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "homepage": "https://redhawk1303d.github.io/Doc-Notes",
3 | "name": "docs",
4 | "private": true,
5 | "version": "0.0.0",
6 | "type": "module",
7 | "scripts": {
8 | "predeploy": "npm run build",
9 | "deploy": "gh-pages -d build",
10 | "dev": "vite",
11 | "build": "vite build",
12 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
13 | "preview": "vite preview"
14 | },
15 | "dependencies": {
16 | "file-saver": "^2.0.5",
17 | "framer-motion": "^10.16.15",
18 | "install": "^0.13.0",
19 | "react": "^18.2.0",
20 | "react-dom": "^18.2.0",
21 | "react-icons": "^4.12.0"
22 | },
23 | "devDependencies": {
24 | "@types/react": "^18.2.37",
25 | "@types/react-dom": "^18.2.15",
26 | "@vitejs/plugin-react": "^4.2.0",
27 | "autoprefixer": "^10.4.16",
28 | "eslint": "^8.53.0",
29 | "eslint-plugin-react": "^7.33.2",
30 | "eslint-plugin-react-hooks": "^4.6.0",
31 | "eslint-plugin-react-refresh": "^0.4.4",
32 | "gh-pages": "^6.1.1",
33 | "postcss": "^8.4.32",
34 | "tailwindcss": "^3.3.6",
35 | "vite": "^5.0.0"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/components/Foreground.jsx:
--------------------------------------------------------------------------------
1 | import React, { useRef } from "react";
2 | import Card from "./Card";
3 |
4 | function Foreground() {
5 | const foregroundRef = useRef(null);
6 |
7 | const data = [
8 | {
9 | desc: "Lorem Ipsum dolor sit amet.",
10 | filesize: "0.9mb",
11 | close: true,
12 | tag: { isOpen: true, tagTitle: "Notes", tagColor: "green" },
13 | },
14 | {
15 | desc: "Lorem Ipsum dolor sit amet consectetur adipisicing.",
16 | filesize: "0.9mb",
17 | close: false,
18 | tag: { isOpen: true, tagTitle: "Download", tagColor: "blue" },
19 | },
20 | {
21 | desc: "Lorem Ipsum dolor sit amet consectetur adipisicing. Lorem Ipsum dolor sit amet consectetur",
22 | filesize: "0.9mb",
23 | close: true,
24 | tag: { isOpen: true, tagTitle: "Upload", tagColor: "green" },
25 | },
26 | ];
27 |
28 | return (
29 |
30 | {data.map((item, index) => (
31 |
32 | ))}
33 |
34 | );
35 | }
36 |
37 | export default Foreground;
38 |
--------------------------------------------------------------------------------
/public/vite.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/components/Card.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from "react";
2 | import { PiFilesFill } from "react-icons/pi";
3 | import { PiDownload } from "react-icons/pi";
4 | import { IoClose } from "react-icons/io5";
5 | import { motion } from "framer-motion";
6 | import { saveAs } from "file-saver";
7 |
8 | function Card({ id, data, reference }) {
9 | const [inputText, setInputText] = useState("");
10 | const [fileSize, setFileSize] = useState(data.filesize);
11 |
12 | useEffect(() => {
13 |
14 | const savedData = localStorage.getItem(`cardInputText_${id}`);
15 | if (savedData) {
16 | setInputText(savedData);
17 | setFileSize(`${savedData.length} characters`);
18 | }
19 | }, [id]);
20 |
21 | const handleInputChange = (e) => {
22 | const text = e.target.value;
23 | setInputText(text);
24 |
25 | setFileSize(`${text.length} characters`);
26 |
27 | localStorage.setItem(`cardInputText_${id}`, text);
28 | };
29 |
30 | const handleDownload = () => {
31 |
32 | const blob = new Blob([inputText], { type: "text/plain;charset=utf-8" });
33 |
34 | saveAs(blob, `card_content_${id}.txt`);
35 | };
36 |
37 | const handleDelete = () => {
38 |
39 | localStorage.removeItem(`cardInputText_${id}`);
40 |
41 | };
42 |
43 | return (
44 |
52 |
53 |
54 |
61 |
62 |
63 |
64 |
{fileSize}
65 |
66 |
67 | {data.close ? : }
68 |
69 |
70 | {data.tag.isOpen && (
71 |
72 |
{data.tag.tagTitle}
73 |
74 | )}
75 |
76 |
77 | );
78 | }
79 |
80 | export default Card;
81 |
--------------------------------------------------------------------------------
/src/assets/react.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------