calculator.css 2.1 KB

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