Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. HTML:
  2. <div class='goal-cont'>
  3. <div class="title-enclosure">
  4. <div id='title'>Goal Name</div> - <div class="goal-total">TRY1200</div> (<div id='goal-end-date'>48 days to go</div>)
  5. </div>
  6. <div id='goal-bar'>
  7. </div>
  8. <div class="fake-goal-bar">
  9. <div class="goal-holder">
  10. <span id='goal'>0</span>
  11. </div>
  12. </div>
  13. </div>
  14.  
  15. CSS:
  16. .goal-holder,.title-enclosure{text-shadow:0 0 6px rgba(0,0,0,.67)}.goal-cont{background-image:url(https://image.ibb.co/dtPrgo/Yase_Donation_Holder.png);height:79px;width:697px;z-index:1;position:absolute;top:0;left:0;font-family:"Times New Roman",Times,serif}#goal-bar,.fake-goal-bar{height:44px;width:691px;left:3px;top:33px;position:absolute}.fake-goal-bar{z-index:5}#goal-bar{background:url(https://image.ibb.co/fakdu8/Yase_Donation_bar.png) bottom left no-repeat;z-index:2}.title-enclosure{text-transform:uppercase;z-index:3;position:absolute;left:60px;top:5px;font-size:14px;font-weight:400;color:#e7ecff}.title-enclosure div{display:inline-block}.goal-holder{z-index:4;position:absolute;color:#e8e6c5;font-size:23px;top:10px;right:13px;text-align:right}
  17.  
  18. JS:
  19. document.addEventListener("goalLoad",function(t){console.log(t.detail),$("#title").html(t.detail.title),$("#goal-current").text(t.detail.currency+t.detail.amount.current),$(".goal-total").text(t.detail.currency+t.detail.amount.target);var e=new Date,a=new Date(t.detail.to_go.ends_at),n=Math.ceil((a.getTime()-e.getTime())/864e5);$("#goal-end-date").text(n+" days to go");var o=t.detail.amount.current/t.detail.amount.target*100,l=(o=Math.round(100*o)/100,t.detail.currency+t.detail.amount.current+" ("+o+"%)");$("#goal").text(l),$("#goal-bar").width(o+"%")}),document.addEventListener("goalEvent",function(t){console.log(t.detail),$("#goal-current").text(t.detail.currency+t.detail.amount.current);var e=new Date,a=new Date(t.detail.to_go.ends_at),n=Math.ceil((a.getTime()-e.getTime())/864e5);$("#goal-end-date").text(n+" days to go");var o=t.detail.amount.current/t.detail.amount.target*100,l=(o=Math.round(100*o)/100,t.detail.currency+t.detail.amount.current+" ("+o+"%)");$("#goal").text(l),$("#goal-bar").width(o+"%")});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement