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.
- fpythons/__init__.py +12 -0
- fpythons/__main__.py +4 -0
- fpythons/data/00_START_HERE.md +144 -0
- fpythons/data/ALL_SLIPS_CODE.txt +1854 -0
- fpythons/data/README.md +35 -0
- fpythons/data/Slip_01.md +160 -0
- fpythons/data/Slip_02.md +104 -0
- fpythons/data/Slip_03.md +95 -0
- fpythons/data/Slip_04.md +131 -0
- fpythons/data/Slip_05.md +120 -0
- fpythons/data/Slip_06.md +161 -0
- fpythons/data/Slip_07.md +121 -0
- fpythons/data/Slip_08.md +95 -0
- fpythons/data/Slip_09.md +92 -0
- fpythons/data/Slip_10.md +113 -0
- fpythons/data/Slip_11.md +109 -0
- fpythons/data/Slip_12.md +181 -0
- fpythons/data/Slip_13.md +163 -0
- fpythons/data/Slip_14.md +141 -0
- fpythons/data/Slip_15.md +100 -0
- fpythons/data/Slip_16.md +127 -0
- fpythons/data/Slip_17.md +93 -0
- fpythons/data/Slip_18.md +96 -0
- fpythons/data/Slip_19.md +94 -0
- fpythons/data/Slip_20.md +165 -0
- fpythons/data/Slip_21.md +122 -0
- fpythons/data/VIVA.md +195 -0
- fpythons/data/code/slip1/.gitignore +2 -0
- fpythons/data/code/slip1/package.json +31 -0
- fpythons/data/code/slip1/public/index.html +12 -0
- fpythons/data/code/slip1/src/App.js +7 -0
- fpythons/data/code/slip1/src/index.js +10 -0
- fpythons/data/code/slip1/src/slip1/loginForm.js +26 -0
- fpythons/data/code/slip1/src/slip1/style.css +46 -0
- fpythons/data/code/slip10/.gitignore +2 -0
- fpythons/data/code/slip10/package.json +31 -0
- fpythons/data/code/slip10/public/index.html +12 -0
- fpythons/data/code/slip10/src/App.js +7 -0
- fpythons/data/code/slip10/src/index.js +10 -0
- fpythons/data/code/slip10/src/slip10/SumOfDigits.js +37 -0
- fpythons/data/code/slip11/.gitignore +2 -0
- fpythons/data/code/slip11/package.json +31 -0
- fpythons/data/code/slip11/public/index.html +12 -0
- fpythons/data/code/slip11/src/App.js +7 -0
- fpythons/data/code/slip11/src/index.js +10 -0
- fpythons/data/code/slip11/src/slip11/StringOperation.js +33 -0
- fpythons/data/code/slip12/.gitignore +2 -0
- fpythons/data/code/slip12/package.json +33 -0
- fpythons/data/code/slip12/public/index.html +12 -0
- fpythons/data/code/slip12/src/App.js +7 -0
- fpythons/data/code/slip12/src/index.js +14 -0
- fpythons/data/code/slip12/src/slip12/NotesManagementApp.js +35 -0
- fpythons/data/code/slip12/src/slip12/redux/notesSlice.js +20 -0
- fpythons/data/code/slip12/src/slip12/redux/store.js +10 -0
- fpythons/data/code/slip13/.gitignore +2 -0
- fpythons/data/code/slip13/package.json +33 -0
- fpythons/data/code/slip13/public/index.html +12 -0
- fpythons/data/code/slip13/src/App.js +7 -0
- fpythons/data/code/slip13/src/index.js +14 -0
- fpythons/data/code/slip13/src/slip13/Counter.js +20 -0
- fpythons/data/code/slip13/src/slip13/redux/counterSlice.js +19 -0
- fpythons/data/code/slip13/src/slip13/redux/store.js +10 -0
- fpythons/data/code/slip14/.gitignore +2 -0
- fpythons/data/code/slip14/package.json +31 -0
- fpythons/data/code/slip14/public/index.html +12 -0
- fpythons/data/code/slip14/src/App.js +7 -0
- fpythons/data/code/slip14/src/index.js +10 -0
- fpythons/data/code/slip14/src/slip14/Calculator.js +64 -0
- fpythons/data/code/slip15/.gitignore +2 -0
- fpythons/data/code/slip15/package.json +31 -0
- fpythons/data/code/slip15/public/index.html +12 -0
- fpythons/data/code/slip15/src/App.js +7 -0
- fpythons/data/code/slip15/src/index.js +10 -0
- fpythons/data/code/slip15/src/slip15/Counter.js +24 -0
- fpythons/data/code/slip16/.gitignore +2 -0
- fpythons/data/code/slip16/package.json +31 -0
- fpythons/data/code/slip16/public/index.html +12 -0
- fpythons/data/code/slip16/src/App.js +7 -0
- fpythons/data/code/slip16/src/index.js +10 -0
- fpythons/data/code/slip16/src/slip16/TraditionalDOM.html +24 -0
- fpythons/data/code/slip16/src/slip16/VirtualDOM.js +16 -0
- fpythons/data/code/slip17/.gitignore +2 -0
- fpythons/data/code/slip17/package.json +31 -0
- fpythons/data/code/slip17/public/index.html +12 -0
- fpythons/data/code/slip17/src/App.js +7 -0
- fpythons/data/code/slip17/src/index.js +10 -0
- fpythons/data/code/slip17/src/slip17/Sign-in.js +17 -0
- fpythons/data/code/slip18/.gitignore +2 -0
- fpythons/data/code/slip18/package.json +31 -0
- fpythons/data/code/slip18/public/index.html +12 -0
- fpythons/data/code/slip18/public/logo192.png +0 -0
- fpythons/data/code/slip18/src/App.js +7 -0
- fpythons/data/code/slip18/src/index.js +10 -0
- fpythons/data/code/slip18/src/slip18/Profile.js +20 -0
- fpythons/data/code/slip19/.gitignore +2 -0
- fpythons/data/code/slip19/package.json +31 -0
- fpythons/data/code/slip19/public/index.html +12 -0
- fpythons/data/code/slip19/src/App.js +7 -0
- fpythons/data/code/slip19/src/index.js +10 -0
- fpythons/data/code/slip19/src/slip19/Movies.js +19 -0
- fpythons/data/code/slip2/.gitignore +2 -0
- fpythons/data/code/slip2/package.json +31 -0
- fpythons/data/code/slip2/public/index.html +12 -0
- fpythons/data/code/slip2/src/App.js +7 -0
- fpythons/data/code/slip2/src/index.js +10 -0
- fpythons/data/code/slip2/src/slip2/useEffect.js +23 -0
- fpythons/data/code/slip20/.gitignore +2 -0
- fpythons/data/code/slip20/package.json +32 -0
- fpythons/data/code/slip20/public/index.html +12 -0
- fpythons/data/code/slip20/src/App.js +16 -0
- fpythons/data/code/slip20/src/index.js +10 -0
- fpythons/data/code/slip20/src/slip20/Login.js +45 -0
- fpythons/data/code/slip20/src/slip20/Students.js +27 -0
- fpythons/data/code/slip21/.gitignore +2 -0
- fpythons/data/code/slip21/package.json +31 -0
- fpythons/data/code/slip21/public/index.html +12 -0
- fpythons/data/code/slip21/src/App.js +7 -0
- fpythons/data/code/slip21/src/index.js +10 -0
- fpythons/data/code/slip21/src/slip21/NumberString.js +46 -0
- fpythons/data/code/slip3/.gitignore +2 -0
- fpythons/data/code/slip3/package.json +31 -0
- fpythons/data/code/slip3/public/index.html +12 -0
- fpythons/data/code/slip3/src/App.js +7 -0
- fpythons/data/code/slip3/src/index.js +10 -0
- fpythons/data/code/slip3/src/slip3/toggleBtn.js +16 -0
- fpythons/data/code/slip4/.gitignore +2 -0
- fpythons/data/code/slip4/package.json +32 -0
- fpythons/data/code/slip4/public/index.html +12 -0
- fpythons/data/code/slip4/src/App.js +23 -0
- fpythons/data/code/slip4/src/index.js +10 -0
- fpythons/data/code/slip4/src/slip4/About.js +7 -0
- fpythons/data/code/slip4/src/slip4/Contact.js +7 -0
- fpythons/data/code/slip4/src/slip4/home.js +7 -0
- fpythons/data/code/slip5/.gitignore +2 -0
- fpythons/data/code/slip5/package.json +32 -0
- fpythons/data/code/slip5/public/index.html +12 -0
- fpythons/data/code/slip5/src/App.js +18 -0
- fpythons/data/code/slip5/src/index.js +10 -0
- fpythons/data/code/slip5/src/slip5/loginValidation.js +30 -0
- fpythons/data/code/slip6/.gitignore +2 -0
- fpythons/data/code/slip6/package.json +32 -0
- fpythons/data/code/slip6/public/index.html +12 -0
- fpythons/data/code/slip6/src/App.js +31 -0
- fpythons/data/code/slip6/src/index.js +10 -0
- fpythons/data/code/slip6/src/slip6/Dashboard.js +12 -0
- fpythons/data/code/slip6/src/slip6/Login.js +23 -0
- fpythons/data/code/slip6/src/slip6/ProtectedRoute.js +10 -0
- fpythons/data/code/slip7/.gitignore +2 -0
- fpythons/data/code/slip7/package.json +31 -0
- fpythons/data/code/slip7/public/index.html +12 -0
- fpythons/data/code/slip7/src/App.js +7 -0
- fpythons/data/code/slip7/src/index.js +10 -0
- fpythons/data/code/slip7/src/slip7/TodoList.js +42 -0
- fpythons/data/code/slip8/.gitignore +2 -0
- fpythons/data/code/slip8/package.json +31 -0
- fpythons/data/code/slip8/public/index.html +12 -0
- fpythons/data/code/slip8/src/App.js +7 -0
- fpythons/data/code/slip8/src/index.js +10 -0
- fpythons/data/code/slip8/src/slip8/ToggleButton.js +19 -0
- fpythons/data/code/slip9/.gitignore +2 -0
- fpythons/data/code/slip9/package.json +31 -0
- fpythons/data/code/slip9/public/index.html +12 -0
- fpythons/data/code/slip9/src/App.js +7 -0
- fpythons/data/code/slip9/src/index.js +10 -0
- fpythons/data/code/slip9/src/slip9/Counter.js +16 -0
- fpythons/main.py +226 -0
- fpythons-0.1.0.dist-info/METADATA +64 -0
- fpythons-0.1.0.dist-info/RECORD +170 -0
- fpythons-0.1.0.dist-info/WHEEL +4 -0
- fpythons-0.1.0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "slip5",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"react": "^19.3.1",
|
|
7
|
+
"react-dom": "^19.3.1",
|
|
8
|
+
"react-router-dom": "^7.18.7",
|
|
9
|
+
"react-scripts": "5.0.1"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"start": "react-scripts start",
|
|
13
|
+
"build": "react-scripts build"
|
|
14
|
+
},
|
|
15
|
+
"eslintConfig": {
|
|
16
|
+
"extends": [
|
|
17
|
+
"react-app"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"browserslist": {
|
|
21
|
+
"production": [
|
|
22
|
+
">0.2%",
|
|
23
|
+
"not dead",
|
|
24
|
+
"not op_mini all"
|
|
25
|
+
],
|
|
26
|
+
"development": [
|
|
27
|
+
"last 1 chrome version",
|
|
28
|
+
"last 1 firefox version",
|
|
29
|
+
"last 1 safari version"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -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 5</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,18 @@
|
|
|
1
|
+
import { BrowserRouter, Routes, Route, Link, Navigate } from 'react-router-dom';
|
|
2
|
+
import LoginValidation from './slip5/loginValidation';
|
|
3
|
+
|
|
4
|
+
function App() {
|
|
5
|
+
return (
|
|
6
|
+
<BrowserRouter>
|
|
7
|
+
<Link to="/login">Login</Link>
|
|
8
|
+
|
|
9
|
+
<Routes>
|
|
10
|
+
<Route path="/" element={<Navigate to="/login" />} />
|
|
11
|
+
<Route path="/login" element={<LoginValidation />} />
|
|
12
|
+
<Route path="*" element={<h1>404 Error, Page Not Found</h1>} />
|
|
13
|
+
</Routes>
|
|
14
|
+
</BrowserRouter>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default App;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
|
|
3
|
+
const LoginValidation = () => {
|
|
4
|
+
const [username, setUsername] = useState('');
|
|
5
|
+
const [password, setPassword] = useState('');
|
|
6
|
+
const [message, setMessage] = useState('');
|
|
7
|
+
|
|
8
|
+
function validateLogin(e){
|
|
9
|
+
e.preventDefault();
|
|
10
|
+
if(username === 'Admin' && password === 'Pass123'){
|
|
11
|
+
console.log("Login successful.");
|
|
12
|
+
}
|
|
13
|
+
else{
|
|
14
|
+
setMessage("Unauthorized access.")
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return (
|
|
18
|
+
<div>
|
|
19
|
+
<h1>Login Form</h1>
|
|
20
|
+
<form onSubmit={validateLogin}>
|
|
21
|
+
<label>Username:<input type='text' placeholder='Enter username' value={username} onChange={(e) => setUsername(e.target.value)}></input></label><br></br>
|
|
22
|
+
<label>Password:<input type='password' placeholder='Enter password' value={password} onChange={(e) => setPassword(e.target.value)}></input></label><br></br>
|
|
23
|
+
<input type='submit' value='Login'></input>
|
|
24
|
+
</form>
|
|
25
|
+
<p>{message}</p>
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default LoginValidation
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "slip6",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"react": "^19.3.1",
|
|
7
|
+
"react-dom": "^19.3.1",
|
|
8
|
+
"react-router-dom": "^7.18.7",
|
|
9
|
+
"react-scripts": "5.0.1"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"start": "react-scripts start",
|
|
13
|
+
"build": "react-scripts build"
|
|
14
|
+
},
|
|
15
|
+
"eslintConfig": {
|
|
16
|
+
"extends": [
|
|
17
|
+
"react-app"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"browserslist": {
|
|
21
|
+
"production": [
|
|
22
|
+
">0.2%",
|
|
23
|
+
"not dead",
|
|
24
|
+
"not op_mini all"
|
|
25
|
+
],
|
|
26
|
+
"development": [
|
|
27
|
+
"last 1 chrome version",
|
|
28
|
+
"last 1 firefox version",
|
|
29
|
+
"last 1 safari version"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -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 6</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,31 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
|
|
3
|
+
import ProtectedRoute from './slip6/ProtectedRoute';
|
|
4
|
+
import Login from './slip6/Login';
|
|
5
|
+
import Dashboard from './slip6/Dashboard';
|
|
6
|
+
|
|
7
|
+
function App() {
|
|
8
|
+
const [isAuthenticated, setIsAuthenticated] = useState(false);
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<BrowserRouter>
|
|
12
|
+
<Routes>
|
|
13
|
+
<Route path="/" element={<Navigate to="/dashboard" />} />
|
|
14
|
+
<Route
|
|
15
|
+
path="/login"
|
|
16
|
+
element={<Login setIsAuthenticated={setIsAuthenticated} />}
|
|
17
|
+
/>
|
|
18
|
+
<Route
|
|
19
|
+
path="/dashboard"
|
|
20
|
+
element={
|
|
21
|
+
<ProtectedRoute isAuthenticated={isAuthenticated}>
|
|
22
|
+
<Dashboard />
|
|
23
|
+
</ProtectedRoute>
|
|
24
|
+
}
|
|
25
|
+
/>
|
|
26
|
+
</Routes>
|
|
27
|
+
</BrowserRouter>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default App;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useNavigate } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
const Login = ({ setIsAuthenticated }) => {
|
|
5
|
+
|
|
6
|
+
const navigate = useNavigate();
|
|
7
|
+
|
|
8
|
+
const handleLogin = () => {
|
|
9
|
+
setIsAuthenticated(true);
|
|
10
|
+
navigate('/dashboard');
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div>
|
|
15
|
+
<h2>Login Page</h2>
|
|
16
|
+
<button onClick={handleLogin}>
|
|
17
|
+
Login
|
|
18
|
+
</button>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default Login;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "slip7",
|
|
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 7</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,42 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
|
|
3
|
+
const TodoList = () => {
|
|
4
|
+
|
|
5
|
+
const [task, setTask] = useState('');
|
|
6
|
+
const [tasks, setTasks] = useState([]);
|
|
7
|
+
|
|
8
|
+
const handleSubmit = (e) =>{
|
|
9
|
+
e.preventDefault();
|
|
10
|
+
if(task.trim() === '')
|
|
11
|
+
return;
|
|
12
|
+
setTasks([...tasks, task]);
|
|
13
|
+
setTask('');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const handleDelete = (indexToDelete) => {
|
|
17
|
+
const updatedTasks = tasks.filter(
|
|
18
|
+
(item, index) => index !== indexToDelete
|
|
19
|
+
);
|
|
20
|
+
setTasks(updatedTasks);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div>
|
|
25
|
+
<h2>To-do List</h2>
|
|
26
|
+
<form onSubmit={handleSubmit}>
|
|
27
|
+
<label>Enter task<input type='text' value={task} onChange={(e) => setTask(e.target.value)}></input></label>
|
|
28
|
+
<button type='submit'>Add Task</button>
|
|
29
|
+
</form>
|
|
30
|
+
<ul>
|
|
31
|
+
{tasks.map((item, index) => (
|
|
32
|
+
<li key={index}>
|
|
33
|
+
{item}
|
|
34
|
+
<button onClick={() => handleDelete(index)}>Delete</button>
|
|
35
|
+
</li>
|
|
36
|
+
))}
|
|
37
|
+
</ul>
|
|
38
|
+
</div>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default TodoList
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "slip8",
|
|
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 8</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,19 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
const ToggleButton = () => {
|
|
4
|
+
const [isOn, setIsOn] = useState(false);
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<div>
|
|
8
|
+
<h2>Toggle Button</h2>
|
|
9
|
+
<button
|
|
10
|
+
onClick={() => setIsOn(!isOn)}
|
|
11
|
+
style={{ backgroundColor: isOn ? 'lightgreen' : 'lightcoral' }}
|
|
12
|
+
>
|
|
13
|
+
{isOn ? 'ON' : 'OFF'}
|
|
14
|
+
</button>
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default ToggleButton;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "slip9",
|
|
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 9</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,16 @@
|
|
|
1
|
+
import React, {useState} from 'react'
|
|
2
|
+
|
|
3
|
+
const Counter = ({initialCount}) => {
|
|
4
|
+
|
|
5
|
+
const [count, setCount] = useState(initialCount);
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div>
|
|
9
|
+
<h2>Count: {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 Counter
|