main.scss 13 KB

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