Created
January 12, 2016 13:06
-
-
Save Albirew/bd613af596447b1b64c1 to your computer and use it in GitHub Desktop.
Un vieux JS pour rediriger l'utilisateur selon sa résolution (surtout pour différencier les smartphones)
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
/*JavaScript Redirection based on Ratio*/ | |
var s = (screen.height/screen.width) | |
if (s==.75) | |
window.location.replace("/lol?somevars=4-3") // 4:3 | |
else if (s==.625) | |
window.location.replace("/lol?somevars=8-5") // 8:5 (16:10) | |
else if (s==.5625) | |
window.location.replace("/lol?somevars=16-9") // 16:9 | |
else if (s==.5294117647058824) | |
window.location.replace("/lol?somevars=17-9") // 17:9 | |
else if (s==.6) | |
window.location.replace("/lol?somevars=5-3") // 5:3 | |
else if (s==.8) | |
window.location.replace("/lol?somevars=5-4") // 5:4 | |
else if (s>1) | |
window.location.replace("/lol?somevars=smartphones") // resolutions smartphones/tablettes | |
else | |
window.location.replace("http://albirew.fr/lol?somevars=others") // 3:2 et autres resolutions a la con |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment