fpythons 0.1.0__py3-none-any.whl

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.
Files changed (170) hide show
  1. fpythons/__init__.py +12 -0
  2. fpythons/__main__.py +4 -0
  3. fpythons/data/00_START_HERE.md +144 -0
  4. fpythons/data/ALL_SLIPS_CODE.txt +1854 -0
  5. fpythons/data/README.md +35 -0
  6. fpythons/data/Slip_01.md +160 -0
  7. fpythons/data/Slip_02.md +104 -0
  8. fpythons/data/Slip_03.md +95 -0
  9. fpythons/data/Slip_04.md +131 -0
  10. fpythons/data/Slip_05.md +120 -0
  11. fpythons/data/Slip_06.md +161 -0
  12. fpythons/data/Slip_07.md +121 -0
  13. fpythons/data/Slip_08.md +95 -0
  14. fpythons/data/Slip_09.md +92 -0
  15. fpythons/data/Slip_10.md +113 -0
  16. fpythons/data/Slip_11.md +109 -0
  17. fpythons/data/Slip_12.md +181 -0
  18. fpythons/data/Slip_13.md +163 -0
  19. fpythons/data/Slip_14.md +141 -0
  20. fpythons/data/Slip_15.md +100 -0
  21. fpythons/data/Slip_16.md +127 -0
  22. fpythons/data/Slip_17.md +93 -0
  23. fpythons/data/Slip_18.md +96 -0
  24. fpythons/data/Slip_19.md +94 -0
  25. fpythons/data/Slip_20.md +165 -0
  26. fpythons/data/Slip_21.md +122 -0
  27. fpythons/data/VIVA.md +195 -0
  28. fpythons/data/code/slip1/.gitignore +2 -0
  29. fpythons/data/code/slip1/package.json +31 -0
  30. fpythons/data/code/slip1/public/index.html +12 -0
  31. fpythons/data/code/slip1/src/App.js +7 -0
  32. fpythons/data/code/slip1/src/index.js +10 -0
  33. fpythons/data/code/slip1/src/slip1/loginForm.js +26 -0
  34. fpythons/data/code/slip1/src/slip1/style.css +46 -0
  35. fpythons/data/code/slip10/.gitignore +2 -0
  36. fpythons/data/code/slip10/package.json +31 -0
  37. fpythons/data/code/slip10/public/index.html +12 -0
  38. fpythons/data/code/slip10/src/App.js +7 -0
  39. fpythons/data/code/slip10/src/index.js +10 -0
  40. fpythons/data/code/slip10/src/slip10/SumOfDigits.js +37 -0
  41. fpythons/data/code/slip11/.gitignore +2 -0
  42. fpythons/data/code/slip11/package.json +31 -0
  43. fpythons/data/code/slip11/public/index.html +12 -0
  44. fpythons/data/code/slip11/src/App.js +7 -0
  45. fpythons/data/code/slip11/src/index.js +10 -0
  46. fpythons/data/code/slip11/src/slip11/StringOperation.js +33 -0
  47. fpythons/data/code/slip12/.gitignore +2 -0
  48. fpythons/data/code/slip12/package.json +33 -0
  49. fpythons/data/code/slip12/public/index.html +12 -0
  50. fpythons/data/code/slip12/src/App.js +7 -0
  51. fpythons/data/code/slip12/src/index.js +14 -0
  52. fpythons/data/code/slip12/src/slip12/NotesManagementApp.js +35 -0
  53. fpythons/data/code/slip12/src/slip12/redux/notesSlice.js +20 -0
  54. fpythons/data/code/slip12/src/slip12/redux/store.js +10 -0
  55. fpythons/data/code/slip13/.gitignore +2 -0
  56. fpythons/data/code/slip13/package.json +33 -0
  57. fpythons/data/code/slip13/public/index.html +12 -0
  58. fpythons/data/code/slip13/src/App.js +7 -0
  59. fpythons/data/code/slip13/src/index.js +14 -0
  60. fpythons/data/code/slip13/src/slip13/Counter.js +20 -0
  61. fpythons/data/code/slip13/src/slip13/redux/counterSlice.js +19 -0
  62. fpythons/data/code/slip13/src/slip13/redux/store.js +10 -0
  63. fpythons/data/code/slip14/.gitignore +2 -0
  64. fpythons/data/code/slip14/package.json +31 -0
  65. fpythons/data/code/slip14/public/index.html +12 -0
  66. fpythons/data/code/slip14/src/App.js +7 -0
  67. fpythons/data/code/slip14/src/index.js +10 -0
  68. fpythons/data/code/slip14/src/slip14/Calculator.js +64 -0
  69. fpythons/data/code/slip15/.gitignore +2 -0
  70. fpythons/data/code/slip15/package.json +31 -0
  71. fpythons/data/code/slip15/public/index.html +12 -0
  72. fpythons/data/code/slip15/src/App.js +7 -0
  73. fpythons/data/code/slip15/src/index.js +10 -0
  74. fpythons/data/code/slip15/src/slip15/Counter.js +24 -0
  75. fpythons/data/code/slip16/.gitignore +2 -0
  76. fpythons/data/code/slip16/package.json +31 -0
  77. fpythons/data/code/slip16/public/index.html +12 -0
  78. fpythons/data/code/slip16/src/App.js +7 -0
  79. fpythons/data/code/slip16/src/index.js +10 -0
  80. fpythons/data/code/slip16/src/slip16/TraditionalDOM.html +24 -0
  81. fpythons/data/code/slip16/src/slip16/VirtualDOM.js +16 -0
  82. fpythons/data/code/slip17/.gitignore +2 -0
  83. fpythons/data/code/slip17/package.json +31 -0
  84. fpythons/data/code/slip17/public/index.html +12 -0
  85. fpythons/data/code/slip17/src/App.js +7 -0
  86. fpythons/data/code/slip17/src/index.js +10 -0
  87. fpythons/data/code/slip17/src/slip17/Sign-in.js +17 -0
  88. fpythons/data/code/slip18/.gitignore +2 -0
  89. fpythons/data/code/slip18/package.json +31 -0
  90. fpythons/data/code/slip18/public/index.html +12 -0
  91. fpythons/data/code/slip18/public/logo192.png +0 -0
  92. fpythons/data/code/slip18/src/App.js +7 -0
  93. fpythons/data/code/slip18/src/index.js +10 -0
  94. fpythons/data/code/slip18/src/slip18/Profile.js +20 -0
  95. fpythons/data/code/slip19/.gitignore +2 -0
  96. fpythons/data/code/slip19/package.json +31 -0
  97. fpythons/data/code/slip19/public/index.html +12 -0
  98. fpythons/data/code/slip19/src/App.js +7 -0
  99. fpythons/data/code/slip19/src/index.js +10 -0
  100. fpythons/data/code/slip19/src/slip19/Movies.js +19 -0
  101. fpythons/data/code/slip2/.gitignore +2 -0
  102. fpythons/data/code/slip2/package.json +31 -0
  103. fpythons/data/code/slip2/public/index.html +12 -0
  104. fpythons/data/code/slip2/src/App.js +7 -0
  105. fpythons/data/code/slip2/src/index.js +10 -0
  106. fpythons/data/code/slip2/src/slip2/useEffect.js +23 -0
  107. fpythons/data/code/slip20/.gitignore +2 -0
  108. fpythons/data/code/slip20/package.json +32 -0
  109. fpythons/data/code/slip20/public/index.html +12 -0
  110. fpythons/data/code/slip20/src/App.js +16 -0
  111. fpythons/data/code/slip20/src/index.js +10 -0
  112. fpythons/data/code/slip20/src/slip20/Login.js +45 -0
  113. fpythons/data/code/slip20/src/slip20/Students.js +27 -0
  114. fpythons/data/code/slip21/.gitignore +2 -0
  115. fpythons/data/code/slip21/package.json +31 -0
  116. fpythons/data/code/slip21/public/index.html +12 -0
  117. fpythons/data/code/slip21/src/App.js +7 -0
  118. fpythons/data/code/slip21/src/index.js +10 -0
  119. fpythons/data/code/slip21/src/slip21/NumberString.js +46 -0
  120. fpythons/data/code/slip3/.gitignore +2 -0
  121. fpythons/data/code/slip3/package.json +31 -0
  122. fpythons/data/code/slip3/public/index.html +12 -0
  123. fpythons/data/code/slip3/src/App.js +7 -0
  124. fpythons/data/code/slip3/src/index.js +10 -0
  125. fpythons/data/code/slip3/src/slip3/toggleBtn.js +16 -0
  126. fpythons/data/code/slip4/.gitignore +2 -0
  127. fpythons/data/code/slip4/package.json +32 -0
  128. fpythons/data/code/slip4/public/index.html +12 -0
  129. fpythons/data/code/slip4/src/App.js +23 -0
  130. fpythons/data/code/slip4/src/index.js +10 -0
  131. fpythons/data/code/slip4/src/slip4/About.js +7 -0
  132. fpythons/data/code/slip4/src/slip4/Contact.js +7 -0
  133. fpythons/data/code/slip4/src/slip4/home.js +7 -0
  134. fpythons/data/code/slip5/.gitignore +2 -0
  135. fpythons/data/code/slip5/package.json +32 -0
  136. fpythons/data/code/slip5/public/index.html +12 -0
  137. fpythons/data/code/slip5/src/App.js +18 -0
  138. fpythons/data/code/slip5/src/index.js +10 -0
  139. fpythons/data/code/slip5/src/slip5/loginValidation.js +30 -0
  140. fpythons/data/code/slip6/.gitignore +2 -0
  141. fpythons/data/code/slip6/package.json +32 -0
  142. fpythons/data/code/slip6/public/index.html +12 -0
  143. fpythons/data/code/slip6/src/App.js +31 -0
  144. fpythons/data/code/slip6/src/index.js +10 -0
  145. fpythons/data/code/slip6/src/slip6/Dashboard.js +12 -0
  146. fpythons/data/code/slip6/src/slip6/Login.js +23 -0
  147. fpythons/data/code/slip6/src/slip6/ProtectedRoute.js +10 -0
  148. fpythons/data/code/slip7/.gitignore +2 -0
  149. fpythons/data/code/slip7/package.json +31 -0
  150. fpythons/data/code/slip7/public/index.html +12 -0
  151. fpythons/data/code/slip7/src/App.js +7 -0
  152. fpythons/data/code/slip7/src/index.js +10 -0
  153. fpythons/data/code/slip7/src/slip7/TodoList.js +42 -0
  154. fpythons/data/code/slip8/.gitignore +2 -0
  155. fpythons/data/code/slip8/package.json +31 -0
  156. fpythons/data/code/slip8/public/index.html +12 -0
  157. fpythons/data/code/slip8/src/App.js +7 -0
  158. fpythons/data/code/slip8/src/index.js +10 -0
  159. fpythons/data/code/slip8/src/slip8/ToggleButton.js +19 -0
  160. fpythons/data/code/slip9/.gitignore +2 -0
  161. fpythons/data/code/slip9/package.json +31 -0
  162. fpythons/data/code/slip9/public/index.html +12 -0
  163. fpythons/data/code/slip9/src/App.js +7 -0
  164. fpythons/data/code/slip9/src/index.js +10 -0
  165. fpythons/data/code/slip9/src/slip9/Counter.js +16 -0
  166. fpythons/main.py +226 -0
  167. fpythons-0.1.0.dist-info/METADATA +64 -0
  168. fpythons-0.1.0.dist-info/RECORD +170 -0
  169. fpythons-0.1.0.dist-info/WHEEL +4 -0
  170. fpythons-0.1.0.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,10 @@
1
+ import {configureStore} from '@reduxjs/toolkit';
2
+ import notesReducer from './notesSlice';
3
+
4
+ const store = configureStore({
5
+ reducer: {
6
+ notes: notesReducer
7
+ }
8
+ })
9
+
10
+ export default store;
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ build/
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "slip13",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "dependencies": {
6
+ "@reduxjs/toolkit": "^2.15.0",
7
+ "react": "^19.3.1",
8
+ "react-dom": "^19.3.1",
9
+ "react-redux": "^9.3.1",
10
+ "react-scripts": "5.0.1"
11
+ },
12
+ "scripts": {
13
+ "start": "react-scripts start",
14
+ "build": "react-scripts build"
15
+ },
16
+ "eslintConfig": {
17
+ "extends": [
18
+ "react-app"
19
+ ]
20
+ },
21
+ "browserslist": {
22
+ "production": [
23
+ ">0.2%",
24
+ "not dead",
25
+ "not op_mini all"
26
+ ],
27
+ "development": [
28
+ "last 1 chrome version",
29
+ "last 1 firefox version",
30
+ "last 1 safari version"
31
+ ]
32
+ }
33
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Slip 13</title>
7
+ </head>
8
+ <body>
9
+ <noscript>You need to enable JavaScript to run this app.</noscript>
10
+ <div id="root"></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,7 @@
1
+ import Counter from './slip13/Counter';
2
+
3
+ function App() {
4
+ return <Counter />;
5
+ }
6
+
7
+ export default App;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import { Provider } from 'react-redux';
4
+ import App from './App';
5
+ import counterStore from './slip13/redux/store';
6
+
7
+ const root = ReactDOM.createRoot(document.getElementById('root'));
8
+ root.render(
9
+ <React.StrictMode>
10
+ <Provider store={counterStore}>
11
+ <App />
12
+ </Provider>
13
+ </React.StrictMode>
14
+ );
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { increment, decrement } from './redux/counterSlice';
3
+ import { useDispatch, useSelector } from 'react-redux';
4
+
5
+ const Counter = () => {
6
+
7
+ const count = useSelector((state) => state.counter);
8
+ const dispatch = useDispatch();
9
+ console.log("Current count is: ",count);
10
+
11
+ return (
12
+ <div>
13
+ <h2>Count: {count}</h2>
14
+ <button type='submit' onClick={() => dispatch(increment())}>Increment</button>
15
+ <button type='submit' onClick={() => dispatch(decrement())}>Decrement</button>
16
+ </div>
17
+ )
18
+ }
19
+
20
+ export default Counter
@@ -0,0 +1,19 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+
3
+ const counterSlice = createSlice ({
4
+ name : 'counter',
5
+ initialState : 0,
6
+ reducers : {
7
+ increment(state){
8
+ return state + 1;
9
+ },
10
+
11
+ decrement(state){
12
+ return state - 1;
13
+ }
14
+ }
15
+ })
16
+
17
+ export const {increment, decrement} = counterSlice.actions;
18
+
19
+ export default counterSlice.reducer;
@@ -0,0 +1,10 @@
1
+ import { configureStore } from "@reduxjs/toolkit";
2
+ import counterReducer from './counterSlice.js';
3
+
4
+ const counterStore = configureStore ({
5
+ reducer : {
6
+ counter : counterReducer
7
+ }
8
+ });
9
+
10
+ export default counterStore;
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ build/
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "slip14",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "dependencies": {
6
+ "react": "^19.3.1",
7
+ "react-dom": "^19.3.1",
8
+ "react-scripts": "5.0.1"
9
+ },
10
+ "scripts": {
11
+ "start": "react-scripts start",
12
+ "build": "react-scripts build"
13
+ },
14
+ "eslintConfig": {
15
+ "extends": [
16
+ "react-app"
17
+ ]
18
+ },
19
+ "browserslist": {
20
+ "production": [
21
+ ">0.2%",
22
+ "not dead",
23
+ "not op_mini all"
24
+ ],
25
+ "development": [
26
+ "last 1 chrome version",
27
+ "last 1 firefox version",
28
+ "last 1 safari version"
29
+ ]
30
+ }
31
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Slip 14</title>
7
+ </head>
8
+ <body>
9
+ <noscript>You need to enable JavaScript to run this app.</noscript>
10
+ <div id="root"></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,7 @@
1
+ import Calculator from './slip14/Calculator';
2
+
3
+ function App() {
4
+ return <Calculator />;
5
+ }
6
+
7
+ export default App;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const root = ReactDOM.createRoot(document.getElementById('root'));
6
+ root.render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>
10
+ );
@@ -0,0 +1,64 @@
1
+ import React, { useState } from 'react';
2
+
3
+ const Calculator = () =>{
4
+
5
+ const [firstNumber, setFirstNumber] = useState('');
6
+ const [secondNumber, setSecondNumber] = useState('');
7
+ const [result, setResult] = useState(null);
8
+
9
+ const handleAddition = () =>{
10
+ if(firstNumber.trim() === '' || secondNumber.trim() === '')
11
+ return;
12
+
13
+ let total = 0;
14
+ total = Number(firstNumber) + Number(secondNumber);
15
+ setResult(total);
16
+ }
17
+
18
+ const handleSubtraction = () =>{
19
+ if(firstNumber.trim() === '' || secondNumber.trim() === '')
20
+ return;
21
+
22
+ let total = 0;
23
+ total = Number(firstNumber) - Number(secondNumber);
24
+ setResult(total);
25
+ }
26
+
27
+ const handleMultiplication = () =>{
28
+ if(firstNumber.trim() === '' || secondNumber.trim() === '')
29
+ return;
30
+
31
+ let total = 0;
32
+ total = Number(firstNumber) * Number(secondNumber);
33
+ setResult(total);
34
+ }
35
+
36
+ const handleDivision = () =>{
37
+ if(firstNumber.trim() === '' || secondNumber.trim() === '')
38
+ return;
39
+
40
+ if(Number(secondNumber) === 0){
41
+ alert("Can't divide by zero");
42
+ return;
43
+ }
44
+
45
+ let total = 0;
46
+ total = Number(firstNumber) / Number(secondNumber);
47
+ setResult(total);
48
+ }
49
+
50
+ return (
51
+ <div>
52
+ <h2>Calculator</h2>
53
+ <input value={firstNumber} onChange={(e) => setFirstNumber(e.target.value)}></input>
54
+ <input value={secondNumber} onChange={(e) => setSecondNumber(e.target.value)}></input>
55
+ <button onClick={handleAddition}>Addition</button>
56
+ <button onClick={handleSubtraction}>Subtraction</button>
57
+ <button onClick={handleMultiplication}>Multiplication</button>
58
+ <button onClick={handleDivision}>Division</button>
59
+ <p>Result: {result}</p>
60
+ </div>
61
+ )
62
+ }
63
+
64
+ export default Calculator
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ build/
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "slip15",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "dependencies": {
6
+ "react": "^19.3.1",
7
+ "react-dom": "^19.3.1",
8
+ "react-scripts": "5.0.1"
9
+ },
10
+ "scripts": {
11
+ "start": "react-scripts start",
12
+ "build": "react-scripts build"
13
+ },
14
+ "eslintConfig": {
15
+ "extends": [
16
+ "react-app"
17
+ ]
18
+ },
19
+ "browserslist": {
20
+ "production": [
21
+ ">0.2%",
22
+ "not dead",
23
+ "not op_mini all"
24
+ ],
25
+ "development": [
26
+ "last 1 chrome version",
27
+ "last 1 firefox version",
28
+ "last 1 safari version"
29
+ ]
30
+ }
31
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Slip 15</title>
7
+ </head>
8
+ <body>
9
+ <noscript>You need to enable JavaScript to run this app.</noscript>
10
+ <div id="root"></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,7 @@
1
+ import Counter from './slip15/Counter';
2
+
3
+ function App() {
4
+ return <Counter />;
5
+ }
6
+
7
+ export default App;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const root = ReactDOM.createRoot(document.getElementById('root'));
6
+ root.render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>
10
+ );
@@ -0,0 +1,24 @@
1
+ import React, { useReducer } from 'react'
2
+
3
+ const Counter = () => {
4
+
5
+ function reducer(state, action){
6
+ if(action === 'increment'){
7
+ return state + 1;
8
+ }
9
+ if(action === 'decrement'){
10
+ return state - 1;
11
+ }
12
+ return state;
13
+ }
14
+ const [count, dispatch] = useReducer(reducer, 0);
15
+ return (
16
+ <div>
17
+ <h2>Counter: {count}</h2>
18
+ <button onClick={() => dispatch('increment')}>Increment</button>
19
+ <button onClick={() => dispatch('decrement')}>Decrement</button>
20
+ </div>
21
+ )
22
+ }
23
+
24
+ export default Counter
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ build/
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "slip16",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "dependencies": {
6
+ "react": "^19.3.1",
7
+ "react-dom": "^19.3.1",
8
+ "react-scripts": "5.0.1"
9
+ },
10
+ "scripts": {
11
+ "start": "react-scripts start",
12
+ "build": "react-scripts build"
13
+ },
14
+ "eslintConfig": {
15
+ "extends": [
16
+ "react-app"
17
+ ]
18
+ },
19
+ "browserslist": {
20
+ "production": [
21
+ ">0.2%",
22
+ "not dead",
23
+ "not op_mini all"
24
+ ],
25
+ "development": [
26
+ "last 1 chrome version",
27
+ "last 1 firefox version",
28
+ "last 1 safari version"
29
+ ]
30
+ }
31
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Slip 16</title>
7
+ </head>
8
+ <body>
9
+ <noscript>You need to enable JavaScript to run this app.</noscript>
10
+ <div id="root"></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,7 @@
1
+ import VirtualDOM from './slip16/VirtualDOM';
2
+
3
+ function App() {
4
+ return <VirtualDOM />;
5
+ }
6
+
7
+ export default App;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const root = ReactDOM.createRoot(document.getElementById('root'));
6
+ root.render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>
10
+ );
@@ -0,0 +1,24 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>TraditionalDOM Counter</title>
7
+ </head>
8
+ <body>
9
+ <h2 id="count">0</h2>
10
+ <button onclick="increment()">Increment</button>
11
+ <button onclick="decrement()">Decrement</button>
12
+ <script>
13
+ let count = 0;
14
+ function increment(){
15
+ count++;
16
+ document.getElementById("count").innerHTML = count;
17
+ }
18
+ function decrement(){
19
+ count--;
20
+ document.getElementById("count").innerHTML = count;
21
+ }
22
+ </script>
23
+ </body>
24
+ </html>
@@ -0,0 +1,16 @@
1
+ import React, { useState } from 'react';
2
+
3
+ const VirtualDOM = () =>{
4
+
5
+ const [count, setCount] = useState(0);
6
+
7
+ return(
8
+ <div>
9
+ <h2>VirtualDOM Counter: {count}</h2>
10
+ <button onClick={() => setCount(count + 1)}>Increment</button>
11
+ <button onClick={() => setCount(count - 1)}>Decrement</button>
12
+ </div>
13
+ )
14
+ }
15
+
16
+ export default VirtualDOM
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ build/
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "slip17",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "dependencies": {
6
+ "react": "^19.3.1",
7
+ "react-dom": "^19.3.1",
8
+ "react-scripts": "5.0.1"
9
+ },
10
+ "scripts": {
11
+ "start": "react-scripts start",
12
+ "build": "react-scripts build"
13
+ },
14
+ "eslintConfig": {
15
+ "extends": [
16
+ "react-app"
17
+ ]
18
+ },
19
+ "browserslist": {
20
+ "production": [
21
+ ">0.2%",
22
+ "not dead",
23
+ "not op_mini all"
24
+ ],
25
+ "development": [
26
+ "last 1 chrome version",
27
+ "last 1 firefox version",
28
+ "last 1 safari version"
29
+ ]
30
+ }
31
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Slip 17</title>
7
+ </head>
8
+ <body>
9
+ <noscript>You need to enable JavaScript to run this app.</noscript>
10
+ <div id="root"></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,7 @@
1
+ import SignIn from './slip17/Sign-in';
2
+
3
+ function App() {
4
+ return <SignIn />;
5
+ }
6
+
7
+ export default App;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const root = ReactDOM.createRoot(document.getElementById('root'));
6
+ root.render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>
10
+ );
@@ -0,0 +1,17 @@
1
+ import React, {useState} from 'react'
2
+
3
+ const SignIn = () => {
4
+
5
+ const [isLoggedIn, setIsLoggedIn] = useState(false);
6
+
7
+ return (
8
+ <div>
9
+ <h2>SignIn SignOut</h2>
10
+ {isLoggedIn ? <h3>Hello! Welcome in Home page.</h3> : <h3>Please login first.</h3>}
11
+ {!isLoggedIn && (<button onClick={() => setIsLoggedIn(true)}>Sign in</button>)}
12
+ {isLoggedIn && (<button onClick={() => setIsLoggedIn(false)}>Sign out</button>)}
13
+ </div>
14
+ )
15
+ }
16
+
17
+ export default SignIn
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ build/
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "slip18",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "dependencies": {
6
+ "react": "^19.3.1",
7
+ "react-dom": "^19.3.1",
8
+ "react-scripts": "5.0.1"
9
+ },
10
+ "scripts": {
11
+ "start": "react-scripts start",
12
+ "build": "react-scripts build"
13
+ },
14
+ "eslintConfig": {
15
+ "extends": [
16
+ "react-app"
17
+ ]
18
+ },
19
+ "browserslist": {
20
+ "production": [
21
+ ">0.2%",
22
+ "not dead",
23
+ "not op_mini all"
24
+ ],
25
+ "development": [
26
+ "last 1 chrome version",
27
+ "last 1 firefox version",
28
+ "last 1 safari version"
29
+ ]
30
+ }
31
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Slip 18</title>
7
+ </head>
8
+ <body>
9
+ <noscript>You need to enable JavaScript to run this app.</noscript>
10
+ <div id="root"></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,7 @@
1
+ import Profile from './slip18/Profile';
2
+
3
+ function App() {
4
+ return <Profile />;
5
+ }
6
+
7
+ export default App;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const root = ReactDOM.createRoot(document.getElementById('root'));
6
+ root.render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>
10
+ );
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ const Profile = () => {
4
+
5
+ const name = "Your Name";
6
+ const bio = "I'm a Second year M.Sc.CA student.";
7
+ const desc = "Learning React";
8
+
9
+ return (
10
+ <div>
11
+ <h2>My Profile</h2>
12
+ <h3>{name}</h3>
13
+ <p>{bio}</p>
14
+ <img src='/logo192.png' alt='logo'></img>
15
+ <p>{desc}</p>
16
+ </div>
17
+ )
18
+ }
19
+
20
+ export default Profile