File tree Expand file tree Collapse file tree 1 file changed +26
-24
lines changed
Expand file tree Collapse file tree 1 file changed +26
-24
lines changed Original file line number Diff line number Diff line change @@ -148,29 +148,31 @@ nowFetch().then(response => {
148148 document . querySelector ( '.temperature' ) . textContent = temperaturePhrase ;
149149 } )
150150 // VPN DETECTION
151- const date = new Date ( Date . now ( ) )
152- const vpnData = { timezone : data . timezone , deviceTime : date . getTime ( ) }
153- let options = {
154- timeZone : vpnData . timezone ,
155- hour : 'numeric' ,
156- minute : 'numeric' ,
157- month : 'numeric' ,
158- second : 'numeric' ,
159- year : 'numeric' ,
160- day : 'numeric'
161- } ;
162- formatter = new Intl . DateTimeFormat ( [ ] , options ) ;
163- const stringTime = formatter . format ( new Date ( ) ) ;
164- const IPtime = Date . parse ( stringTime )
165- let diff = IPtime - Date . now ( )
166- if ( diff < 0 ) {
167- diff = - 1 * diff
168- }
169- if ( diff > 50000 ) {
170- console . log ( "YAY VPN" )
171- document . querySelector ( '.VPN' ) . textContent = `You ARE using a VPN`
172- } else {
173- console . log ( "NO VPN" )
174- document . querySelector ( '.VPN' ) . textContent = `You donot seem to Use a VPN`
151+ if ( deviceWidth > 990 ) {
152+ const date = new Date ( Date . now ( ) )
153+ const vpnData = { timezone : data . timezone , deviceTime : date . getTime ( ) }
154+ let options = {
155+ timeZone : vpnData . timezone ,
156+ hour : 'numeric' ,
157+ minute : 'numeric' ,
158+ month : 'numeric' ,
159+ second : 'numeric' ,
160+ year : 'numeric' ,
161+ day : 'numeric'
162+ } ;
163+ formatter = new Intl . DateTimeFormat ( [ ] , options ) ;
164+ const stringTime = formatter . format ( new Date ( ) ) ;
165+ const IPtime = Date . parse ( stringTime )
166+ let diff = IPtime - Date . now ( )
167+ if ( diff < 0 ) {
168+ diff = - 1 * diff
169+ }
170+ if ( diff > 50000 ) {
171+ console . log ( "YAY VPN" )
172+ document . querySelector ( '.VPN' ) . textContent = `You ARE using a VPN`
173+ } else {
174+ console . log ( "NO VPN" )
175+ document . querySelector ( '.VPN' ) . textContent = `You donot seem to Use a VPN`
176+ }
175177 }
176178} )
You can’t perform that action at this time.
0 commit comments