-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The flags indicate the current language and offers link to inverse language. - Add pry for Ruby Debug; - Create methods to list links; - Create logic with JavaScript to style of flags.
- Loading branch information
Showing
13 changed files
with
192 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var app = app || {}; | ||
|
||
app.langs = function() { | ||
I18n.init(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var I18n = I18n || {}; | ||
|
||
I18n.init = function() { | ||
var langs = new Array("/en", "guide", "guia"), | ||
pathname = window.location.pathname; | ||
|
||
for (var i = 0; i < langs.length; i++) { | ||
if (pathname.indexOf(langs[i]) > -1) { | ||
if (langs[i] === "/en" || langs[i] === "guide") { | ||
this.setEnglish(); | ||
} else { | ||
this.setPortuguese(); | ||
} | ||
} | ||
}; | ||
|
||
if (pathname === "/") { | ||
this.setPortuguese(); | ||
} | ||
} | ||
|
||
I18n.setEnglish = function() { | ||
this.addDisableClassLang("lang-pt"); | ||
document.documentElement.lang = "en"; | ||
} | ||
|
||
I18n.setPortuguese = function() { | ||
this.addDisableClassLang("lang-en"); | ||
document.documentElement.lang = "pt-BR"; | ||
} | ||
|
||
I18n.addDisableClassLang = function(el) { | ||
this.el = document.getElementById(el); | ||
this.el.className += " lang--is-disable"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.langs { | ||
position: fixed; | ||
top: $base-whitespace; | ||
right: $base-whitespace; | ||
z-index: 2; | ||
|
||
margin-top: 0; | ||
padding-left: 0; | ||
|
||
list-style-type: none; | ||
text-align: center; | ||
} | ||
|
||
.langs-item { | ||
display: inline-block; | ||
} | ||
|
||
.lang { | ||
display: block; | ||
width: 36px; | ||
height: 25px; | ||
|
||
background-repeat: no-repeat; | ||
@include background-size(contain); | ||
@include hide-text(); | ||
pointer-events: none; | ||
} | ||
|
||
.lang--en { | ||
background-image: image-url("united-kingdom.png"); | ||
} | ||
|
||
.lang--pt-br { | ||
background-image: image-url("brazil.png"); | ||
} | ||
|
||
.lang--is-disable { | ||
@include opacity(.5); | ||
@include filter(grayscale(1)); | ||
@include transition(all 300ms ease-in-out); | ||
pointer-events: initial; | ||
|
||
@include attention() { | ||
@include opacity(1); | ||
@include filter(grayscale(0)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters