Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Added JS
  • Loading branch information
NandanSatheesh authored Aug 31, 2019
commit 6e422f1f4aa521be60ec1296b66d1161fdff6aec
14 changes: 14 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var colorCombinationsAvailable = [['#43A047', '#FAFAFA'], ['#485564', '#FAFAFA'], ['#303F9F', '#FAFAFA'], ['#AF3D4E', '#FAFAFA'], ['#FAFAFA', '#0277BD'], ['#FFEB3B', '#1E1E1E']]

var mainBackground = document.getElementsByTagName("main")[0];
var linkElememts = document.getElementsByClassName("fab")

var colorPaletteIndex = Math.floor(Math.random() * colorCombinationsAvailable.length);
var colorPalette = colorCombinationsAvailable[colorPaletteIndex];

mainBackground.style.background = colorPalette[0] ;
mainBackground.style.color = colorPalette[1] ;

Object.keys(linkElememts).forEach((key) => {
linkElememts[key].style.color = colorPalette[1];
});