Skip to content

Commit

Permalink
#28 Projects
Browse files Browse the repository at this point in the history
  • Loading branch information
fdhhhdjd committed Sep 18, 2023
1 parent fc7a5ab commit 85a0d91
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
28 changes: 28 additions & 0 deletions src/projects/6. Search Icon Project/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React, { useState } from 'react';
import { FaSearch } from 'react-icons/fa';
import './style.css';

function Learn_6() {
const [showInput, setShowInput] = useState(false);
const [bgColor, setBgColor] = useState('white');

const handleClick = (e) => {
setBgColor('#1a1a1a');
if (e.target.className === 'container') {
setShowInput(false);
setBgColor('#fff');
}
};

return (
<section className="container" style={{ backgroundColor: bgColor }} onClick={handleClick}>
{showInput ? (
<input type="text" placeholder="Search..." />
) : (
<FaSearch onClick={() => setShowInput(true)} />
)}
</section>
);
}

export default Learn_6;
33 changes: 33 additions & 0 deletions src/projects/6. Search Icon Project/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

section {
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
transition: 0.7s ease;
}

button {
position: absolute;
top: 20px;
right: 20px;
padding: 10px 20px;
background: transparent;
cursor: pointer;
}

input {
padding: 13px 12px;
background: transparent;
outline: none;
border: 1px solid #fff;
color: #fff;
border-radius: 2px;
box-shadow: 2px 2px 2px 1px rgb(35, 35, 35);
}
8 changes: 5 additions & 3 deletions src/projects/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import React from 'react';

//* PROJECT
// import Project_10 from './10.E-Commerce-Advance-Filtering';
// import Project_3 from './3. Meals API Project';
import Project_4 from './4. Calculator';
// import Project_4 from './4. Calculator';
// import Project_5 from './5. Color Toggler';
// import Project_6 from './6. Search Icon Project';
// import Project_10 from './10.E-Commerce-Advance-Filtering';

const Projects = () => {
return (
<>
{/* <Project_3 /> */}
<Project_4 />
{/* <Project_4 /> */}
{/* <Project_5 /> */}
{/* <Project_6 /> */}
{/* <Project_10 /> */}
</>
);
Expand Down

0 comments on commit 85a0d91

Please sign in to comment.