diff --git a/habit.php b/habit.php index d22adf3..4d0d022 100644 --- a/habit.php +++ b/habit.php @@ -691,6 +691,8 @@ } } + //print_r($dateArray); + // Find the longest streak of 0's in dateArray $currentStreak = 0; $longestStreak = 0; @@ -704,6 +706,9 @@ } } + // Check for a streak at the end of the array + $longestStreak = max($longestStreak, $currentStreak); + return $longestStreak; } diff --git a/habit.php b/habit.php index d22adf3..4d0d022 100644 --- a/habit.php +++ b/habit.php @@ -691,6 +691,8 @@ } } + //print_r($dateArray); + // Find the longest streak of 0's in dateArray $currentStreak = 0; $longestStreak = 0; @@ -704,6 +706,9 @@ } } + // Check for a streak at the end of the array + $longestStreak = max($longestStreak, $currentStreak); + return $longestStreak; } diff --git a/habit_ui.php b/habit_ui.php index 3c90ecb..31ecafb 100644 --- a/habit_ui.php +++ b/habit_ui.php @@ -45,7 +45,7 @@ - + @@ -90,11 +90,11 @@ $align = "bad"; $calCol = "#e81b1b"; $title1 = "Streak"; - $title2 = "Top"; - $title3 = "Total"; + $title2 = "Total"; + $title3 = "Top"; $result1 = habit_get_stat_missed($section['Activity'], $moodlog); - $result2 = habit_get_stat_top_missing($section['Activity'], $moodlog); - $result3 = habit_get_stat_year($section['Activity'], $moodlog); + $result2 = habit_get_stat_year($section['Activity'], $moodlog); + $result3 = habit_get_stat_top_missing($section['Activity'], $moodlog); } $todayCheck = habit_check_daily($section['Activity'], $moodlog); if ($todayCheck) { @@ -139,9 +139,9 @@
'.$section['Description'].'
-
'.$title1.'
'.$result1.'
-
'.$title2.'
'.$result2.'
-
'.$title3.'
'.$result3.'
+
'.$title1.'
'.$result1.'
+
'.$title2.'
'.$result2.'
+
'.$title3.'
'.$result3.'
'; diff --git a/habit.php b/habit.php index d22adf3..4d0d022 100644 --- a/habit.php +++ b/habit.php @@ -691,6 +691,8 @@ } } + //print_r($dateArray); + // Find the longest streak of 0's in dateArray $currentStreak = 0; $longestStreak = 0; @@ -704,6 +706,9 @@ } } + // Check for a streak at the end of the array + $longestStreak = max($longestStreak, $currentStreak); + return $longestStreak; } diff --git a/habit_ui.php b/habit_ui.php index 3c90ecb..31ecafb 100644 --- a/habit_ui.php +++ b/habit_ui.php @@ -45,7 +45,7 @@ - + @@ -90,11 +90,11 @@ $align = "bad"; $calCol = "#e81b1b"; $title1 = "Streak"; - $title2 = "Top"; - $title3 = "Total"; + $title2 = "Total"; + $title3 = "Top"; $result1 = habit_get_stat_missed($section['Activity'], $moodlog); - $result2 = habit_get_stat_top_missing($section['Activity'], $moodlog); - $result3 = habit_get_stat_year($section['Activity'], $moodlog); + $result2 = habit_get_stat_year($section['Activity'], $moodlog); + $result3 = habit_get_stat_top_missing($section['Activity'], $moodlog); } $todayCheck = habit_check_daily($section['Activity'], $moodlog); if ($todayCheck) { @@ -139,9 +139,9 @@
'.$section['Description'].'
-
'.$title1.'
'.$result1.'
-
'.$title2.'
'.$result2.'
-
'.$title3.'
'.$result3.'
+
'.$title1.'
'.$result1.'
+
'.$title2.'
'.$result2.'
+
'.$title3.'
'.$result3.'
'; diff --git a/habit_ui_style.css b/habit_ui_style.css index 9fbea16..94089ba 100644 --- a/habit_ui_style.css +++ b/habit_ui_style.css @@ -47,10 +47,6 @@ margin-top: -90px; margin-right: 90px; } -.habit-info{ - text-align: right; - font-size:1.6em; -} .good{ color: #58e81b;} .bad{ color: #e81b1b; } @@ -75,14 +71,30 @@ .button-bad{ background-color: #e81b1b; color:#000; } .button-neut{ background-color: #efe23e; color:#000; } -.habit-score{ - width:145px; - display:inline-block; - text-align: center; - font-size: 0.9em; +.habit-info { + text-align: right; + font-size: 1.6em; + display: flex; + justify-content: flex-end; } + +.habit-score { + width: 135px; + display: inline-block; + text-align: center; + font-size: 1.3em; + background-color: #222; + box-sizing: border-box; + margin-right: 0; + margin-left: 0; +} + .score-title{ font-weight:700; + font-size:0.8em; +} +.score-result{ + font-size: 1.5em; } .habit-cal-day, .habit-cal-week{ diff --git a/habit.php b/habit.php index d22adf3..4d0d022 100644 --- a/habit.php +++ b/habit.php @@ -691,6 +691,8 @@ } } + //print_r($dateArray); + // Find the longest streak of 0's in dateArray $currentStreak = 0; $longestStreak = 0; @@ -704,6 +706,9 @@ } } + // Check for a streak at the end of the array + $longestStreak = max($longestStreak, $currentStreak); + return $longestStreak; } diff --git a/habit_ui.php b/habit_ui.php index 3c90ecb..31ecafb 100644 --- a/habit_ui.php +++ b/habit_ui.php @@ -45,7 +45,7 @@ - + @@ -90,11 +90,11 @@ $align = "bad"; $calCol = "#e81b1b"; $title1 = "Streak"; - $title2 = "Top"; - $title3 = "Total"; + $title2 = "Total"; + $title3 = "Top"; $result1 = habit_get_stat_missed($section['Activity'], $moodlog); - $result2 = habit_get_stat_top_missing($section['Activity'], $moodlog); - $result3 = habit_get_stat_year($section['Activity'], $moodlog); + $result2 = habit_get_stat_year($section['Activity'], $moodlog); + $result3 = habit_get_stat_top_missing($section['Activity'], $moodlog); } $todayCheck = habit_check_daily($section['Activity'], $moodlog); if ($todayCheck) { @@ -139,9 +139,9 @@
'.$section['Description'].'
-
'.$title1.'
'.$result1.'
-
'.$title2.'
'.$result2.'
-
'.$title3.'
'.$result3.'
+
'.$title1.'
'.$result1.'
+
'.$title2.'
'.$result2.'
+
'.$title3.'
'.$result3.'
'; diff --git a/habit_ui_style.css b/habit_ui_style.css index 9fbea16..94089ba 100644 --- a/habit_ui_style.css +++ b/habit_ui_style.css @@ -47,10 +47,6 @@ margin-top: -90px; margin-right: 90px; } -.habit-info{ - text-align: right; - font-size:1.6em; -} .good{ color: #58e81b;} .bad{ color: #e81b1b; } @@ -75,14 +71,30 @@ .button-bad{ background-color: #e81b1b; color:#000; } .button-neut{ background-color: #efe23e; color:#000; } -.habit-score{ - width:145px; - display:inline-block; - text-align: center; - font-size: 0.9em; +.habit-info { + text-align: right; + font-size: 1.6em; + display: flex; + justify-content: flex-end; } + +.habit-score { + width: 135px; + display: inline-block; + text-align: center; + font-size: 1.3em; + background-color: #222; + box-sizing: border-box; + margin-right: 0; + margin-left: 0; +} + .score-title{ font-weight:700; + font-size:0.8em; +} +.score-result{ + font-size: 1.5em; } .habit-cal-day, .habit-cal-week{ diff --git a/index.php b/index.php index b449640..0140716 100755 --- a/index.php +++ b/index.php @@ -699,11 +699,11 @@ $align = "bad"; $calCol = "#e81b1b"; $title1 = "Streak"; - $title2 = "Top"; - $title3 = "Total (Year)"; + $title2 = "Total (Year)"; + $title3 = "Top"; $result1 = habit_get_stat_missed($section['Activity'], $moodlog); - $result2 = habit_get_stat_top_missing($section['Activity'], $moodlog); - $result3 = habit_get_stat_year($section['Activity'], $moodlog); + $result2 = habit_get_stat_year($section['Activity'], $moodlog); + $result3 = habit_get_stat_top_missing($section['Activity'], $moodlog); } $todayCheck = habit_check_daily($section['Activity'], $moodlog); if ($todayCheck) {