-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Daily-Quotes/dev
v1.1
- Loading branch information
Showing
21 changed files
with
931 additions
and
79 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
h1, h5 { | ||
margin : 0; | ||
} | ||
|
||
a { | ||
text-decoration : underline; | ||
} | ||
|
||
body { | ||
border-radius : 15px; | ||
width : 270px; | ||
margin : 45px; | ||
} | ||
|
||
p { | ||
margin : 0; | ||
font-size : 1.2em; | ||
} | ||
|
||
h1 { | ||
font-size : 2.7em; | ||
} | ||
|
||
h3 { | ||
font-size : 1.6em; | ||
margin-bottom : 10px; | ||
} | ||
|
||
h5 { | ||
margin : auto; | ||
font-size : 1.05em; | ||
text-align : center; | ||
} | ||
|
||
.inline-flex { | ||
display : inline-flex; | ||
} | ||
|
||
.horizontal-flex { | ||
display : flex; | ||
flex-direction : column; | ||
} | ||
|
||
.space-around { | ||
display : flex; | ||
justify-content : space-around; | ||
} | ||
|
||
#configuration-sections > div{ | ||
margin: 3em 0; | ||
} | ||
|
||
#colors-list { | ||
padding : 0; | ||
margin : 0.5em auto; | ||
width : 100%; | ||
justify-content : space-between; | ||
list-style : none; | ||
display : inline-flex; | ||
} | ||
|
||
#colors-list li button { | ||
box-shadow : inset 0 2px 1px rgba(255, 255, 255, 0.2); | ||
height : 20px; | ||
width : 20px; | ||
border : none; | ||
border-radius : 15px; | ||
transition : all 0.5s; | ||
} | ||
#colors-list li button:hover { | ||
transform : scale(1.2); | ||
} | ||
|
||
#colors-list li button.active { | ||
transform : scale(1.3); | ||
} | ||
|
||
#buy-me-a-coffee img { | ||
position : relative; | ||
left : 50%; | ||
transform : translateX(-50%); | ||
height : 40px; | ||
} | ||
|
||
#font-selector { | ||
display : inline | ||
} | ||
|
||
#current-font-container { | ||
width : 70%; | ||
} | ||
|
||
#current-font{ | ||
font-size: 1.4em; | ||
text-align: center; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// | ||
//------- Color Buttons -------- | ||
// | ||
|
||
getStoredHighlightColorPopup() | ||
|
||
const handleColorClick = (e) => { | ||
const selectedColor = e.target.value; | ||
|
||
// Restore all buttons | ||
colorButtons.map(colorButton => { | ||
if (colorButton.hasClass("active")) { | ||
colorButton.removeClass("active") | ||
} | ||
}) | ||
|
||
// Check if selectedColor isn't the current color | ||
if ($(`#set-${selectedColor}-button`).hasClass("active") !== true) { | ||
// If not, set as current color | ||
$(`#set-${selectedColor}-button`).addClass("active"); | ||
|
||
// Set selected color to elements with class "dynamic-color" | ||
$(".dynamic-color").css("color", `var(--${selectedColor})`); | ||
|
||
// Save new color to storage | ||
chrome.storage.sync.set({highlightColor: selectedColor}, function () { | ||
console.log('highlightColor is set to ' + selectedColor); | ||
}); | ||
} | ||
} | ||
|
||
colorButtons.map(colorButton => { | ||
colorButton.click(handleColorClick); | ||
}) | ||
|
||
// | ||
//------- Font Change -------- | ||
// | ||
getStoredFontIndex(); | ||
|
||
$(function handleNextFontClick () { | ||
$('#next-font').on('click', () => { | ||
// Check if savedFontIndex is not the last element if so, reset to 0 | ||
if (savedFontIndex < fontsNames.length - 1){ | ||
savedFontIndex++; | ||
}else{ | ||
savedFontIndex = 0 | ||
} | ||
|
||
// Save savedFontIndex into chrome | ||
chrome.storage.sync.set({fontIndex: savedFontIndex}, function () { | ||
console.log('fontIndex is set to ' + savedFontIndex); | ||
}); | ||
|
||
$(".dynamic-font").css("font-family", `${fontsNames[savedFontIndex]}`); | ||
|
||
const currentFontElement = $("#current-font") | ||
currentFontElement.css("font-family", `${fontsNames[savedFontIndex]}`); | ||
currentFontElement.text(fontsNames[savedFontIndex]) | ||
}) | ||
}) | ||
|
||
$(function handlePrevFontClick () { | ||
$('#prev-font').on('click', () => { | ||
// Check if savedFontIndex is not the last element if so, reset to 0 | ||
if (savedFontIndex > 0){ | ||
savedFontIndex--; | ||
}else{ | ||
savedFontIndex = fontsNames.length - 1; | ||
} | ||
|
||
// Save savedFontIndex into chrome | ||
chrome.storage.sync.set({fontIndex: savedFontIndex}, function () { | ||
console.log('fontIndex is set to ' + savedFontIndex); | ||
}); | ||
|
||
$(".dynamic-font").css("font-family", `${fontsNames[savedFontIndex]}`); | ||
|
||
const currentFontElement = $("#current-font") | ||
currentFontElement.css("font-family", `${fontsNames[savedFontIndex]}`); | ||
currentFontElement.text(fontsNames[savedFontIndex]) | ||
}) | ||
}) | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.