diff --git a/index.js b/index.js new file mode 100644 index 0000000..c2aa1a8 --- /dev/null +++ b/index.js @@ -0,0 +1,12 @@ +const button = document.getElementById('top'); + +let opacity = 0; +button.style.opacity = opacity; +window.addEventListener('scroll', function() { + + const scrollPosition = window.scrollY / (document.documentElement.scrollHeight - window.innerHeight); + + opacity = scrollPosition; + + button.style.opacity = opacity; +}); \ No newline at end of file diff --git a/problem4.css b/problem4.css index 3823cb2..7e573bf 100644 --- a/problem4.css +++ b/problem4.css @@ -1,126 +1,173 @@ - -h1{ - background-color:rgb(180, 238, 219); color:black; - text-align: center; - width: 50%; - border-bottom: 2px solid gray; - margin:0px auto 15px auto; -} -.totalsum{ - border-radius:20px; - border: 5px solid black; - background-color: rgb(180, 238, 219); color:black; - text-align: center; - width:50%; height:100%; - margin:0 auto 0 auto; -} -.totalsum p{ - font-size:40px; - margin-bottom:15px; -} -h3{ - margin:5px 0 5px 0; -} -div.total -{ - display: flex; - justify-content: space-evenly; - margin-bottom: 10px; - } -div.allincome{ - color:blue; -} -span.plus-button { - display:inline-block; - width:20px; - height:20px; - border-radius: 100%; - border-color: black; - border: 1px solid; - font-size: 14px; - background-color: aliceblue; -} -div.alloutcome{ - color:red; +h1 { + background-color: rgb(180, 238, 219); + color: black; + text-align: center; + width: 50%; + border-bottom: 2px solid gray; + margin: 0px auto 15px auto; +} +.totalsum { + border-radius: 20px; + border: 5px solid black; + background-color: rgb(180, 238, 219); + color: black; + text-align: center; + width: 50%; + height: 100%; + margin: 0 auto 0 auto; +} +.totalsum p { + font-size: 40px; + margin: 0px 0 15px 0; +} +h3 { + margin: 5px 0 5px 0; +} +div.total { + display: flex; + justify-content: space-evenly; + margin-bottom: 10px; +} +div.allincome { + color: blue; +} +span.plus-button { + display: inline-block; + width: 20px; + height: 20px; + border-radius: 100%; + border-color: black; + border: 1px solid; + font-size: 14px; + background-color: aliceblue; +} +div.alloutcome { + color: red; } span.minus-button { - display:inline-block; - width: 20px; - height: 20px; - border-radius: 100%; - border-color: black; - border: 1px solid; - font-size: 14px; - background-color: aliceblue; + display: inline-block; + width: 20px; + height: 20px; + border-radius: 100%; + border-color: black; + border: 1px solid; + font-size: 14px; + background-color: aliceblue; } div.date { - box-sizing: border-box; - width:50%; margin:30px auto 0 auto; - display:flex; - justify-content: center; - border-top: solid 2px; - border-color: gray; - padding:10px 0 20px 0; -} -button.left, .right{ - border:none; - background-color: white; + box-sizing: border-box; + width: 50%; + margin: 30px auto 0 auto; + display: flex; + justify-content: center; + border-top: solid 2px; + border-color: gray; + padding: 10px 0 20px 0; +} +button.left, +.right { + border: none; + background-color: white; } section.main { - box-sizing: border-box; - width:50%; - margin:0 auto 0 auto; - display: flex; - flex-direction: row; - justify-content: space-between; - border-bottom: solid 1px; - padding-bottom: 20px; - border-color: rgb(190, 188, 188); -} -button.income, button.outcome { - border-radius: 10px; - background-color: rgb(17, 127, 90); - color:white; + box-sizing: border-box; + width: 50%; + margin: 0 auto 0 auto; + display: flex; + flex-direction: row; + justify-content: space-between; + border-bottom: solid 1px; + padding-bottom: 20px; + border-color: rgb(190, 188, 188); +} +button.income, +button.spend { + border: none; + background-color: white; +} +div.item { + box-sizing: border-box; + width: 50%; + margin: 15px auto 10px auto; + display: flex; + justify-content: space-between; + border-radius: 30px; + background-color: rgb(180, 238, 219); + color: black; + padding: 15px; +} +.category { + font-size: 14px; +} +section.details { + height: 400px; + overflow-y: scroll; + width: 50%; + margin: 0 auto 0 auto; +} +.money_minus { + color: red; +} +.money_plus { + color: blue; +} +button.x { + border: none; + background-color: rgb(180, 238, 219); +} +footer { + width: 50%; + margin: 0 auto 0 auto; + background-color: rgb(180, 238, 219); + border-radius: 5rem; + height: 2rem; +} +div.plus_button { + display: flex; + justify-content: center; + text-align: center; + height: 2rem; +} +.last { + display: inline-block; + width: 10%; + border: none; + margin: 0; + padding: 0; + border-radius: 5rem; + background-color: rgb(112, 179, 112); +} + +.modal { + display: none; + position: fixed; + z-index: 1; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgba(0, 0, 0, 0.4); +} + +.modal-content { + background-color: #fefefe; + margin: 15% auto; + padding: 20px; + border: 1px solid #888; + width: 80%; +} + +.close { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} +.close:hover, +.close:focus { + color: black; + text-decoration: none; + cursor: pointer; } -button.income:hover, button.outcome:hover { - background-color:pink; - color:black; -} -div.item{ - box-sizing: border-box; - width:50%; - margin:15px auto 10px auto; - display: flex; - justify-content: space-between; - border-radius: 30px; - background-color: rgb(180, 238, 219); - color:black; padding:15px; -} -.category{ - font-size: 14px; -} -section.details{ - height: 400px; - overflow-y: scroll; - width:50%; - margin:0 auto 0 auto; -} -.money_minus{ - color:red; -} -.money_plus{ - color:blue; -} -button.x{ - border:none; - background-color: rgb(180, 238, 219); -} -footer.plus_button{ - text-align: center; -} -button.last{ - display:inline-block; - width:50%; - margin:0 auto 0 auto; -} \ No newline at end of file diff --git a/problem4.html b/problem4.html index 2a56a7d..2eb8c3f 100644 --- a/problem4.html +++ b/problem4.html @@ -1,69 +1,73 @@ -
- - - + + + +71000
-0
+