Training File
Training File
Development
(Photo Editor Using React.Js)
Submitted by
Pradeep Singh
Roll No. – 2124388
• Topic : React.Js
• Duration : 6 Week
Technology used
• HTML
• CSS
• JAVASCRIPT
• REACT
ACKNOWLEDGEMENT
The Training opportunity I had with Solitaire Infosys provided a great environment for
learning, enhancing and developing professional skills of myself. I feel extremely honored as I
was provided with an opportunity to be a part of the esteemed organization.
The satisfaction that accompanies the successful completion of any task would be incomplete
without the mention of people whose ceaseless cooperation made it possible, whose constant
guidance and encouragement crown all efforts with success. I am grateful to the instructor
Mr. Vikas and Mr. Ashish who led me through this learning period. Without their support, this
project would not have been possible. I choose this opportunity to acknowledge his
contribution gratefully.
My best and fond regards with deep sense of gratitude to Ms. Himanshi (Technical Assistant )
for their everlasting and precious guidance and encouragement from time to time which were
extremely valuable for my theoretical and practical study.
I would also like to acknowledge my hearty gratitude towards my In charge Dr. Anshu Bhasin
and all the professors at IKGPTU, who taught the fundamentals essential for undertaking such a
project. Without their guidance it would have been extremely difficult to grasp and visualize the
project theoretically.
2 Introduction
3 About React Js
5 Future Work
6 Conclusion
ABOUT THE COMPANY
Solitaire Infosystems Pvt. Ltd. is an acclaimed IT service provider contributing its part in
the development of many businesses around the globe. We socialize with our clients to
get a superior cognizance of their business and requirements and help them in fabricating
websites and applications for their business. Founded in 2011 by a dynamic duo with the
same aim and zeal, we have come a long way in satisfying our clients.
We are serving our clients with the world-class services for more than seven years now.
The clients are delivered with the best IT solutions after we have developed a great
understanding of their business and requirements. Our team works on the client projects
like its own and that is the reason why we hold the edge in the league.
With every project that we deliver, we deliver our respect, creativity, quality, transparency,
and teamwork to our clients. We have the experience, expertise, and capabilities to enable
organizations to accelerate their service processes in every possible way. We are known
for our excellent customer satisfaction, cost-effectiveness, and innovative skills that are
unparalleled.
OUR VISION
We visualize becoming the most trusted and respected IT service provider across the
globe with our vibrant, dynamic, and value-based IT solutions that revolve around our
clients, team, and international standards. Solitaire Infosystems Pvt. Ltd. envisions
becoming a reliable partner to all its clients and focusing on doing everything ethically
and rightly. We are always open to accept our mistakes and have the nerve to do the
necessary changes.
➢ About React.Js :-
React.js is a powerful JavaScript library for building dynamic user interfaces, developed and
maintained by Facebook. It provides a declarative and efficient way to create interactive
components that can seamlessly update and render in response to changes in application state.
1. Components:
• React applications are built using components, which are modular, reusable pieces of
code that encapsulate specific functionality and user interface elements. Components
can be combined to create complex UIs.
2. Virtual DOM:
• React uses a virtual DOM (Document Object Model) to optimize rendering. Instead of
updating the entire DOM when changes occur, React creates a virtual representation
of the DOM and updates only the necessary parts, improving performance and
responsiveness.
3. JSX (JavaScript XML):
• JSX is a syntax extension for JavaScript that allows you to write HTML-like code within
your JavaScript files. It provides a concise and readable way to describe the structure
of UI components.
4. Unidirectional Data Flow:
• React follows a unidirectional data flow, where data changes are passed down through
the component hierarchy. This helps maintain a clear and predictable flow of data,
making it easier to understand and debug applications.
Whether you're building a simple web application or a complex user interface, React provides a
flexible and efficient foundation for constructing modern, interactive, and scalable applications.
REACT Versions:-
Components of React.Js :-
➢ HTML:
HTML, which stands for Hyper Text Mark up Language . It provides a means to create
structured documents by denoting structural semantics for text such as headings, paragraphs,
lists etc as well as for links, quotes, and other items.
• HTML elements label pieces of content such as "this is a heading", "this is a paragraph",
"this is a link", etc.
➢ CSS:
• CSS saves a lot of work. It can control the layout of multiple web pages all at once. • External
stylesheets are stored in CSS files.
There are three ways of inserting a style sheet:
1) Inline CSS
2) Internal CSS
3) External CSS
External CSS contains separate CSS file which contains only style property with the help of tag
attributes (For example class, id, heading, etc.). • External by using a <link> element to link to an
external CSS file.
➢ JAVASCRIPT:
• JavaScript is the most popular programming language in the world and that makes it a
programmer’s great choice. Once you learnt JavaScript, it helps you developing great front-end
as well as back-end software using different JavaScript based frameworks like jQuery, Node.JS
etc.
• JavaScript is everywhere, it comes installed on every modern web browser and so to learn
JavaScript you really do not need any special environment setup. For example Chrome, Mozilla
Firefox, Safari and every browser you know as of today, supports JavaScript.
• Websites:JavaScript helps us to add behaviour of our website. It helps users to interact with
the website. For e.g. clicking on buttons, saving details, uploading details on the website, etc.
• Web Servers:We can make robust server applications using JavaScript. To be precise we use
JavaScript frameworks like Node.js and Express.js to build these servers.
• Game Development: In Game Development industry, JavaScript is used widely. With the
addition of HTML5 Canvas, it’s now possible to make 2D and 3D games in JavaScript very
efficiently.
JavaScript is the most popular and hence the most loved language around the globe. Apart from
this, there are abundant reasons to learn it. Below are a listing of few important points:
• No need of compilers:
Since JavaScript is an interpreted language, therefore it does not need any compiler for
compilations.
• Used everywhere:
JavaScript is so loved because it can be used anywhere. It can be used to develop websites,
games or mobile apps, etc.
➢ BOOTSTRAP:
• Bootstrap is a free front-end framework for faster and easier web development
• Bootstrap includes HTML and CSS based design templates for typography, forms, buttons,
tables, navigation, modals, image carousels and many other, as well as optional JavaScript
plugins
• Bootstrap also gives you the ability to easily create responsive designs.
• React is used for the development of single-page applications and mobile applications
because of its ability to handle rapidly changing data.
• Virtual DOM –
A virtual DOM object is a representation of a DOM object.
Virtual DOM is actually a copy of the original DOM. Any modification in the web application
causes the entire UI to re-render the virtual DOM.
Then the difference between the original DOM and this virtual DOM is compared and the
changes are made accordingly to the original DOM.
• JSX –
Stands for JavaScript XML. It is an HTML/XML JavaScript Extension which is used in React.
Makes it easier and simpler to write React components.
• Components –
React JS supports Components. Components are the building blocks of UI wherein each
component has a logic and contributes to the overall UI. These components also promote
code reusability and make the overall web application easier to understand.
• High Performance –
Features like Virtual DOM, JSX and Components makes it much faster than the rest of the
frameworks out there.
• You can start your react application by first installing “create-react-app” using npm or yarn.
➢ Node.js: JS Runtime Environment
Node.js provides a JavaScript Environment which allows the user to run their code on the server
(outside the browser).
Node pack manager i.e. npm allows the user to choose from thousands of free packages (node
modules) to download.
Initialize a Node.js application by typing running the below command in the command window. Accept
the standard settings.
Attributes used in the project:-
1. State Management:
• Image State: Keep track of the current image being edited.
• Tool State: Track the selected editing tool (e.g., crop, rotate, filter).
• Canvas State: Store information about the canvas, such as dimensions.
2. Components:
• Canvas Component: Display the image and handle drawing on it.
• Toolbox Component: Contains buttons or options for different editing tools.
• Upload Component: For uploading images from the user's device.
• Save Component: Allows users to save the edited image.
4. User Interaction:
• Mouse/Touch Events: Implement event listeners for mouse or touch interactions on the canvas.
5. Filters:
• Implement a way to apply filters to the image (brightness, contrast, saturation, etc.).
• You might use a library like react-filter-range for sliders to control filter parameters.
6. Undo/Redo Functionality:
• Keep a history of changes to allow users to undo or redo edits.
7. File Handling:
• Implement features for uploading and saving images.
• Use the FileReader API for reading uploaded images.
8. Styling:
• Apply styles to make your app visually appealing and user-friendly.
9. Responsive Design:
• Ensure your app works well on various screen sizes and devices.
Introduction to project :-
Project Overview:
In a world increasingly driven by visual content, our Image Editor in React aims to provide a
simple yet powerful solution for users to manipulate images effortlessly. Whether it's cropping,
scaling, or adjusting colors, our application leverages the capabilities of React and a chosen
image manipulation library to deliver an intuitive and responsive image editing experience.
**Key Features:**
User-Friendly Interface:
The application offers an easy-to-use interface that allows users to upload images quickly and
perform a variety of edits effortlessly.
Upload Image:
Users can upload their desired images through a user-friendly file input interface.
Save or Export:
After making desired edits, users can save or export the edited image for personal or professional
use.
➢ Image Editor Interface :-
Basic Layout:-
Choosing Image :-
: Choose the image from your local system you want to edit by pressing the Choose Image
button.
:- Use Brightness button and the Slider to adjust the brightness of the image.
:- Use the Contrast button and Slider to adjust the contrast of the image.
Similarly , we can use the Sepia , Saturate , HueRotate and Grascale buttons to adjust the
colour , hue , saturation , gray value and sepia of the image according to our liking.
:- We can use the Undo button given in the bottom right to undo any unwanted step while editing
the photo.
:- Use the Redo button to repeat the action you unintentionally revoked by using the undo button.
:- I case we want to start over and erase all the changes we can use the Reset button.
:- We can directly Drag over the image to quickly perform a rectangular crop on the image.
:- Later we can adjust the cropped area as well.
:- Press the Crop Image button to finalize the cropped portion you want to use.
:-We can flip the image vertically or horizontally by using the Flip buttons present at the
bottom.
OR
:- We can also rotate the images in 90 degree by using Rotate right or Rotate left.
OR
:- When we are Satisfied with all the changes we have made to the image,
we can use the Save Image button to save the edited image.
➢ Conclusion of the React Photo Editor Project:
In conclusion, the React Photo Editor project has been a journey of creativity, innovation, and
technical exploration. As we wrap up this project, several key aspects and achievements deserve
acknowledgment:
User-Friendly Interface:
The project successfully delivers a user-friendly interface, providing an intuitive environment for
users to edit and enhance their photos effortlessly.
Efficient Integration:
The integration of a popular image manipulation library within the React framework ensures
efficiency and reliability in handling core functionalities. This strategic decision contributes to
the overall performance of the application.
Feature Highlights:
The photo editor encompasses a range of features, including but not limited to cropping,
scaling, adjusting colors, and other creative enhancements. These features empower users to
unleash their creativity while maintaining ease of use.
Responsive Design:
A key consideration throughout the development process has been maintaining a responsive
design. The photo editor adapts seamlessly to various screen sizes and devices, ensuring a
consistent and enjoyable experience for users across platforms.