File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 33< script >
44( ( ) => {
55
6+ const VARIANT_VERSION = 2 ;
7+ const STORAGE_KEY = `ribbonVariant_v${ VARIANT_VERSION } ` ;
8+
9+
610 const ribbonVariants = [
711 { href : '/masterclasses/' , text : 'Arrange a Masterclass' } ,
812 { href : '/sentinel/' , text : 'Sentinel: Your Web-Performance Watchman' } ,
913 { href : '/performance-audits/#fix-it-fast' , text : 'Suffering? Fix it Fast!' } ,
14+ { href : '/newsletter/' , text : 'Join the Newsletter' } ,
15+ { href : '/supporters/' , text : 'Become a Supporter' }
1016 ] ;
1117
1218 const getVariantIndex = ( ) => {
13- const stored = localStorage . getItem ( 'ribbonVariant' ) ;
19+ const stored = localStorage . getItem ( STORAGE_KEY ) ;
1420 const len = ribbonVariants . length ;
1521
1622 if ( stored !== null ) {
2127 }
2228
2329 const i = Math . floor ( Math . random ( ) * len ) ;
24- localStorage . setItem ( 'ribbonVariant' , i ) ;
30+ localStorage . setItem ( STORAGE_KEY , i ) ;
2531 return i ;
2632 } ;
2733
You can’t perform that action at this time.
0 commit comments