From e139b5a72b0248fc9abbeae1f5a283b0c135ddd2 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Wed, 24 Jul 2024 17:07:04 -0500 Subject: [PATCH] Still demo values, but make them stable --- app/helpers/splats_helper.rb | 10 ++++++++++ app/views/splats/_splat.html.erb | 2 +- app/views/splats/index.html.erb | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/helpers/splats_helper.rb b/app/helpers/splats_helper.rb index 403fba86f..e6c1fc3ed 100644 --- a/app/helpers/splats_helper.rb +++ b/app/helpers/splats_helper.rb @@ -1,2 +1,12 @@ module SplatsHelper + SPLAT_ROTATION = %w[90 80 75 60 45 35 25 5 -45 -40 -75] + SPLAT_SIZE = %w[20 18 16 14 12] + + def splat_rotation(splat) + "--splat-rotate: #{ SPLAT_ROTATION[Zlib.crc32(splat.to_param) % SPLAT_ROTATION.size] }deg;" + end + + def splat_size(splat) + "--splat-size: #{ SPLAT_SIZE[Zlib.crc32(splat.to_param) % SPLAT_SIZE.size] }cqi;" + end end diff --git a/app/views/splats/_splat.html.erb b/app/views/splats/_splat.html.erb index 50a8587ba..d754754a0 100644 --- a/app/views/splats/_splat.html.erb +++ b/app/views/splats/_splat.html.erb @@ -1,4 +1,4 @@ -
+
<%= link_to splat, class: "splat__link" do %>

<%= splat.title %>

diff --git a/app/views/splats/index.html.erb b/app/views/splats/index.html.erb index 035630b3b..0c5c7da0b 100644 --- a/app/views/splats/index.html.erb +++ b/app/views/splats/index.html.erb @@ -73,7 +73,7 @@ <% @splats.each do | splat | %>
  • <%= link_to splat, class: "flex align-center gap flex-item-grow" do %> -
    +
    <%= splat.title %>