From 1ca53ceb0c0bbdb8115ce7781efebf7c11b51511 Mon Sep 17 00:00:00 2001 From: Maciej Gomola Date: Thu, 17 Oct 2024 16:38:32 +0200 Subject: [PATCH] Settings menu now works, although being unfinished --- static/assets/css/style.css | 26 +++++++++++++++++++++++++- static/assets/js/calculator-logic.js | 6 ++++++ static/index.html | 6 ++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/static/assets/css/style.css b/static/assets/css/style.css index df93c91..19c2941 100644 --- a/static/assets/css/style.css +++ b/static/assets/css/style.css @@ -53,7 +53,6 @@ button { font-optical-sizing: auto; font-weight: 400; font-style: normal; - user-select: none; transform: scale(1.2); filter: blur(10px); @@ -83,4 +82,29 @@ body.history-open .calculator { transform: scale(0.8); filter: blur(10px); opacity: 0.4; +} + +.settings-container { + position: absolute; + width: 100%; + height: 80%; + bottom: -80%; + left: 0; + + font-family: "IBM Plex", sans-serif; + font-optical-sizing: auto; + font-weight: 400; + font-style: normal; + + z-index: 150; + + transition: all 0.4s; +} + +body.settings-open .settings-container { + bottom: 0; +} + +body.settings-open .calculator { + transform: translateY(-80%); } \ No newline at end of file diff --git a/static/assets/js/calculator-logic.js b/static/assets/js/calculator-logic.js index 086104d..2a47c1a 100644 --- a/static/assets/js/calculator-logic.js +++ b/static/assets/js/calculator-logic.js @@ -13,6 +13,8 @@ buttons.forEach(button => { resetCalculator(); } else if (value === 'H') { toggleHistory(); + } else if (value === '') { + toggleSettings(); } else if (value === '=') { calculateResult(); } else { @@ -134,6 +136,10 @@ function toggleHistory() { } } +function toggleSettings() { + $('body').toggleClass('settings-open'); +} + $('#history').on('click', toggleHistory); function clearDisplay() { diff --git a/static/index.html b/static/index.html index bf28180..5d38301 100644 --- a/static/index.html +++ b/static/index.html @@ -50,6 +50,12 @@ +
+ Kolor tła:
+ Kolor tekstu:
+ Kolor podstawowy:
+ Kolor alternatywny: +