Grille des programmes de Riff en HTML CSS JS.

style.scss 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. @import '../../../../../codyhouse-framework/main/assets/css/style.scss'; // ⚠️ make sure to import the CodyHouse framework
  2. @import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600'); // custom font
  3. // --------------------------------
  4. // Schedule Template - by CodyHouse.co
  5. // --------------------------------
  6. :root {
  7. // colors
  8. @include defineColorHSL(--cd-color-event-1, 199, 25%, 46%); // Smalt Blue
  9. @include defineColorHSL(--cd-color-event-2, 271, 23%, 26%); // Martinique
  10. @include defineColorHSL(--cd-color-event-3, 162, 14%, 68%); // Edward
  11. @include defineColorHSL(--cd-color-event-4, 31, 89%, 68%); // Rajah
  12. @include defineColorHSL(--cd-color-text, 0, 0%, 13%); // Black
  13. @include defineColorHSL(--cd-color-border, 0, 0%, 92%); // Grey
  14. // font
  15. --font-primary: 'Source Sans Pro', sans-serif;
  16. //schedule template
  17. --schedule-rows-number: 19;
  18. --schedule-rows-height: 50px;
  19. }
  20. body {
  21. color: var(--cd-color-text);
  22. }
  23. a {
  24. color: var(--cd-color-event-3);
  25. }
  26. .cd-schedule {
  27. position: relative;
  28. &::before { // never visible - this is used in js to check the current MQ
  29. content: 'mobile';
  30. display: none;
  31. }
  32. .js & {
  33. @include breakpoint(md) {
  34. width: calc(100% - 2*var(--component-padding));
  35. margin-left: auto;
  36. margin-right: auto;
  37. max-width: var(--max-width-xl);
  38. &::before {
  39. content: 'desktop';
  40. }
  41. }
  42. }
  43. }
  44. .cd-schedule__timeline { // events time
  45. display: none;
  46. .js & {
  47. @include breakpoint(md) {
  48. display: block;
  49. position: absolute;
  50. top: 0;
  51. left: 0;
  52. height: 100%;
  53. width: 100%;
  54. padding-top: var(--schedule-rows-height);
  55. li {
  56. position: relative;
  57. height: var(--schedule-rows-height);
  58. &::after { // this is used to create the table horizontal lines
  59. content: '';
  60. position: absolute;
  61. bottom: 0;
  62. left: 0;
  63. width: 100%;
  64. height: 1px;
  65. background: var(--cd-color-border);
  66. }
  67. &:last-of-type::after {
  68. display: none;
  69. }
  70. span {
  71. display: none;
  72. }
  73. }
  74. }
  75. @include breakpoint(lg) {
  76. li {
  77. &::after {
  78. width: calc(100% - 60px);
  79. left: 60px;
  80. }
  81. span {
  82. display: inline-block;
  83. transform: translateY(-50%);
  84. font-size: var(--text-sm);
  85. }
  86. &:nth-of-type(2n) span {
  87. display: none;
  88. }
  89. }
  90. }
  91. }
  92. }
  93. .cd-schedule__events {
  94. position: relative;
  95. z-index: 1;
  96. .js & {
  97. @include breakpoint(md) {
  98. width: 100%;
  99. > ul {
  100. display: flex;
  101. flex-wrap: nowrap;
  102. }
  103. }
  104. @include breakpoint(lg) {
  105. width: calc(100% - 60px); // 60px is the .cd-schedule__timeline > li::after element left
  106. margin-left: 60px;
  107. }
  108. }
  109. }
  110. .cd-schedule__group { // group of same day events
  111. margin-bottom: var(--space-lg);
  112. .js & {
  113. @include breakpoint(md) {
  114. flex-basis: 0;
  115. flex-grow: 1;
  116. border: 1px solid var(--cd-color-border);
  117. margin-bottom: 0; // reset style
  118. &:not(:first-of-type) {
  119. border-left-width: 0;
  120. }
  121. }
  122. }
  123. }
  124. .cd-schedule__group > ul {
  125. position: relative;
  126. padding: 0 var(--component-padding);
  127. display: flex;
  128. overflow-x: scroll;
  129. -webkit-overflow-scrolling: touch;
  130. &::after { // never visible - used to add a right padding to .cd-schedule__group > ul
  131. display: inline-block;
  132. content: '-';
  133. width: 1px;
  134. height: 100%;
  135. opacity: 0;
  136. color: transparent;
  137. }
  138. .js & {
  139. @include breakpoint(md) {
  140. height: calc(var(--schedule-rows-height)*var(--schedule-rows-number));
  141. overflow: visible;
  142. padding: 0;
  143. &::after { // reset style
  144. display: none;
  145. }
  146. }
  147. }
  148. }
  149. .cd-schedule__top-info { // day label
  150. width: 100%;
  151. padding: 0 var(--component-padding);
  152. > span {
  153. display: inline-block;
  154. margin-bottom: var(--space-sm);
  155. font-weight: bold;
  156. }
  157. .js & {
  158. @include breakpoint(md) {
  159. // vertically center its content
  160. display: flex;
  161. align-items: center;
  162. justify-content: center;
  163. height: var(--schedule-rows-height);
  164. border-bottom: 1px solid var(--cd-color-border);
  165. padding: 0; // reset style
  166. > span {
  167. font-weight: normal;
  168. font-size: var(--text-sm);
  169. margin-bottom: 0;
  170. }
  171. }
  172. }
  173. }
  174. .cd-schedule__event {
  175. flex-shrink: 0; // force them to stay on one line
  176. float: left; // flex fallback
  177. height: 150px;
  178. width: 70%;
  179. max-width: 300px;
  180. margin-right: var(--space-md);
  181. transition: opacity .2s, background .2s;
  182. a {
  183. display: block;
  184. height: 100%;
  185. padding: var(--space-sm);
  186. box-shadow: inset 0 -3px 0 rgba(#000, .2);
  187. text-decoration: none;
  188. }
  189. a::before { // event start/end date
  190. content: attr(data-start)' - 'attr(data-end);
  191. }
  192. .js & {
  193. @include breakpoint(sm) {
  194. width: 40%;
  195. }
  196. @include breakpoint(md) {
  197. position: absolute;
  198. z-index: 3;
  199. width: calc(100% + 2px); // top position and height will be set using js
  200. left: -1px;
  201. max-width: none; // reset style
  202. margin-right: 0;
  203. a {
  204. padding: var(--space-sm);
  205. box-shadow: 0 10px 20px rgba(#000, .1), inset 0 -3px 0 rgba(#000, .2);
  206. }
  207. }
  208. }
  209. }
  210. .js {
  211. @include breakpoint(md) {
  212. .cd-schedule__event--selected { // classes added when an user select the event
  213. visibility: hidden;
  214. }
  215. .cd-schedule--loading .cd-schedule__event {
  216. // the class .cd-schedule--loading is added by default to the .cd-schedule element
  217. // it is removed as soon as the single events are placed in the schedule plan (using javascript)
  218. opacity: 0;
  219. }
  220. }
  221. }
  222. .cd-schedule__name, // event name in the schedule template
  223. .cd-schedule__event a::before, // event date in the schedule template
  224. .cd-schedule-modal__name, // event name in the modal element
  225. .cd-schedule-modal__date { // event date in the modal element
  226. display: block;
  227. color: var(--color-white);
  228. font-weight: bold;
  229. @include fontSmooth;
  230. }
  231. .cd-schedule__name,
  232. .cd-schedule-modal__name {
  233. font-size: var(--text-lg);
  234. @include breakpoint(md) {
  235. font-size: calc(var(--text-sm)*1.2);
  236. }
  237. }
  238. .cd-schedule-modal__date, // not included in the the HTML but added using JavScript
  239. .cd-schedule__event a::before {
  240. opacity: .7;
  241. margin-bottom: var(--space-xxxs);
  242. @include breakpoint(md) {
  243. font-size: calc(var(--text-xs)*1.05);
  244. margin-bottom: var(--space-xxxxs);
  245. }
  246. }
  247. .cd-schedule__event [data-event="event-1"],
  248. .cd-schedule-modal[data-event="event-1"] .cd-schedule-modal__header-bg {
  249. // this is used to set a background color for the event and the modal window
  250. background: var(--cd-color-event-1);
  251. }
  252. .cd-schedule__event [data-event="event-2"],
  253. .cd-schedule-modal[data-event="event-2"] .cd-schedule-modal__header-bg {
  254. background: var(--cd-color-event-2);
  255. }
  256. .cd-schedule__event [data-event="event-3"],
  257. .cd-schedule-modal[data-event="event-3"] .cd-schedule-modal__header-bg {
  258. background: var(--cd-color-event-3);
  259. }
  260. .cd-schedule__event [data-event="event-4"],
  261. .cd-schedule-modal[data-event="event-4"] .cd-schedule-modal__header-bg {
  262. background: var(--cd-color-event-4);
  263. }
  264. .cd-schedule-modal {
  265. position: fixed;
  266. z-index: 3;
  267. top: 0;
  268. right: 0;
  269. height: 100%;
  270. width: 100%;
  271. visibility: hidden;
  272. transform: translateZ(0); // Force Hardware acceleration
  273. transform: translateX(100%);
  274. transition: transform .4s, visibility .4s;
  275. transition-timing-function: cubic-bezier(.5,0,.1,1);
  276. @include breakpoint(md) {
  277. // reset style
  278. right: auto;
  279. width: auto;
  280. height: auto;
  281. transform: translateX(0);
  282. will-change: transform, width, height;
  283. transition: height .4s, width .4s, transform .4s, visibility .4s;
  284. transition-timing-function: cubic-bezier(.5,0,.1,1);
  285. }
  286. }
  287. .cd-schedule-modal__header {
  288. position: relative;
  289. height: 70px;
  290. display: flex;
  291. align-content: center;
  292. width: 100%;
  293. @include breakpoint(md) {
  294. position: absolute;
  295. display: block;
  296. top: 0;
  297. left: 0;
  298. height: 100%;
  299. }
  300. }
  301. .cd-schedule-modal__content {
  302. position: relative;
  303. z-index: 3;
  304. display: flex;
  305. align-items: center;
  306. padding: var(--space-sm) var(--component-padding);
  307. @include breakpoint(md) {
  308. // reset style
  309. display: block;
  310. padding: var(--space-sm);
  311. }
  312. }
  313. .cd-schedule-modal__body {
  314. position: relative;
  315. width: 100%;
  316. height: calc(100% - 70px); // 70px is the .cd-schedule-modal__header height
  317. @include breakpoint(md) {
  318. height: 100%;
  319. width: auto;
  320. }
  321. }
  322. .cd-schedule-modal__event-info {
  323. position: relative;
  324. z-index: 2;
  325. line-height: var(--body-line-height);
  326. height: 100%;
  327. overflow: hidden;
  328. font-size: calc(var(--text-sm) * 1.2);
  329. > div {
  330. overflow: auto;
  331. height: 100%;
  332. padding: var(--space-md) var(--component-padding);
  333. }
  334. @include breakpoint(md) {
  335. opacity: 0;
  336. font-size: var(--text-sm);
  337. > div {
  338. padding: calc(var(--space-md)*1.3) calc(var(--space-lg)*1.2) calc(var(--space-md)*1.3) calc(var(--space-md)*1.3);
  339. }
  340. }
  341. }
  342. .cd-schedule-modal__header-bg,
  343. .cd-schedule-modal__body-bg { // these are the morphing backgrounds - visible on desktop only
  344. position: absolute;
  345. top: 0;
  346. left: 0;
  347. height: 100%;
  348. width: 100%;
  349. @include breakpoint(md) {
  350. // Force Hardware acceleration
  351. transform: translateZ(0);
  352. will-change: transform;
  353. backface-visibility: hidden;
  354. }
  355. }
  356. .cd-schedule-modal__header-bg {
  357. z-index: 2;
  358. transform-origin: top center;
  359. @include breakpoint(md) {
  360. transition: transform .4s;
  361. transition-timing-function: cubic-bezier(.5,0,.1,1);
  362. }
  363. }
  364. .cd-schedule-modal__body-bg {
  365. z-index: 1;
  366. background: var(--color-white);
  367. transform-origin: top left;
  368. @include breakpoint(md) {
  369. opacity: 0;
  370. transform: none;
  371. }
  372. }
  373. .cd-schedule-modal--no-transition {
  374. transition: none;
  375. .cd-schedule-modal__header-bg,
  376. .cd-schedule-modal__body-bg {
  377. transition: none !important;
  378. }
  379. }
  380. .cd-schedule-modal__date {
  381. display: none;
  382. @include breakpoint(md) {
  383. display: block;
  384. }
  385. }
  386. .cd-schedule-modal__close { // close modal icon
  387. position: absolute;
  388. z-index: 3;
  389. top: 0;
  390. right: 0;
  391. height: 70px;
  392. width: 70px;
  393. background: alpha(var(--color-black), .1);
  394. &::before, &::after { // these are the two lines of the 'X' icon
  395. content: '';
  396. position: absolute;
  397. top: 50%;
  398. left: 50%;
  399. width: 2px;
  400. height: 22px;
  401. background: var(--color-white);
  402. backface-visibility: hidden;
  403. }
  404. &::before {
  405. transform: translateX(-50%) translateY(-50%) rotate(45deg);
  406. }
  407. &::after {
  408. transform: translateX(-50%) translateY(-50%) rotate(-45deg);
  409. }
  410. @include breakpoint(md) {
  411. width: 40px;
  412. height: 40px;
  413. background: transparent;
  414. opacity: 0;
  415. &::after, &::before {
  416. background: var(--cd-color-text);
  417. height: 16px;
  418. }
  419. }
  420. }
  421. .cd-schedule-modal--open { // this class is added as soon as an event is selected
  422. transform: translateX(0);
  423. visibility: visible;
  424. .cd-schedule-modal__event-info > div { // smooth scroll on iOS touch deviceS
  425. -webkit-overflow-scrolling: touch;
  426. }
  427. }
  428. @include breakpoint(md) {
  429. .cd-schedule-modal--animation-completed .cd-schedule-modal__close,
  430. .cd-schedule-modal--content-loaded.cd-schedule-modal--animation-completed .cd-schedule-modal__event-info {
  431. // the .cd-schedule-modal--animation-completed class is added when the modal animation is completed
  432. // the .cd-schedule-modal--content-loaded class is added when the modal content has been loaded (using ajax)
  433. opacity: 1;
  434. transition: opacity .2s;
  435. }
  436. .cd-schedule-modal--open .cd-schedule-modal__body-bg {
  437. opacity: 1;
  438. transition: transform .4s;
  439. transition-timing-function: cubic-bezier(.5,0,.1,1);
  440. }
  441. }
  442. .cd-schedule__cover-layer { // layer between the content and the modal window
  443. position: fixed;
  444. z-index: 2;
  445. top: 0;
  446. left: 0;
  447. height: 100%;
  448. width: 100%;
  449. background: alpha(var(--color-black), 0.8);
  450. opacity: 0;
  451. visibility: hidden;
  452. transition: opacity .4s, visibility .4s;
  453. }
  454. .cd-schedule-modal--open + .cd-schedule__cover-layer {
  455. opacity: 1;
  456. visibility: visible;
  457. }
  458. //demo style
  459. .cd-main-header h1 {
  460. color: var(--cd-color-text);
  461. font-weight: 700;
  462. }
  463. .cd-article-link {
  464. font-size: var(--text-sm);
  465. transition: opacity .2s;
  466. &:hover {
  467. opacity: 0.8;
  468. }
  469. }