[WIP] add first draft of shecoded 2018 social image (#50)
* add first draft of shecoded 2018 social image * Use conditionally first name and 50/60 font size
This commit is contained in:
parent
01246fdde0
commit
efe9b56c9a
1 changed files with 10 additions and 3 deletions
|
|
@ -19,9 +19,16 @@ class GeneratedImage
|
|||
end
|
||||
|
||||
def she_coded_image_path(article)
|
||||
path = cl_image_path(article.user.profile_image_url || "http://41orchard.com/wp-content/uploads/2011/12/Robot-Chalkboard-Decal.gif", :sign_url=>true, :type=>"fetch", :transformation=>[
|
||||
{:height=>520, :width=>420, :crop=>"imagga_scale"},
|
||||
{:effect=>"sharpen:50", :gravity=>"east", :underlay=>"nevertheless-shecoded-2_q0c81o"}
|
||||
user_name = article.user.name.length >= 15 ? article.user.name.split(" ").first : article.user.name
|
||||
she_coded_font_size = user_name.length >= 10 ? 50 : 60
|
||||
path = cl_image_path(article.user.profile_image_url || "http://41orchard.com/wp-content/uploads/2011/12/Robot-Chalkboard-Decal.gif",
|
||||
sign_url: true, type: "fetch", transformation: [
|
||||
{ height: 150, width: 150, radius: "max", crop: "imagga_scale" },
|
||||
{ underlay: "nevertheless-she-coded-08_vbwnoc", x: "280", y: "10" },
|
||||
{ overlay: "text:NixieOne.ttf_#{she_coded_font_size}_normal_normal_normal_left_FFFFFF_2:Nevertheless%252C%0A#{user_name}%20Coded", color: "#FFFFFF", gravity: "east", x: "50", y: "-10", bo: "FFFFFF_2" },
|
||||
# font is Nixie One.
|
||||
# Since there isn't a bold version I had to add a stroke onto the text.
|
||||
# It's 1.25pt on the "nevertheless" and 2pt on the "she coded", #FFFFFF.
|
||||
])
|
||||
"#{path}?shecoded&t=#{Time.now.to_i}"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue