site.css 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. :root {
  2. --control-bar-height: 44px;
  3. }
  4. /* html (not body) is the actual scrolling element on desktop, so the
  5. reserved space for the fixed control bar belongs on it: that's the
  6. ancestor position:sticky measures its offsets against. */
  7. html {
  8. padding-bottom: var(--control-bar-height);
  9. }
  10. body {
  11. font-family: 'Helvetica Neue', Verdana, Helvetica, Arial, sans-serif;
  12. max-width: 600px;
  13. margin: 0;
  14. -webkit-font-smoothing: antialiased;
  15. font-size: 1.125em;
  16. color: #333;
  17. line-height: 1.5em;
  18. }
  19. /* On narrow screens, contain scroll to the sheet area so position:fixed
  20. stays anchored to the viewport rather than the document bottom. */
  21. @media (max-width: 767px) {
  22. html, body {
  23. height: 100%;
  24. overflow: hidden;
  25. padding-bottom: 0; /* .sheet-container becomes the scrolling ancestor instead; see below */
  26. }
  27. #app {
  28. height: 100%;
  29. display: flex;
  30. flex-direction: column;
  31. }
  32. #main-layout {
  33. flex: 1;
  34. display: flex;
  35. flex-direction: column;
  36. min-height: 0;
  37. }
  38. .sheet-container {
  39. flex: 1;
  40. overflow: auto;
  41. min-height: 0;
  42. padding-bottom: var(--control-bar-height);
  43. }
  44. }
  45. h1, h2, h3 {
  46. color: #000;
  47. }
  48. h1 {
  49. font-size: 2.5em
  50. }
  51. h2 {
  52. font-size: 2em
  53. }
  54. h3 {
  55. font-size: 1.5em
  56. }
  57. a {
  58. text-decoration: none;
  59. color: #09f;
  60. }
  61. a:hover {
  62. text-decoration: underline;
  63. }
  64. #main-table {
  65. /*position: fixed;
  66. top: 0;
  67. left: 0;*/
  68. }
  69. table {
  70. border-collapse: separate;
  71. border-spacing: 0;
  72. border-top: 1px solid black;
  73. border-left: 1px solid black;
  74. }
  75. td, th {
  76. border-right: 1px solid black;
  77. border-bottom: 1px solid black;
  78. padding: 0;
  79. }
  80. /* Sticky column headers (top row) */
  81. #main-table tr:first-child th {
  82. position: sticky;
  83. top: 0;
  84. z-index: 1;
  85. background: white;
  86. }
  87. /* Sticky row headers (left column) */
  88. #main-table tr:not(:first-child) th {
  89. position: sticky;
  90. left: 0;
  91. z-index: 1;
  92. background: white;
  93. }
  94. /* Corner cell: sticky in both directions */
  95. #main-table tr:first-child th:first-child {
  96. left: 0;
  97. z-index: 2;
  98. }
  99. /* Totals row: pinned to the bottom of the viewport, just above the control bar.
  100. bottom:0 rests it flush against the scrolling ancestor's own reserved
  101. padding-bottom (html on desktop, .sheet-container on mobile) - deliberately
  102. not an explicit --control-bar-height offset here, so the space is only
  103. ever accounted for once. */
  104. #main-table .totals-row th,
  105. #main-table .totals-row td {
  106. position: sticky;
  107. bottom: 0;
  108. z-index: 1;
  109. background: #e8edf5;
  110. border-top: 2px solid #333;
  111. }
  112. /* Bottom-left corner: sticky in both directions, like the top-left corner cell */
  113. #main-table .totals-row th:first-child {
  114. z-index: 2;
  115. }
  116. .totals-row td {
  117. padding: 5px;
  118. text-align: right;
  119. font-weight: 600;
  120. }
  121. .totals-row .totals-error {
  122. color: #b00020;
  123. }
  124. th {
  125. text-align: center;
  126. min-width: 40px;
  127. }
  128. td {
  129. text-align: right;
  130. position: relative;
  131. }
  132. td input.highlighted {
  133. background-color: lightblue;
  134. }
  135. td input {
  136. border: none;
  137. padding: 5px;
  138. width: 80px;
  139. }
  140. td input:hover {
  141. background-color: #ccc;
  142. }
  143. td input:focus {
  144. background-color: #ccf;
  145. }
  146. td input:not(:focus) {
  147. text-align: right;
  148. }
  149. /* ── Control bar ── */
  150. #control-bar {
  151. position: fixed;
  152. bottom: 0;
  153. left: 0;
  154. right: 0;
  155. height: var(--control-bar-height);
  156. display: flex;
  157. align-items: center;
  158. background: #f5f5f5;
  159. border-top: 1px solid #ccc;
  160. z-index: 999;
  161. }
  162. #bar-logo {
  163. height: var(--control-bar-height);
  164. width: 44px;
  165. flex-shrink: 0;
  166. display: flex;
  167. align-items: center;
  168. justify-content: center;
  169. border-right: 1px solid #ccc;
  170. }
  171. #bar-logo img {
  172. width: 100%;
  173. height: 100%;
  174. }
  175. .bar-btn {
  176. height: 100%;
  177. padding: 0 16px;
  178. border: none;
  179. border-right: 1px solid #ccc;
  180. background: none;
  181. cursor: pointer;
  182. font-size: 0.9em;
  183. color: #333;
  184. }
  185. .bar-btn:hover {
  186. background: #e8e8e8;
  187. }
  188. /* ── About modal ── */
  189. #about-modal-overlay {
  190. position: fixed;
  191. inset: 0;
  192. background: rgba(0, 0, 0, 0.45);
  193. z-index: 1000;
  194. display: flex;
  195. align-items: center;
  196. justify-content: center;
  197. padding: 16px;
  198. }
  199. #about-modal {
  200. background: white;
  201. border-radius: 8px;
  202. padding: 24px;
  203. max-width: 480px;
  204. width: 100%;
  205. max-height: 80vh;
  206. overflow-y: auto;
  207. box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  208. }
  209. #about-modal button {
  210. margin-top: 12px;
  211. padding: 8px 20px;
  212. border: 1px solid #ccc;
  213. border-radius: 4px;
  214. background: #f5f5f5;
  215. cursor: pointer;
  216. }
  217. #about-modal button:hover {
  218. background: #e0e0e0;
  219. }
  220. .smartborder {
  221. width: calc(100% + 2px);
  222. height: calc(100% + 2px);
  223. border: 3px solid blue;
  224. position: absolute;
  225. left: -4px;
  226. top: -4px;
  227. background: none;
  228. z-index: 999;
  229. /*pointer-events: none;*/
  230. }
  231. td input:not(:focus) + .smartborder {
  232. visibility: hidden;
  233. }
  234. .smartborder .button {
  235. --button-size: 20px;
  236. --half-button-size: 10px;
  237. /*pointer-events: all;/* TODO check this (what is "initial"?) */
  238. width: var(--button-size);
  239. height: var(--button-size);
  240. background-color: blue;
  241. color: white;
  242. border-radius: var(--half-button-size);
  243. position: absolute;
  244. }
  245. .extendrange.button {
  246. left: 100%;
  247. top: 100%;
  248. }
  249. .fillrange.button {
  250. top: 100%;
  251. left: calc(50% - var(--half-button-size));
  252. }
  253. .moverange.button {
  254. top: calc(50% - var(--half-button-size));
  255. left: calc(0px - var(--button-size));
  256. }
  257. .emptyrange.button {
  258. top: calc(0px - var(--button-size));
  259. left: calc(100% - var(--button-size) - 5px);
  260. }
  261. .deleterange.button {
  262. top: calc(0px - var(--button-size));
  263. left: 100%;
  264. }
  265. .copyrange.button {
  266. top: calc(0px - var(--button-size));
  267. left: 0;
  268. }