9090 border-radius : 4px ;
9191 transition : width 0.3s ease;
9292 }
93+
94+ .home-btn {
95+ position : fixed;
96+ bottom : 20px ;
97+ right : 20px ;
98+ padding : 12px 24px ;
99+ background : var (--primary );
100+ color : white;
101+ border : none;
102+ border-radius : 8px ;
103+ cursor : pointer;
104+ box-shadow : 0 4px 6px rgba (0 , 0 , 0 , 0.1 );
105+ text-align : center;
106+ }
93107 </ style >
94108</ head >
95109< body >
@@ -130,6 +144,8 @@ <h2>Using the AgriTool</h2>
130144 </ div >
131145 </ div >
132146
147+ < button class ="home-btn " onclick ="window.location.href='index.html' "> Home</ button >
148+
133149 < script >
134150 // Tutorial state management
135151 const tutorialState = {
@@ -152,6 +168,14 @@ <h2>Using the AgriTool</h2>
152168 }
153169 this . saveState ( ) ;
154170 this . updateDashboard ( ) ;
171+ } ,
172+ updateDashboard ( ) {
173+ const totalTutorials = Object . keys ( this . progress ) . length ;
174+ const completedTutorials = this . completed . length ;
175+ const menuItem = document . querySelector ( '.menu-item.tutorials' ) ;
176+
177+ menuItem . textContent = `🎓 Tutorials (${ completedTutorials } /${ totalTutorials } )` ;
178+ menuItem . style . color = completedTutorials === totalTutorials ? 'green' : 'red' ;
155179 }
156180 } ;
157181
@@ -192,29 +216,8 @@ <h2>Using the AgriTool</h2>
192216 document . querySelectorAll ( '.progress-fill' ) [ videoId === 'environment' ? 0 : 1 ] . style . width = '100%' ;
193217 }
194218 } ) ;
219+ tutorialState . updateDashboard ( ) ;
195220 } ) ;
196-
197- <!-- tutorials.html -->
198- document . addEventListener ( 'DOMContentLoaded' , ( ) => {
199- const tutorialsData = {
200- tutorials : [
201- {
202- title : 'Understanding Environmental Data' ,
203- description : 'Learn about the importance of environmental data.' ,
204- duration : 15 ,
205- completed : false
206- } ,
207- {
208- title : 'Using the AgriTool' ,
209- description : 'A comprehensive guide to using the AgriTool.' ,
210- duration : 20 ,
211- completed : false
212- }
213- ]
214- } ;
215- localStorage . setItem ( 'tutorialsData' , JSON . stringify ( tutorialsData ) ) ;
216- } ) ;
217-
218221 </ script >
219222</ body >
220223</ html >
0 commit comments