calculator.css 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. html {
  2. box-sizing: border-box;
  3. }
  4. *, *:before, *:after {
  5. box-sizing: inherit;
  6. }
  7. body {
  8. margin: 0;
  9. font: 100 14px 'Roboto';
  10. }
  11. button {
  12. display: block;
  13. background: none;
  14. border: none;
  15. padding: 0;
  16. font-family: inherit;
  17. user-select: none;
  18. cursor: pointer;
  19. outline: none;
  20. -webkit-tap-highlight-color: rgba(0,0,0,0);
  21. }
  22. button:active {
  23. box-shadow: inset 0px 0px 80px 0px rgba(0,0,0,0.25);
  24. }
  25. #wrapper {
  26. /* height: 100vh; */
  27. height: max-content;
  28. display: flex;
  29. align-items: center;
  30. justify-content: center;
  31. }
  32. #app {
  33. width: 320px;
  34. height: 520px;
  35. position: relative;
  36. }
  37. .calculator {
  38. width: 100%;
  39. height: 100%;
  40. background: black;
  41. display: flex;
  42. flex-direction: column;
  43. }
  44. #wrapper .calculator {
  45. box-shadow: 0px 0px 20px 0px #aaa;
  46. }
  47. .calculator-display {
  48. color: white;
  49. background: #1c191c;
  50. line-height: 130px;
  51. /* font-size: 6em; */
  52. font-size: 16px;
  53. font-size: 4vw;
  54. max-height: 160px;
  55. padding: 0 30px;
  56. /* height: 80px; */
  57. flex: 1;
  58. }
  59. .auto-scaling-text {
  60. display: inline-block;
  61. }
  62. .calculator-display .auto-scaling-text {
  63. /* padding: 0 30px; */
  64. /* position: absolute; */
  65. /* right: 0; */
  66. /* transform-origin: right; */
  67. }
  68. .calculator-keypad {
  69. height: 400px;
  70. display: flex;
  71. }
  72. .calculator .input-keys {
  73. width: 240px;
  74. }
  75. .calculator .function-keys {
  76. display: flex;
  77. }
  78. .calculator .digit-keys {
  79. background: #e0e0e7;
  80. display: flex;
  81. flex-direction: row;
  82. flex-wrap: wrap-reverse;
  83. }
  84. .calculator-key {
  85. width: 80px;
  86. height: 80px;
  87. border-top: 1px solid #777;
  88. border-right: 1px solid #666;
  89. text-align: center;
  90. line-height: 80px;
  91. }
  92. .calculator .function-keys .calculator-key {
  93. font-size: 2em;
  94. }
  95. .calculator .function-keys .key-multiply {
  96. line-height: 50px;
  97. }
  98. .calculator .digit-keys .calculator-key {
  99. font-size: 2.25em;
  100. }
  101. .calculator .digit-keys .key-0 {
  102. width: 160px;
  103. text-align: left;
  104. padding-left: 32px;
  105. }
  106. .calculator .digit-keys .key-dot {
  107. padding-top: 1em;
  108. font-size: 0.75em;
  109. }
  110. .calculator .operator-keys .calculator-key {
  111. color: white;
  112. border-right: 0;
  113. font-size: 3em;
  114. }
  115. .calculator .function-keys {
  116. background: linear-gradient(to bottom, rgba(202,202,204,1) 0%, rgba(196,194,204,1) 100%);
  117. }
  118. .calculator .operator-keys {
  119. background: linear-gradient(to bottom, rgba(252,156,23,1) 0%, rgba(247,126,27,1) 100%);
  120. }