Skip to content

Commit

Permalink
Merge pull request #4459 from tibvdm/mario-icon
Browse files Browse the repository at this point in the history
It's a me Mario
  • Loading branch information
jorg-vr authored Mar 9, 2023
2 parents 3f15cac + f2390e0 commit 382632c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/stylesheets/base.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
// 6. Seasonal css sheets
@import "seasonal/christmas.css.scss";
@import "seasonal/valentine.css.scss";
@import "seasonal/mario-day.css.scss";

/* stylelint-disable-next-line selector-class-pattern */
.field_with_errors input {
Expand Down
22 changes: 22 additions & 0 deletions app/assets/stylesheets/seasonal/mario-day.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.series-icon.mario-day {
.overlay {
overflow: visible;
}

.overlay div {
content: "";
position: absolute;
width: 48px;
height: 48px;
margin-left: -4px;
background-size: contain;
background-repeat: no-repeat;
top: -21px;
}

&.completed:not(.deadline-missed) {
.overlay div {
content: url("seasonal/series_status_overlays/mario.svg");
}
}
}
5 changes: 5 additions & 0 deletions app/helpers/seasonal_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ def valentine(current_time)
current_time.month == 2 && current_time.day == 14
end

def mario_day(current_time)
current_time.month == 3 && current_time.day == 10
end

# returns seasonal class
def series_status_overlay
current_time = Time.now.in_time_zone(config.time_zone)

return 'christmas' if christmas(current_time)
return 'valentine' if valentine(current_time)
return 'mario-day' if mario_day(current_time)

nil
end
Expand Down

0 comments on commit 382632c

Please sign in to comment.