@@ -76,7 +76,7 @@ const chatgpt = {
76
76
modalMessage = document . createElement ( 'p' ) ;
77
77
78
78
// Create/append/update modal style (if missing or outdated)
79
- const thisUpdated = 20231203 ; // datestamp of last edit for this file's `modalStyle`
79
+ const thisUpdated = 1734685032942 ; // timestamp of last edit for this file's `modalStyle`
80
80
let modalStyle = document . querySelector ( '#chatgpt-modal-style' ) ; // try to select existing style
81
81
if ( ! modalStyle || parseInt ( modalStyle . getAttribute ( 'last-updated' ) , 10 ) < thisUpdated ) { // if missing or outdated
82
82
if ( ! modalStyle ) { // outright missing, create/id/attr/append it first
@@ -89,25 +89,29 @@ const chatgpt = {
89
89
90
90
// Background styles
91
91
+ '.chatgpt-modal {'
92
+ + 'pointer-events: auto ;' // override any disabling from site modals (like guest login spam)
92
93
+ 'position: fixed ; top: 0 ; left: 0 ; width: 100% ; height: 100% ;' // expand to full view-port
93
- + 'background-color: rgba(67, 70, 72, 0) ;' // init dim bg but no opacity
94
- + 'transition: background-color 0.05s ease ;' // speed to transition in show alert routine
94
+ + 'transition: background-color 0.25s ease !important ;' // speed to show bg dim
95
95
+ 'display: flex ; justify-content: center ; align-items: center ; z-index: 9999 }' // align
96
96
97
97
// Alert styles
98
98
+ '.chatgpt-modal > div {'
99
- + 'opacity: 0 ; transform: translateX(-2px) translateY(5px) ; max-width: 75vw ; word-wrap: break-word ;'
100
- + 'transition: opacity 0.1s cubic-bezier(.165,.84,.44,1), transform 0.2s cubic-bezier(.165,.84,.44,1) ;'
101
- + `background-color: ${ scheme == 'dark' ? 'black' : 'white' } ;`
102
- + ( scheme != 'dark' ? 'border: 1px solid rgba(0, 0, 0, 0.3) ;' : '' )
99
+ + 'opacity: 0 ;' // to fade-in
100
+ + `border: 1px solid ${ scheme == 'dark' ? 'white' : '#b5b5b5' } ;`
101
+ + `color: ${ scheme == 'dark' ? 'white' : 'black' } ;`
102
+ + `background-color: ${ scheme == 'dark' ? 'black' : 'white' } ;`
103
+ + 'transform: translateX(-3px) translateY(7px) ;' // offset to move-in from
104
+ + 'transition: opacity 0.65s cubic-bezier(.165,.84,.44,1),' // for fade-ins
105
+ + 'transform 0.55s cubic-bezier(.165,.84,.44,1) ;' // for move-ins
106
+ + 'max-width: 75vw ; word-wrap: break-word ;'
103
107
+ 'padding: 20px ; margin: 12px 23px ; border-radius: 15px ; box-shadow: 0 30px 60px rgba(0, 0, 0, .12) ;'
104
108
+ ' -webkit-user-select: none ; -moz-user-select: none ; -ms-user-select: none ; user-select: none ; }'
105
109
+ '.chatgpt-modal h2 { margin-bottom: 9px }'
106
110
+ `.chatgpt-modal a { color: ${ scheme == 'dark' ? '#00cfff' : '#1e9ebb' } }`
107
- + '.chatgpt-modal.animated > div { opacity: 1 ; transform: translateX(0) translateY(0) }'
108
- + '@keyframes alert-zoom-fade-out { 0% { opacity: 1 ; transform: scale(1) } '
109
- + '50% { opacity: 0.25 ; transform: scale(1.05) }'
110
- + '100% { opacity: 0 ; transform: scale(1.35) }}'
111
+ + '.chatgpt-modal.animated > div { z-index: 13456 ; opacity: 0.98 ; transform: translateX(0) translateY(0) }'
112
+ + '@keyframes alert-zoom-fade-out {'
113
+ + '0% { opacity: 1 } 50% { opacity: 0.25 ; transform: scale(1.05) }'
114
+ + '100% { opacity: 0 ; transform: scale(1.35) }}'
111
115
112
116
// Button styles
113
117
+ '.modal-buttons { display: flex ; justify-content: flex-end ; margin: 20px -5px -3px 0 ;'
@@ -221,10 +225,10 @@ const chatgpt = {
221
225
modalContainer . style . display = 'none' ;
222
226
if ( alertQueue . length === 1 ) {
223
227
modalContainer . style . display = '' ;
224
- setTimeout ( ( ) => { // delay non-0 opacity's for transition fx
225
- modalContainer . style . backgroundColor = (
226
- `rgba(67, 70, 72, ${ scheme === 'dark' ? 0.62 : 0.1 } )` ) ;
227
- modalContainer . classList . add ( 'animated' ) ; } , 100 ) ;
228
+ setTimeout ( ( ) => { // dim bg
229
+ modal . parentNode . style . backgroundColor = `rgba(67, 70, 72, ${ scheme == 'dark' ? 0.62 : 0.33 } )`
230
+ modal . parentNode . classList . add ( 'animated' )
231
+ } , 100 ) // delay for transition fx
228
232
}
229
233
230
234
// Define click/key handlers
@@ -251,7 +255,7 @@ const chatgpt = {
251
255
// Define alert dismisser
252
256
const dismissAlert = ( ) => {
253
257
modalContainer . style . backgroundColor = 'transparent' ;
254
- modal . style . animation = 'alert-zoom-fade-out 0.075s ease-out' ;
258
+ modal . style . animation = 'alert-zoom-fade-out 0.135s ease-out' ;
255
259
setTimeout ( ( ) => { // delay removal for fade-out
256
260
257
261
// Remove alert
@@ -270,7 +274,7 @@ const chatgpt = {
270
274
} , 500 ) ;
271
275
}
272
276
273
- } , 50 ) ;
277
+ } , 135 ) ;
274
278
} ;
275
279
276
280
return modalContainer . id ; // if assignment used
0 commit comments