diff --git a/app/helpers/posts_helper.rb b/app/helpers/posts_helper.rb index 4c099c7bc..3e8f35583 100644 --- a/app/helpers/posts_helper.rb +++ b/app/helpers/posts_helper.rb @@ -41,4 +41,8 @@ module PostsHelper source end end + + def is_danbirthday?(post) + post.id == 1 && post.created_at.strftime("%m-%d") == Time.zone.today.strftime("%m-%d") + end end diff --git a/app/javascript/src/styles/specific/posts.scss b/app/javascript/src/styles/specific/posts.scss index 057e7121e..fba8ce4d4 100644 --- a/app/javascript/src/styles/specific/posts.scss +++ b/app/javascript/src/styles/specific/posts.scss @@ -159,6 +159,16 @@ div#c-posts { .image-container { margin: 1em 0 0.5em; + + &.danbirthday::before { + content: ""; + position: absolute; + left: 33%; + top: -16%; + width: 100%; + height: 100%; + background: top left/20% no-repeat url(../../../../../public/images/danbirthday.png); + } } #favlist { diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index 23d4dbd93..f23d3a8b6 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -44,7 +44,7 @@ <%= render "posts/partials/show/notices", :post => @post %> - <%= content_tag(:section, class: "image-container note-container", **PostPreviewComponent.new(post: @post).data_attributes) do -%> + <%= tag.section class: ["image-container", "note-container", ("danbirthday" if is_danbirthday?(@post))], **PostPreviewComponent.new(post: @post).data_attributes do -%> <%= render "posts/partials/show/embedded", post: @post %>
<% end -%> diff --git a/public/images/danbirthday.png b/public/images/danbirthday.png new file mode 100755 index 000000000..73c2c4c51 Binary files /dev/null and b/public/images/danbirthday.png differ