From 4e410b98707356411cb87f5a73b193b69b4af375 Mon Sep 17 00:00:00 2001 From: Roomote Date: Tue, 28 Apr 2026 16:02:23 +0000 Subject: [PATCH] feat: add animated rainbow homepage background --- app/assets/stylesheets/application.css | 30 ++++++++++++++++++++++++ app/views/home/index.html.erb | 2 +- test/controllers/home_controller_test.rb | 10 ++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 test/controllers/home_controller_test.rb diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 1bc8ecd..994379b 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -7,3 +7,33 @@ body { margin: 0; padding: 0; } + +.rainbow-cycle-bg { + background: linear-gradient( + 135deg, + #ff0000, + #ff7f00, + #ffff00, + #00ff00, + #0000ff, + #4b0082, + #8b00ff, + #ff0000 + ); + background-size: 400% 400%; + animation: rainbow-cycle 12s linear infinite; +} + +@keyframes rainbow-cycle { + 0% { + background-position: 0% 50%; + } + + 50% { + background-position: 100% 50%; + } + + 100% { + background-position: 0% 50%; + } +} diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 74fa0aa..f9d4251 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,6 +1,6 @@ <%= turbo_stream_from "counter" %> -
+

Hello, World!

Rails 8 Full Stack Demo

diff --git a/test/controllers/home_controller_test.rb b/test/controllers/home_controller_test.rb new file mode 100644 index 0000000..42361e3 --- /dev/null +++ b/test/controllers/home_controller_test.rb @@ -0,0 +1,10 @@ +require "test_helper" + +class HomeControllerTest < ActionDispatch::IntegrationTest + test "root page uses the rainbow background" do + get root_url + + assert_response :success + assert_includes response.body, "rainbow-cycle-bg" + end +end