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

Customisable Font Text by user click #21

Merged
merged 10 commits into from
May 3, 2022
Merged

Customisable Font Text by user click #21

merged 10 commits into from
May 3, 2022

Conversation

t-divya
Copy link
Contributor

@t-divya t-divya commented Apr 19, 2022

Issue #4

Task:
To Add custom fonts and chnage it when user clicks.

Change:

  • Created new folder chrome-utils for text change.
  • Added dyslexia friendly custom fonts from google free font library.
  • Added button which on click changes the text-font of the website.
  • Chrome API's used for manipulating text-font.
  • Also refactored the display of extension popup:
  • removed overflow and margin and added width

After Refactoring the extension looks something like this

Screenshot 2022-04-19 5 26 20 PM

Here is the before and after image after the user clicks button.

Below is the example web page, when textSetting button is not clicked and font not applied.

Screenshot 2022-04-19 5 35 18 PM

Below is the example web page, after button is clicked and the font is applied, this is how the text of website looks.

Screenshot 2022-04-19 5 35 37 PM

@t-divya t-divya requested a review from digvijayu April 19, 2022 16:47
body {
overflow: hidden;
width: 350px;
margin: 0px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
margin: 0px;
margin: 0;

Comment on lines 28 to 34
<style>
body {
overflow: hidden;
width: 350px;
margin: 0px;
}
</style>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can achieve the same thing with react

@@ -0,0 +1,33 @@
export default async function changeText() {
console.log("inside async fn");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log("inside async fn");

export default async function changeText() {
console.log("inside async fn");
const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
console.log("tab.id", tab.id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log("tab.id", tab.id);

Comment on lines 5 to 8
chrome.scripting.executeScript({
target: { tabId: tab.id ? tab.id : 1111 },
func: getTextFont,
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
chrome.scripting.executeScript({
target: { tabId: tab.id ? tab.id : 1111 },
func: getTextFont,
});
if(tab.id) {
chrome.scripting.executeScript({
target: { tabId: tab.id },
func: getTextFont,
});
}

Comment on lines 24 to 26
p{
font-weight: 400 !important;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
p{
font-weight: 400 !important;
}

Comment on lines 4 to 7
const StyledTextSettingsContainer = styled.div`
max-width: 150px;
height: 150px;
`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the reason behind this height? Assign width and height to app instead..

Comment on lines 5 to 8
chrome.scripting.executeScript({
target: { tabId: tab.id ? tab.id : 1111 },
func: getTextFont,
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the CSS injector api

public/index.html Outdated Show resolved Hide resolved
@digvijayu digvijayu merged commit fc4c180 into master May 3, 2022
@digvijayu digvijayu deleted the font-experiment branch May 3, 2022 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants