Dinamic favicon add

This commit is contained in:
2021-09-30 21:32:16 -03:00
parent e044cacccf
commit 409cdb1c36
9 changed files with 13 additions and 3 deletions

BIN
public/img/Rest Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
public/img/Rest Icon.psd Normal file

Binary file not shown.

BIN
public/img/Working Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
public/img/Working Icon.psd Normal file

Binary file not shown.

BIN
public/img/rest favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -11,7 +11,7 @@
<link href="https://fonts.googleapis.com/css2?family=Rambla:wght@400;700&display=swap" rel="stylesheet">
<!-- CSS -->
<meta charset="utf-8" />
<link rel="icon" href="./img/favicon.ico" />
<link rel="icon" href="./img/favicon.ico" id="favicon" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta

View File

@@ -216,6 +216,12 @@ const MainPomodoroTimer = (props) => {
})*/
const getFavicon = () => {
const r = document.getElementById('favicon')
return r
}
React.useEffect ( () => {
let idTimeOut
@@ -224,6 +230,8 @@ const MainPomodoroTimer = (props) => {
if (!weAreInBreakTime) {
getFavicon().href = './img/working favicon.ico'
if (!alreadyCountingStart) {
const time = getAndFormatCurrentTime()
props.setStartTime(time)
@@ -279,6 +287,8 @@ const MainPomodoroTimer = (props) => {
if(weAreInBreakTime) {
getFavicon().href = './img/rest favicon.ico'
if (minutes === 0 && seconds === 0) {
setTimerActivity(false)
@@ -315,6 +325,8 @@ const MainPomodoroTimer = (props) => {
if (!props.timerOn) {
getFavicon().href = './img/favicon.ico'
if ( timerActivity === true) {
if (!weAreInBreakTime) {

View File

@@ -3,8 +3,6 @@ import MainPomodoroTimer from './Main Pomodoro Childrens/MainPomodoroTimer'
import PomodoroCounter from './Main Pomodoro Childrens/PomodoroCounter'
import StyleSelector from './Main Pomodoro Childrens/StyleSelector'
import uploadToClockifyTimer from './Clockify/uploadToClockifyTimer'
import react from 'react'
const MainPomodoro = (props) => {