Skip to content

Commit

Permalink
fix desgin
Browse files Browse the repository at this point in the history
  • Loading branch information
jugyo committed Jan 20, 2011
1 parent 802a0b7 commit fbd36a5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 28 deletions.
15 changes: 8 additions & 7 deletions views/index.slim
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,10 @@
h2 Example #welcome
span ➜ h2 Example
a href="/I%20am%20a%20pen!" "I am a pen!" span ➜
a href="/I%20am%20a%20pen!" "I am a pen!"


h2 by URL h2 by URL
img src="/by_url.png" img src="/by_url.png"


h2 by the Bookmarklet h2 by the Bookmarklet
img src="/by_bookmarklet.png" img src="/by_bookmarklet.png"
9 changes: 6 additions & 3 deletions views/layout.slim
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ html
h2 { color: #BBB; border-bottom: dashed 1px #CCC; font-size: 160%; } h2 { color: #BBB; border-bottom: dashed 1px #CCC; font-size: 160%; }
a { color: blue; text-decoration: none; } a { color: blue; text-decoration: none; }
a:hover { text-decoration: underline; } a:hover { text-decoration: underline; }
img { display: block; width: 96%; margin: 0 auto; } img { display: block; width: 100%; margin: 0 auto; }
#wrap { max-width: 600px; margin: 0 auto; } #wrap { max-width: 600px; margin: 0 auto; }
#footer { text-align: right; color: #999; clear: both; } #welcome { margin: 0 8px; }
#content { margin: 0 8px 12px 8px; }
#footer { text-align: right; color: #999; }
#footer ul { margin: 0; } #footer ul { margin: 0; }
#footer ul li { list-style: none; margin: 2px 2px; padding: 0; } #footer ul li { list-style: none; margin: 2px 2px; padding: 0; }
#powerd-by-google-translate-api { color: #666; font-size: 80%; text-align: right; } #powerd-by-google-translate-api { color: #666; font-size: 80%; text-align: right; }
#powerd-by-google-translate-api a { color: #666; } #powerd-by-google-translate-api a { color: #666; }
.source, .target { margin: 4px 8px; padding: 8px; border: solid 1px #CCC; border-radius: 8px; } .source, .target { margin: 2px 0; padding: 8px; border: solid 1px #CCC; border-radius: 8px; }
.arrow { text-align: center; color: #CCC; } .arrow { text-align: center; color: #CCC; }
.bookmarklet { font-weight: bold; } .bookmarklet { font-weight: bold; }
.created-by { font-size: 80%; } .created-by { font-size: 80%; }
.created-by a { color: #666; } .created-by a { color: #666; }
.clear { clear: both; }


body body
#wrap #wrap
Expand Down
40 changes: 22 additions & 18 deletions views/show.slim
Original file line number Original file line Diff line number Diff line change
@@ -1,21 +1,25 @@
.source = text #content
.source = text


.arrow ⬇ .arrow ⬇


.target .target
#google-translate-result ... #google-translate-result ...
#powerd-by-google-translate-api #powerd-by-google-translate-api
span powerd by span powerd by
a href="http://code.google.com/intl/ja/apis/language/translate/overview.html" Google Translate API a href="http://code.google.com/intl/ja/apis/language/translate/overview.html" Google Translate API


javascript:
function googleTranslate(response) { javascript:
var result = response.data.translations[0].translatedText; function googleTranslate(response) {
$('#google-translate-result').text(result); var result = response.data.translations[0].translatedText;
} $('#google-translate-result').text(result);
$(function() { }
$('<script>').attr({ $(function() {
type: "text/javascript", $('<script>').attr({
src: "https://www.googleapis.com/language/translate/v2?key=AIzaSyDf3VkeewjJd884BrTyOBiw-1KggQ0537g&source=#{source}&target=#{target}&callback=googleTranslate&q=#{text}" type: "text/javascript",
}).appendTo($('head')); src: "https://www.googleapis.com/language/translate/v2?key=AIzaSyDf3VkeewjJd884BrTyOBiw-1KggQ0537g&source=#{source}&target=#{target}&callback=googleTranslate&q=#{text}"
}); }).appendTo($('head'));
});
.clear

0 comments on commit fbd36a5

Please sign in to comment.