A tiny self-hostable "microjournaling" web app. Helps fill the void when abstaining from social media by encouraging journaling small thoughts throughout the day. # Requirements - web host with PHP
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

journal.css 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. /* Variables */
  2. :root {
  3. --page-background: #eee;
  4. --text-color: #000;
  5. --secondary-text-color: #888;
  6. --nav-background: #fff;
  7. --menu-background: #eee;
  8. --menu-border: #ccc;
  9. --menu-divider: #ddd;
  10. --secondary-button-color: #ccc;
  11. --post-background: #fff;
  12. --highlight: #c72;
  13. --highlight-contrast: #000;
  14. --error-text: #d00;
  15. --error-background: #fcc;
  16. --error-border: #400;
  17. --callout-text: #000;
  18. --callout-background: #ffc;
  19. --callout-border: #886;
  20. --destructive: #e00;
  21. --destructive-contrast: #fff;
  22. --font-size: 12pt;
  23. --font-ui: sans-serif;
  24. --font-text: Garamond, Times New Roman, serif;
  25. }
  26. @media (prefers-color-scheme: dark) {
  27. :root {
  28. --page-background: #222;
  29. --text-color: #fff;
  30. --secondary-text-color: #888;
  31. --nav-background: #444;
  32. --menu-background: #444;
  33. --menu-border: #000;
  34. --menu-divider: #282828;
  35. --secondary-button-color: #444;
  36. --post-background: #444;
  37. --highlight: #e94;
  38. --highlight-contrast: #000;
  39. }
  40. }
  41. @media screen and (max-width: 450px) {
  42. :root {
  43. --font-size: 19px;
  44. }
  45. }
  46. /* General */
  47. :root, input {
  48. font-family: var(--font-ui);
  49. font-size: var(--font-size);
  50. line-height: 1.25;
  51. }
  52. body, textarea, input, select {
  53. background-color: var(--page-background);
  54. color: var(--text-color);
  55. }
  56. body {
  57. margin: 0;
  58. padding: 0;
  59. }
  60. a {
  61. color: var(--highlight);
  62. text-decoration: none;
  63. }
  64. :focus {
  65. outline: var(--highlight) solid 2px;
  66. }
  67. .secondary-text {
  68. color: var(--secondary-text-color);
  69. font-size: 0.8rem;
  70. }
  71. /* Forms */
  72. .form-container {
  73. position: relative;
  74. text-align: center;
  75. margin-left: auto;
  76. margin-right: auto;
  77. }
  78. .form-container form {
  79. display: inline-block;
  80. text-align: start;
  81. }
  82. textarea {
  83. width: 100%;
  84. height: 8em;
  85. font-family: var(--font-text);
  86. font-size: 1rem;
  87. margin: 0;
  88. padding: 0.5em;
  89. border-radius: 0.2em;
  90. box-sizing: border-box;
  91. resize: vertical;
  92. }
  93. textarea::placeholder {
  94. font-size: 1rem;
  95. }
  96. .form-row {
  97. margin-bottom: 0.5em;
  98. }
  99. .form-buttons {
  100. margin-top: 0.5em;
  101. position: relative;
  102. min-height: 44px;
  103. }
  104. textarea, input[type="text"], input[type="search"], input[type="password"] {
  105. border: 1px solid var(--text-color);
  106. font-size: 20px;
  107. padding: 0.25em;
  108. }
  109. textarea:focus, input[type="text"]:focus, input[type="search"]:focus, input[type="password"]:focus {
  110. border: 1px solid transparent;
  111. }
  112. input[type="submit"] {
  113. -webkit-appearance: none;
  114. }
  115. a.pseudobutton {
  116. display: flex;
  117. align-items: center;
  118. justify-content: center;
  119. user-select: none;
  120. -webkit-user-select: none;
  121. -webkit-touch-callout: none;
  122. }
  123. input[type="submit"], .pseudobutton, .primary-button, .secondary-button {
  124. padding: 0.3em 1.5em;
  125. min-width: 12ch;
  126. min-height: 44px;
  127. border-radius: 0.2em;
  128. font-size: 1rem;
  129. box-sizing: border-box;
  130. text-align: center;
  131. }
  132. .primary-button {
  133. color: var(--highlight);
  134. border: 1px solid var(--highlight);
  135. }
  136. .primary-button:hover {
  137. background-color: var(--highlight);
  138. color: var(--highlight-contrast);
  139. }
  140. .secondary-button {
  141. color: var(--text-color);
  142. border: 1px solid var(--secondary-button-color);
  143. }
  144. .secondary-button:hover {
  145. background-color: var(--secondary-button-color);
  146. }
  147. .forward-button {
  148. float: right;
  149. float: inline-end;
  150. }
  151. .back-button {
  152. float: left;
  153. float: inline-start;
  154. }
  155. /* Menus */
  156. summary {
  157. /* prevent rapid clicking from selecting menu text */
  158. -webkit-user-select: none;
  159. user-select: none;
  160. }
  161. summary.no-indicator {
  162. list-style-type: none;
  163. }
  164. summary.no-indicator::-webkit-details-marker {
  165. display: none;
  166. }
  167. summary.menu-button:hover {
  168. color: var(--highlight);
  169. }
  170. summary.menu-button > span:first-child {
  171. display: inline-block;
  172. line-height: 1em;
  173. padding: 0.5rem 0.7em;
  174. margin: 0;
  175. border-radius: 0.5em;
  176. }
  177. summary:focus {
  178. outline-style: none;
  179. }
  180. details[open] summary.menu-button > span:first-child {
  181. background-color: var(--highlight);
  182. color: var(--highlight-contrast);
  183. }
  184. details.menu ul {
  185. position: relative;
  186. z-index: 2;
  187. margin: 0;
  188. padding: 0;
  189. list-style-type: none;
  190. border: 1px solid var(--menu-border);
  191. background-color: var(--menu-background);
  192. box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.25);
  193. text-align: start;
  194. font-size: 1rem;
  195. }
  196. details.menu li a {
  197. color: var(--highlight);
  198. font-weight: bolder;
  199. padding: 0.6em 1em;
  200. display: inline-block;
  201. position: relative;
  202. width: 10ch;
  203. }
  204. details.menu li a:hover {
  205. background-color: var(--highlight);
  206. color: var(--highlight-contrast);
  207. }
  208. details.menu li + li {
  209. border-top: 1px solid var(--menu-divider);
  210. }
  211. details.menu li.menu-divider {
  212. padding-top: 0.75em;
  213. }
  214. details.menu li.destructive a {
  215. color: var(--destructive);
  216. }
  217. details.menu li.destructive a:hover {
  218. background-color: var(--destructive);
  219. color: var(--destructive-contrast);
  220. }
  221. /* Navigation */
  222. .top-nav {
  223. position: fixed;
  224. top: 0;
  225. inset-inline-start: 0;
  226. inset-inline-end: 0;
  227. min-height: 44px;
  228. z-index: 1;
  229. text-align: center;
  230. background-color: var(--nav-background);
  231. box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.25);
  232. }
  233. .title-container {
  234. position: absolute;
  235. display: flex;
  236. align-items: center;
  237. justify-content: center;
  238. top: 0;
  239. bottom: 0;
  240. inset-inline-start: 0;
  241. inset-inline-end: 0;
  242. }
  243. .title {
  244. font-size: 1.2rem;
  245. font-weight: bold;
  246. line-height: 1.2rem;
  247. }
  248. .nav-menu-container {
  249. position: absolute;
  250. top: 0.1rem;
  251. right: 0;
  252. }
  253. .nav-menu-container summary {
  254. text-align: right;
  255. }
  256. .nav-menu-container .menu-button {
  257. font-size: 1.2rem;
  258. }
  259. /* Content container */
  260. .content {
  261. max-width: 66ch;
  262. margin: 3em auto 2em auto;
  263. padding: 0.5em;
  264. }
  265. /* Errors and alerts */
  266. .error {
  267. padding: 1em;
  268. border: 1px solid var(--error-border);
  269. background-color: var(--error-background);
  270. color: var(--error-text);
  271. font-weight: bold;
  272. margin-bottom: 1em;
  273. }
  274. .important {
  275. padding: 1em;
  276. border: 1px solid var(--callout-border);
  277. background-color: var(--callout-background);
  278. color: var(--callout-text);
  279. margin-bottom: 1em;
  280. }
  281. /* Post form */
  282. .submit-post {
  283. text-align: right;
  284. }
  285. /* Search */
  286. #search-form input[type="search"] {
  287. width: 100%;
  288. }
  289. /* Posts */
  290. .post-container {
  291. margin-top: 2.5rem;
  292. }
  293. .post {
  294. margin-top: 0.5em;
  295. margin-bottom: 2em;
  296. }
  297. .post-body {
  298. font-family: var(--font-text);
  299. background-color: var(--post-background);
  300. padding: 0.5em;
  301. box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25);
  302. }
  303. .post-body p {
  304. margin: 0 0 1em 0;
  305. }
  306. .post-body p:last-child {
  307. margin: 0;
  308. }
  309. .post-footer {
  310. margin-top: 0.5em;
  311. position: relative;
  312. }
  313. .post-actions {
  314. position: absolute;
  315. top: 0;
  316. inset-inline-end: 0;
  317. }
  318. .post-actions summary {
  319. text-align: end;
  320. }
  321. .post-actions summary > span:first-child {
  322. padding-top: 0;
  323. padding-bottom: 0;
  324. }
  325. details.menu li.post-action-delete a {
  326. color: var(--destructive);
  327. }
  328. details.menu li.post-action-delete a:hover {
  329. background-color: var(--destructive);
  330. color: var(--destructive-contrast);
  331. }
  332. .next {
  333. text-align: end;
  334. }