main.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. // @Author: Bachir Soussi Chiadmi <bach>
  2. // @Date: 16-04-2017
  3. // @Email: bachir@figureslibres.io
  4. // @Last modified by: bach
  5. // @Last modified time: 18-04-2017
  6. // @License: GPL-V3
  7. $fs:16px;
  8. @mixin base_font{
  9. font-family: 'amiri', sans-serif;
  10. font-size: $fs;
  11. font-kerning: auto;
  12. line-height: 1.4;
  13. }
  14. html, body{
  15. @include base_font;
  16. position: relative;
  17. margin:0;
  18. padding:0;
  19. }
  20. $header_height:5em;
  21. $dot_w:550px;
  22. $bullet_w:40px;
  23. $margin_left:50px + ($bullet_w/2);
  24. header{
  25. position: fixed;
  26. width:100%; height:$header_height;
  27. top:0; z-index: 5;
  28. background-color: white;
  29. // padding: 0 0 0 $margin_left;
  30. // outline: 1px solid green;
  31. >*{
  32. display: inline-block;
  33. vertical-align: text-bottom;
  34. // &:first-child{ margin-left: 1em;}
  35. &:last-child{ margin-right: 1em;}
  36. }
  37. hgroup{
  38. margin: 0 4em 0 $margin_left;
  39. h1,h2{
  40. margin:0; padding:0;
  41. line-height: 1;
  42. }
  43. h1{font-size: 3em;}
  44. h2{line-height: 1;}
  45. }
  46. #menus{
  47. // float:right;
  48. >*{
  49. display: inline-block;
  50. vertical-align: top;
  51. }
  52. nav {
  53. padding:0 1em;
  54. position: relative;
  55. h3{
  56. margin:0; padding:0;
  57. line-height: 1;
  58. cursor: pointer;
  59. transition: color 0.3s ease-in-out;
  60. }
  61. ul{
  62. position: absolute;
  63. margin:0;
  64. left:0; padding:0 1em 1em;
  65. background-color: rgba(255,255,255, 1);
  66. // top:2em;
  67. white-space: nowrap;
  68. height:1px; opacity:0;
  69. overflow: hidden;
  70. transition: opacity 0.3s ease-in-out;
  71. li{
  72. margin:0;
  73. padding:0;
  74. list-style: none;
  75. transition: color 0.3s ease-in-out;
  76. font-weight:500;
  77. font-size: 1.2em;
  78. line-height: 1.2;
  79. a{
  80. color: inherit;
  81. text-decoration: none;
  82. }
  83. }
  84. }
  85. }
  86. // nav#parts-nav{
  87. // ul{
  88. // right:0; left: auto;
  89. // }
  90. // }
  91. &:hover{
  92. h3{
  93. color: rgb(100,100,100);
  94. }
  95. nav:hover{
  96. z-index: 10;
  97. h3{
  98. color:#000;
  99. }
  100. ul{
  101. height:auto; opacity: 1;
  102. transition: height opacity 0.3s ease-in-out;
  103. }
  104. li{
  105. color: rgb(100,100,100);
  106. &:hover{
  107. color: #000;
  108. }
  109. }
  110. }
  111. }
  112. }
  113. }
  114. // #app{
  115. // position: relative;
  116. // text-align: center;
  117. // margin: 3em auto;
  118. // }
  119. #db-loader{
  120. position: relative;
  121. width:300px;
  122. height:1px;
  123. background-color: black;
  124. margin-left: $margin_left;
  125. #db-loaded{
  126. position: absolute;
  127. top:-1px; left:0;
  128. width: 0%;
  129. height:3px;
  130. background-color: black;
  131. transition: width 1.2s;
  132. }
  133. }
  134. .sticky-clone-wrapper{
  135. padding-top: $header_height;
  136. // padding-bottom: 1em;
  137. position: fixed;
  138. top:0; left: 0;
  139. z-index: 4;
  140. width:100%;
  141. background-color: white;
  142. h1.part-title{
  143. // // font-size: 1.6em;
  144. // // body.mode-connections &{
  145. // // margin: 0 0 0 $margin_left;
  146. // }
  147. // body.mode-text &{
  148. margin:0 0 0 $margin_left;
  149. // }
  150. }
  151. // h2.title{
  152. // font-size: 1em;
  153. // body.mode-connections &{
  154. // margin: 0 0 0 $margin_left;
  155. // }
  156. // body.mode-text &{
  157. // margin:0 0 0 $margin_left;
  158. // }
  159. // }
  160. }
  161. main#content{
  162. margin-top: $header_height;
  163. // margin: 5em;
  164. // width: 450px;
  165. // &>*{
  166. // width: 450px;
  167. // }
  168. // h1.part-title{
  169. // font-size: 1.6em;
  170. // width:450px;
  171. // }
  172. section.part{
  173. position: relative;
  174. margin-bottom:2em;
  175. }
  176. // h2.title, h2.filet{
  177. // font-size: 1em;
  178. // width:450px;
  179. // // margin: 1em 0;
  180. // }
  181. }
  182. section.intro{
  183. margin-left: $margin_left;
  184. }
  185. // Commons
  186. h1.part-title{
  187. font-size: 1.8em;
  188. margin:0 0 0 $margin_left;
  189. padding-bottom: 0.5em;
  190. font-weight: normal;
  191. letter-spacing: 0.3em;
  192. em{
  193. font-size: 0.7em;
  194. letter-spacing: normal;
  195. }
  196. }
  197. h2.title{
  198. font-size: 1.2em;
  199. font-weight: 500;
  200. margin:1em 0 0 $margin_left;
  201. line-height: 1;
  202. }
  203. // div.definition,
  204. // div.axiom{
  205. // margin-top: 1em;
  206. // }
  207. h4.filet{
  208. margin:0.5em 0 0 $margin_left;
  209. }
  210. div.proposition,
  211. div.appendice,
  212. div.chapitre{
  213. &:not(.chapitre), &.chapitre:first-of-type, &:not(.dot.nested){margin-top: 1em;}
  214. span.title{
  215. font-size: 1.2em;
  216. font-weight: 500;
  217. }
  218. }
  219. div.explication,
  220. div.demonstration,
  221. div.scolie,
  222. div.corollaire,
  223. div.prop-axiom,
  224. div.lemme{
  225. span.title{
  226. font-size: 0.8em;
  227. text-transform:capitalize;
  228. font-variant: small-caps;
  229. }
  230. }
  231. div.lemme-scolie,
  232. div.lemme-corrollaire,
  233. div.lemme-demonstration,
  234. div.corollaire-demo{
  235. span.title{
  236. font-size: 0.7em;
  237. text-transform:capitalize;
  238. font-variant: small-caps;
  239. }
  240. }
  241. // ____ __ _
  242. // / _/___ / / (_)___ ___
  243. // / // __ \/ / / / __ \/ _ \
  244. // _/ // / / / /___/ / / / / __/
  245. // /___/_/ /_/_____/_/_/ /_/\___/
  246. main#content.mode-text{
  247. // h1.part-title{
  248. // margin: 1em 0 0 $margin_left;
  249. // }
  250. // h2.title, h4.filet{
  251. // margin: 1em 0 0 $margin_left;
  252. // }
  253. // .sticky{
  254. // color: red;
  255. // &.fixed{
  256. // position: fixed;
  257. // }
  258. // }
  259. section.enonce, section.item.nested{
  260. width:600px;
  261. margin: 1em 0 1em $margin_left;
  262. overflow-x: visible;
  263. }
  264. section.enonce{
  265. @include base_font;
  266. // max-height:14px;
  267. // overflow: hidden;
  268. // transition: max-height 0.5s ease-in-out;
  269. // &.active{
  270. // max-height:1000px;
  271. // }
  272. h2{
  273. font-size: 1em;
  274. font-weight: 300;
  275. margin: 0;
  276. cursor:pointer;
  277. }
  278. &.definition, &.axiom, &.def-affect{
  279. &:not(.nested)>h2{
  280. font-size: 1.2em;
  281. float:left;
  282. margin:0 0.5em 0 0;
  283. // line-height: 1.9;
  284. font-weight: 600;
  285. text-transform: uppercase;
  286. }
  287. }
  288. h3{
  289. font-size: 0.9em;
  290. font-weight: 300;
  291. margin: 0;
  292. cursor:pointer;
  293. }
  294. &.proposition>div.text{
  295. font-size: 1.5em;
  296. font-weight: 500;
  297. }
  298. div.text{
  299. font-size: 1.2em;
  300. div.paragraph{
  301. margin-bottom: 1em;
  302. div.opened-link{
  303. display:inline;
  304. }
  305. a.link, span.link.text{
  306. font-weight: 600;
  307. text-decoration: none;
  308. color: inherit;
  309. }
  310. span.link.text:after{
  311. content:':'
  312. }
  313. section.enonce, section.item{
  314. padding-left:2em;
  315. border-left: 1px solid #999;
  316. }
  317. img{
  318. float: left;
  319. }
  320. sup{
  321. font-size: 55%;
  322. font-weight: 400;
  323. a{
  324. pointer-events: none;
  325. cursor: pointer;
  326. }
  327. }
  328. }
  329. }
  330. // footnotes
  331. hr{
  332. display:none;
  333. }
  334. section ol{
  335. font-size: 0.7em;
  336. margin: -1em 0 2em 0;
  337. padding:0 0 0 1em;
  338. a{
  339. display: none;
  340. }
  341. }
  342. }
  343. // reset font-size since nested items are in a div with alternate font-size
  344. .enonce.nested, .item.nested{
  345. font-size: $fs;
  346. font-style: normal;
  347. }
  348. .opened-link{
  349. // position:relative;
  350. // outline: 1px solid red;
  351. .close-link-btn{
  352. width:20px;
  353. margin:1em 0 -2.1em $margin_left - 9px;
  354. // outline: 1px solid green;
  355. // display:inline-block;
  356. position:relative;
  357. background-color: white;
  358. z-index: 10;
  359. // top:0; left:-1em;
  360. cursor: pointer;
  361. text-align: center;
  362. span{
  363. font-style: normal;
  364. font-size: 0.7em;
  365. font-weight: 300;
  366. }
  367. }
  368. }
  369. }
  370. // ______
  371. // /_ __/_______ ___
  372. // / / / ___/ _ \/ _ \
  373. // / / / / / __/ __/
  374. // /_/ /_/ \___/\___/
  375. main#content.mode-connections{
  376. // h2.title, h4.filet{
  377. // margin:0 0 0 $margin_left;
  378. // }
  379. }
  380. .dot{
  381. margin:0 0 0 $margin_left;
  382. position: relative;
  383. // overflow-x: visible;
  384. // overflow-y: auto;
  385. border: 1px solid white;
  386. // transform: translate3d(0,0,0);
  387. // transition: transform 0.2s ease-in-out;
  388. width: $dot_w;
  389. // >span.id{
  390. // display: inline-block;
  391. // // position: absolute;
  392. // // left:-3.5em;
  393. // width: $margin_left - ($bullet_w/2); text-align: right;
  394. // opacity:0;
  395. // // transform: translate3d(0, 0, 0);
  396. // // transition: transform 0.2s ease-in-out,opacity 0.4s ease-in-out;
  397. // transition: opacity 0.4s ease-in-out;
  398. // }
  399. // >span.bullet{
  400. // display: inline-block;
  401. // width:$bullet_w; text-align: center;
  402. // vertical-align: top;
  403. // font-size: 15px;
  404. // font-kerning: none;
  405. // }
  406. >span.title{
  407. padding: 0 0.6em 0 0;
  408. }
  409. &.opened>span.title{
  410. display:block;
  411. }
  412. >p.summary{
  413. display: inline-block;
  414. vertical-align: top;
  415. margin: 0;
  416. opacity: 0;
  417. transition: opacity 0.4s ease-in-out;
  418. max-width : $dot_w - $margin_left -5px;
  419. }
  420. &.preface{
  421. .title{display: none;}
  422. p.summary{
  423. opacity: 1;
  424. }
  425. }
  426. &:not(.disabled) {
  427. >span.title,>p.summary{cursor: pointer;}
  428. }
  429. &.disabled {
  430. >span.title,>p.summary{cursor: default;}
  431. }
  432. >section.text{
  433. display: inline-block;
  434. vertical-align: top;
  435. margin: 0;
  436. width : $dot_w - $margin_left - $bullet_w -5px;
  437. p{
  438. margin:0;
  439. &:not(:last-child){
  440. margin-bottom:1em;
  441. }
  442. }
  443. a{
  444. color: inherit;
  445. text-decoration: none;
  446. font-weight: bold;
  447. }
  448. }
  449. &.to-links > section.text{
  450. border-top: 1px solid #e2e2e2;
  451. padding-top:1.5em;
  452. margin-top: -1.4em;
  453. }
  454. &.from-links > section.text{
  455. border-bottom: 1px solid #e2e2e2;
  456. }
  457. >nav.links{
  458. position:relative;
  459. // left: $margin_left*2;
  460. box-sizing: border-box;
  461. &.to{
  462. bottom:100%;
  463. margin-top: 15px;
  464. padding-bottom:10px;
  465. margin-top: 1em;
  466. &:before{
  467. content: "\2304";
  468. display: flex;
  469. align-items: flex-end;
  470. }
  471. }
  472. &.from{
  473. top:100%;
  474. padding-top:10px;
  475. margin-bottom: 1em;
  476. &:before{
  477. content: "\2303";
  478. }
  479. }
  480. &:before{
  481. border-left: 1px solid #e2e2e2;
  482. position: absolute;
  483. top:0; left:$margin_left - 5px;
  484. height: 100%; width:0;
  485. z-index: 3;
  486. text-indent: -0.45em;
  487. line-height: 1;
  488. color: #4a4848;
  489. }
  490. }
  491. &:hover, &.opened, &.highlight{
  492. // transform: translate3d(0.5em, 0, 0);
  493. // transition: transform 0.1s ease-in-out;
  494. >p.summary{
  495. opacity: 1;
  496. transition: opacity 0.4s ease-in-out;
  497. }
  498. // >span.id{
  499. // opacity: 1;
  500. // // transform: translate3d(-0.5em, 0, 0);
  501. // // transition: transform 0.1s ease-in-out,opacity 0.4s ease-in-out;
  502. // transition: opacity 0.4s ease-in-out;
  503. // }
  504. }
  505. &.disabled>*{
  506. color:grey;
  507. }
  508. // &:not(.opened){
  509. // line-height: 0.8;
  510. // }
  511. &.opened{
  512. // position:relative;
  513. // outline: 1px solid red;
  514. margin-bottom: 15px;
  515. // span.title{
  516. // float:left;
  517. // }
  518. }
  519. .bullet,.close-link-btn{
  520. position:absolute;
  521. width:20px;
  522. // top:0;
  523. left:-24px;
  524. margin:-3px 0 0 0;
  525. // outline: 1px solid green;
  526. // display:inline-block;
  527. // background-color: white;
  528. // z-index: 10;
  529. text-align: center;
  530. }
  531. .bullet{
  532. span{
  533. font-style: normal;
  534. font-size: 0.2em;
  535. font-weight: 300;
  536. }
  537. }
  538. .close-link-btn{
  539. cursor: pointer;
  540. span{
  541. font-style: normal;
  542. font-size: 0.7em;
  543. font-weight: 300;
  544. }
  545. }
  546. &.nested{
  547. font-size: $fs;
  548. }
  549. }
  550. footer{
  551. position: fixed;
  552. bottom: 0;
  553. background-color: white;
  554. >*{margin-left: $margin_left;}
  555. width: 100%;
  556. }