site.css 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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. /* Totals row header cell: click to cycle sum / average / both */
  125. #main-table .totals-row th.totals-toggle {
  126. cursor: pointer;
  127. }
  128. #main-table .totals-row th.totals-toggle:hover {
  129. background: #dde5f0;
  130. }
  131. /* "Both" mode: sum and average stacked in smaller font */
  132. .totals-row--both td {
  133. font-size: 0.75em;
  134. }
  135. .totals-row--both .totals-value {
  136. line-height: 1.3;
  137. }
  138. th {
  139. text-align: center;
  140. min-width: 40px;
  141. }
  142. td {
  143. text-align: right;
  144. position: relative;
  145. }
  146. td input.highlighted {
  147. background-color: lightblue;
  148. }
  149. td input {
  150. border: none;
  151. padding: 5px;
  152. width: 80px;
  153. }
  154. td input:hover {
  155. background-color: #ccc;
  156. }
  157. td input:focus {
  158. background-color: #ccf;
  159. }
  160. td input:not(:focus) {
  161. text-align: right;
  162. }
  163. /* ── Control bar ── */
  164. #control-bar {
  165. position: fixed;
  166. bottom: 0;
  167. left: 0;
  168. right: 0;
  169. height: var(--control-bar-height);
  170. display: flex;
  171. align-items: center;
  172. background: #f5f5f5;
  173. border-top: 1px solid #ccc;
  174. z-index: 999;
  175. }
  176. #bar-logo {
  177. height: var(--control-bar-height);
  178. width: 44px;
  179. flex-shrink: 0;
  180. display: flex;
  181. align-items: center;
  182. justify-content: center;
  183. border-right: 1px solid #ccc;
  184. }
  185. #bar-logo img {
  186. width: 100%;
  187. height: 100%;
  188. }
  189. .bar-btn {
  190. height: 100%;
  191. padding: 0 16px;
  192. border: none;
  193. border-right: 1px solid #ccc;
  194. background: none;
  195. cursor: pointer;
  196. font-size: 0.9em;
  197. color: #333;
  198. }
  199. .bar-btn:hover {
  200. background: #e8e8e8;
  201. }
  202. /* ── About modal ── */
  203. #about-modal-overlay {
  204. position: fixed;
  205. inset: 0;
  206. background: rgba(0, 0, 0, 0.45);
  207. z-index: 1000;
  208. display: flex;
  209. align-items: center;
  210. justify-content: center;
  211. padding: 16px;
  212. }
  213. #about-modal {
  214. background: white;
  215. border-radius: 8px;
  216. padding: 24px;
  217. max-width: 480px;
  218. width: 100%;
  219. max-height: 80vh;
  220. overflow-y: auto;
  221. box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  222. }
  223. #about-modal button {
  224. margin-top: 12px;
  225. padding: 8px 20px;
  226. border: 1px solid #ccc;
  227. border-radius: 4px;
  228. background: #f5f5f5;
  229. cursor: pointer;
  230. }
  231. #about-modal button:hover {
  232. background: #e0e0e0;
  233. }
  234. .smartborder {
  235. width: calc(100% + 2px);
  236. height: calc(100% + 2px);
  237. border: 3px solid blue;
  238. position: absolute;
  239. left: -4px;
  240. top: -4px;
  241. background: none;
  242. z-index: 999;
  243. /*pointer-events: none;*/
  244. }
  245. td input:not(:focus) + .smartborder {
  246. visibility: hidden;
  247. }
  248. .smartborder .button {
  249. --button-size: 20px;
  250. --half-button-size: 10px;
  251. /*pointer-events: all;/* TODO check this (what is "initial"?) */
  252. width: var(--button-size);
  253. height: var(--button-size);
  254. background-color: blue;
  255. color: white;
  256. border-radius: var(--half-button-size);
  257. position: absolute;
  258. }
  259. .extendrange.button {
  260. left: 100%;
  261. top: 100%;
  262. }
  263. .fillrange.button {
  264. top: 100%;
  265. left: calc(50% - var(--half-button-size));
  266. }
  267. .moverange.button {
  268. top: calc(50% - var(--half-button-size));
  269. left: calc(0px - var(--button-size));
  270. }
  271. .emptyrange.button {
  272. top: calc(0px - var(--button-size));
  273. left: calc(100% - var(--button-size) - 5px);
  274. }
  275. .deleterange.button {
  276. top: calc(0px - var(--button-size));
  277. left: 100%;
  278. }
  279. .copyrange.button {
  280. top: calc(0px - var(--button-size));
  281. left: 0;
  282. }