File tree 3 files changed +39
-2
lines changed
3 files changed +39
-2
lines changed Original file line number Diff line number Diff line change 19
19
< section class ="intro ">
20
20
< h1 class ="intro-title "> Good ${morning}!</ h1 >
21
21
< div class ="intro-time "> time</ div >
22
- < div class ="intro-dated "> date</ div >
22
+ < div class ="intro-date "> date</ div >
23
23
< p class ="intro-text "> </ p >
24
24
25
25
</ section >
@@ -34,6 +34,7 @@ <h1 class="intro-title">Good ${morning}!</h1>
34
34
35
35
</ footer >
36
36
< script src ="logic.js "> </ script >
37
+ < script src ="feature-intro.js "> </ script >
37
38
< script src ="feature-tube.js "> </ script >
38
39
< script src ="feature-meme.js "> </ script >
39
40
Original file line number Diff line number Diff line change @@ -33,9 +33,21 @@ const shadowedNames = [
33
33
function requiresShadow ( lineID ) {
34
34
return shadowedNames . includes ( lineID ) ;
35
35
}
36
+
37
+
38
+ function getTimeOfDay ( hour ) {
39
+ if ( hour > 5 && hour < 12 ) return "Morning" ;
40
+ if ( hour > 11 && hour < 18 ) return "Afternoon" ;
41
+ if ( hour > 17 && hour < 22 ) return "Evening" ;
42
+ return "Night"
43
+ }
44
+
45
+
46
+
47
+
36
48
// request("https://corporatebs-generator.sameerkumar.website/",function (response){
37
49
// console.log(response);
38
50
// });
39
51
if ( typeof module !== "undefined" ) {
40
- module . exports = { getStatusClass, requiresShadow } ;
52
+ module . exports = { getStatusClass, requiresShadow, getTimeOfDay } ;
41
53
}
Original file line number Diff line number Diff line change
1
+ const tape = require ( "tape" ) ;
2
+ const logic = require ( "../logic.js" ) ;
3
+
4
+ tape ( "Check if tape is working" , t => {
5
+ t . pass ( ) ;
6
+ t . end ( ) ;
7
+ } ) ;
8
+
9
+ tape ( "Check if getTimeOfDay returns Morning" , t => {
10
+
11
+ t . equal ( logic . getTimeOfDay ( 7 ) , "Morning" ) ;
12
+ t . equal ( logic . getTimeOfDay ( 9 ) , "Morning" ) ;
13
+ t . equal ( logic . getTimeOfDay ( 11 ) , "Morning" ) ;
14
+ t . end ( ) ;
15
+ } ) ;
16
+
17
+ tape ( "Check if getTimeOfDay returns Afternoon" , t => {
18
+
19
+ t . equal ( logic . getTimeOfDay ( 17 ) , "Afternoon" ) ;
20
+ t . equal ( logic . getTimeOfDay ( 15 ) , "Afternoon" ) ;
21
+ t . equal ( logic . getTimeOfDay ( 12 ) , "Afternoon" ) ;
22
+ t . end ( ) ;
23
+ } ) ;
24
+
You can’t perform that action at this time.
0 commit comments