Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Added animated favicon #56

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
599 changes: 345 additions & 254 deletions package-lock.json

Large diffs are not rendered by default.

File renamed without changes.
Binary file added public/folded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 28 additions & 2 deletions docs/public/index.html β†’ public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="%PUBLIC_URL%/images.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
Expand All @@ -24,7 +24,33 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<title>GetButtons.io
</title>
<script>
// Get current title and icon
var title = $('title').text();
var favicon = $('link[rel=icon]').attr('href');
var newtitle = 'Please Visit Again!';

// Active
window.addEventListener('focus', resetTitleicon);

// Inactive
window.addEventListener('blur', changeTitleicon);

// Change page title and icon
function changeTitleicon(){
$("title").text(newtitle);
$('link[rel=icon]').attr('href', 'folded.png');
}

// Reset the page title and icon
function resetTitleicon(){
$('title').text(title);
$('link[rel=icon]').attr('href', 'images.png');
}
</script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/src/App.js β†’ src/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

import React from "react";
function App() {
return (
<div className="App">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.