@reuters-graphics/graphics-components 0.0.1-beta.1

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 (195) hide show
  1. package/README.md +7 -0
  2. package/dist/@types/actions/cssVariables/index.d.ts +4 -0
  3. package/dist/@types/actions/resizeObserver/index.d.ts +4 -0
  4. package/dist/@types/components/@types/global.d.ts +28 -0
  5. package/dist/@types/components/Article/Article.svelte.d.ts +32 -0
  6. package/dist/@types/components/BeforeAfter/BeforeAfter.svelte.d.ts +57 -0
  7. package/dist/@types/components/Block/Block.svelte.d.ts +24 -0
  8. package/dist/@types/components/BodyText/BodyText.svelte.d.ts +20 -0
  9. package/dist/@types/components/DatawrapperChart/DatawrapperChart.svelte.d.ts +52 -0
  10. package/dist/@types/components/EmbedPreviewerLink/EmbedPreviewerLink.svelte.d.ts +16 -0
  11. package/dist/@types/components/FeaturePhoto/FeaturePhoto.svelte.d.ts +43 -0
  12. package/dist/@types/components/Framer/Framer.svelte.d.ts +29 -0
  13. package/dist/@types/components/Framer/Resizer/index.svelte.d.ts +27 -0
  14. package/dist/@types/components/Framer/stores.d.ts +1 -0
  15. package/dist/@types/components/Framer/uniqNames.d.ts +2 -0
  16. package/dist/@types/components/GraphicBlock/AriaHidden.svelte.d.ts +20 -0
  17. package/dist/@types/components/GraphicBlock/GraphicBlock.svelte.d.ts +64 -0
  18. package/dist/@types/components/GraphicBlock/TextBlock.svelte.d.ts +19 -0
  19. package/dist/@types/components/Headline/Headline.svelte.d.ts +29 -0
  20. package/dist/@types/components/Hero/Hero.svelte.d.ts +41 -0
  21. package/dist/@types/components/NoteText/NoteText.svelte.d.ts +20 -0
  22. package/dist/@types/components/PaddingReset/index.svelte.d.ts +27 -0
  23. package/dist/@types/components/PhotoPack/PhotoPack.svelte.d.ts +50 -0
  24. package/dist/@types/components/PhotoPack/docProps.d.ts +38 -0
  25. package/dist/@types/components/PymChild/PymChild.svelte.d.ts +16 -0
  26. package/dist/@types/components/ReutersLogo/ReutersLogo.svelte.d.ts +18 -0
  27. package/dist/@types/components/SEO/SEO.svelte.d.ts +66 -0
  28. package/dist/@types/components/SEO/analytics.d.ts +2 -0
  29. package/dist/@types/components/SEO/publisherTags.d.ts +2 -0
  30. package/dist/@types/components/Scroller/Background.svelte.d.ts +20 -0
  31. package/dist/@types/components/Scroller/Embedded/Background.svelte.d.ts +19 -0
  32. package/dist/@types/components/Scroller/Embedded/Foreground.svelte.d.ts +18 -0
  33. package/dist/@types/components/Scroller/Embedded/index.svelte.d.ts +19 -0
  34. package/dist/@types/components/Scroller/Foreground.svelte.d.ts +17 -0
  35. package/dist/@types/components/Scroller/Scroller.svelte.d.ts +76 -0
  36. package/dist/@types/components/Sharer/Sharer.svelte.d.ts +19 -0
  37. package/dist/@types/components/Sharer/utils/copyToClipboard.d.ts +2 -0
  38. package/dist/@types/components/Sharer/utils/facebook.d.ts +2 -0
  39. package/dist/@types/components/Sharer/utils/meta.d.ts +2 -0
  40. package/dist/@types/components/Sharer/utils/twitter.d.ts +2 -0
  41. package/dist/@types/components/SiteFooter/CompanyLinks.svelte.d.ts +23 -0
  42. package/dist/@types/components/SiteFooter/LegalLinks.svelte.d.ts +23 -0
  43. package/dist/@types/components/SiteFooter/QuickLinks.svelte.d.ts +23 -0
  44. package/dist/@types/components/SiteFooter/Referrals/IntersectionObserver.svelte.d.ts +39 -0
  45. package/dist/@types/components/SiteFooter/Referrals/Link.svelte.d.ts +29 -0
  46. package/dist/@types/components/SiteFooter/Referrals/Referrals.svelte.d.ts +23 -0
  47. package/dist/@types/components/SiteFooter/Referrals/index.svelte.d.ts +23 -0
  48. package/dist/@types/components/SiteFooter/SiteFooter.svelte.d.ts +23 -0
  49. package/dist/@types/components/SiteFooter/svgs/Facebook.svelte.d.ts +23 -0
  50. package/dist/@types/components/SiteFooter/svgs/Graphics.svelte.d.ts +19 -0
  51. package/dist/@types/components/SiteFooter/svgs/Instagram.svelte.d.ts +23 -0
  52. package/dist/@types/components/SiteFooter/svgs/LinkedIn.svelte.d.ts +23 -0
  53. package/dist/@types/components/SiteFooter/svgs/Pictures.svelte.d.ts +19 -0
  54. package/dist/@types/components/SiteFooter/svgs/Twitter.svelte.d.ts +23 -0
  55. package/dist/@types/components/SiteFooter/svgs/Videos.svelte.d.ts +19 -0
  56. package/dist/@types/components/SiteFooter/svgs/YouTube.svelte.d.ts +23 -0
  57. package/dist/@types/components/SiteHeader/MobileMenu/index.svelte.d.ts +27 -0
  58. package/dist/@types/components/SiteHeader/NavBar/DownArrow.svelte.d.ts +23 -0
  59. package/dist/@types/components/SiteHeader/NavBar/NavDropdown/MoreDropdown.svelte.d.ts +23 -0
  60. package/dist/@types/components/SiteHeader/NavBar/NavDropdown/SectionDropdown.svelte.d.ts +25 -0
  61. package/dist/@types/components/SiteHeader/NavBar/NavDropdown/Spinner/index.svelte.d.ts +19 -0
  62. package/dist/@types/components/SiteHeader/NavBar/NavDropdown/StoryCard/index.svelte.d.ts +25 -0
  63. package/dist/@types/components/SiteHeader/NavBar/NavDropdown/StoryCard/time.d.ts +1 -0
  64. package/dist/@types/components/SiteHeader/NavBar/NavDropdown/index.svelte.d.ts +27 -0
  65. package/dist/@types/components/SiteHeader/NavBar/index.svelte.d.ts +23 -0
  66. package/dist/@types/components/SiteHeader/NavBar/utils/index.d.ts +1 -0
  67. package/dist/@types/components/SiteHeader/SiteHeader.svelte.d.ts +14 -0
  68. package/dist/@types/components/SiteHeader/svgs/Close.svelte.d.ts +19 -0
  69. package/dist/@types/components/SiteHeader/svgs/Menu.svelte.d.ts +23 -0
  70. package/dist/@types/components/Spinner/Spinner.svelte.d.ts +28 -0
  71. package/dist/@types/components/Theme/@types/component.d.ts +28 -0
  72. package/dist/@types/components/Theme/Theme.svelte.d.ts +54 -0
  73. package/dist/@types/components/Theme/themes/dark.d.ts +2 -0
  74. package/dist/@types/components/Theme/themes/light.d.ts +22 -0
  75. package/dist/@types/components/Theme/utils/flatten.d.ts +1 -0
  76. package/dist/@types/components/Theme/utils/merge.d.ts +4 -0
  77. package/dist/@types/components/Video/Controls.svelte.d.ts +45 -0
  78. package/dist/@types/components/Video/Video.svelte.d.ts +46 -0
  79. package/dist/@types/components/Visible/Visible.svelte.d.ts +29 -0
  80. package/dist/@types/index.d.ts +24 -0
  81. package/dist/actions/cssVariables/index.js +20 -0
  82. package/dist/actions/resizeObserver/index.js +25 -0
  83. package/dist/components/@types/global.js +1 -0
  84. package/dist/components/Article/Article.svelte +47 -0
  85. package/dist/components/BeforeAfter/BeforeAfter.svelte +341 -0
  86. package/dist/components/Block/Block.svelte +177 -0
  87. package/dist/components/BodyText/BodyText.svelte +193 -0
  88. package/dist/components/DatawrapperChart/DatawrapperChart.svelte +105 -0
  89. package/dist/components/EmbedPreviewerLink/EmbedPreviewerLink.svelte +26 -0
  90. package/dist/components/FeaturePhoto/FeaturePhoto.svelte +113 -0
  91. package/dist/components/Framer/Framer.svelte +136 -0
  92. package/dist/components/Framer/Resizer/index.svelte +223 -0
  93. package/dist/components/Framer/stores.js +3 -0
  94. package/dist/components/Framer/uniqNames.js +54 -0
  95. package/dist/components/GraphicBlock/AriaHidden.svelte +13 -0
  96. package/dist/components/GraphicBlock/GraphicBlock.svelte +269 -0
  97. package/dist/components/GraphicBlock/TextBlock.svelte +12 -0
  98. package/dist/components/Headline/Headline.svelte +109 -0
  99. package/dist/components/Hero/Hero.svelte +78 -0
  100. package/dist/components/NoteText/NoteText.svelte +124 -0
  101. package/dist/components/PaddingReset/index.svelte +17 -0
  102. package/dist/components/PhotoPack/PhotoPack.svelte +156 -0
  103. package/dist/components/PhotoPack/docProps.js +20 -0
  104. package/dist/components/PymChild/PymChild.svelte +10 -0
  105. package/dist/components/ReutersLogo/ReutersLogo.svelte +21 -0
  106. package/dist/components/SEO/SEO.svelte +179 -0
  107. package/dist/components/SEO/analytics.js +332 -0
  108. package/dist/components/SEO/publisherTags.js +26 -0
  109. package/dist/components/Scroller/Background.svelte +30 -0
  110. package/dist/components/Scroller/Embedded/Background.svelte +14 -0
  111. package/dist/components/Scroller/Embedded/Foreground.svelte +203 -0
  112. package/dist/components/Scroller/Embedded/index.svelte +18 -0
  113. package/dist/components/Scroller/Foreground.svelte +42 -0
  114. package/dist/components/Scroller/Scroller.svelte +210 -0
  115. package/dist/components/Sharer/Sharer.svelte +157 -0
  116. package/dist/components/Sharer/utils/copyToClipboard.js +10 -0
  117. package/dist/components/Sharer/utils/facebook.js +22 -0
  118. package/dist/components/Sharer/utils/meta.js +7 -0
  119. package/dist/components/Sharer/utils/twitter.js +22 -0
  120. package/dist/components/SiteFooter/CompanyLinks.svelte +173 -0
  121. package/dist/components/SiteFooter/LegalLinks.svelte +202 -0
  122. package/dist/components/SiteFooter/QuickLinks.svelte +259 -0
  123. package/dist/components/SiteFooter/Referrals/IntersectionObserver.svelte +45 -0
  124. package/dist/components/SiteFooter/Referrals/Link.svelte +73 -0
  125. package/dist/components/SiteFooter/Referrals/Referrals.svelte +56 -0
  126. package/dist/components/SiteFooter/Referrals/index.svelte +53 -0
  127. package/dist/components/SiteFooter/SiteFooter.svelte +41 -0
  128. package/dist/components/SiteFooter/data.json +210 -0
  129. package/dist/components/SiteFooter/svgs/Facebook.svelte +18 -0
  130. package/dist/components/SiteFooter/svgs/Graphics.svelte +18 -0
  131. package/dist/components/SiteFooter/svgs/Instagram.svelte +20 -0
  132. package/dist/components/SiteFooter/svgs/LinkedIn.svelte +18 -0
  133. package/dist/components/SiteFooter/svgs/Pictures.svelte +14 -0
  134. package/dist/components/SiteFooter/svgs/Twitter.svelte +18 -0
  135. package/dist/components/SiteFooter/svgs/Videos.svelte +14 -0
  136. package/dist/components/SiteFooter/svgs/YouTube.svelte +18 -0
  137. package/dist/components/SiteHeader/MobileMenu/index.svelte +199 -0
  138. package/dist/components/SiteHeader/NavBar/DownArrow.svelte +26 -0
  139. package/dist/components/SiteHeader/NavBar/NavDropdown/MoreDropdown.svelte +112 -0
  140. package/dist/components/SiteHeader/NavBar/NavDropdown/SectionDropdown.svelte +118 -0
  141. package/dist/components/SiteHeader/NavBar/NavDropdown/Spinner/index.svelte +49 -0
  142. package/dist/components/SiteHeader/NavBar/NavDropdown/StoryCard/index.svelte +99 -0
  143. package/dist/components/SiteHeader/NavBar/NavDropdown/StoryCard/time.js +70 -0
  144. package/dist/components/SiteHeader/NavBar/NavDropdown/index.svelte +277 -0
  145. package/dist/components/SiteHeader/NavBar/index.svelte +234 -0
  146. package/dist/components/SiteHeader/NavBar/utils/index.js +2 -0
  147. package/dist/components/SiteHeader/SiteHeader.svelte +235 -0
  148. package/dist/components/SiteHeader/data.json +1 -0
  149. package/dist/components/SiteHeader/scss/_breakpoints.scss +59 -0
  150. package/dist/components/SiteHeader/scss/_colors.scss +25 -0
  151. package/dist/components/SiteHeader/scss/_eases.scss +9 -0
  152. package/dist/components/SiteHeader/scss/_grids.scss +126 -0
  153. package/dist/components/SiteHeader/scss/_z-indexes.scss +15 -0
  154. package/dist/components/SiteHeader/svgs/Close.svelte +14 -0
  155. package/dist/components/SiteHeader/svgs/Menu.svelte +19 -0
  156. package/dist/components/Spinner/Spinner.svelte +91 -0
  157. package/dist/components/Theme/@types/component.js +3 -0
  158. package/dist/components/Theme/Theme.svelte +37 -0
  159. package/dist/components/Theme/themes/dark.js +23 -0
  160. package/dist/components/Theme/themes/light.js +22 -0
  161. package/dist/components/Theme/utils/flatten.js +39 -0
  162. package/dist/components/Theme/utils/merge.js +23 -0
  163. package/dist/components/Video/Controls.svelte +68 -0
  164. package/dist/components/Video/Video.svelte +278 -0
  165. package/dist/components/Visible/Visible.svelte +54 -0
  166. package/dist/index.js +31 -0
  167. package/dist/scss/_mixins.scss +6 -0
  168. package/dist/scss/_variables.scss +2 -0
  169. package/dist/scss/bootstrap/_main.scss +34 -0
  170. package/dist/scss/bootstrap/_variables.scss +10 -0
  171. package/dist/scss/colours/thematic/_nord.scss +40 -0
  172. package/dist/scss/colours/thematic/_tr.scss +27 -0
  173. package/dist/scss/components/_hero-title.scss +118 -0
  174. package/dist/scss/fonts/_font-faces.scss +129 -0
  175. package/dist/scss/fonts/_mixins.scss +25 -0
  176. package/dist/scss/fonts/_rules.scss +19 -0
  177. package/dist/scss/fonts/_variables.scss +26 -0
  178. package/dist/scss/main.scss +16 -0
  179. package/dist/scss/mixins/_block.scss +62 -0
  180. package/dist/scss/mixins/_body-text.scss +113 -0
  181. package/dist/scss/mixins/_graphic.scss +66 -0
  182. package/dist/scss/mixins/_note-text.scss +34 -0
  183. package/dist/scss/mixins/_visually-hidden.scss +12 -0
  184. package/dist/scss/spacers/_rules.scss +65 -0
  185. package/dist/scss/spacers/_variables.scss +19 -0
  186. package/dist/scss/typography/_box-shadow.scss +11 -0
  187. package/dist/scss/typography/_font-size.scss +81 -0
  188. package/dist/scss/typography/_letter-spacing.scss +15 -0
  189. package/dist/scss/typography/_main.scss +5 -0
  190. package/dist/scss/typography/_mixins.scss +26 -0
  191. package/dist/scss/typography/_rules.scss +83 -0
  192. package/dist/scss/typography/_text-shadow.scss +13 -0
  193. package/dist/scss/typography/_transform.scss +7 -0
  194. package/dist/scss/typography/_variables.scss +39 -0
  195. package/package.json +210 -0
@@ -0,0 +1,202 @@
1
+ <script>
2
+ import { normalizeUrl } from '../SiteHeader/NavBar/utils';
3
+
4
+ export let links = {};
5
+ </script>
6
+
7
+ {#if links.ad_links}
8
+ <section class="legal">
9
+ <div class="content-container">
10
+ <section class="ad-links">
11
+ <ul class="link-group">
12
+ {#each links.ad_links as link}
13
+ <li>
14
+ <a href="{normalizeUrl(link.url)}">
15
+ {link.text}
16
+ </a>
17
+ </li>
18
+ {/each}
19
+ </ul>
20
+ </section>
21
+ <p class="disclaimer">
22
+ All quotes delayed a minimum of 15 minutes. <a
23
+ href="{normalizeUrl(links.disclaimer_link)}"
24
+ >See here for a complete list of exchanges and delays</a
25
+ >.
26
+ </p>
27
+ <section class="misc-links">
28
+ <ul class="link-group">
29
+ {#each links.misc_links.filter((d) => !d.self) as link}
30
+ <li>
31
+ <a href="{normalizeUrl(link.url)}">
32
+ {link.text}
33
+ </a>
34
+ </li>
35
+ {/each}
36
+ </ul>
37
+ </section>
38
+ <p class="copyright">
39
+ © {links.copyright_year} Reuters.
40
+ <a href="{normalizeUrl(links.copyright_link)}">All rights reserved</a>
41
+ </p>
42
+ </div>
43
+ </section>
44
+ {/if}
45
+
46
+ <style>.content-container {
47
+ max-width: 1440px;
48
+ width: 100%;
49
+ margin: 0 auto;
50
+ }
51
+
52
+ .legal {
53
+ padding-top: 24px;
54
+ padding-bottom: 24px;
55
+ box-sizing: border-box;
56
+ }
57
+ .legal .content-container {
58
+ display: grid;
59
+ grid-template-columns: repeat(12, 1fr);
60
+ grid-column-gap: 2.2222222222vw;
61
+ }
62
+ @media (max-width: 1023px) {
63
+ .legal .content-container {
64
+ grid-column-gap: 4.2666666667vw;
65
+ }
66
+ }
67
+ @media (min-width: 1440px) {
68
+ .legal .content-container {
69
+ grid-column-gap: 32px;
70
+ }
71
+ }
72
+ @media (max-width: 1023px) {
73
+ .legal .content-container {
74
+ grid-template-columns: repeat(4, 1fr);
75
+ }
76
+ }
77
+
78
+ .legal {
79
+ border-top: 1px solid var(--nav-rules, #d0d0d0);
80
+ }
81
+ .legal .content-container {
82
+ padding-left: 2.2222222222vw;
83
+ padding-right: 2.2222222222vw;
84
+ box-sizing: border-box;
85
+ }
86
+ @media (max-width: 1023px) {
87
+ .legal .content-container {
88
+ padding-left: 4.2666666667vw;
89
+ padding-right: 4.2666666667vw;
90
+ }
91
+ }
92
+ @media (min-width: 1440px) {
93
+ .legal .content-container {
94
+ padding-left: 32px;
95
+ padding-right: 32px;
96
+ }
97
+ }
98
+
99
+ .legal .content-container {
100
+ grid-row-gap: 1.1111111111vw;
101
+ }
102
+ @media (min-width: 1440px) {
103
+ .legal .content-container {
104
+ grid-row-gap: 16px;
105
+ }
106
+ }
107
+ .legal .content-container .ad-links {
108
+ grid-column: 1/span 5;
109
+ grid-row: 1;
110
+ }
111
+ .legal .content-container .misc-links {
112
+ grid-column: 5/span 8;
113
+ grid-row: 1;
114
+ justify-self: end;
115
+ }
116
+ .legal .content-container .disclaimer {
117
+ grid-column: 1/span 7;
118
+ grid-row: 2;
119
+ }
120
+ .legal .content-container .copyright {
121
+ grid-column: 8/span 5;
122
+ grid-row: 2;
123
+ justify-self: end;
124
+ }
125
+ @media (max-width: 1023px) {
126
+ .legal .content-container {
127
+ grid-row-gap: 2.2222222222vw;
128
+ }
129
+ }
130
+ @media (max-width: 1023px) and (max-width: 1023px) {
131
+ .legal .content-container {
132
+ grid-row-gap: 4.2666666667vw;
133
+ }
134
+ }
135
+ @media (max-width: 1023px) and (min-width: 1440px) {
136
+ .legal .content-container {
137
+ grid-row-gap: 32px;
138
+ }
139
+ }
140
+ @media (max-width: 1023px) {
141
+ .legal .content-container .ad-links,
142
+ .legal .content-container .misc-links,
143
+ .legal .content-container .disclaimer,
144
+ .legal .content-container .copyright {
145
+ grid-column: 1/span 4;
146
+ justify-self: start;
147
+ }
148
+ }
149
+ @media (max-width: 1023px) {
150
+ .legal .content-container .ad-links {
151
+ grid-row: 1;
152
+ }
153
+ }
154
+ @media (max-width: 1023px) {
155
+ .legal .content-container .disclaimer {
156
+ grid-row: 2;
157
+ }
158
+ }
159
+ @media (max-width: 1023px) {
160
+ .legal .content-container .misc-links {
161
+ grid-row: 3;
162
+ }
163
+ }
164
+ @media (max-width: 1023px) {
165
+ .legal .content-container .copyright {
166
+ grid-row: 4;
167
+ }
168
+ }
169
+
170
+ .link-group {
171
+ margin: 0;
172
+ padding: 0;
173
+ }
174
+ .link-group li {
175
+ display: inline-flex;
176
+ margin-right: 16px;
177
+ list-style: none;
178
+ align-items: center;
179
+ }
180
+ .link-group li a {
181
+ font-family: "Knowledge", "Source Sans Pro", Arial, sans-serif;
182
+ color: var(--nav-primary, #404040);
183
+ font-size: 14px;
184
+ font-weight: 500;
185
+ }
186
+
187
+ section {
188
+ max-width: 100%;
189
+ margin: 0;
190
+ }
191
+
192
+ p.copyright,
193
+ p.disclaimer {
194
+ margin: 0;
195
+ font-family: "Knowledge", "Source Sans Pro", Arial, sans-serif;
196
+ font-size: 14px;
197
+ color: var(--nav-primary, #404040);
198
+ }
199
+ p.copyright a,
200
+ p.disclaimer a {
201
+ color: inherit;
202
+ }</style>
@@ -0,0 +1,259 @@
1
+ <script>
2
+ import { normalizeUrl } from '../SiteHeader/NavBar/utils';
3
+
4
+ import Graphics from './svgs/Graphics.svelte';
5
+ import Pictures from './svgs/Pictures.svelte';
6
+ import Videos from './svgs/Videos.svelte';
7
+
8
+ const symbols = {
9
+ graphics: Graphics,
10
+ pictures: Pictures,
11
+ videos: Videos,
12
+ };
13
+
14
+ export let links = {};
15
+
16
+ let windowWidth = 1200;
17
+ const mobileBreakpoint = 745;
18
+ </script>
19
+
20
+ <svelte:window bind:innerWidth="{windowWidth}" />
21
+
22
+ {#if links.latest_links}
23
+ <section class="quick-links">
24
+ <h2 class="visually-hidden">Site Index</h2>
25
+ <div class="content-container">
26
+ {#if windowWidth < mobileBreakpoint}
27
+ <div class="latest-and-media">
28
+ <section class="link-group">
29
+ <h3>Latest</h3>
30
+ <ul>
31
+ {#each links.latest_links as link}
32
+ <li>
33
+ <a href="{normalizeUrl(link.url)}">{link.text}</a>
34
+ </li>
35
+ {/each}
36
+ </ul>
37
+ </section>
38
+ <section class="link-group media">
39
+ <h3>Media</h3>
40
+ <ul>
41
+ {#each links.media_links as link}
42
+ <li>
43
+ <div class="symbol">
44
+ <svelte:component this="{symbols[link.symbol]}" />
45
+ </div>
46
+ <a href="{normalizeUrl(link.url)}">
47
+ {link.text}
48
+ </a>
49
+ </li>
50
+ {/each}
51
+ </ul>
52
+ </section>
53
+ </div>
54
+ {:else}
55
+ <section class="link-group">
56
+ <h3>Latest</h3>
57
+ <ul>
58
+ {#each links.latest_links as link}
59
+ <li>
60
+ <a href="{normalizeUrl(link.url)}">{link.text}</a>
61
+ </li>
62
+ {/each}
63
+ </ul>
64
+ </section>
65
+ {/if}
66
+
67
+ <section class="link-group">
68
+ <h3>Browse</h3>
69
+ <ul>
70
+ {#each links.browse_links as link}
71
+ <li>
72
+ <a href="{normalizeUrl(link.url)}">{link.text}</a>
73
+ </li>
74
+ {/each}
75
+ </ul>
76
+ </section>
77
+ {#if windowWidth >= mobileBreakpoint}
78
+ <section class="link-group media">
79
+ <h3>Media</h3>
80
+ <ul>
81
+ {#each links.media_links as link}
82
+ <li>
83
+ <div class="symbol">
84
+ <svelte:component this="{symbols[link.symbol]}" />
85
+ </div>
86
+ <a href="{normalizeUrl(link.url)}">
87
+ {link.text}
88
+ </a>
89
+ </li>
90
+ {/each}
91
+ </ul>
92
+ </section>
93
+ {/if}
94
+ <div class="about-and-stay-informed">
95
+ <section class="about">
96
+ <h3>About Reuters</h3>
97
+ <ul>
98
+ {#each links.about_links as link}
99
+ <li>
100
+ <a href="{normalizeUrl(link.url)}">{link.text}</a>
101
+ </li>
102
+ {/each}
103
+ </ul>
104
+ </section>
105
+ <section class="stay-informed">
106
+ <h3>Stay Informed</h3>
107
+ <ul>
108
+ {#each links.stay_informed_links as link}
109
+ <li>
110
+ <a href="{normalizeUrl(link.url)}">{link.text}</a>
111
+ </li>
112
+ {/each}
113
+ </ul>
114
+ </section>
115
+ </div>
116
+ </div>
117
+ </section>
118
+ {/if}
119
+
120
+ <style>.content-container {
121
+ max-width: 1440px;
122
+ width: 100%;
123
+ margin: 0 auto;
124
+ }
125
+
126
+ .quick-links {
127
+ padding-top: 24px;
128
+ padding-bottom: 24px;
129
+ box-sizing: border-box;
130
+ }
131
+ .quick-links .content-container {
132
+ display: grid;
133
+ grid-template-columns: repeat(12, 1fr);
134
+ grid-column-gap: 2.2222222222vw;
135
+ }
136
+ @media (max-width: 1023px) {
137
+ .quick-links .content-container {
138
+ grid-column-gap: 4.2666666667vw;
139
+ }
140
+ }
141
+ @media (min-width: 1440px) {
142
+ .quick-links .content-container {
143
+ grid-column-gap: 32px;
144
+ }
145
+ }
146
+ @media (max-width: 1023px) {
147
+ .quick-links .content-container {
148
+ grid-template-columns: repeat(4, 1fr);
149
+ }
150
+ }
151
+ .quick-links ul {
152
+ margin: 0;
153
+ padding: 0;
154
+ }
155
+ .quick-links ul li {
156
+ list-style: none;
157
+ display: flex;
158
+ align-items: center;
159
+ margin: 8px 0;
160
+ font-family: "Knowledge", "Source Sans Pro", Arial, sans-serif;
161
+ }
162
+ .quick-links ul li a {
163
+ color: var(--nav-primary, #404040);
164
+ font-weight: 500;
165
+ font-size: 16px;
166
+ }
167
+
168
+ section.quick-links {
169
+ border-top: 1px solid var(--nav-rules, #d0d0d0);
170
+ max-width: 100%;
171
+ }
172
+ section.quick-links .content-container {
173
+ padding-left: 2.2222222222vw;
174
+ padding-right: 2.2222222222vw;
175
+ box-sizing: border-box;
176
+ }
177
+ @media (max-width: 1023px) {
178
+ section.quick-links .content-container {
179
+ padding-left: 4.2666666667vw;
180
+ padding-right: 4.2666666667vw;
181
+ }
182
+ }
183
+ @media (min-width: 1440px) {
184
+ section.quick-links .content-container {
185
+ padding-left: 32px;
186
+ padding-right: 32px;
187
+ }
188
+ }
189
+ section.quick-links h3 {
190
+ color: var(--nav-primary, #404040);
191
+ font-size: 16px;
192
+ font-weight: 400;
193
+ margin: 0;
194
+ }
195
+
196
+ .quick-links .content-container {
197
+ grid-row-gap: 2.2222222222vw;
198
+ }
199
+ @media (max-width: 1023px) {
200
+ .quick-links .content-container {
201
+ grid-row-gap: 4.2666666667vw;
202
+ }
203
+ }
204
+ @media (min-width: 1440px) {
205
+ .quick-links .content-container {
206
+ grid-row-gap: 32px;
207
+ }
208
+ }
209
+ .quick-links .content-container section.link-group {
210
+ grid-column: auto/span 2;
211
+ margin: 0;
212
+ }
213
+ @media (min-width: 1024px) {
214
+ .quick-links .content-container section.link-group:last-child {
215
+ grid-column: 10/span 3;
216
+ }
217
+ }
218
+ .quick-links .content-container .latest-and-media {
219
+ grid-column: 1/span 2;
220
+ grid-row: 1;
221
+ }
222
+ .quick-links .content-container .latest-and-media .media {
223
+ margin-top: 24px;
224
+ }
225
+ .quick-links .content-container .about-and-stay-informed {
226
+ grid-column: 7/span 3;
227
+ grid-row: 1;
228
+ }
229
+ @media (max-width: 1023px) {
230
+ .quick-links .content-container .about-and-stay-informed {
231
+ grid-column: 9/span 3;
232
+ }
233
+ }
234
+ @media (max-width: 745px) {
235
+ .quick-links .content-container .about-and-stay-informed {
236
+ grid-column: 1/span 2;
237
+ grid-row: 2;
238
+ }
239
+ }
240
+ .quick-links .content-container .stay-informed {
241
+ margin-top: 24px;
242
+ }
243
+
244
+ .symbol {
245
+ width: 20px;
246
+ margin-right: 16px;
247
+ }
248
+
249
+ .visually-hidden {
250
+ border: 0;
251
+ clip: rect(0 0 0 0);
252
+ height: 1px;
253
+ margin: -1px;
254
+ overflow: hidden;
255
+ padding: 0;
256
+ position: absolute;
257
+ width: 1px;
258
+ white-space: nowrap;
259
+ }</style>
@@ -0,0 +1,45 @@
1
+ <script>
2
+ import { onMount } from 'svelte';
3
+ export let once = false;
4
+ export let top = 0;
5
+ export let bottom = 0;
6
+ export let left = 0;
7
+ export let right = 0;
8
+ let intersecting = false;
9
+ let container;
10
+ onMount(() => {
11
+ if (typeof IntersectionObserver !== 'undefined') {
12
+ const rootMargin = `${bottom}px ${left}px ${top}px ${right}px`;
13
+ const observer = new IntersectionObserver(
14
+ (entries) => {
15
+ intersecting = entries[0].isIntersecting;
16
+ if (intersecting && once) {
17
+ observer.unobserve(container);
18
+ }
19
+ },
20
+ {
21
+ rootMargin,
22
+ }
23
+ );
24
+ observer.observe(container);
25
+ return () => observer.unobserve(container);
26
+ }
27
+ function handler() {
28
+ const bcr = container.getBoundingClientRect();
29
+ intersecting =
30
+ bcr.bottom + bottom > 0 &&
31
+ bcr.right + right > 0 &&
32
+ bcr.top - top < window.innerHeight &&
33
+ bcr.left - left < window.innerWidth;
34
+ if (intersecting && once) {
35
+ window.removeEventListener('scroll', handler);
36
+ }
37
+ }
38
+ window.addEventListener('scroll', handler);
39
+ return () => window.removeEventListener('scroll', handler);
40
+ });
41
+ </script>
42
+
43
+ <div bind:this="{container}">
44
+ <slot intersecting="{intersecting}" />
45
+ </div>
@@ -0,0 +1,73 @@
1
+ <script>
2
+ import IntersectionObserver from './IntersectionObserver.svelte';
3
+ export let url;
4
+ export let image;
5
+ export let title;
6
+ export let description;
7
+ </script>
8
+
9
+ <div class="referral" title="{description}">
10
+ <a href="{url.replace('index.html', '')}">
11
+ <IntersectionObserver let:intersecting top="{600}" once="{true}">
12
+ {#if intersecting}
13
+ <div class="image" style="{`background-image: url(${image});`}"></div>
14
+ {:else}
15
+ <div class="image"></div>
16
+ {/if}
17
+ </IntersectionObserver>
18
+ <p>{title}</p>
19
+ </a>
20
+ </div>
21
+
22
+ <!-- svelte-ignore css-unused-selector -->
23
+ <style>a {
24
+ text-decoration: none;
25
+ }
26
+
27
+ .image {
28
+ width: 100%;
29
+ padding-bottom: 50%;
30
+ background-size: cover;
31
+ background-position: 50%;
32
+ }
33
+
34
+ .referral {
35
+ width: 25%;
36
+ padding: 0 10px;
37
+ }
38
+ .referral div.image {
39
+ margin-bottom: 5px;
40
+ border: 1px solid var(--nav-rules, #efefef);
41
+ border-radius: 8px;
42
+ }
43
+ .referral a:hover {
44
+ text-decoration: none;
45
+ }
46
+ .referral a:hover p {
47
+ text-decoration: underline;
48
+ }
49
+ .referral p {
50
+ font-family: "Knowledge", "Source Sans Pro", Arial, sans-serif;
51
+ color: var(--nav-primary, #666);
52
+ font-size: 0.9rem;
53
+ line-height: 1.2rem;
54
+ text-transform: none;
55
+ margin: 0;
56
+ font-weight: 400;
57
+ }
58
+ @media (max-width: 768px) {
59
+ .referral {
60
+ width: 33.33333%;
61
+ }
62
+ .referral:nth-child(4) {
63
+ display: none;
64
+ }
65
+ }
66
+ @media (max-width: 575px) {
67
+ .referral {
68
+ width: 50%;
69
+ }
70
+ .referral:nth-child(3) {
71
+ display: none;
72
+ }
73
+ }</style>
@@ -0,0 +1,56 @@
1
+ <script>
2
+ import { onMount } from 'svelte';
3
+ import Link from './Link.svelte';
4
+
5
+ export let referrals = [];
6
+
7
+ $: verifiedReferrals = referrals
8
+ .filter((r) => r.url && r.title && r.image)
9
+ .slice(0, 4);
10
+
11
+ let metadata;
12
+
13
+ onMount(() => {
14
+ if (verifiedReferrals.length === 4) {
15
+ metadata = verifiedReferrals;
16
+ return;
17
+ }
18
+ fetch(
19
+ 'https://graphics.thomsonreuters.com/data/reuters-graphics/homepage/graphics.json'
20
+ )
21
+ .then((resp) => resp.json())
22
+ .then((d) => {
23
+ const data = d
24
+ .filter(({ canonical }) => {
25
+ const pathname = window.location.pathname
26
+ .replace(/\/index\.html$/, '')
27
+ .replace(/\/$/, '');
28
+ if (!pathname) return true;
29
+ return !canonical.includes(pathname);
30
+ })
31
+ .slice(0, 4)
32
+ .map(({ url, image, title, description }) => ({
33
+ url,
34
+ image,
35
+ title,
36
+ description,
37
+ }));
38
+ metadata = [...verifiedReferrals, ...data].slice(0, 4);
39
+ });
40
+ });
41
+ </script>
42
+
43
+ {#if metadata}
44
+ <nav class="referral-rail row">
45
+ {#each metadata as referral}
46
+ <Link {...referral} />
47
+ {/each}
48
+ </nav>
49
+ {/if}
50
+
51
+ <style>.row {
52
+ margin-right: -10px;
53
+ margin-left: -10px;
54
+ display: flex;
55
+ flex-wrap: wrap;
56
+ }</style>
@@ -0,0 +1,53 @@
1
+ <script>
2
+ import Referrals from './Referrals.svelte';
3
+ import IntersectionObserver from './IntersectionObserver.svelte';
4
+
5
+ export let referrals = [];
6
+ </script>
7
+
8
+ <IntersectionObserver let:intersecting top="{2400}" once="{true}">
9
+ {#if intersecting}
10
+ <section class="referrals">
11
+ <h2>
12
+ <a href="https://graphics.reuters.com/">More from Reuters Graphics</a>
13
+ </h2>
14
+ {#if typeof window !== 'undefined'}
15
+ <Referrals referrals="{referrals}" />
16
+ {/if}
17
+ </section>
18
+ {/if}
19
+ </IntersectionObserver>
20
+
21
+ <style>section.referrals {
22
+ margin: 0;
23
+ max-width: 1400px;
24
+ padding: 25px 0;
25
+ padding-left: 2.2222222222vw;
26
+ padding-right: 2.2222222222vw;
27
+ border-top: 1px solid var(--nav-rules, #999);
28
+ }
29
+ @media (max-width: 1023px) {
30
+ section.referrals {
31
+ padding-left: 4.2666666667vw;
32
+ padding-right: 4.2666666667vw;
33
+ }
34
+ }
35
+ @media (min-width: 1440px) {
36
+ section.referrals {
37
+ padding-left: 32px;
38
+ padding-right: 32px;
39
+ }
40
+ }
41
+ section.referrals h2 {
42
+ font-size: 16px;
43
+ font-weight: 500;
44
+ margin: 0 0 10px;
45
+ color: var(--nav-primary, #666);
46
+ }
47
+ section.referrals h2 a {
48
+ color: var(--nav-primary, #666);
49
+ text-decoration: none;
50
+ }
51
+ section.referrals h2 a:hover {
52
+ text-decoration: underline;
53
+ }</style>