changed font size

This commit is contained in:
Harry Bomrah 2017-06-29 16:43:57 +08:00
parent 0e1123396b
commit 3203b35722
1 changed files with 1 additions and 2 deletions

View File

@ -191,12 +191,11 @@ class AnnouncementsController < ApplicationController
} }
end end
max = temp.max_by{|t| t["count"]}["count"] max = temp.max_by{|t| t["count"]}["count"]
min = temp.min_by{|t| t["count"]}["count"]
tags = [] tags = []
temp.each do |tag| temp.each do |tag|
if tag["count"] > 0 if tag["count"] > 0
percent = (tag["count"] * 100) / max percent = (tag["count"] * 100) / max
font_size = ((percent / 10).ceil) + 11 font_size = ((percent / 10).round) + 16
tag["font-size"] = font_size tag["font-size"] = font_size
tags << tag tags << tag
end end