Skip to content

Commit

Permalink
Fixed arrow positions on new(ish) strength bar.
Browse files Browse the repository at this point in the history
Maintained old arrow positions for old lesson bar, which still shows in timed practice (at least for me).
  • Loading branch information
HodofHod committed Jan 12, 2015
1 parent 8968f6c commit f9b18f0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions duolingo-lesson-review.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @match *://www.duolingo.com/*
// @author HodofHod
// @namespace HodofHod
// @version 0.2.3
// @version 0.2.4
// ==/UserScript==

/*
Expand Down Expand Up @@ -288,13 +288,16 @@ function init(){
$('#prev-arrow, #next-arrow').remove();
var arrow = $('<span></span>').css({
background: 'url("//d7mj4aqfscim2.cloudfront.net/images/sprite_mv_082bd900117422dec137f596afcc1708.png") no-repeat',
width: '24px', height: '18px', float: 'left', 'pointer-events':'none', 'background-position': '-323px -130px'
width: '24px', height: '18px', position: 'absolute', 'pointer-events':'none', 'background-position': '-323px -130px'
});

var strength = $('.strength-bar').length;
$.each(['prev', 'next'], function(i, val){
var rotate = 'rotate('+(val==='prev'?'-':'')+'90deg)';
arrow.clone().attr('id', val +'-arrow').css({
margin: '31px 0 0' + (val==='prev' ?' -15px': ''),
top: strength ? '22px' : '31px',
left: val==='prev' ? (strength ? '80px' : '16px') : '' ,
right: val==='next' && strength ? '154px' : '',
transform: rotate, '-webkit-transform': rotate
})[(val==='prev' ? 'prepend' : 'append') + 'To']('#progress-bar');
});
Expand Down

0 comments on commit f9b18f0

Please sign in to comment.