anuragshas commited on
Commit
dd7420a
·
1 Parent(s): 9807072

add: tailwindcss

Browse files
Files changed (6) hide show
  1. .postcssrc +5 -0
  2. eslint.config.mjs +44 -0
  3. index.html +66 -47
  4. package-lock.json +0 -0
  5. package.json +15 -14
  6. style.css +1 -78
.postcssrc ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "plugins": {
3
+ "@tailwindcss/postcss": {}
4
+ }
5
+ }
eslint.config.mjs ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { defineConfig } from "eslint/config";
2
+ import globals from "globals";
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import js from "@eslint/js";
6
+ import { FlatCompat } from "@eslint/eslintrc";
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+ const compat = new FlatCompat({
11
+ baseDirectory: __dirname,
12
+ recommendedConfig: js.configs.recommended,
13
+ allConfig: js.configs.all
14
+ });
15
+
16
+ export default defineConfig([{
17
+ extends: compat.extends("eslint:recommended"),
18
+
19
+ languageOptions: {
20
+ globals: {
21
+ ...globals.browser,
22
+ ...globals.node,
23
+ },
24
+
25
+ ecmaVersion: 12,
26
+ sourceType: "module",
27
+ },
28
+
29
+ rules: {
30
+ indent: ["error", 2],
31
+ quotes: ["error", "single"],
32
+ semi: ["error", "always"],
33
+
34
+ "no-unused-vars": ["error", {
35
+ args: "all",
36
+ argsIgnorePattern: "^_",
37
+ caughtErrors: "all",
38
+ caughtErrorsIgnorePattern: "^_",
39
+ destructuredArrayIgnorePattern: "^_",
40
+ varsIgnorePattern: "^_",
41
+ ignoreRestSiblings: true,
42
+ }],
43
+ },
44
+ }]);
index.html CHANGED
@@ -8,65 +8,84 @@
8
  <link rel="stylesheet" href="style.css">
9
  </head>
10
 
11
- <body>
12
- <h1>Quotation Generator</h1>
13
- <div id="form-container">
14
- <form id="quotation-form">
15
- <fieldset>
16
- <legend>Your Company Details</legend>
17
- <input type="text" id="company-name" name="company-name" placeholder="Company Name" required>
18
- <textarea id="company-address" name="company-address" placeholder="Address" required></textarea>
19
- <input type="text" id="company-phone" name="company-phone" placeholder="Phone">
20
- <input type="email" id="company-email" name="company-email" placeholder="Email">
21
- <input type="text" id="company-gstin" name="company-gstin" placeholder="GSTIN">
 
 
 
 
 
22
  </fieldset>
23
- <fieldset>
24
- <legend>Customer Company Details</legend>
25
- <input type="text" id="customer-name" name="customer-name" placeholder="Customer Name" required>
26
- <textarea id="customer-address" name="customer-address" placeholder="Address" required></textarea>
27
- <input type="text" id="customer-phone" name="customer-phone" placeholder="Phone">
28
- <input type="email" id="customer-email" name="customer-email" placeholder="Email">
29
- <input type="text" id="customer-gstin" name="customer-gstin" placeholder="GSTIN">
 
 
 
 
 
30
  </fieldset>
31
- <fieldset>
32
- <legend>Quotation Details</legend>
33
- <input type="text" id="quotation-number" name="quotation-number" placeholder="Quotation Number" required>
34
- <input type="date" id="quotation-date" name="quotation-date" required>
 
 
35
  </fieldset>
36
- <fieldset>
37
- <legend>Items</legend>
38
- <table id="items-table">
39
  <thead>
40
- <tr>
41
- <th>S.No</th>
42
- <th>Description</th>
43
- <th>HSN Code</th>
44
- <th>Qty</th>
45
- <th>Unit Price</th>
46
- <th>Discount (%)</th>
47
- <th>Amount</th>
48
- <th></th>
49
  </tr>
50
  </thead>
51
  <tbody>
52
  </tbody>
53
  </table>
54
- <button type="button" id="add-item">Add Item</button>
 
55
  </fieldset>
56
- <fieldset>
57
- <legend>Additional Charges</legend>
58
- <label>IGST (%)<input type="number" id="igst-rate" name="igst-rate" value="0" min="0"></label>
59
- <label>Freight Charges<input type="number" id="freight-charges" name="freight-charges" value="0"
60
- min="0"></label>
 
61
  </fieldset>
62
- <fieldset>
63
- <legend>Bank Details</legend>
64
- <input type="text" id="bank-name" name="bank-name" placeholder="Bank Name" required>
65
- <input type="text" id="bank-account" name="bank-account" placeholder="Account Number" required>
66
- <input type="text" id="bank-ifsc" name="bank-ifsc" placeholder="IFSC Code" required>
67
- <input type="text" id="bank-branch" name="bank-branch" placeholder="Branch" required>
 
 
 
 
68
  </fieldset>
69
- <button type="submit">Generate Quotation</button>
 
70
  </form>
71
  </div>
72
  <div id="quotation-output" style="display:none;"></div>
 
8
  <link rel="stylesheet" href="style.css">
9
  </head>
10
 
11
+ <body class="bg-gray-100">
12
+ <h1 class="text-3xl font-bold text-center my-8">Quotation Generator</h1>
13
+ <div id="form-container" class="container mx-auto">
14
+ <form id="quotation-form" class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
15
+ <fieldset class="border border-gray-300 p-4 mb-4">
16
+ <legend class="text-lg font-semibold mb-2">Your Company Details</legend>
17
+ <input type="text" id="company-name" name="company-name" placeholder="Company Name" required
18
+ class="w-full p-2 border border-gray-300 rounded mb-2">
19
+ <textarea id="company-address" name="company-address" placeholder="Address" required
20
+ class="w-full p-2 border border-gray-300 rounded mb-2"></textarea>
21
+ <input type="text" id="company-phone" name="company-phone" placeholder="Phone"
22
+ class="w-full p-2 border border-gray-300 rounded mb-2">
23
+ <input type="email" id="company-email" name="company-email" placeholder="Email"
24
+ class="w-full p-2 border border-gray-300 rounded mb-2">
25
+ <input type="text" id="company-gstin" name="company-gstin" placeholder="GSTIN"
26
+ class="w-full p-2 border border-gray-300 rounded">
27
  </fieldset>
28
+ <fieldset class="border border-gray-300 p-4 mb-4">
29
+ <legend class="text-lg font-semibold mb-2">Customer Company Details</legend>
30
+ <input type="text" id="customer-name" name="customer-name" placeholder="Customer Name" required
31
+ class="w-full p-2 border border-gray-300 rounded mb-2">
32
+ <textarea id="customer-address" name="customer-address" placeholder="Address" required
33
+ class="w-full p-2 border border-gray-300 rounded mb-2"></textarea>
34
+ <input type="text" id="customer-phone" name="customer-phone" placeholder="Phone"
35
+ class="w-full p-2 border border-gray-300 rounded mb-2">
36
+ <input type="email" id="customer-email" name="customer-email" placeholder="Email"
37
+ class="w-full p-2 border border-gray-300 rounded mb-2">
38
+ <input type="text" id="customer-gstin" name="customer-gstin" placeholder="GSTIN"
39
+ class="w-full p-2 border border-gray-300 rounded">
40
  </fieldset>
41
+ <fieldset class="border border-gray-300 p-4 mb-4">
42
+ <legend class="text-lg font-semibold mb-2">Quotation Details</legend>
43
+ <input type="text" id="quotation-number" name="quotation-number" placeholder="Quotation Number" required
44
+ class="w-full p-2 border border-gray-300 rounded mb-2">
45
+ <input type="date" id="quotation-date" name="quotation-date" required
46
+ class="w-full p-2 border border-gray-300 rounded">
47
  </fieldset>
48
+ <fieldset class="border border-gray-300 p-4 mb-4">
49
+ <legend class="text-lg font-semibold mb-2">Items</legend>
50
+ <table id="items-table" class="w-full mb-2">
51
  <thead>
52
+ <tr class="bg-gray-200">
53
+ <th class="p-2 border border-gray-300">S.No</th>
54
+ <th class="p-2 border border-gray-300">Description</th>
55
+ <th class="p-2 border border-gray-300">HSN Code</th>
56
+ <th class="p-2 border border-gray-300">Qty</th>
57
+ <th class="p-2 border border-gray-300">Unit Price</th>
58
+ <th class="p-2 border border-gray-300">Discount (%)</th>
59
+ <th class="p-2 border border-gray-300">Amount</th>
60
+ <th class="p-2 border border-gray-300"></th>
61
  </tr>
62
  </thead>
63
  <tbody>
64
  </tbody>
65
  </table>
66
+ <button type="button" id="add-item"
67
+ class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">Add Item</button>
68
  </fieldset>
69
+ <fieldset class="border border-gray-300 p-4 mb-4">
70
+ <legend class="text-lg font-semibold mb-2">Additional Charges</legend>
71
+ <label class="block mb-2">IGST (%)<input type="number" id="igst-rate" name="igst-rate" value="0" min="0"
72
+ class="w-full p-2 border border-gray-300 rounded"></label>
73
+ <label class="block">Freight Charges<input type="number" id="freight-charges" name="freight-charges" value="0"
74
+ min="0" class="w-full p-2 border border-gray-300 rounded"></label>
75
  </fieldset>
76
+ <fieldset class="border border-gray-300 p-4 mb-4">
77
+ <legend class="text-lg font-semibold mb-2">Bank Details</legend>
78
+ <input type="text" id="bank-name" name="bank-name" placeholder="Bank Name" required
79
+ class="w-full p-2 border border-gray-300 rounded mb-2">
80
+ <input type="text" id="bank-account" name="bank-account" placeholder="Account Number" required
81
+ class="w-full p-2 border border-gray-300 rounded mb-2">
82
+ <input type="text" id="bank-ifsc" name="bank-ifsc" placeholder="IFSC Code" required
83
+ class="w-full p-2 border border-gray-300 rounded mb-2">
84
+ <input type="text" id="bank-branch" name="bank-branch" placeholder="Branch" required
85
+ class="w-full p-2 border border-gray-300 rounded">
86
  </fieldset>
87
+ <button type="submit" class="bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded">Generate
88
+ Quotation</button>
89
  </form>
90
  </div>
91
  <div id="quotation-output" style="display:none;"></div>
package-lock.json CHANGED
The diff for this file is too large to render. See raw diff
 
package.json CHANGED
@@ -3,21 +3,20 @@
3
  "version": "1.0.0",
4
  "description": "Client-side quotation generator with linting setup",
5
  "scripts": {
6
- "prepare": "husky install",
 
 
7
  "lint:js": "eslint script.js tests",
8
- "lint:css": "stylelint '**/*.css'",
9
- "lint:html": "htmlhint index.html",
10
- "lint": "npm-run-all lint:html lint:css lint:js",
11
  "test": "node tests/test.js"
12
  },
13
  "devDependencies": {
14
- "eslint": "^8.0.0",
15
- "htmlhint": "^0.15.0",
16
- "husky": "^8.0.3",
17
- "lint-staged": "^13.3.0",
18
- "npm-run-all": "^4.1.5",
19
- "stylelint": "^15.0.0",
20
- "stylelint-config-standard": "^32.0.0"
21
  },
22
  "lint-staged": {
23
  "*.js": [
@@ -25,9 +24,11 @@
25
  ],
26
  "*.css": [
27
  "stylelint --fix"
28
- ],
29
- "*.html": [
30
- "htmlhint"
31
  ]
 
 
 
 
 
32
  }
33
  }
 
3
  "version": "1.0.0",
4
  "description": "Client-side quotation generator with linting setup",
5
  "scripts": {
6
+ "prepare": "husky",
7
+ "dev": "parcel index.html",
8
+ "build": "parcel build index.html",
9
  "lint:js": "eslint script.js tests",
10
+ "lint": "npm run lint:js",
 
 
11
  "test": "node tests/test.js"
12
  },
13
  "devDependencies": {
14
+ "eslint": "^9.3.0",
15
+ "husky": "^9.1.7",
16
+ "lint-staged": "^16.1.2",
17
+ "parcel": "^2.15.4",
18
+ "stylelint": "^16.21.0",
19
+ "stylelint-config-standard": "^38.0.0"
 
20
  },
21
  "lint-staged": {
22
  "*.js": [
 
24
  ],
25
  "*.css": [
26
  "stylelint --fix"
 
 
 
27
  ]
28
+ },
29
+ "dependencies": {
30
+ "@tailwindcss/postcss": "^4.1.11",
31
+ "postcss": "^8.5.6",
32
+ "tailwindcss": "^4.1.11"
33
  }
34
  }
style.css CHANGED
@@ -1,46 +1,4 @@
1
- body {
2
- font-family: Arial, sans-serif;
3
- margin: 20px;
4
- }
5
-
6
- fieldset {
7
- margin-bottom: 15px;
8
- border: 1px solid #ccc;
9
- padding: 10px;
10
- }
11
-
12
- legend {
13
- font-weight: bold;
14
- }
15
-
16
- input,
17
- textarea {
18
- width: 100%;
19
- padding: 5px;
20
- margin: 5px 0;
21
- box-sizing: border-box;
22
- }
23
-
24
- #items-table,
25
- .quotation-table {
26
- width: 100%;
27
- border-collapse: collapse;
28
- margin-bottom: 10px;
29
- }
30
-
31
- #items-table th,
32
- #items-table td,
33
- .quotation-table th,
34
- .quotation-table td {
35
- border: 1px solid #ccc;
36
- padding: 5px;
37
- text-align: left;
38
- }
39
-
40
- button {
41
- padding: 8px 12px;
42
- margin: 5px;
43
- }
44
 
45
  .quotation-print {
46
  max-width: 800px;
@@ -163,38 +121,3 @@ button {
163
  margin-top: 20px;
164
  font-weight: bold;
165
  }
166
-
167
-
168
- @media screen and (width <=768px) {
169
- #items-table thead {
170
- display: none;
171
- }
172
-
173
- #items-table,
174
- #items-table tbody,
175
- #items-table tr,
176
- #items-table td {
177
- display: block;
178
- width: 100%;
179
- }
180
-
181
- #items-table tr {
182
- margin-bottom: 15px;
183
- }
184
-
185
- #items-table td {
186
- text-align: right;
187
- padding-left: 50%;
188
- position: relative;
189
- }
190
-
191
- #items-table td::before {
192
- content: attr(data-label);
193
- position: absolute;
194
- left: 0;
195
- width: 45%;
196
- padding-left: 15px;
197
- font-weight: bold;
198
- text-align: left;
199
- }
200
- }
 
1
+ @import url("tailwindcss");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  .quotation-print {
4
  max-width: 800px;
 
121
  margin-top: 20px;
122
  font-weight: bold;
123
  }