File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ <h1>EPIC_Tracker</h1>
3333 < span class ="pin "> </ span > < br >
3434 < span class ="weather "> </ span > < br >
3535 < span class ="temperature "> </ span > < br >
36+ < span class ="visits "> </ span > < br >
3637 < span class ="VPN "> </ span > < br >
3738 < strong class ="rotation-rate "> </ strong > < br >
3839 < strong class ="acceleration "> </ strong >
Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ if (deviceWidth < 990) {
5858 } , 1000 ) ;
5959 } )
6060 }
61+ } else {
62+ document . querySelector ( '.rotation-rate' ) . textContent = `Open this website on your mobile device to see device motion tracker information` ;
6163}
6264function guessIfTheDeviceIsOnTable ( x , y , z ) {
6365 if ( x === 0 && y === 0 && z === 0 ) {
@@ -98,6 +100,16 @@ async function weather(city) {
98100 } )
99101 return response . json ( )
100102}
103+ // Visits
104+ let visitCount = localStorage . getItem ( "visits" )
105+ if ( ! visitCount ) {
106+ document . querySelector ( '.visits' ) . textContent = `This is your first time on this page` ;
107+ localStorage . setItem ( "visits" , 1 )
108+ } else {
109+ visitCount = parseInt ( visitCount ) + 1 ;
110+ localStorage . setItem ( "visits" , visitCount )
111+ document . querySelector ( '.visits' ) . textContent = `You have visited this page ${ visitCount } times` ;
112+ }
101113// PLay with cookies
102114nowFetch ( ) . then ( response => {
103115 const data = {
You can’t perform that action at this time.
0 commit comments