|
1 | | -// var challenge_palette = [ |
2 | | -// "--learnmyog-purple: #3d3846ff;", |
3 | | -// "--dark-purple: #312744ff;", |
4 | | -// "--prussian-blue: #133754ff;", |
5 | | -// "--bright-navy-blue: #1874ddff;", |
6 | | -// "--viridian-green: #019aa5ff;", |
7 | | -// "--sunglow: #ffcc37ff;", |
8 | | -// "--pearly-purple: #b063aaff;", |
9 | | -// "--magenta-dye: #d0046fff;" |
10 | | -// ]; |
| 1 | +// Challenge Colors |
| 2 | +const mainColors=[ |
| 3 | + "#3d3846", //--learnmyog-purple: #3d3846ff |
| 4 | + "#312744", //--dark-purple: #312744ff |
| 5 | + "#133653", //--prussian-blue: #133653ff |
| 6 | + "#2a3d37", //--green-mountain: #2a3d37ff |
| 7 | + "#4e0d0f", //--barn-red: #4e0d0fff |
| 8 | + "#433818", //--army-olive: #433818ff |
| 9 | + "#375466", //--blue-wave: #375466ff; |
| 10 | + "#800007", //--brick-red: #800007ff; |
| 11 | +]; |
| 12 | + |
| 13 | +const accentColors = [ |
| 14 | + "#1874dd", //--bright-navy-blue: #1874ddff |
| 15 | + "#019aa5", //--viridian-green: #019aa5ff |
| 16 | + "#ffcc37", //--sunglow: #ffcc37ff |
| 17 | + "#b063aa", //--pearly-purple: #b063aaff |
| 18 | + "#d0046f", //--magenta-dye: #d0046fff |
| 19 | + "#c2c1c2", //--silver-bullet: #c2c1c2ff |
| 20 | + "#a0743c", //--coyote-brown: #a0743cff |
| 21 | +]; |
| 22 | + |
| 23 | +const lightColors = ["#ffcc37"]; // these need black text |
11 | 24 |
|
12 | 25 | window.onload=function(){ |
13 | | - var colors=[ |
14 | | - "#3d3846", |
15 | | - "#1874dd", |
16 | | - "#019aa5", |
17 | | - "#312744", |
18 | | - "#ffcc37", |
19 | | - "#133653", |
20 | | - "#2a3d37", |
21 | | - "#b063aa", |
22 | | - "#d0046f", |
23 | | - "#c5d929", |
24 | | - "#4e0d0f", |
25 | | - "#433818", |
26 | | - "#375466", |
27 | | - "#936621" |
28 | | - ]; |
29 | 26 |
|
30 | | - let lightColors = ["#ffcc37", "#c5d929"]; |
31 | | - |
32 | | - // let rn = Math.floor(Math.random()*colors.length); |
33 | | - var primary = colors[randomNumberInList(colors)]; |
34 | | - var secondary = colors[randomNumberInList(colors)]; |
| 27 | + let primary = mainColors[randomNumberInList(mainColors)]; |
| 28 | + let secondary = accentColors[randomNumberInList(accentColors)]; |
35 | 29 | $(':root').css('--banner', primary); |
36 | 30 | $(':root').css('--overlay', hexToRGB(primary, .4)) |
37 | 31 | if (secondary != primary){ |
38 | 32 | $(':root').css('--spotlight', secondary); |
39 | 33 | } |
40 | 34 |
|
41 | 35 | // for light colored primary (e.g.) yellow remove invert class for text colors |
42 | | - if( $.inArray(primary, lightColors) != -1){ |
43 | | - $('footer').removeClass('invert'); |
44 | | - console.log('primary is light') |
45 | | - } else { |
46 | | - console.log('primary is dark so invert'); |
47 | | - } |
| 36 | + // if( $.inArray(primary, lightColors) != -1){ |
| 37 | + // $('footer').removeClass('invert'); |
| 38 | + // console.log('primary is light') |
| 39 | + // } else { |
| 40 | + // console.log('primary is dark so invert'); |
| 41 | + // } |
48 | 42 | console.log("banner is " + primary, "spotlight is " + secondary); |
49 | 43 | } |
50 | 44 |
|
|
0 commit comments