Try a simple calculation to size bubbles by number activity

This commit is contained in:
Jason Zimdars
2024-08-20 10:55:54 -05:00
parent 4b5e2663a9
commit 34273f4ef7
+3 -2
View File
@@ -1,12 +1,13 @@
module SplatsHelper
SPLAT_ROTATION = %w[90 80 75 60 45 35 25 5 -45 -40 -75]
SPLAT_SIZE = %w[22 18 16 14]
SPLAT_SIZE = [14, 16, 18, 20, 22]
MIN_THRESHOLD = 7
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;"
"--splat-size: #{ SPLAT_SIZE.min_by { |size| (size - (splat.boosts.size + splat.comments.size + MIN_THRESHOLD)).abs } }cqi;"
end
end