erudit 2.0.0-dev.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/.nuxtrc +1 -0
  2. package/app/app.vue +172 -0
  3. package/app/assets/icons/alert.svg +3 -0
  4. package/app/assets/icons/angle-right.svg +3 -0
  5. package/app/assets/icons/arrow-in-text.svg +3 -0
  6. package/app/assets/icons/arrow-left.svg +3 -0
  7. package/app/assets/icons/arrow-up-to-right.svg +3 -0
  8. package/app/assets/icons/aside-open.svg +3 -0
  9. package/app/assets/icons/asterisk.svg +3 -0
  10. package/app/assets/icons/book-question.svg +3 -0
  11. package/app/assets/icons/book.svg +3 -0
  12. package/app/assets/icons/bug.svg +3 -0
  13. package/app/assets/icons/chip.svg +3 -0
  14. package/app/assets/icons/circle-help.svg +3 -0
  15. package/app/assets/icons/construction.svg +3 -0
  16. package/app/assets/icons/cross.svg +3 -0
  17. package/app/assets/icons/draw.svg +3 -0
  18. package/app/assets/icons/ellipsis-vertical.svg +3 -0
  19. package/app/assets/icons/file-check.svg +3 -0
  20. package/app/assets/icons/file-lines.svg +3 -0
  21. package/app/assets/icons/file-star.svg +3 -0
  22. package/app/assets/icons/folder-open.svg +3 -0
  23. package/app/assets/icons/folder.svg +3 -0
  24. package/app/assets/icons/globe.svg +3 -0
  25. package/app/assets/icons/house.svg +3 -0
  26. package/app/assets/icons/link-external.svg +3 -0
  27. package/app/assets/icons/link.svg +3 -0
  28. package/app/assets/icons/moon.svg +3 -0
  29. package/app/assets/icons/outline/book.svg +3 -0
  30. package/app/assets/icons/outline/file-lines.svg +3 -0
  31. package/app/assets/icons/pirate.svg +3 -0
  32. package/app/assets/icons/plus-circle.svg +3 -0
  33. package/app/assets/icons/plus.svg +3 -0
  34. package/app/assets/icons/puzzle.svg +3 -0
  35. package/app/assets/icons/search.svg +3 -0
  36. package/app/assets/icons/shuffle.svg +3 -0
  37. package/app/assets/icons/star.svg +3 -0
  38. package/app/assets/icons/sun-moon.svg +3 -0
  39. package/app/assets/icons/sun.svg +3 -0
  40. package/app/assets/icons/user.svg +3 -0
  41. package/app/assets/icons/users.svg +3 -0
  42. package/app/components/Loading.vue +23 -0
  43. package/app/components/SiteAside.vue +382 -0
  44. package/app/components/SiteMain.vue +35 -0
  45. package/app/components/ads/BannerTemplate.vue +51 -0
  46. package/app/components/ads/BottomBanner.vue +45 -0
  47. package/app/components/ads/LeftBanner.vue +50 -0
  48. package/app/components/aside/AsideListItem.vue +74 -0
  49. package/app/components/aside/AsideMajor.vue +56 -0
  50. package/app/components/aside/AsideMinor.vue +71 -0
  51. package/app/components/aside/major/PaneContentScroll.vue +23 -0
  52. package/app/components/aside/major/PaneSwitch.vue +54 -0
  53. package/app/components/aside/major/PaneSwitchButton.vue +63 -0
  54. package/app/components/aside/major/SiteInfo.vue +85 -0
  55. package/app/components/aside/major/panes/Language.vue +79 -0
  56. package/app/components/aside/major/panes/Pages.vue +34 -0
  57. package/app/components/aside/major/panes/Search.vue +3 -0
  58. package/app/components/aside/major/panes/nav/Nav.vue +91 -0
  59. package/app/components/aside/major/panes/nav/NavBook.vue +86 -0
  60. package/app/components/aside/major/panes/nav/NavBookLoading.vue +24 -0
  61. package/app/components/aside/major/panes/nav/NavGlobal.vue +16 -0
  62. package/app/components/aside/major/panes/nav/fnav/FNav.vue +105 -0
  63. package/app/components/aside/major/panes/nav/fnav/FNavBook.vue +32 -0
  64. package/app/components/aside/major/panes/nav/fnav/FNavFlags.vue +40 -0
  65. package/app/components/aside/major/panes/nav/fnav/FNavFolder.vue +60 -0
  66. package/app/components/aside/major/panes/nav/fnav/FNavItem.vue +34 -0
  67. package/app/components/aside/major/panes/nav/fnav/FNavSeparator.vue +80 -0
  68. package/app/components/aside/major/panes/nav/fnav/FNavTopic.vue +24 -0
  69. package/app/components/aside/major/panes/other/ItemContent.vue +29 -0
  70. package/app/components/aside/major/panes/other/ItemGenerator.vue +15 -0
  71. package/app/components/aside/major/panes/other/ItemTheme.vue +54 -0
  72. package/app/components/aside/major/panes/other/Other.vue +16 -0
  73. package/app/components/aside/minor/AsideMinorContributor.vue +5 -0
  74. package/app/components/aside/minor/AsideMinorNews.vue +11 -0
  75. package/app/components/aside/minor/AsideMinorPane.vue +16 -0
  76. package/app/components/aside/minor/AsideMinorTopLink.vue +67 -0
  77. package/app/components/aside/minor/Contribute.vue +145 -0
  78. package/app/components/aside/minor/content/AsideMinorContent.vue +92 -0
  79. package/app/components/aside/minor/topic/AsideMinorTopic.vue +32 -0
  80. package/app/components/aside/minor/topic/TopicContributors.vue +177 -0
  81. package/app/components/aside/minor/topic/TopicNav.vue +49 -0
  82. package/app/components/aside/minor/topic/TopicToc.vue +202 -0
  83. package/app/components/aside/minor/topic/TopicTocItem.vue +31 -0
  84. package/app/components/aside/utils/AsideOverlayPane.vue +40 -0
  85. package/app/components/bitran/BitranContent.vue +64 -0
  86. package/app/components/bitran/RenderWrapper.vue +12 -0
  87. package/app/components/contributor/ContributorAvatar.vue +43 -0
  88. package/app/components/contributor/ContributorListItem.vue +35 -0
  89. package/app/components/main/topic/MainTopic.vue +79 -0
  90. package/app/components/main/topic/TopicPartSwitch.vue +118 -0
  91. package/app/components/main/utils/Breadcrumb.vue +75 -0
  92. package/app/components/main/utils/ContentDecoration.vue +29 -0
  93. package/app/components/main/utils/ContentDescription.vue +20 -0
  94. package/app/components/main/utils/ContentFlag.vue +16 -0
  95. package/app/components/main/utils/ContentPopover.vue +176 -0
  96. package/app/components/main/utils/ContentPopovers.vue +105 -0
  97. package/app/components/main/utils/ContentReferences.vue +76 -0
  98. package/app/components/main/utils/ContentSection.vue +42 -0
  99. package/app/components/main/utils/ContentTitle.vue +37 -0
  100. package/app/components/main/utils/reference/ReferenceGroup.vue +41 -0
  101. package/app/components/main/utils/reference/ReferenceItem.vue +64 -0
  102. package/app/components/main/utils/reference/ReferenceSource.vue +110 -0
  103. package/app/components/preview/Preview.vue +177 -0
  104. package/app/components/preview/PreviewDisplay.vue +139 -0
  105. package/app/components/preview/PreviewFooterAction.vue +73 -0
  106. package/app/components/preview/PreviewLoading.vue +15 -0
  107. package/app/components/preview/PreviewScreen.vue +99 -0
  108. package/app/components/preview/display/Alert.vue +50 -0
  109. package/app/components/preview/display/Custom.vue +18 -0
  110. package/app/components/preview/display/GenericLink.vue +48 -0
  111. package/app/components/preview/display/PageLink.vue +20 -0
  112. package/app/components/preview/display/Unique.vue +49 -0
  113. package/app/components/transition/Fade.vue +22 -0
  114. package/app/components/tree/TreeContainer.vue +12 -0
  115. package/app/components/tree/TreeItem.vue +89 -0
  116. package/app/composables/bitran.ts +132 -0
  117. package/app/composables/bitranContent.ts +36 -0
  118. package/app/composables/bitranLocation.ts +7 -0
  119. package/app/composables/contentData.ts +36 -0
  120. package/app/composables/contentPage.ts +156 -0
  121. package/app/composables/contentRoute.ts +45 -0
  122. package/app/composables/darkMagic.ts +24 -0
  123. package/app/composables/externalApi.ts +63 -0
  124. package/app/composables/favicon.ts +8 -0
  125. package/app/composables/formatText.ts +86 -0
  126. package/app/composables/majorPane.ts +60 -0
  127. package/app/composables/phrases.ts +80 -0
  128. package/app/composables/theme.ts +29 -0
  129. package/app/composables/url.ts +33 -0
  130. package/app/pages/_test/preview.vue +110 -0
  131. package/app/pages/article/[...articleId].vue +3 -0
  132. package/app/pages/book/[...bookId].vue +47 -0
  133. package/app/pages/group/[...groupId].vue +64 -0
  134. package/app/pages/index.vue +32 -0
  135. package/app/pages/members.vue +7 -0
  136. package/app/pages/practice/[...practice].vue +3 -0
  137. package/app/pages/summary/[...summaryId].vue +3 -0
  138. package/app/public/favicon/article.svg +10 -0
  139. package/app/public/favicon/default.svg +10 -0
  140. package/app/public/favicon/practice.svg +10 -0
  141. package/app/public/favicon/summary.svg +10 -0
  142. package/app/public/logotype.svg +17 -0
  143. package/app/public/og-default.png +0 -0
  144. package/app/public/user.svg +10 -0
  145. package/app/scripts/_immediate.js +4 -0
  146. package/app/scripts/aside/index.ts +59 -0
  147. package/app/scripts/aside/major/nav.ts +26 -0
  148. package/app/scripts/aside/minor/state.ts +37 -0
  149. package/app/scripts/aside/minor/topic.ts +3 -0
  150. package/app/scripts/flag.ts +28 -0
  151. package/app/scripts/og.ts +27 -0
  152. package/app/scripts/preview/build.ts +84 -0
  153. package/app/scripts/preview/data/alert.ts +19 -0
  154. package/app/scripts/preview/data/custom.ts +8 -0
  155. package/app/scripts/preview/data/genericLink.ts +24 -0
  156. package/app/scripts/preview/data/pageLink.ts +20 -0
  157. package/app/scripts/preview/data/unique.ts +70 -0
  158. package/app/scripts/preview/data.ts +26 -0
  159. package/app/scripts/preview/display.ts +39 -0
  160. package/app/scripts/preview/footer.ts +9 -0
  161. package/app/scripts/preview/request.ts +51 -0
  162. package/app/scripts/preview/state.ts +63 -0
  163. package/app/styles/_immediate.css +3 -0
  164. package/app/styles/_util.scss +50 -0
  165. package/app/styles/_utils.scss +44 -0
  166. package/app/styles/app.scss +91 -0
  167. package/app/styles/def/_bp.scss +24 -0
  168. package/app/styles/def/_size.scss +7 -0
  169. package/app/styles/def/_z.scss +5 -0
  170. package/app/styles/default.scss +85 -0
  171. package/app/styles/normalize.scss +63 -0
  172. package/app/styles/partials/_darkMagic.scss +7 -0
  173. package/app/styles/partials/_fnav.scss +18 -0
  174. package/app/styles/partials/_preview.scss +7 -0
  175. package/globalPath.ts +24 -0
  176. package/globals/bitran.ts +39 -0
  177. package/globals/content.ts +22 -0
  178. package/globals/contributor.ts +5 -0
  179. package/globals/erudit.ts +5 -0
  180. package/globals/register.ts +18 -0
  181. package/languages/en.ts +95 -0
  182. package/languages/ru.ts +99 -0
  183. package/module/bitran.ts +34 -0
  184. package/module/config.ts +34 -0
  185. package/module/imports.ts +46 -0
  186. package/module/index.ts +35 -0
  187. package/module/logger.ts +10 -0
  188. package/module/paths.ts +22 -0
  189. package/module/restart.ts +61 -0
  190. package/nuxt.config.ts +96 -0
  191. package/package.json +32 -0
  192. package/server/api/aside/major/nav/bookIds.ts +5 -0
  193. package/server/api/aside/major/nav/bookNav/[...bookId].ts +20 -0
  194. package/server/api/aside/major/nav/global.ts +7 -0
  195. package/server/api/aside/minor/news.ts +7 -0
  196. package/server/api/aside/minor/path.ts +78 -0
  197. package/server/api/bitran/content/[location].ts +7 -0
  198. package/server/api/bitran/toc/[location].ts +7 -0
  199. package/server/api/content/data.ts +72 -0
  200. package/server/api/contributor/count.ts +6 -0
  201. package/server/api/fake/content.ts +11 -0
  202. package/server/api/fake/shared/languages.ts +12 -0
  203. package/server/api/language/functions.ts +12 -0
  204. package/server/api/language/phrase/[phraseId].ts +19 -0
  205. package/server/api/language/phraseIds.ts +8 -0
  206. package/server/api/preview/page/[...parts].ts +51 -0
  207. package/server/api/preview/unique/[location].ts +55 -0
  208. package/server/plugin/bitran/content.ts +176 -0
  209. package/server/plugin/bitran/core.ts +51 -0
  210. package/server/plugin/bitran/location.ts +25 -0
  211. package/server/plugin/bitran/products/include.ts +229 -0
  212. package/server/plugin/bitran/products/link.ts +114 -0
  213. package/server/plugin/bitran/setup.ts +10 -0
  214. package/server/plugin/bitran/toc.ts +82 -0
  215. package/server/plugin/build/close.ts +10 -0
  216. package/server/plugin/build/jobs/content/builderArgs.ts +8 -0
  217. package/server/plugin/build/jobs/content/generic.ts +176 -0
  218. package/server/plugin/build/jobs/content/parse.ts +90 -0
  219. package/server/plugin/build/jobs/content/path.ts +6 -0
  220. package/server/plugin/build/jobs/content/type/book.ts +9 -0
  221. package/server/plugin/build/jobs/content/type/group.ts +37 -0
  222. package/server/plugin/build/jobs/content/type/topic.ts +36 -0
  223. package/server/plugin/build/jobs/contributors.ts +66 -0
  224. package/server/plugin/build/jobs/language.ts +36 -0
  225. package/server/plugin/build/jobs/nav.ts +209 -0
  226. package/server/plugin/build/process.ts +25 -0
  227. package/server/plugin/build/rebuild.ts +55 -0
  228. package/server/plugin/build/setup.ts +21 -0
  229. package/server/plugin/content/absoluteId.ts +94 -0
  230. package/server/plugin/content/context.ts +112 -0
  231. package/server/plugin/db/entities/Book.ts +7 -0
  232. package/server/plugin/db/entities/Content.ts +49 -0
  233. package/server/plugin/db/entities/Contribution.ts +10 -0
  234. package/server/plugin/db/entities/Contributor.ts +16 -0
  235. package/server/plugin/db/entities/Group.ts +14 -0
  236. package/server/plugin/db/entities/Hash.ts +15 -0
  237. package/server/plugin/db/entities/Topic.ts +20 -0
  238. package/server/plugin/db/entities/Unique.ts +21 -0
  239. package/server/plugin/db/setup.ts +34 -0
  240. package/server/plugin/global.ts +18 -0
  241. package/server/plugin/importer.ts +12 -0
  242. package/server/plugin/index.ts +9 -0
  243. package/server/plugin/logger.ts +23 -0
  244. package/server/plugin/nav/node.ts +26 -0
  245. package/server/plugin/nav/utils.ts +129 -0
  246. package/server/plugin/repository/book.ts +21 -0
  247. package/server/plugin/repository/content.ts +238 -0
  248. package/server/plugin/repository/contributor.ts +8 -0
  249. package/server/plugin/repository/frontNav.ts +148 -0
  250. package/server/plugin/repository/topic.ts +32 -0
  251. package/server/tsconfig.json +7 -0
  252. package/shared/aside/minor.ts +50 -0
  253. package/shared/asset.ts +15 -0
  254. package/shared/bitran/alias.ts +17 -0
  255. package/shared/bitran/context.ts +7 -0
  256. package/shared/bitran/location.ts +166 -0
  257. package/shared/bitran/products/alias/core/factory.ts +46 -0
  258. package/shared/bitran/products/alias/core/index.ts +13 -0
  259. package/shared/bitran/products/alias/render/Alias.vue +10 -0
  260. package/shared/bitran/products/alias/render/icon.svg +3 -0
  261. package/shared/bitran/products/alias/render/index.ts +17 -0
  262. package/shared/bitran/products/alias/render/languages/en.ts +5 -0
  263. package/shared/bitran/products/alias/render/languages/ru.ts +5 -0
  264. package/shared/bitran/products/alias/shared.ts +11 -0
  265. package/shared/bitran/products/heading/core/factory.ts +53 -0
  266. package/shared/bitran/products/heading/core/index.ts +19 -0
  267. package/shared/bitran/products/heading/render/Heading.vue +47 -0
  268. package/shared/bitran/products/heading/render/icon.svg +3 -0
  269. package/shared/bitran/products/heading/render/index.ts +17 -0
  270. package/shared/bitran/products/heading/render/languages/en.ts +5 -0
  271. package/shared/bitran/products/heading/render/languages/ru.ts +5 -0
  272. package/shared/bitran/products/heading/shared.ts +13 -0
  273. package/shared/bitran/products/include/core/factory.ts +61 -0
  274. package/shared/bitran/products/include/core/index.ts +13 -0
  275. package/shared/bitran/products/include/render/Include.vue +13 -0
  276. package/shared/bitran/products/include/render/icon.svg +3 -0
  277. package/shared/bitran/products/include/render/index.ts +18 -0
  278. package/shared/bitran/products/include/render/languages/en.ts +5 -0
  279. package/shared/bitran/products/include/render/languages/ru.ts +5 -0
  280. package/shared/bitran/products/include/shared.ts +15 -0
  281. package/shared/bitran/products/link/core/factory.ts +20 -0
  282. package/shared/bitran/products/link/core/index.ts +17 -0
  283. package/shared/bitran/products/link/render/Link.vue +174 -0
  284. package/shared/bitran/products/link/render/icon.svg +3 -0
  285. package/shared/bitran/products/link/render/index.ts +17 -0
  286. package/shared/bitran/products/link/render/languages/en.ts +5 -0
  287. package/shared/bitran/products/link/render/languages/ru.ts +5 -0
  288. package/shared/bitran/products/link/shared.ts +15 -0
  289. package/shared/bitran/products/link/target.ts +134 -0
  290. package/shared/bitran/toc.ts +8 -0
  291. package/shared/content/context.ts +9 -0
  292. package/shared/content/data/base.ts +32 -0
  293. package/shared/content/data/index.ts +5 -0
  294. package/shared/content/data/type/book.ts +5 -0
  295. package/shared/content/data/type/group.ts +6 -0
  296. package/shared/content/data/type/topic.ts +11 -0
  297. package/shared/content/previousNext.ts +9 -0
  298. package/shared/contributor.ts +5 -0
  299. package/shared/frontNav.ts +41 -0
  300. package/shared/icons.ts +38 -0
  301. package/shared/image.ts +5 -0
  302. package/shared/link.ts +25 -0
  303. package/shared/types/language.ts +75 -0
  304. package/shared/utils/objectsEqual.ts +4 -0
  305. package/shared/utils/stringColor.ts +9 -0
  306. package/test/bitran/alias.test.ts +44 -0
  307. package/test/bitran/location.test.ts +143 -0
  308. package/test/bitran/products/alias.test.ts +83 -0
  309. package/test/bitran/products/heading.test.ts +119 -0
  310. package/test/bitran/products/include.test.ts +77 -0
  311. package/test/bitran/products/link/factory.test.ts +30 -0
  312. package/test/bitran/products/link/target.test.ts +138 -0
  313. package/tsconfig.json +8 -0
  314. package/utils/stress.ts +9 -0
@@ -0,0 +1,382 @@
1
+ <script lang="ts" setup>
2
+ import { previewVisible } from '@app/scripts/preview/state';
3
+ import {
4
+ AsideType,
5
+ clickTargets,
6
+ forcedAside,
7
+ switchVisible,
8
+ } from '@app/scripts/aside';
9
+
10
+ const props = defineProps<{
11
+ type: AsideType;
12
+ }>();
13
+
14
+ const $style = useCssModule();
15
+
16
+ const switchElement = ref<HTMLElement>();
17
+ const asideElement = ref<HTMLElement>();
18
+
19
+ const canShowSwitch = computed(
20
+ () => switchVisible.value && !forcedAside.value && !previewVisible.value,
21
+ );
22
+ const asideForceVisible = computed(() => props.type === forcedAside.value);
23
+
24
+ const typeClass = props.type === AsideType.Major ? $style.major : $style.minor;
25
+
26
+ onMounted(() => {
27
+ clickTargets[props.type].push(
28
+ ...[switchElement.value!, asideElement.value!],
29
+ );
30
+ });
31
+
32
+ function switchClick() {
33
+ forcedAside.value = props.type;
34
+ }
35
+ </script>
36
+
37
+ <template>
38
+ <div
39
+ ref="switchElement"
40
+ @click="switchClick"
41
+ :class="[
42
+ $style.asideSwitch,
43
+ typeClass,
44
+ canShowSwitch ? $style.visible : '',
45
+ ]"
46
+ >
47
+ <MyIcon name="aside-open" />
48
+ </div>
49
+
50
+ <aside
51
+ ref="asideElement"
52
+ :class="[
53
+ $style.aside,
54
+ typeClass,
55
+ asideForceVisible ? $style.forceVisible : '',
56
+ ]"
57
+ >
58
+ <slot></slot>
59
+ <div :class="$style.innerShadow"></div>
60
+ </aside>
61
+ </template>
62
+
63
+ <style lang="scss" module>
64
+ @use '$/def/bp';
65
+ @use '$/def/z';
66
+ @use '$/def/size';
67
+
68
+ // !!
69
+ // !!
70
+ // !! Rewrite the whole logic based on coords relative to main content. It will be 1000% easier. See how <Preview> is implemented!
71
+ // !!
72
+ // !!
73
+
74
+ @function maxLayoutEdge() {
75
+ @return calc(
76
+ 50% - min(var(--wMainMax), calc(100% - 2 * var(--wAside))) / 2
77
+ );
78
+ }
79
+
80
+ @mixin ___asidePositionLogic {
81
+ /* For God's sake, don't ever touch this code */
82
+
83
+ --_pos: var(--_posHidden); // Start with hidden position (mobile first)
84
+
85
+ --_posHidden: calc(-1 * var(--wAside));
86
+ --_posVisible: var(--_posVisibleCorner);
87
+
88
+ --_posVisibleCorner: 0;
89
+ --_posVisibleMax: calc(#{maxLayoutEdge()} - var(--wAside));
90
+
91
+ &.major.forceVisible,
92
+ &.minor.forceVisible {
93
+ --_pos: var(--_posVisible); // Always visible when forced
94
+ }
95
+
96
+ &.major {
97
+ left: var(--_pos);
98
+
99
+ @include bp.above('aside1') {
100
+ --_posVisible: var(--_posVisibleCorner);
101
+ --_pos: var(--_posVisible);
102
+ }
103
+
104
+ @include bp.above('aside2') {
105
+ --_posVisible: var(--_posVisibleMax);
106
+ }
107
+ }
108
+
109
+ &.minor {
110
+ right: var(--_pos);
111
+
112
+ @include bp.above('aside2') {
113
+ --_posVisible: var(--_posVisibleMax);
114
+ --_pos: var(--_posVisible);
115
+ }
116
+ }
117
+ }
118
+
119
+ .aside {
120
+ //
121
+ // Global
122
+ //
123
+
124
+ position: fixed;
125
+ z-index: z.$aside;
126
+ top: 0;
127
+
128
+ width: var(--wAside);
129
+ height: 100dvh;
130
+
131
+ background: var(--bgAside);
132
+ backdrop-filter: initial;
133
+
134
+ --shadowColor: #{rgba(black, 0.065)};
135
+
136
+ @include transition(left, right, background, backdrop-filter, box-shadow);
137
+
138
+ @include dark {
139
+ --shadowColor: #{rgba(white, 0.075)};
140
+ }
141
+
142
+ //
143
+
144
+ @include ___asidePositionLogic;
145
+
146
+ //
147
+ // Global States
148
+ //
149
+
150
+ @mixin asideVisible {
151
+ }
152
+
153
+ @mixin asideHidden {
154
+ }
155
+
156
+ @mixin asideModal {
157
+ background: color-mix(
158
+ in srgb,
159
+ color-mix(in srgb, var(--bgAside), black 0%),
160
+ transparent 22%
161
+ );
162
+ backdrop-filter: blur(10px);
163
+
164
+ box-shadow:
165
+ 0px 0px 15px 15px rgba(0, 0, 0, 0.1),
166
+ 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
167
+
168
+ @include dark {
169
+ background: color-mix(in srgb, var(--bgAside), transparent 10%);
170
+
171
+ box-shadow:
172
+ 0px 0px 15px 15px rgba(255, 255, 255, 0.025),
173
+ 0px 0px 8px 0px rgba(255, 255, 255, 0.03);
174
+ }
175
+ }
176
+
177
+ &.major {
178
+ //
179
+ // Major Aside
180
+ //
181
+
182
+ box-shadow: -1px 0px 2px 0px var(--shadowColor);
183
+
184
+ @include bp.above('aside1') {
185
+ //
186
+ // Major Visible
187
+ //
188
+
189
+ @include asideVisible;
190
+ }
191
+
192
+ @include bp.below('aside1') {
193
+ //
194
+ // Major Hidden
195
+ //
196
+
197
+ @include asideHidden;
198
+
199
+ &.forceVisible {
200
+ //
201
+ // Major Modal
202
+ //
203
+
204
+ @include asideModal;
205
+ }
206
+ }
207
+ }
208
+
209
+ &.minor {
210
+ //
211
+ // Minor Aside
212
+ //
213
+
214
+ box-shadow: 1px 0px 2px 0px var(--shadowColor);
215
+
216
+ @include bp.above('aside2') {
217
+ //
218
+ // Minor Visible
219
+ //
220
+
221
+ @include asideVisible;
222
+ }
223
+
224
+ @include bp.below('aside2') {
225
+ //
226
+ // Minor Hidden
227
+ //
228
+
229
+ @include asideHidden;
230
+
231
+ &.forceVisible {
232
+ //
233
+ // Minor Modal
234
+ //
235
+
236
+ @include asideModal;
237
+ }
238
+ }
239
+ }
240
+ }
241
+
242
+ //
243
+ //
244
+ //
245
+
246
+ @mixin ___switchPositionLogic {
247
+ /* For God's sake, don't ever touch this code */
248
+
249
+ --_switchSize: calc(var(--iconSize) + 2 * var(--p) + var(--m));
250
+
251
+ --_pos: var(--_posHidden);
252
+
253
+ --_posVisible: calc(var(--_posHidden) + var(--_switchSize));
254
+ --_posHidden: var(--_posBehindCorner);
255
+
256
+ --_posBehindCorner: calc(-1 * var(--_switchSize));
257
+ --_posBehindMajorAside: calc(var(--wAside) - var(--_switchSize));
258
+ --_posBehindFullLayout: calc(#{maxLayoutEdge()} - var(--_switchSize));
259
+
260
+ &.visible {
261
+ --_pos: var(--_posVisible);
262
+ }
263
+
264
+ &.major {
265
+ left: var(--_pos);
266
+
267
+ @include bp.above('aside1') {
268
+ --_posHidden: var(--_posBehindMajorAside);
269
+ --_posVisible: var(--_posHidden);
270
+ }
271
+ }
272
+
273
+ &.minor {
274
+ right: var(--_pos);
275
+
276
+ @include bp.above('aside2') {
277
+ --_posVisible: var(--_posHidden);
278
+ }
279
+ }
280
+
281
+ &.major,
282
+ &.minor {
283
+ @include bp.above('aside2') {
284
+ --_posHidden: var(--_posBehindFullLayout);
285
+ }
286
+ }
287
+ }
288
+
289
+ .asideSwitch {
290
+ --iconSize: 36px;
291
+ --p: 12px;
292
+ --m: var(--gapBig);
293
+
294
+ //
295
+
296
+ position: fixed;
297
+ z-index: z.$asideSwitch;
298
+ bottom: 0;
299
+
300
+ font-size: var(--iconSize);
301
+ padding: var(--p);
302
+ margin: var(--gapBig);
303
+
304
+ background: #8c8c8c;
305
+ color: var(--bgMain);
306
+ box-shadow: 0px 0px 20px 20px var(--bgMain);
307
+ opacity: 0.95;
308
+
309
+ cursor: pointer;
310
+
311
+ @include transition(left, right, opacity, box-shadow);
312
+
313
+ @include dark {
314
+ background: #8c8c8c;
315
+ }
316
+
317
+ &:hover {
318
+ opacity: 1;
319
+ }
320
+
321
+ &.minor {
322
+ svg {
323
+ transform: scaleX(-1);
324
+ }
325
+ }
326
+
327
+ @mixin invisible {
328
+ box-shadow: none; /* TODO: Fix missing fade-out transition! */
329
+ }
330
+
331
+ //
332
+
333
+ @include ___switchPositionLogic;
334
+
335
+ &:not(.visible) {
336
+ @include invisible;
337
+ }
338
+ &.major {
339
+ @include bp.above('aside1') {
340
+ @include invisible;
341
+ }
342
+ }
343
+ @include bp.above('aside2') {
344
+ @include invisible;
345
+ }
346
+ }
347
+
348
+ //
349
+ //
350
+ //
351
+
352
+ .innerShadow {
353
+ position: absolute;
354
+ z-index: 9999;
355
+ top: 0;
356
+ width: 30px;
357
+ height: 100%;
358
+ pointer-events: none;
359
+ touch-action: none;
360
+ box-shadow: -1px 0px 2px 0px
361
+ color-mix(in srgb, var(--invert), transparent 93%) inset;
362
+
363
+ @include transition(box-shadow);
364
+
365
+ .major & {
366
+ right: 0;
367
+
368
+ @include bp.below('aside1') {
369
+ box-shadow: none;
370
+ }
371
+ }
372
+
373
+ .minor & {
374
+ left: 0;
375
+ transform: scaleX(-1);
376
+
377
+ @include bp.below('aside2') {
378
+ box-shadow: none;
379
+ }
380
+ }
381
+ }
382
+ </style>
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <main :class="$style.main" erudit-main>
3
+ <ClientOnly>
4
+ <Preview />
5
+ </ClientOnly>
6
+ <div :class="$style.mainInner">
7
+ <slot></slot>
8
+ </div>
9
+ </main>
10
+ </template>
11
+
12
+ <style lang="scss" module>
13
+ @use '$/def/bp';
14
+ @use 'bitran/public/scss/def' as bitranDef;
15
+
16
+ .main {
17
+ --_pMainBase: var(--gapBig);
18
+ --_pMainX: var(--_pMainBase);
19
+ --_pMainY: calc(var(--_pMainBase) / 2);
20
+
21
+ position: relative;
22
+ min-height: 100dvh;
23
+ background: var(--bgMain);
24
+ font-size: 18px;
25
+
26
+ @include bp.below('mobile') {
27
+ --_pMainBase: #{bitranDef.$asideFullWidth};
28
+ font-size: 15px;
29
+ }
30
+
31
+ .mainInner {
32
+ padding: var(--_pMainY) 0;
33
+ }
34
+ }
35
+ </style>
@@ -0,0 +1,51 @@
1
+ <script lang="ts" setup>
2
+ const props = defineProps<{
3
+ bannerId: string;
4
+ }>();
5
+
6
+ const { getElementId, registerBanner } = useDarkMagic();
7
+ const phrase = await usePhrases('ads_replacer', '_language_code');
8
+
9
+ onMounted(() => {
10
+ registerBanner(props.bannerId);
11
+ });
12
+ </script>
13
+
14
+ <template>
15
+ <section :class="$style.darkMagicContainer">
16
+ <div :id="getElementId(bannerId)">
17
+ <div :class="$style.darkMagicReplacer">
18
+ <MyIcon name="pirate" />
19
+ <div v-html="phrase.ads_replacer"></div>
20
+ </div>
21
+ </div>
22
+ </section>
23
+ </template>
24
+
25
+ <style lang="scss" module>
26
+ .darkMagicContainer {
27
+ --maxHeight: 300px;
28
+
29
+ > div {
30
+ width: 100%;
31
+ max-height: var(--maxHeight);
32
+ }
33
+ }
34
+
35
+ .darkMagicReplacer {
36
+ max-height: var(--maxHeight);
37
+ height: var(--maxHeight);
38
+ width: 100%;
39
+ background: var(--bgAccent);
40
+ box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.1) inset;
41
+ color: var(--textMuted);
42
+
43
+ @include dark {
44
+ box-shadow: 0px 0px 3px 1px rgba(white, 0.025) inset;
45
+ }
46
+
47
+ strong {
48
+ color: inherit;
49
+ }
50
+ }
51
+ </style>
@@ -0,0 +1,45 @@
1
+ <script lang="ts" setup>
2
+ import eruditConfig from '#erudit/config';
3
+ </script>
4
+
5
+ <template>
6
+ <AdsBannerTemplate
7
+ :bannerId="eruditConfig.ads!.bottomBlockId!"
8
+ :class="$style.darkMagicBottom"
9
+ />
10
+ </template>
11
+
12
+ <style lang="scss" module>
13
+ @use '$/def/bp';
14
+ @use '$/partials/darkMagic';
15
+
16
+ .darkMagicBottom {
17
+ --maxHeight: 300px;
18
+
19
+ padding: var(--_pMainY) var(--_pMainX);
20
+ padding-top: var(--gapBig);
21
+
22
+ @include darkMagic.replacer {
23
+ display: flex;
24
+ justify-content: center;
25
+ align-items: center;
26
+ gap: var(--gapBig);
27
+ font-size: 22px;
28
+
29
+ [my-icon] {
30
+ font-size: 60px;
31
+ }
32
+
33
+ @include bp.below('mobile') {
34
+ flex-direction: column;
35
+ gap: var(--gap);
36
+ font-size: 16px;
37
+ text-align: center;
38
+
39
+ [my-icon] {
40
+ font-size: 68px;
41
+ }
42
+ }
43
+ }
44
+ }
45
+ </style>
@@ -0,0 +1,50 @@
1
+ <script lang="ts" setup>
2
+ import eruditConfig from '#erudit/config';
3
+ </script>
4
+
5
+ <template>
6
+ <AdsBannerTemplate
7
+ :bannerId="eruditConfig.ads!.leftBlockId!"
8
+ :class="$style.darkMagicLeft"
9
+ />
10
+ </template>
11
+
12
+ <style lang="scss" module>
13
+ @use '$/partials/darkMagic';
14
+
15
+ .darkMagicLeft {
16
+ --maxHeight: 300px;
17
+
18
+ padding: var(--gap);
19
+ border-top: 1px solid var(--border);
20
+
21
+ @media (max-height: 1080px) {
22
+ --maxHeight: 200px;
23
+ }
24
+
25
+ @media (max-height: 700px) {
26
+ --maxHeight: 100px;
27
+ [my-icon] {
28
+ display: none;
29
+ }
30
+ }
31
+
32
+ @media (max-height: 350px) {
33
+ display: none;
34
+ }
35
+
36
+ @include darkMagic.replacer {
37
+ display: flex;
38
+ flex-direction: column;
39
+ justify-content: center;
40
+ align-items: center;
41
+ gap: var(--gap);
42
+ text-align: center;
43
+ font-size: 0.95em;
44
+
45
+ [my-icon] {
46
+ font-size: 46px;
47
+ }
48
+ }
49
+ }
50
+ </style>
@@ -0,0 +1,74 @@
1
+ <script lang="ts" setup>
2
+ import type { MyIconName } from '#my-icons';
3
+
4
+ defineProps<{
5
+ link?: string;
6
+ icon?: MyIconName;
7
+ main?: string;
8
+ active?: boolean;
9
+ secondary?: string;
10
+ }>();
11
+
12
+ const nuxtLink = defineNuxtLink({});
13
+ </script>
14
+
15
+ <template>
16
+ <component
17
+ :is="link ? nuxtLink : 'div'"
18
+ :to="link"
19
+ :class="[$style.asideListItem, active ? $style.active : '']"
20
+ >
21
+ <slot>
22
+ <MyIcon v-if="icon" :name="icon" />
23
+ <div :class="$style.main">{{ main }}</div>
24
+ <div v-if="secondary" :class="$style.secondary">
25
+ {{ secondary }}
26
+ </div>
27
+ </slot>
28
+ </component>
29
+ </template>
30
+
31
+ <style lang="scss" module>
32
+ .asideListItem {
33
+ display: flex;
34
+ align-items: center;
35
+ gap: var(--gap);
36
+ padding: var(--gap);
37
+ height: 60px;
38
+ border-bottom: 1px solid var(--border);
39
+ color: var(--textMuted);
40
+ text-decoration: none;
41
+ background: transparent;
42
+ cursor: pointer;
43
+ @include transition(color, background);
44
+
45
+ &:hover {
46
+ color: var(--text);
47
+ background: var(--bgAccent);
48
+ }
49
+
50
+ [my-icon] {
51
+ position: relative;
52
+ top: 1px;
53
+ flex-shrink: 0;
54
+ font-size: 20px;
55
+ }
56
+
57
+ .secondary {
58
+ font-weight: 500;
59
+ color: var(--textDimmed);
60
+ }
61
+
62
+ [my-icon],
63
+ .main {
64
+ @include transition(color);
65
+ }
66
+
67
+ &.active {
68
+ [my-icon],
69
+ .main {
70
+ color: var(--brand);
71
+ }
72
+ }
73
+ }
74
+ </style>
@@ -0,0 +1,56 @@
1
+ <script lang="ts" setup>
2
+ import eruditConfig from '#erudit/config';
3
+
4
+ import PaneSwitch from './major/PaneSwitch.vue';
5
+
6
+ const { panes, activePane, getPaneOrder } = useMajorPane();
7
+
8
+ function paneStyle(paneKey: MajorPaneKey) {
9
+ const thisPaneOrder = getPaneOrder(paneKey);
10
+ const activePaneOrder = getPaneOrder(activePane.value);
11
+
12
+ return {
13
+ left: `calc(${Math.sign(thisPaneOrder - activePaneOrder)} * var(--wAside))`,
14
+ opacity: thisPaneOrder === activePaneOrder ? 1 : 0,
15
+ };
16
+ }
17
+ </script>
18
+
19
+ <template>
20
+ <div :class="$style.asideInner">
21
+ <AsideMajorSiteInfo />
22
+ <PaneSwitch />
23
+ <div :class="$style.paneHolder">
24
+ <component
25
+ v-for="(pane, paneKey) of panes"
26
+ :is="pane.content"
27
+ :class="$style.pane"
28
+ :style="paneStyle(paneKey)"
29
+ />
30
+ </div>
31
+ <AdsLeftBanner v-if="eruditConfig.ads?.leftBlockId" />
32
+ </div>
33
+ </template>
34
+
35
+ <style lang="scss" module>
36
+ .asideInner {
37
+ display: flex;
38
+ flex-direction: column;
39
+ height: 100%;
40
+ }
41
+
42
+ .paneHolder {
43
+ flex: 1;
44
+ position: relative;
45
+ overflow-x: hidden;
46
+ }
47
+
48
+ .pane {
49
+ position: absolute;
50
+ top: 0;
51
+ width: 100%;
52
+ height: 100%;
53
+ opacity: 0;
54
+ @include transition(left, opacity);
55
+ }
56
+ </style>