webtech-codes 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- webtech_codes-1.0.0/LICENSE +21 -0
- webtech_codes-1.0.0/PKG-INFO +74 -0
- webtech_codes-1.0.0/README.md +33 -0
- webtech_codes-1.0.0/pyproject.toml +35 -0
- webtech_codes-1.0.0/setup.cfg +4 -0
- webtech_codes-1.0.0/src/webtech_codes.egg-info/PKG-INFO +74 -0
- webtech_codes-1.0.0/src/webtech_codes.egg-info/SOURCES.txt +52 -0
- webtech_codes-1.0.0/src/webtech_codes.egg-info/dependency_links.txt +1 -0
- webtech_codes-1.0.0/src/webtech_codes.egg-info/entry_points.txt +2 -0
- webtech_codes-1.0.0/src/webtech_codes.egg-info/top_level.txt +1 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/__init__.py +1 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/cli.py +107 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex02_Blog/index.html +15 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex02_Blog/styles.css +4 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex03_Hotspot/index.html +15 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex03_Hotspot/styles.css +3 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex04_Registration_Form/index.html +18 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex04_Registration_Form/styles.css +6 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex05_College_Website/admission.html +2 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex05_College_Website/contact.html +2 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex05_College_Website/events.html +2 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex05_College_Website/fees.html +2 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex05_College_Website/index.html +2 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex05_College_Website/results.html +2 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex05_College_Website/styles.css +7 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex06_Shopping_Webpage/index.html +9 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex06_Shopping_Webpage/styles.css +11 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex07a_Electricity_Bill/7a.js +7 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex07b_Student_Marks/7b.js +8 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex07c_ATM_PIN/7c.js +13 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex07d_Shopping_Amount/7d.js +6 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex07e_Employee_Salary/7e.js +11 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex08a_Table_Mouse_Events/index.html +11 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex08a_Table_Mouse_Events/styles.css +3 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex08b_Digital_Clock/index.html +6 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex08b_Digital_Clock/styles.css +2 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex08c_Keyboard_Interaction/index.html +5 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex08c_Keyboard_Interaction/styles.css +3 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex08d_Form_Display/index.html +4 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex08d_Form_Display/styles.css +2 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex08e_Mini_Login/index.html +4 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex08e_Mini_Login/styles.css +2 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex08f_Dark_Light_Mode/index.html +4 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex08f_Dark_Light_Mode/styles.css +2 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex09_AngularJS_Validation/index.html +9 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex09_AngularJS_Validation/styles.css +4 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex10_React_Components_Props_State_Events/index.html +8 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex10_React_Components_Props_State_Events/styles.css +2 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex11_React_State_Input/index.html +6 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex11_React_State_Input/styles.css +2 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex12_Node_MongoDB/README.txt +17 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex12_Node_MongoDB/package.json +7 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/Ex12_Node_MongoDB/server.js +33 -0
- webtech_codes-1.0.0/src/webtech_lab_codes/experiments/SOURCE_README.txt +16 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ajay
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: webtech-codes
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Terminal cheat-sheet browser for Web Technology Lab experiment code files
|
|
5
|
+
Author: Ajay
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Ajay
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Keywords: web-technology,html,css,javascript,react,angularjs,nodejs,lab,education
|
|
29
|
+
Classifier: Development Status :: 4 - Beta
|
|
30
|
+
Classifier: Environment :: Console
|
|
31
|
+
Classifier: Intended Audience :: Education
|
|
32
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
33
|
+
Classifier: Operating System :: OS Independent
|
|
34
|
+
Classifier: Programming Language :: Python :: 3
|
|
35
|
+
Classifier: Topic :: Education
|
|
36
|
+
Classifier: Topic :: Utilities
|
|
37
|
+
Requires-Python: >=3.9
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
License-File: LICENSE
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
|
|
42
|
+
# WebTech Lab Codes
|
|
43
|
+
|
|
44
|
+
A small terminal utility that lists the Web Technology Lab experiment folders and prints every code file in a selected experiment. The bundled source files are from the provided `Web_Technology_Lab_Experiments_2_to_12.zip`.
|
|
45
|
+
|
|
46
|
+
## Install from PyPI
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
python -m pip install webtech-lab-codes-ajay
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Commands
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
webtech show all exp
|
|
56
|
+
webtech display 2
|
|
57
|
+
webtech display "Ex02 Blog"
|
|
58
|
+
webtech display "Ex12 Node MongoDB"
|
|
59
|
+
webtech --help
|
|
60
|
+
webtech --version
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Experiment names are case-insensitive. `display` prints each file with a filename banner and preserves the source indentation. It prints files only; it does not execute HTML, JavaScript, Node.js, or database code.
|
|
64
|
+
|
|
65
|
+
## Run from a source checkout
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
python -m pip install -e .
|
|
69
|
+
webtech show all exp
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Build and publish
|
|
73
|
+
|
|
74
|
+
See `PUBLISHING.md` for step-by-step PyPI instructions. Check the package name on PyPI before publishing; if it is already taken, change `project.name` in `pyproject.toml` and use that name in install commands.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# WebTech Lab Codes
|
|
2
|
+
|
|
3
|
+
A small terminal utility that lists the Web Technology Lab experiment folders and prints every code file in a selected experiment. The bundled source files are from the provided `Web_Technology_Lab_Experiments_2_to_12.zip`.
|
|
4
|
+
|
|
5
|
+
## Install from PyPI
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
python -m pip install webtech-lab-codes-ajay
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
webtech show all exp
|
|
15
|
+
webtech display 2
|
|
16
|
+
webtech display "Ex02 Blog"
|
|
17
|
+
webtech display "Ex12 Node MongoDB"
|
|
18
|
+
webtech --help
|
|
19
|
+
webtech --version
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Experiment names are case-insensitive. `display` prints each file with a filename banner and preserves the source indentation. It prints files only; it does not execute HTML, JavaScript, Node.js, or database code.
|
|
23
|
+
|
|
24
|
+
## Run from a source checkout
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
python -m pip install -e .
|
|
28
|
+
webtech show all exp
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Build and publish
|
|
32
|
+
|
|
33
|
+
See `PUBLISHING.md` for step-by-step PyPI instructions. Check the package name on PyPI before publishing; if it is already taken, change `project.name` in `pyproject.toml` and use that name in install commands.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "webtech-codes"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Terminal cheat-sheet browser for Web Technology Lab experiment code files"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = { file = "LICENSE" }
|
|
12
|
+
authors = [{ name = "Ajay" }]
|
|
13
|
+
keywords = ["web-technology", "html", "css", "javascript", "react", "angularjs", "nodejs", "lab", "education"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Education",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Topic :: Education",
|
|
22
|
+
"Topic :: Utilities",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.scripts]
|
|
26
|
+
webtech = "webtech_lab_codes.cli:main"
|
|
27
|
+
|
|
28
|
+
[tool.setuptools]
|
|
29
|
+
include-package-data = true
|
|
30
|
+
|
|
31
|
+
[tool.setuptools.packages.find]
|
|
32
|
+
where = ["src"]
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.package-data]
|
|
35
|
+
webtech_lab_codes = ["experiments/**/*", "experiments/*", "experiments/**/**/*"]
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: webtech-codes
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Terminal cheat-sheet browser for Web Technology Lab experiment code files
|
|
5
|
+
Author: Ajay
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Ajay
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Keywords: web-technology,html,css,javascript,react,angularjs,nodejs,lab,education
|
|
29
|
+
Classifier: Development Status :: 4 - Beta
|
|
30
|
+
Classifier: Environment :: Console
|
|
31
|
+
Classifier: Intended Audience :: Education
|
|
32
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
33
|
+
Classifier: Operating System :: OS Independent
|
|
34
|
+
Classifier: Programming Language :: Python :: 3
|
|
35
|
+
Classifier: Topic :: Education
|
|
36
|
+
Classifier: Topic :: Utilities
|
|
37
|
+
Requires-Python: >=3.9
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
License-File: LICENSE
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
|
|
42
|
+
# WebTech Lab Codes
|
|
43
|
+
|
|
44
|
+
A small terminal utility that lists the Web Technology Lab experiment folders and prints every code file in a selected experiment. The bundled source files are from the provided `Web_Technology_Lab_Experiments_2_to_12.zip`.
|
|
45
|
+
|
|
46
|
+
## Install from PyPI
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
python -m pip install webtech-lab-codes-ajay
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Commands
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
webtech show all exp
|
|
56
|
+
webtech display 2
|
|
57
|
+
webtech display "Ex02 Blog"
|
|
58
|
+
webtech display "Ex12 Node MongoDB"
|
|
59
|
+
webtech --help
|
|
60
|
+
webtech --version
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Experiment names are case-insensitive. `display` prints each file with a filename banner and preserves the source indentation. It prints files only; it does not execute HTML, JavaScript, Node.js, or database code.
|
|
64
|
+
|
|
65
|
+
## Run from a source checkout
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
python -m pip install -e .
|
|
69
|
+
webtech show all exp
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Build and publish
|
|
73
|
+
|
|
74
|
+
See `PUBLISHING.md` for step-by-step PyPI instructions. Check the package name on PyPI before publishing; if it is already taken, change `project.name` in `pyproject.toml` and use that name in install commands.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/webtech_codes.egg-info/PKG-INFO
|
|
5
|
+
src/webtech_codes.egg-info/SOURCES.txt
|
|
6
|
+
src/webtech_codes.egg-info/dependency_links.txt
|
|
7
|
+
src/webtech_codes.egg-info/entry_points.txt
|
|
8
|
+
src/webtech_codes.egg-info/top_level.txt
|
|
9
|
+
src/webtech_lab_codes/__init__.py
|
|
10
|
+
src/webtech_lab_codes/cli.py
|
|
11
|
+
src/webtech_lab_codes/experiments/SOURCE_README.txt
|
|
12
|
+
src/webtech_lab_codes/experiments/Ex02_Blog/index.html
|
|
13
|
+
src/webtech_lab_codes/experiments/Ex02_Blog/styles.css
|
|
14
|
+
src/webtech_lab_codes/experiments/Ex03_Hotspot/index.html
|
|
15
|
+
src/webtech_lab_codes/experiments/Ex03_Hotspot/styles.css
|
|
16
|
+
src/webtech_lab_codes/experiments/Ex04_Registration_Form/index.html
|
|
17
|
+
src/webtech_lab_codes/experiments/Ex04_Registration_Form/styles.css
|
|
18
|
+
src/webtech_lab_codes/experiments/Ex05_College_Website/admission.html
|
|
19
|
+
src/webtech_lab_codes/experiments/Ex05_College_Website/contact.html
|
|
20
|
+
src/webtech_lab_codes/experiments/Ex05_College_Website/events.html
|
|
21
|
+
src/webtech_lab_codes/experiments/Ex05_College_Website/fees.html
|
|
22
|
+
src/webtech_lab_codes/experiments/Ex05_College_Website/index.html
|
|
23
|
+
src/webtech_lab_codes/experiments/Ex05_College_Website/results.html
|
|
24
|
+
src/webtech_lab_codes/experiments/Ex05_College_Website/styles.css
|
|
25
|
+
src/webtech_lab_codes/experiments/Ex06_Shopping_Webpage/index.html
|
|
26
|
+
src/webtech_lab_codes/experiments/Ex06_Shopping_Webpage/styles.css
|
|
27
|
+
src/webtech_lab_codes/experiments/Ex07a_Electricity_Bill/7a.js
|
|
28
|
+
src/webtech_lab_codes/experiments/Ex07b_Student_Marks/7b.js
|
|
29
|
+
src/webtech_lab_codes/experiments/Ex07c_ATM_PIN/7c.js
|
|
30
|
+
src/webtech_lab_codes/experiments/Ex07d_Shopping_Amount/7d.js
|
|
31
|
+
src/webtech_lab_codes/experiments/Ex07e_Employee_Salary/7e.js
|
|
32
|
+
src/webtech_lab_codes/experiments/Ex08a_Table_Mouse_Events/index.html
|
|
33
|
+
src/webtech_lab_codes/experiments/Ex08a_Table_Mouse_Events/styles.css
|
|
34
|
+
src/webtech_lab_codes/experiments/Ex08b_Digital_Clock/index.html
|
|
35
|
+
src/webtech_lab_codes/experiments/Ex08b_Digital_Clock/styles.css
|
|
36
|
+
src/webtech_lab_codes/experiments/Ex08c_Keyboard_Interaction/index.html
|
|
37
|
+
src/webtech_lab_codes/experiments/Ex08c_Keyboard_Interaction/styles.css
|
|
38
|
+
src/webtech_lab_codes/experiments/Ex08d_Form_Display/index.html
|
|
39
|
+
src/webtech_lab_codes/experiments/Ex08d_Form_Display/styles.css
|
|
40
|
+
src/webtech_lab_codes/experiments/Ex08e_Mini_Login/index.html
|
|
41
|
+
src/webtech_lab_codes/experiments/Ex08e_Mini_Login/styles.css
|
|
42
|
+
src/webtech_lab_codes/experiments/Ex08f_Dark_Light_Mode/index.html
|
|
43
|
+
src/webtech_lab_codes/experiments/Ex08f_Dark_Light_Mode/styles.css
|
|
44
|
+
src/webtech_lab_codes/experiments/Ex09_AngularJS_Validation/index.html
|
|
45
|
+
src/webtech_lab_codes/experiments/Ex09_AngularJS_Validation/styles.css
|
|
46
|
+
src/webtech_lab_codes/experiments/Ex10_React_Components_Props_State_Events/index.html
|
|
47
|
+
src/webtech_lab_codes/experiments/Ex10_React_Components_Props_State_Events/styles.css
|
|
48
|
+
src/webtech_lab_codes/experiments/Ex11_React_State_Input/index.html
|
|
49
|
+
src/webtech_lab_codes/experiments/Ex11_React_State_Input/styles.css
|
|
50
|
+
src/webtech_lab_codes/experiments/Ex12_Node_MongoDB/README.txt
|
|
51
|
+
src/webtech_lab_codes/experiments/Ex12_Node_MongoDB/package.json
|
|
52
|
+
src/webtech_lab_codes/experiments/Ex12_Node_MongoDB/server.js
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
webtech_lab_codes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.0.0"
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import difflib
|
|
4
|
+
import sys
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from . import __version__
|
|
8
|
+
|
|
9
|
+
EXP_DIR = Path(__file__).resolve().parent / "experiments"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _experiment_dirs() -> list[Path]:
|
|
13
|
+
return sorted((p for p in EXP_DIR.iterdir() if p.is_dir()), key=lambda p: p.name.lower())
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _normalise(value: str) -> str:
|
|
17
|
+
return " ".join("".join(ch.lower() if ch.isalnum() else " " for ch in value).split())
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _label(path: Path) -> str:
|
|
21
|
+
return path.name.replace("_", " ")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def show_all() -> None:
|
|
25
|
+
dirs = _experiment_dirs()
|
|
26
|
+
print("Web Technology Lab — Experiments 2 to 12")
|
|
27
|
+
print("=" * 48)
|
|
28
|
+
for folder in dirs:
|
|
29
|
+
files = sorted(p.name for p in folder.rglob("*") if p.is_file())
|
|
30
|
+
print(f"{_label(folder)}")
|
|
31
|
+
print(f" Files: {', '.join(files)}")
|
|
32
|
+
print(f"\nTotal: {len(dirs)} experiment folders")
|
|
33
|
+
print("Use: webtech display <experiment name>")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def display_experiment(query: str) -> int:
|
|
37
|
+
folders = _experiment_dirs()
|
|
38
|
+
wanted = _normalise(query)
|
|
39
|
+
if not wanted:
|
|
40
|
+
print("Please provide an experiment name. Try: webtech show all exp")
|
|
41
|
+
return 2
|
|
42
|
+
matches = []
|
|
43
|
+
for folder in folders:
|
|
44
|
+
candidates = {_normalise(folder.name), _normalise(_label(folder))}
|
|
45
|
+
exp_num = ''.join(ch for ch in folder.name.split('_', 1)[0] if ch.isdigit())
|
|
46
|
+
if exp_num:
|
|
47
|
+
candidates.update({_normalise(f"experiment {int(exp_num)}"), _normalise(f"exp {int(exp_num)}"), _normalise(str(int(exp_num)))})
|
|
48
|
+
if wanted in candidates or any(c.startswith(wanted) for c in candidates):
|
|
49
|
+
matches.append(folder)
|
|
50
|
+
if not matches:
|
|
51
|
+
choices = [_label(p) for p in folders]
|
|
52
|
+
close = difflib.get_close_matches(query, choices, n=5, cutoff=0.35)
|
|
53
|
+
print(f"No experiment matched: {query}")
|
|
54
|
+
if close:
|
|
55
|
+
print("Closest matches:")
|
|
56
|
+
for item in close:
|
|
57
|
+
print(f" {item}")
|
|
58
|
+
print("Run 'webtech show all exp' to see all names.")
|
|
59
|
+
return 1
|
|
60
|
+
if len(matches) > 1:
|
|
61
|
+
print("The name matches multiple experiments. Use one of these exact names:")
|
|
62
|
+
for folder in matches:
|
|
63
|
+
print(f" {_label(folder)}")
|
|
64
|
+
return 2
|
|
65
|
+
folder = matches[0]
|
|
66
|
+
files = sorted(p for p in folder.rglob("*") if p.is_file())
|
|
67
|
+
print(f"\n{'=' * 78}\n{_label(folder)}\n{'=' * 78}")
|
|
68
|
+
for path in files:
|
|
69
|
+
rel = path.relative_to(folder).as_posix()
|
|
70
|
+
print(f"\n--- FILE: {rel} ---")
|
|
71
|
+
print("-" * min(78, len(rel) + 13))
|
|
72
|
+
try:
|
|
73
|
+
content = path.read_text(encoding="utf-8-sig")
|
|
74
|
+
except UnicodeDecodeError:
|
|
75
|
+
content = path.read_text(encoding="latin-1")
|
|
76
|
+
print(content.rstrip())
|
|
77
|
+
print()
|
|
78
|
+
print(f"Displayed {len(files)} file(s) from {_label(folder)}.")
|
|
79
|
+
return 0
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def main(argv: list[str] | None = None) -> int:
|
|
83
|
+
args = list(sys.argv[1:] if argv is None else argv)
|
|
84
|
+
if not args or args in (["--help"], ["-h"]):
|
|
85
|
+
print("Web Technology Lab Codes")
|
|
86
|
+
print("Usage:")
|
|
87
|
+
print(" webtech show all exp")
|
|
88
|
+
print(" webtech display <experiment name or number>")
|
|
89
|
+
print(" webtech --version")
|
|
90
|
+
return 0 if args else 2
|
|
91
|
+
if args == ["--version"] or args == ["-V"]:
|
|
92
|
+
print(f"webtech-lab-codes {__version__}")
|
|
93
|
+
return 0
|
|
94
|
+
if len(args) >= 3 and args[:3] == ["show", "all", "exp"]:
|
|
95
|
+
if len(args) > 3:
|
|
96
|
+
print("Unexpected extra arguments after 'show all exp'.")
|
|
97
|
+
return 2
|
|
98
|
+
show_all()
|
|
99
|
+
return 0
|
|
100
|
+
if args[0].lower() == "display":
|
|
101
|
+
return display_experiment(" ".join(args[1:]))
|
|
102
|
+
print("Unknown command. Use 'webtech show all exp' or 'webtech display <name>'.")
|
|
103
|
+
return 2
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
if __name__ == "__main__":
|
|
107
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head><title>My Blog</title><link rel="stylesheet" href="styles.css"></head>
|
|
4
|
+
<body>
|
|
5
|
+
<h1>My Personal Blog</h1>
|
|
6
|
+
<p class="center">Welcome to my simple blog page.</p>
|
|
7
|
+
<hr>
|
|
8
|
+
<h2>About Me</h2><p>I am a student interested in web technology and programming.</p>
|
|
9
|
+
<h2>My Skills</h2><ul><li>HTML</li><li>CSS</li><li>JavaScript</li></ul>
|
|
10
|
+
<h2>Education</h2><table><tr><th>Course</th><th>Status</th></tr><tr><td>B.E. CSE</td><td>Studying</td></tr></table>
|
|
11
|
+
<h2>My Daily Routine</h2><ol><li>Attend college</li><li>Practise coding</li><li>Study</li></ol>
|
|
12
|
+
<h2>Favourite Website</h2><a href="https://www.wikipedia.org">Wikipedia</a>
|
|
13
|
+
<h2>Quote</h2><p><i>Learning never stops.</i></p>
|
|
14
|
+
<h2>Contact</h2><p>Email: student@example.com</p>
|
|
15
|
+
</body></html>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head><title>Image Hotspots</title><link rel="stylesheet" href="styles.css"></head>
|
|
4
|
+
<body>
|
|
5
|
+
<h1>Clickable Hotspots</h1>
|
|
6
|
+
<p>Click a marked region to open its information page.</p>
|
|
7
|
+
<svg width="360" height="300" viewBox="0 0 360 300" role="img" aria-label="Simple map illustration">
|
|
8
|
+
<rect x="1" y="1" width="358" height="298" fill="white" stroke="black"/>
|
|
9
|
+
<path d="M150 25 L190 45 L210 80 L195 110 L220 140 L205 180 L180 215 L155 265 L130 230 L115 190 L95 155 L120 120 L105 85 L130 55 Z" fill="white" stroke="black" stroke-width="2"/>
|
|
10
|
+
<a href="https://en.wikipedia.org/wiki/Delhi" target="_blank"><circle cx="155" cy="105" r="9" fill="white" stroke="black"/><text x="170" y="109" font-size="12">Delhi</text></a>
|
|
11
|
+
<a href="https://en.wikipedia.org/wiki/Tamil_Nadu" target="_blank"><circle cx="165" cy="225" r="9" fill="white" stroke="black"/><text x="180" y="229" font-size="12">Tamil Nadu</text></a>
|
|
12
|
+
<a href="https://en.wikipedia.org/wiki/Kerala" target="_blank"><circle cx="145" cy="230" r="6" fill="white" stroke="black"/><text x="40" y="250" font-size="12">Kerala</text></a>
|
|
13
|
+
</svg>
|
|
14
|
+
<p>Note: This is a simple illustration for practising clickable hotspots, not a geographic map.</p>
|
|
15
|
+
</body></html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head><title>Registration Form</title><link rel="stylesheet" href="styles.css"></head>
|
|
4
|
+
<body>
|
|
5
|
+
<h1>Application Registration Form</h1>
|
|
6
|
+
<form onsubmit="event.preventDefault(); document.getElementById('msg').textContent='Registration submitted successfully.';">
|
|
7
|
+
<label>Full Name <input type="text" required></label>
|
|
8
|
+
<label>Date of Birth <input type="date" required></label>
|
|
9
|
+
<label>Email <input type="email" required></label>
|
|
10
|
+
<label>Mobile Number <input type="tel" pattern="[0-9]{10}" placeholder="10 digits" required></label>
|
|
11
|
+
<label>Gender
|
|
12
|
+
<select required><option value="">Select</option><option>Male</option><option>Female</option><option>Other</option></select></label>
|
|
13
|
+
<label>Address <textarea required></textarea></label>
|
|
14
|
+
<label>State <select><option>Tamil Nadu</option><option>Kerala</option><option>Karnataka</option></select></label>
|
|
15
|
+
<label><input type="checkbox" required> I confirm the details are correct.</label>
|
|
16
|
+
<button type="submit">Register</button> <button type="reset">Reset</button>
|
|
17
|
+
</form><p id="msg"></p>
|
|
18
|
+
</body></html>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
body { font-family: Arial; margin: 25px; color: black; background: white; }
|
|
2
|
+
h1 { text-align: center; }
|
|
3
|
+
form { max-width: 500px; margin: auto; }
|
|
4
|
+
label { display: block; margin: 12px 0; }
|
|
5
|
+
input:not([type=checkbox]), select, textarea { display: block; box-sizing: border-box; width: 100%; padding: 7px; border: 1px solid black; margin-top: 4px; }
|
|
6
|
+
button { padding: 7px 15px; }
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>Admission</title><link rel="stylesheet" href="styles.css"></head>
|
|
2
|
+
<body><header><h1>ABC College</h1><p>Education and Excellence</p></header><nav><a href="index.html">Home</a> | <a href="events.html">Events</a> | <a href="admission.html">Admission</a> | <a href="fees.html">Fees</a> | <a href="results.html">Results</a> | <a href="contact.html">Contact</a></nav><main><h2>Admission</h2><p>Applicants should have completed the required qualifying examination.</p><p>Contact the college office to apply.</p></main><footer>ABC College</footer></body></html>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>Contact</title><link rel="stylesheet" href="styles.css"></head>
|
|
2
|
+
<body><header><h1>ABC College</h1><p>Education and Excellence</p></header><nav><a href="index.html">Home</a> | <a href="events.html">Events</a> | <a href="admission.html">Admission</a> | <a href="fees.html">Fees</a> | <a href="results.html">Results</a> | <a href="contact.html">Contact</a></nav><main><h2>Contact Us</h2><p>Coimbatore, Tamil Nadu</p><form onsubmit="event.preventDefault();alert('Feedback submitted');"><label>Name <input required></label><label>Message <textarea required></textarea></label><button>Send</button></form></main><footer>ABC College</footer></body></html>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>Events</title><link rel="stylesheet" href="styles.css"></head>
|
|
2
|
+
<body><header><h1>ABC College</h1><p>Education and Excellence</p></header><nav><a href="index.html">Home</a> | <a href="events.html">Events</a> | <a href="admission.html">Admission</a> | <a href="fees.html">Fees</a> | <a href="results.html">Results</a> | <a href="contact.html">Contact</a></nav><main><h2>College Events</h2><ul><li>Technical Symposium</li><li>Workshop</li><li>Sports Day</li></ul></main><footer>ABC College</footer></body></html>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>Fees</title><link rel="stylesheet" href="styles.css"></head>
|
|
2
|
+
<body><header><h1>ABC College</h1><p>Education and Excellence</p></header><nav><a href="index.html">Home</a> | <a href="events.html">Events</a> | <a href="admission.html">Admission</a> | <a href="fees.html">Fees</a> | <a href="results.html">Results</a> | <a href="contact.html">Contact</a></nav><main><h2>Fee Structure</h2><table><tr><th>Course</th><th>Fee per year</th></tr><tr><td>CSE</td><td>₹80,000</td></tr><tr><td>ECE</td><td>₹75,000</td></tr></table></main><footer>ABC College</footer></body></html>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>College Home</title><link rel="stylesheet" href="styles.css"></head>
|
|
2
|
+
<body><header><h1>ABC College</h1><p>Education and Excellence</p></header><nav><a href="index.html">Home</a> | <a href="events.html">Events</a> | <a href="admission.html">Admission</a> | <a href="fees.html">Fees</a> | <a href="results.html">Results</a> | <a href="contact.html">Contact</a></nav><main><h2>Welcome to Our College</h2><p>Providing education in engineering and technology.</p><p><a href='admission.html'>Apply Now</a></p></main><footer>ABC College</footer></body></html>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>Results</title><link rel="stylesheet" href="styles.css"></head>
|
|
2
|
+
<body><header><h1>ABC College</h1><p>Education and Excellence</p></header><nav><a href="index.html">Home</a> | <a href="events.html">Events</a> | <a href="admission.html">Admission</a> | <a href="fees.html">Fees</a> | <a href="results.html">Results</a> | <a href="contact.html">Contact</a></nav><main><h2>Sample Results</h2><table><tr><th>Name</th><th>Mark</th></tr><tr><td>Arun</td><td>85</td></tr><tr><td>Kavi</td><td>90</td></tr></table></main><footer>ABC College</footer></body></html>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
body { font-family: Arial; margin: 0; color: black; background: white; }
|
|
2
|
+
header, footer { text-align: center; padding: 15px; border: 1px solid black; }
|
|
3
|
+
nav { text-align: center; padding: 12px; border-bottom: 1px solid black; }
|
|
4
|
+
nav a { color: black; margin: 5px; }
|
|
5
|
+
main { margin: 25px; }
|
|
6
|
+
table { border-collapse: collapse; } th, td { border: 1px solid black; padding: 8px; }
|
|
7
|
+
label { display: block; margin: 10px 0; }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>Shopping Page</title><link rel="stylesheet" href="styles.css"></head>
|
|
2
|
+
<body><header><h1>Simple Mart</h1></header>
|
|
3
|
+
<nav><a href="#">Home</a><div class="dropdown"><a href="#">Products ▾</a><div class="menu"><a href="#grocery">Groceries</a><a href="#fruit">Fruits</a><a href="#dairy">Dairy</a></div></div><a href="#offers">Offers</a><a href="#contact">Contact</a></nav>
|
|
4
|
+
<h2 class="center">Products</h2><section class="products">
|
|
5
|
+
<article id="grocery"><h3>Groceries</h3><p>Rice and pulses</p></article>
|
|
6
|
+
<article id="fruit"><h3>Fruits</h3><p>Fresh seasonal fruits</p></article>
|
|
7
|
+
<article id="dairy"><h3>Dairy</h3><p>Milk and cheese</p></article></section>
|
|
8
|
+
<p id="offers" class="center">Special offers available today.</p><p id="contact" class="center">Contact: shop@example.com</p>
|
|
9
|
+
</body></html>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
body { font-family: Arial; margin: 0; color: black; background: white; }
|
|
2
|
+
header, .center { text-align: center; }
|
|
3
|
+
header { border-bottom: 1px solid black; }
|
|
4
|
+
nav { display: flex; justify-content: center; gap: 25px; border-bottom: 1px solid black; padding: 12px; }
|
|
5
|
+
nav a { color: black; text-decoration: none; }
|
|
6
|
+
.dropdown { position: relative; }
|
|
7
|
+
.menu { display: none; position: absolute; background: white; border: 1px solid black; min-width: 120px; }
|
|
8
|
+
.menu a { display: block; padding: 8px; }
|
|
9
|
+
.dropdown:hover .menu { display: block; }
|
|
10
|
+
.products { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
|
|
11
|
+
article { border: 1px solid black; padding: 20px; width: 180px; text-align: center; }
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const marks = [85, 78, 92, 88, 76];
|
|
2
|
+
let total = 0;
|
|
3
|
+
for (let i = 0; i < marks.length; i++) total += marks[i];
|
|
4
|
+
console.log("Marks:", marks.join(", "));
|
|
5
|
+
console.log("Total:", total);
|
|
6
|
+
console.log("Average:", total / marks.length);
|
|
7
|
+
console.log("Highest:", Math.max(...marks));
|
|
8
|
+
console.log("Lowest:", Math.min(...marks));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const readline = require("node:readline");
|
|
2
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
3
|
+
const correctPIN = "2920";
|
|
4
|
+
let attempts = 0;
|
|
5
|
+
function ask() {
|
|
6
|
+
rl.question("Enter PIN: ", pin => {
|
|
7
|
+
attempts++;
|
|
8
|
+
if (pin === correctPIN) { console.log("PIN Verified"); rl.close(); }
|
|
9
|
+
else if (attempts === 3) { console.log("Wrong PIN Attempt\nATM Blocked"); rl.close(); }
|
|
10
|
+
else { console.log("Wrong PIN Attempt"); ask(); }
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
ask();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const prices = [500, 750, 250, 1000];
|
|
2
|
+
let total = 0;
|
|
3
|
+
for (let i = 0; i < prices.length; i++) total += prices[i];
|
|
4
|
+
console.log("Prices:", prices.join(", "));
|
|
5
|
+
console.log("Total purchase amount: Rs.", total);
|
|
6
|
+
console.log(total >= 2000 ? "Eligible for Discount" : "Not Eligible for Discount");
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const employees = [
|
|
2
|
+
{ name: "Arun", salary: 25000 },
|
|
3
|
+
{ name: "Bala", salary: 30000 },
|
|
4
|
+
{ name: "Charan", salary: 28000 }
|
|
5
|
+
];
|
|
6
|
+
for (const employee of employees) {
|
|
7
|
+
console.log("Name:", employee.name);
|
|
8
|
+
console.log("Monthly salary:", employee.salary);
|
|
9
|
+
console.log("Annual salary:", employee.salary * 12);
|
|
10
|
+
console.log("---------------");
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>Table Mouse Events</title><link rel="stylesheet" href="styles.css"></head><body>
|
|
2
|
+
<h2>Table Mouse Events</h2><p>Hover, click, or double-click a row.</p>
|
|
3
|
+
<table id="t"><tr><th>Name</th><th>Department</th></tr><tr><td>Arun</td><td>CSE</td></tr><tr><td>Rahul</td><td>ECE</td></tr><tr><td>Kavi</td><td>IT</td></tr></table>
|
|
4
|
+
<script>
|
|
5
|
+
document.querySelectorAll("#t tr:not(:first-child)").forEach(row => {
|
|
6
|
+
row.onmouseover = () => row.style.background = "lightgray";
|
|
7
|
+
row.onmouseout = () => { if (!row.classList.contains("selected")) row.style.background = ""; };
|
|
8
|
+
row.onclick = () => { row.classList.toggle("selected"); row.style.background = row.classList.contains("selected") ? "gray" : ""; };
|
|
9
|
+
row.ondblclick = () => { row.classList.remove("selected"); row.style.background = ""; };
|
|
10
|
+
});
|
|
11
|
+
</script></body></html>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>Digital Clock</title><link rel="stylesheet" href="styles.css"></head><body>
|
|
2
|
+
<h2>Real-Time Digital Clock</h2><p id="clock"></p>
|
|
3
|
+
<script>
|
|
4
|
+
function showTime() { document.getElementById("clock").textContent = new Date().toLocaleTimeString(); }
|
|
5
|
+
showTime(); setInterval(showTime, 1000);
|
|
6
|
+
</script></body></html>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>Keyboard Interaction</title><link rel="stylesheet" href="styles.css"></head><body>
|
|
2
|
+
<h2>Keyboard Interaction</h2><p>Press A to add a thick border. Press R to reset.</p>
|
|
3
|
+
<table id="t"><tr><th>Name</th><th>Department</th></tr><tr><td>Arun</td><td>CSE</td></tr><tr><td>Kavi</td><td>IT</td></tr></table>
|
|
4
|
+
<script>document.addEventListener("keydown", e => { if(e.key.toLowerCase()==="a") document.getElementById("t").style.border="4px solid black"; if(e.key.toLowerCase()==="r") document.getElementById("t").style.border="1px solid black"; });</script>
|
|
5
|
+
</body></html>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>Form Display</title><link rel="stylesheet" href="styles.css"></head><body>
|
|
2
|
+
<h2>Simple Form</h2><form id="f"><input id="name" placeholder="Enter your name" required><button>Submit</button></form><p id="out"></p>
|
|
3
|
+
<script>document.getElementById("f").onsubmit = e => { e.preventDefault(); document.getElementById("out").textContent = "You entered: " + document.getElementById("name").value; };</script>
|
|
4
|
+
</body></html>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>Mini Login</title><link rel="stylesheet" href="styles.css"></head><body>
|
|
2
|
+
<h2>Mini Login System</h2><input id="user" placeholder="Username"><input id="pass" type="password" placeholder="Password"><button onclick="login()">Login</button><p id="msg"></p>
|
|
3
|
+
<script>function login(){ document.getElementById("msg").textContent = document.getElementById("user").value==="admin" && document.getElementById("pass").value==="1234" ? "Welcome" : "Invalid credentials"; }</script>
|
|
4
|
+
</body></html>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>Dark Light Mode</title><link rel="stylesheet" href="styles.css"></head><body>
|
|
2
|
+
<h2>Dark / Light Mode</h2><p>Click the button to change the theme.</p><button id="toggle">Toggle Theme</button>
|
|
3
|
+
<script>document.getElementById("toggle").onclick = () => document.body.classList.toggle("dark");</script>
|
|
4
|
+
</body></html>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<!DOCTYPE html><html ng-app="app"><head><title>AngularJS Form Validation</title><script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script><link rel="stylesheet" href="styles.css"></head>
|
|
2
|
+
<body ng-controller="FormCtrl"><h2>Registration Form</h2>
|
|
3
|
+
<form name="f" ng-submit="submit()" novalidate>
|
|
4
|
+
<label>Name: <input name="name" ng-model="user.name" required></label><span ng-show="f.name.$touched && f.name.$invalid">Name is required.</span>
|
|
5
|
+
<label>Email: <input type="email" name="email" ng-model="user.email" required></label><span ng-show="f.email.$touched && f.email.$invalid">Enter a valid email.</span>
|
|
6
|
+
<label>Password: <input type="password" name="password" ng-model="user.password" ng-minlength="4" required></label><span ng-show="f.password.$touched && f.password.$invalid">Password must be at least 4 characters.</span>
|
|
7
|
+
<button ng-disabled="f.$invalid">Register</button></form><p>{{message}}</p>
|
|
8
|
+
<script>angular.module("app",[]).controller("FormCtrl",function($scope){$scope.submit=function(){$scope.message="Registration successful for "+$scope.user.name;};});</script>
|
|
9
|
+
</body></html>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>React Components</title><link rel="stylesheet" href="styles.css">
|
|
2
|
+
<script src="https://unpkg.com/react@18/umd/react.development.js"></script><script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script><script src="https://unpkg.com/@babel/standalone/babel.min.js"></script></head><body>
|
|
3
|
+
<div id="root"></div>
|
|
4
|
+
<script type="text/babel">
|
|
5
|
+
function Greeting(props){return <h2>Hello, {props.name}</h2>;}
|
|
6
|
+
function App(){const [count,setCount]=React.useState(0);return <div><Greeting name="Student"/><p>Button clicked: {count} times</p><button onClick={()=>setCount(count+1)}>Click</button></div>;}
|
|
7
|
+
ReactDOM.createRoot(document.getElementById("root")).render(<App/>);
|
|
8
|
+
</script></body></html>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>React Input Handling</title><link rel="stylesheet" href="styles.css">
|
|
2
|
+
<script src="https://unpkg.com/react@18/umd/react.development.js"></script><script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script><script src="https://unpkg.com/@babel/standalone/babel.min.js"></script></head><body>
|
|
3
|
+
<div id="root"></div><script type="text/babel">
|
|
4
|
+
function App(){const [name,setName]=React.useState("");return <div><h2>Enter Your Name</h2><input value={name} onChange={e=>setName(e.target.value)} placeholder="Name"/><p>Hello, {name || "Student"}</p></div>;}
|
|
5
|
+
ReactDOM.createRoot(document.getElementById("root")).render(<App/>);
|
|
6
|
+
</script></body></html>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
NODE.JS + MONGODB CRUD
|
|
2
|
+
|
|
3
|
+
1. Install Node.js and MongoDB, or create a MongoDB Atlas database.
|
|
4
|
+
2. Open terminal in this folder.
|
|
5
|
+
3. Run: npm install
|
|
6
|
+
4. Start MongoDB locally, or set MONGO_URI to your Atlas connection string.
|
|
7
|
+
5. Run: npm start
|
|
8
|
+
6. Open http://localhost:3000
|
|
9
|
+
|
|
10
|
+
Endpoints:
|
|
11
|
+
GET /students list students
|
|
12
|
+
POST /students create student; JSON body e.g. {"name":"Arun","mark":85}
|
|
13
|
+
GET /students/:id read one student
|
|
14
|
+
PUT /students/:id update student; JSON body e.g. {"mark":90}
|
|
15
|
+
DELETE /students/:id delete student
|
|
16
|
+
|
|
17
|
+
Use Postman, Thunder Client, or another API client for POST/PUT/DELETE requests.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const express = require("express");
|
|
2
|
+
const mongoose = require("mongoose");
|
|
3
|
+
const app = express();
|
|
4
|
+
app.use(express.json());
|
|
5
|
+
|
|
6
|
+
const uri = process.env.MONGO_URI || "mongodb://127.0.0.1:27017/studentdb";
|
|
7
|
+
mongoose.connect(uri).then(() => console.log("MongoDB connected"))
|
|
8
|
+
.catch(err => console.error("MongoDB connection error:", err.message));
|
|
9
|
+
|
|
10
|
+
const Student = mongoose.model("Student", new mongoose.Schema({
|
|
11
|
+
name: { type: String, required: true },
|
|
12
|
+
mark: { type: Number, required: true }
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
app.get("/", (req, res) => res.send("Student CRUD API is running"));
|
|
16
|
+
app.post("/students", async (req, res) => {
|
|
17
|
+
try { res.status(201).json(await Student.create(req.body)); }
|
|
18
|
+
catch (e) { res.status(400).json({ error: e.message }); }
|
|
19
|
+
});
|
|
20
|
+
app.get("/students", async (req, res) => res.json(await Student.find()));
|
|
21
|
+
app.get("/students/:id", async (req, res) => {
|
|
22
|
+
try { const s = await Student.findById(req.params.id); if (!s) return res.status(404).json({error:"Not found"}); res.json(s); }
|
|
23
|
+
catch { res.status(400).json({error:"Invalid ID"}); }
|
|
24
|
+
});
|
|
25
|
+
app.put("/students/:id", async (req, res) => {
|
|
26
|
+
try { const s = await Student.findByIdAndUpdate(req.params.id, req.body, {new:true, runValidators:true}); if (!s) return res.status(404).json({error:"Not found"}); res.json(s); }
|
|
27
|
+
catch (e) { res.status(400).json({error:e.message}); }
|
|
28
|
+
});
|
|
29
|
+
app.delete("/students/:id", async (req, res) => {
|
|
30
|
+
try { const s = await Student.findByIdAndDelete(req.params.id); if (!s) return res.status(404).json({error:"Not found"}); res.json({message:"Student deleted"}); }
|
|
31
|
+
catch { res.status(400).json({error:"Invalid ID"}); }
|
|
32
|
+
});
|
|
33
|
+
app.listen(3000, () => console.log("Server running at http://localhost:3000"));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
WEB TECHNOLOGY LAB — SIMPLE WORKING CODES (EXPERIMENTS 2–12)
|
|
2
|
+
|
|
3
|
+
Each experiment has its own folder. HTML experiments use index.html and styles.css.
|
|
4
|
+
Experiment 7 files are standalone JavaScript programs.
|
|
5
|
+
|
|
6
|
+
HOW TO RUN
|
|
7
|
+
1. HTML/CSS/DOM experiments: open that experiment's index.html in a browser.
|
|
8
|
+
2. Experiment 7: install Node.js, open a terminal in the experiment folder, run:
|
|
9
|
+
node 7a.js (change the filename for the required experiment)
|
|
10
|
+
3. Experiment 9 (AngularJS): open index.html while connected to the internet (AngularJS CDN).
|
|
11
|
+
4. Experiments 10–11 (React): these use React through CDN and Babel; open index.html with internet access.
|
|
12
|
+
5. Experiment 12 (Node.js + MongoDB): install Node.js, install MongoDB locally or use MongoDB Atlas.
|
|
13
|
+
In the folder run: npm install, then npm start. Set MONGO_URI in your environment if needed.
|
|
14
|
+
This is a basic CRUD API; use the browser or an API client to test the endpoints.
|
|
15
|
+
|
|
16
|
+
All designs are intentionally plain black and white. Experiment 3 uses a simple inline SVG map-style image so it works without a separate image download; hotspot coordinates are illustrative.
|