main.css 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <style type="text/css">
  2. @charset "UTF-8";
  3. /* the geometry of the page */
  4. /* the size of the crop marks*/
  5. /* the size of bleed */
  6. /**
  7. * Computation
  8. */
  9. /* EXTRA SPACE AROUND THE PAGE: BLEED + CROP */
  10. /* GEOMETRY OF THE PAPER SHEET */
  11. /* SIZE OF SPREAD */
  12. /**
  13. * DEFINITION OF THE PAPER SHEET
  14. */
  15. @page {
  16. size: 234mm 315mm;
  17. margin: 0; }
  18. /**
  19. * CANVAS
  20. */
  21. @media all {
  22. body {
  23. margin: 0; }
  24. .paper {
  25. width: 234mm;
  26. height: 314mm;
  27. box-sizing: border-box;
  28. counter-increment: page-counter;
  29. page-break-inside: avoid;
  30. page-break-after: always;
  31. overflow: hidden;
  32. /* Crop marks */
  33. padding: 12mm;
  34. position: relative; }
  35. .paper .crops {
  36. width: 234mm;
  37. height: 314mm;
  38. position: absolute;
  39. top: 0;
  40. left: 0; }
  41. .paper .crops div {
  42. border-style: solid;
  43. border-color: black;
  44. border-width: 0;
  45. width: 12mm;
  46. height: 12mm;
  47. position: absolute;
  48. box-sizing: border-box; }
  49. .paper .crops div span {
  50. width: 5mm;
  51. height: 5mm;
  52. background-color: white;
  53. position: absolute; }
  54. .paper .crops .crop-top-left {
  55. border-right-width: 1px;
  56. border-bottom-width: 1px;
  57. top: 0;
  58. left: 0; }
  59. .paper .crops .crop-top-left span {
  60. right: -1px;
  61. bottom: -1px; }
  62. .paper .crops .crop-top-right {
  63. border-left-width: 1px;
  64. border-bottom-width: 1px;
  65. top: 0;
  66. right: 0; }
  67. .paper .crops .crop-top-right span {
  68. left: -1px;
  69. bottom: -1px; }
  70. .paper .crops .crop-bottom-right {
  71. border-left-width: 1px;
  72. border-top-width: 1px;
  73. right: 0;
  74. bottom: 0; }
  75. .paper .crops .crop-bottom-right span {
  76. left: -1px;
  77. top: -1px; }
  78. .paper .crops .crop-bottom-left {
  79. border-right-width: 1px;
  80. border-top-width: 1px;
  81. left: 0;
  82. bottom: 0; }
  83. .paper .crops .crop-bottom-left span {
  84. right: -1px;
  85. top: -1px; }
  86. .page {
  87. width: 210mm;
  88. height: 290mm;
  89. position: relative;
  90. box-sizing: border-box;
  91. overflow: hidden; }
  92. .spread .paper {
  93. float: left; }
  94. .spread .paper:nth-child(odd) {
  95. margin-left: -12mm; }
  96. .spread .paper:nth-child(even) {
  97. margin-right: -12mm; }
  98. .spread .paper:first-child {
  99. margin-left: 210mm; } }
  100. @media print {
  101. html {
  102. width: 234mm; }
  103. body {
  104. /* Allows printing of background colors */
  105. background-color: white;
  106. -webkit-print-color-adjust: exact;
  107. print-color-adjust: exact;
  108. /* Activate opentype features and kernings */
  109. -webkit-font-feature-settings: "liga", "dlig", "clig", "kern";
  110. text-rendering: optimizeLegibility; } }
  111. /**
  112. * Helpers
  113. */
  114. .region-break {
  115. /* Apply this class to an element to put it on a new region.
  116. * Hint:
  117. * You can also use an empty <div class="page-break"></div>
  118. * if you want to put manual page breaks without attaching it to an HTML element
  119. */
  120. -webkit-region-break-before: always;
  121. break-before: always; }
  122. .header,
  123. .body,
  124. .footer {
  125. box-sizing: border-box; }
  126. /* __________________________________ HEADER __________________________________ */
  127. .header {
  128. top: 0;
  129. margin: 0;
  130. padding-top: 10mm;
  131. width: 100%;
  132. height: 10mm;
  133. text-align: left; }
  134. .header:after {
  135. content: "TDSM"; }
  136. /* __________________________________ MAIN SECTION __________________________________ */
  137. .body {
  138. height: 270mm;
  139. width: 210mm;
  140. margin-bottom: 15mm;
  141. padding-top: 20mm;
  142. padding-bottom: 15mm;
  143. position: absolute; }
  144. .recipient {
  145. -webkit-flow-from: myStory;
  146. flow-from: myStory; }
  147. #my-story {
  148. -webkit-flow-into: myStory;
  149. flow-into: myStory; }
  150. /* __________________________________ FOOTER __________________________________ */
  151. .footer {
  152. position: absolute;
  153. bottom: 0;
  154. margin: 0;
  155. width: 100%;
  156. height: 10mm;
  157. text-align: center; }
  158. .footer:after {
  159. content: counter(page-counter); }
  160. /* mirrored pages */
  161. .paper:nth-child(odd) .header {
  162. text-align: right; }
  163. .paper:nth-child(odd) .header,
  164. .paper:nth-child(odd) .body,
  165. .paper:nth-child(odd) .footer {
  166. padding-left: 20mm;
  167. padding-right: 10mm; }
  168. .paper:nth-child(even) .header,
  169. .paper:nth-child(even) .body,
  170. .paper:nth-child(even) .footer {
  171. padding-left: 10mm;
  172. padding-right: 20mm; }
  173. img {
  174. max-width: 100%; }
  175. h1,
  176. h2,
  177. h3,
  178. h4,
  179. h5,
  180. h6 {
  181. /* Avoids headings to be cut or to be orphans.
  182. * But it doesn't seem to work
  183. * if the element after has a page-break-inside avoid. It tries its best! */
  184. -webkit-region-break-inside: avoid;
  185. break-inside: avoid;
  186. -webkit-region-break-after: avoid;
  187. break-after: avoid; }
  188. /* AN EXAMPLE TO AVOID PAGE BREAK INSIDE,
  189. * HERE NO PARAGRAPH WILL BE CUT,
  190. * BUT YOU MIGHT WANT TO DEACTIVATE THIS */
  191. p {
  192. /*-webkit-region-break-inside: avoid;*/
  193. /* break-inside: avoid;*/ }
  194. /**
  195. * DEBUG STYLES
  196. */
  197. .debug .header {
  198. outline: 1px solid pink; }
  199. .debug .body {
  200. outline: 1px solid purple; }
  201. .debug .footer {
  202. outline: 1px solid pink; }
  203. .debug .region-break {
  204. border-top: 1px dashed blue;
  205. box-sizing: border-box; }
  206. .debug img {
  207. outline: 1px solid blue; }
  208. /**
  209. * User Interface
  210. */
  211. @media screen {
  212. body {
  213. background-color: #F0F0F0; }
  214. #pages {
  215. width: 234mm;
  216. height: 314mm;
  217. margin-left: auto;
  218. margin-right: auto; }
  219. .spread #pages {
  220. width: 468mm;
  221. height: 628mm; }
  222. .paper {
  223. /* centrer la page à l'écran */
  224. background-color: white;
  225. margin-top: 1em;
  226. margin-bottom: 1em; }
  227. .normal .page {
  228. outline: 1px dashed lightsalmon; }
  229. .preview .paper {
  230. background: none; }
  231. .preview .page {
  232. outline: 1px solid lightgray;
  233. background-color: white; }
  234. .preview .crops {
  235. visibility: hidden; }
  236. .button {
  237. z-index: 1000;
  238. background-color: black;
  239. font-family: sans-serif;
  240. text-transform: uppercase;
  241. font-size: 9pt !important;
  242. letter-spacing: 1pt;
  243. color: white;
  244. margin: 0;
  245. padding: 5pt 7pt;
  246. cursor: pointer;
  247. border: 0; }
  248. .button:hover {
  249. background-color: white;
  250. color: black;
  251. outline: 1pt solid black; }
  252. .button-active {
  253. background-color: white;
  254. color: black;
  255. outline: 1pt solid black; }
  256. .lo-res {
  257. outline: 10px solid red; }
  258. #interface {
  259. font-family: sans-serif;
  260. text-transform: uppercase;
  261. font-size: 10pt !important;
  262. line-height: 14pt;
  263. letter-spacing: 1pt;
  264. position: fixed;
  265. bottom: 10pt;
  266. right: 10pt; }
  267. #interface a {
  268. text-decoration: none;
  269. position: static; }
  270. div.dropdown {
  271. display: inline-block;
  272. position: relative; }
  273. div.dropdown ul {
  274. padding: 0.5em 0;
  275. display: none;
  276. background-color: black;
  277. position: absolute;
  278. right: 0;
  279. bottom: 2em;
  280. height: 200pt;
  281. width: 80pt;
  282. overflow: auto; }
  283. div.dropdown ul a {
  284. padding: 0 1em;
  285. color: white;
  286. display: block; }
  287. div.dropdown ul a:hover {
  288. background-color: white;
  289. color: black; }
  290. div.dropdown button {
  291. width: 80pt; }
  292. #toc {
  293. display: inline-block; }
  294. #toc-pages {
  295. padding: 0.5em 0;
  296. display: none;
  297. background-color: black;
  298. position: absolute;
  299. right: 0;
  300. bottom: 2em;
  301. height: 200pt;
  302. width: 80pt;
  303. overflow: auto; }
  304. #toc-pages a {
  305. padding: 0 1em;
  306. color: white; }
  307. #toc-pages a:hover {
  308. background-color: white;
  309. color: black; }
  310. #toc-pages button {
  311. width: 80pt; } }
  312. @media print {
  313. #interface {
  314. display: none; } }
  315. </style>