Skip to content

Commit 90383dc

Browse files
Eric HurstEric Hurst
authored andcommitted
Fixed fat-finger error, styled with border-radius
1 parent a294e9b commit 90383dc

File tree

3 files changed

+34
-21
lines changed

3 files changed

+34
-21
lines changed

app/controllers/colors_controller.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ def index
77
def create
88
usernames = params[:usernames].gsub(/[@,]/,'').split(/[\s]/)
99

10-
if usernames != ""
11-
render :update do |page|
12-
page << "if($$('result')){"
13-
page.replace_html "results"
10+
unless usernames.empty?
11+
render :update do |page|
12+
page << "if($$('result')){"
13+
page.replace_html "results"
14+
page << "}"
15+
page.insert_html :top, "results", "<h3>Those are some nice colors!</h3>"
16+
17+
usernames.each do |username|
18+
@user = Twitter.user(username)
19+
page << "if($('fat_finger')){"
20+
page.visual_effect :fade, "fat_finger", :duration => "0.3"
1421
page << "}"
15-
page.insert_html :top, "results", "<h3>Those are some nice colors!</h3>"
16-
17-
usernames.each do |username|
18-
@user = Twitter.user(username)
19-
page << "if($('fat_finger')){"
20-
page.visual_effect :fade, "fat_finger", :duration => "0.3"
21-
page << "}"
22-
page.insert_html :bottom, "results", :partial => "result"
23-
page.visual_effect :highlight, "results", :startcolor => "#6CC", :endcolor => "#FFF"
24-
page[:entry_form].reset
25-
end
22+
page.insert_html :bottom, "results", :partial => "result"
23+
page.visual_effect :highlight, "results", :startcolor => "#6CC", :endcolor => "#FFF"
24+
page[:entry_form].reset
2625
end
26+
end
2727
else
2828
render :update do |page|
2929
page.insert_html :top, "header", "<div id='fat_finger'><h2>FAT FINGER ALERT: Hexminr requires a Twitter username</h2></div>"

app/views/colors/index.html.erb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<% form_remote_tag :url => {:controller => "colors", :action => "create"}, :html => {:id => "entry_form"} do -%>
22
<strong><%= label_tag :usernames, "Submit Twitter usernames &amp; get their color schemes back:" %></strong> <%= text_field_tag :usernames %> <%= submit_tag "Do it" %><br/>
3-
<span style="color: #bbb; font-style: italic; font-size: 70%; position:relative; left:469px;">(e.g. eh hexminr rails)</span>
3+
<span id="example">(e.g. eh hexminr rails)</span>
44
<% end -%>
55

6-
<div id="results"></div>
7-
8-
<span id="oneforty.i.1150"></span>
6+
<div id="results"></div>

public/stylesheets/hexminr.css

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ a:hover {
6262
text-align: center;
6363
padding: 1em;
6464
margin: 0 0 1em 0;
65+
border-right: 7px solid #AAA;
66+
border-bottom: 7px solid #AAA;
67+
border-left: 7px solid #AAA;
68+
-moz-border-radius-bottomright: 35px;
69+
-moz-border-radius-bottomleft: 35px;
70+
-webkit-border-bottom-left-radius: 35px;
71+
-webkit-border-bottom-right-radius: 35px;
6572
}
6673

6774
#container {
@@ -73,6 +80,14 @@ a:hover {
7380
margin: 2em 0;
7481
}
7582

83+
span#example {
84+
color: #bbb;
85+
font-style: italic;
86+
font-size: 70%;
87+
position: relative;
88+
left: 469px;
89+
}
90+
7691
.result {
7792
padding-top: 1.35em;
7893
margin-bottom: 0.75em;
@@ -96,11 +111,11 @@ ul.colors li {
96111
}
97112

98113
ul.colors li p {
99-
text-align:center;
114+
text-align: center;
100115
}
101116

102117
ul.colors li p.swatch {
103-
width:150px;
118+
width: 150px;
104119
height: 150px;
105120
}
106121

0 commit comments

Comments
 (0)