calculator.css 2.3 KB

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