A Pen by Lucille Blumire on CodePen.
Created
August 2, 2020 16:26
-
-
Save LLBlumire/d1a08f93772c27ce918cc47df2d98c48 to your computer and use it in GitHub Desktop.
LYGwwWQ
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
<div id="bar"> | |
<div id="patreon"></div> | |
<div id="drivethru"></div> | |
<div id="twitch"></div> | |
<div id="dayjob"></div> | |
<div id="unearned"></div> | |
</div> |
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
const target = 1500 | |
const earnings = { | |
twitch: 0, | |
patreon: 20, | |
drivethru: 0, | |
dayjob: 500, | |
} | |
for (let k of Object.keys(earnings)) { | |
document.getElementById(k).style.height = `${100 * (earnings[k]/target)}vh`; | |
} |
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
* { | |
margin: 0; | |
padding: 0; | |
} | |
#bar { | |
background-color: white; | |
width: 100vw; | |
height: 100vh; | |
display: flex; | |
flex-direction: column; | |
} | |
#bar div { | |
width: 100vw; | |
} | |
#patreon { | |
background-color: #FF5722; | |
} | |
#twitch { | |
background-color: #673AB7; | |
} | |
#unearned { | |
background-color: #9E9E9E; | |
flex-grow: 1; | |
} | |
#drivethru { | |
background-color: #F44336; | |
} | |
#dayjob { | |
background-color: #2196F3; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment