main.scss 12 KB

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