File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
starters/chrome/extension Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1414
1515 // Import APP data
1616 const { app } = await chrome . storage . sync . get ( 'app' )
17+
18+ // Export DEPENDENCIES to imported resources
19+ dom . dependencies . import ( { env } ) // for env.scheme
1720 modals . dependencies . import ( { app, env } ) // for app data + env.scheme
1821
1922 // Add CHROME MSG listener
Original file line number Diff line number Diff line change 11window . dom = {
2+
3+ dependencies : {
4+ import ( dependencies ) { // { env) }
5+ for ( const name in dependencies ) this [ name ] = dependencies [ name ] }
6+ } ,
7+
28 create : {
39 elem ( elemType , attrs = { } ) {
410 const elem = document . createElement ( elemType )
@@ -13,14 +19,15 @@ window.dom = {
1319 }
1420 } ,
1521
16- fillStarryBG ( targetNode ) { // requires https://assets.aiwebextensions.com/styles/css/<black|white>-rising-stars.min.css
22+ fillStarryBG ( targetNode ) { // requires https://assets.aiwebextensions.com/styles/rising-stars/css/<black|white>.min.css
23+ if ( targetNode . querySelector ( '[id*=stars]' ) ) return
1724 const starsDivsContainer = document . createElement ( 'div' )
1825 starsDivsContainer . style . cssText = 'position: absolute ; top: 0 ; left: 0 ;' // hug targetNode's top-left corner
1926 + 'height: 100% ; width: 100% ; border-radius: 15px ; overflow: clip ;' // bound innards exactly by targetNode
2027 + 'z-index: -1' ; // allow interactive elems to be clicked
2128 [ 'sm' , 'med' , 'lg' ] . forEach ( starSize => {
2229 const starsDiv = document . createElement ( 'div' )
23- starsDiv . id = `${ chatgpt . isDarkMode ( ) ? 'white' : 'black' } -stars-${ starSize } `
30+ starsDiv . id = `${ this . dependencies . env . scheme == 'dark' ? 'white' : 'black' } -stars-${ starSize } `
2431 starsDivsContainer . append ( starsDiv )
2532 } )
2633 targetNode . prepend ( starsDivsContainer )
You can’t perform that action at this time.
0 commit comments