Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Background image and changed aesthetics #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21,194 changes: 13,124 additions & 8,070 deletions package-lock.json

Large diffs are not rendered by default.

Binary file added public/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 0 additions & 41 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,42 +1 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

.blank{
color: rgb(32, 8, 246);
}
1 change: 1 addition & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Switch,
Route
} from "react-router-dom";
import "./css/homepage.css"


function App() {
Expand Down
111 changes: 74 additions & 37 deletions src/components/About.js
Original file line number Diff line number Diff line change
@@ -1,60 +1,97 @@
import React from 'react'
import React from 'react';

export default function About(props) {
// Define a more aesthetic color scheme for dark and light modes
const myStyle = {
color: props.mode === 'dark' ? '#DCE3F2' : '#1F2937', // Lighter text for dark mode, darker for light mode
backgroundColor: props.mode === 'dark' ? '#1C2234' : '#FFFFFF', // Darker background for dark mode, white for light mode
borderColor: props.mode === 'dark' ? '#495579' : '#E5E7EB', // Subtle border based on mode
borderRadius: '8px', // Rounded corners for buttons and accordion items
padding: '15px', // Padding for content areas
};

const containerStyle = {
backgroundColor: props.mode === 'dark' ? '#2D2E32' : '#F0F4F8',
color: props.mode === 'dark' ? '#F0F4F8' : '#2D2E32',
padding: '20px',
borderRadius: '8px',
maxWidth: '800px', // Maximum width of the container
margin: '0 auto', // Center the container horizontally
};


const buttonStyle = {
color: props.mode === 'dark' ? '#DCE3F2' : '#1F2937',
backgroundColor: props.mode === 'dark' ? '#2A2E3D' : '#F9FAFB',
borderColor: props.mode === 'dark' ? '#495579' : '#E5E7EB',
borderRadius: '8px',
};

// const [myStyle, setMyStyle] = useState({
// color: 'black',
// backgroundColor: 'white'
// })
let myStyle = {
color: props.mode ==='dark'?'white':'#042743',
backgroundColor: props.mode ==='dark'?'rgb(36 74 104)':'white',
}

return (
<div className="container">
<h1 className="my-3" style={{color: props.mode ==='dark'?'white':'#042743'}}>About Us</h1>
<div className="container" style={{ maxWidth: '800px', margin: '0 auto', padding: '20px' }}>
<h1 className="my-3">About Us</h1>
<div className="accordion" id="accordionExample">
<div className="accordion-item">
<div className="accordion-item" style={myStyle}>
<h2 className="accordion-header" id="headingOne">
<button className="accordion-button" type="button" style={myStyle} data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<strong>Analyze Your text </strong>
</button>
<button
className="accordion-button"
type="button"
style={buttonStyle}
data-bs-toggle="collapse"
data-bs-target="#collapseOne"
aria-expanded="true"
aria-controls="collapseOne"
>
<strong>Analyze Your Text</strong>
</button>
</h2>
<div id="collapseOne" className="accordion-collapse collapse show" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
<div className="accordion-body" style={myStyle}>
Textutils gives you a way to analyze your text quickly and efficiently. Be it word count, character count or

</div>
<div className="accordion-body" style={myStyle}>
TextUtils gives you a way to analyze your text quickly and efficiently. Be it word count, character count, or more.
</div>
</div>
</div>
<div className="accordion-item">
<div className="accordion-item" style={myStyle}>
<h2 className="accordion-header" id="headingTwo">
<button className="accordion-button collapsed" style={myStyle} type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
<strong>Free to use </strong>
</button>
<button
className="accordion-button collapsed"
style={buttonStyle}
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapseTwo"
aria-expanded="false"
aria-controls="collapseTwo"
>
<strong>Free to Use</strong>
</button>
</h2>
<div id="collapseTwo" className="accordion-collapse collapse" aria-labelledby="headingTwo" data-bs-parent="#accordionExample">
<div className="accordion-body" style={myStyle}>
TextUtils is a free character counter tool that provides instant character count & word count statistics for a given text. TextUtils reports the number of words and characters. Thus it is suitable for writing text with word/ character limit.
</div>
<div className="accordion-body" style={myStyle}>
TextUtils is a free character counter tool that provides instant character count & word count statistics for a given text. It is suitable for writing text with word/character limits.
</div>
</div>
</div>
<div className="accordion-item">
<div className="accordion-item" style={myStyle}>
<h2 className="accordion-header" id="headingThree">
<button className="accordion-button collapsed" style={myStyle} type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
<strong>Browser Compatible </strong>
</button>
<button
className="accordion-button collapsed"
style={buttonStyle}
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapseThree"
aria-expanded="false"
aria-controls="collapseThree"
>
<strong>Browser Compatible</strong>
</button>
</h2>
<div id="collapseThree" className="accordion-collapse collapse" aria-labelledby="headingThree" data-bs-parent="#accordionExample">
<div className="accordion-body" style={myStyle}>
This word counter software works in any web browsers such as Chrome, Firefox, Internet Explorer, Safari, Opera. It suits to count characters in facebook, blog, books, excel document, pdf document, essays, etc.

</div>
<div className="accordion-body" style={myStyle}>
This word counter software works in any web browser such as Chrome, Firefox, Internet Explorer, Safari, and Opera. It suits counting characters in various platforms like Facebook, blogs, books, Excel documents, PDFs, essays, etc.
</div>
</div>
</div>
</div>

</div>
)
);
}
84 changes: 52 additions & 32 deletions src/components/TextForm.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,85 @@
import React, {useState} from 'react'

import React, { useState } from 'react';

export default function TextForm(props) {
const handleUpClick = ()=>{
const handleUpClick = () => {
let newText = text.toUpperCase();
setText(newText)
setText(newText);
props.showAlert("Converted to uppercase!", "success");
}

const handleLoClick = ()=>{
const handleLoClick = () => {
let newText = text.toLowerCase();
setText(newText)
setText(newText);
props.showAlert("Converted to lowercase!", "success");
}

const handleClearClick = ()=>{
const handleClearClick = () => {
let newText = '';
setText(newText);
props.showAlert("Text Cleared!", "success");
}

const handleOnChange = (event)=>{
setText(event.target.value)
const handleOnChange = (event) => {
setText(event.target.value);
}

// Credits: A
const handleCopy = () => {
navigator.clipboard.writeText(text);
navigator.clipboard.writeText(text);
props.showAlert("Copied to Clipboard!", "success");
}

// Credits: Coding Wala
const handleExtraSpaces = () => {
let newText = text.split(/[ ]+/);
setText(newText.join(" "));
props.showAlert("Extra spaces removed!", "success");
}

const [text, setText] = useState('');
// text = "new text"; // Wrong way to change the state
// setText("new text"); // Correct way to change the state
const [text, setText] = useState('');

// Aesthetic Color Scheme
const containerStyle = {
backgroundColor: props.mode === 'dark' ? '#2D2E32' : '#F0F4F8',
color: props.mode === 'dark' ? '#F0F4F8' : '#2D2E32',
padding: '20px',
borderRadius: '8px',
};

const textAreaStyle = {
backgroundColor: props.mode === 'dark' ? '#1E1E22' : '#FFFFFF',
color: props.mode === 'dark' ? '#F0F4F8' : '#2D2E32',
borderColor: props.mode === 'dark' ? '#555' : '#DDD',
borderRadius: '4px',
padding: '10px',
};

const buttonStyle = {
backgroundColor: '#4A90E2',
borderColor: '#4A90E2',
color: '#FFFFFF',
borderRadius: '4px',
padding: '10px 15px',
};

return (
<>
<div className="container" style={{color: props.mode==='dark'?'white':'#042743'}}>
<h1 className='mb-4'>{props.heading}</h1>
<div className="mb-3">
<textarea className="form-control" value={text} onChange={handleOnChange} style={{backgroundColor: props.mode==='dark'?'#13466e':'white', color: props.mode==='dark'?'white':'#042743'}} id="myBox" rows="8"></textarea>
<div className="container" style={containerStyle}>
<h1 className='mb-4'>{props.heading}</h1>
<div className="mb-3">
<textarea className="form-control" value={text} onChange={handleOnChange} style={textAreaStyle} id="myBox" rows="8"></textarea>
</div>
<button disabled={text.length === 0} className="btn btn-primary mx-1 my-1" style={buttonStyle} onClick={handleUpClick}>Convert to Uppercase</button>
<button disabled={text.length === 0} className="btn btn-primary mx-1 my-1" style={buttonStyle} onClick={handleLoClick}>Convert to Lowercase</button>
<button disabled={text.length === 0} className="btn btn-primary mx-1 my-1" style={buttonStyle} onClick={handleClearClick}>Clear Text</button>
<button disabled={text.length === 0} className="btn btn-primary mx-1 my-1" style={buttonStyle} onClick={handleCopy}>Copy Text</button>
<button disabled={text.length === 0} className="btn btn-primary mx-1 my-1" style={buttonStyle} onClick={handleExtraSpaces}>Remove Extra Spaces</button>
</div>
<div className="container my-3" style={containerStyle}>
<h2>Your text summary</h2>
<p>{text.split(/\s+/).filter((element) => { return element.length !== 0 }).length} words and {text.length} characters</p>
<p>{0.008 * text.split(/\s+/).filter((element) => { return element.length !== 0 }).length} Minutes read</p>
<h2>Preview</h2>
<p>{text.length > 0 ? text : "Nothing to preview!"}</p>
</div>
<button disabled={text.length===0} className="btn btn-primary mx-1 my-1" onClick={handleUpClick}>Convert to Uppercase</button>
<button disabled={text.length===0} className="btn btn-primary mx-1 my-1" onClick={handleLoClick}>Convert to Lowercase</button>
<button disabled={text.length===0} className="btn btn-primary mx-1 my-1" onClick={handleClearClick}>Clear Text</button>
<button disabled={text.length===0} className="btn btn-primary mx-1 my-1" onClick={handleCopy}>Copy Text</button>
<button disabled={text.length===0} className="btn btn-primary mx-1 my-1" onClick={handleExtraSpaces}>Remove Extra Spaces</button>
</div>
<div className="container my-3" style={{color: props.mode==='dark'?'white':'#042743'}}>
<h2>Your text summary</h2>
<p>{text.split(/\s+/).filter((element)=>{return element.length!==0}).length} words and {text.length} characters</p>
<p>{0.008 * text.split(/\s+/).filter((element)=>{return element.length!==0}).length} Minutes read</p>
<h2>Preview</h2>
<p>{text.length>0?text:"Nothing to preview!"}</p>
</div>
</>
)
}
6 changes: 6 additions & 0 deletions src/css/homepage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
body {
background-image: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)), url('./login.png');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
Binary file added src/css/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.