Mais recentes
Categorias:
Todos
Sustentabilidade
Transição Energética
Inovação
Nossas Atividades

Sustentabilidade
Como se tornar jogadora de futebol: conheça o cenário brasileiro e principais iniciativas

Nossas Atividades
Soltar balão é crime: mas por que é proibido e o que isso tem a ver com você?

Transição Energética
Quem é Petra? A pesquisadora do universo em quadrinhos da Petrobras

Sustentabilidade
Equidade de gênero ou igualdade de gênero? Descubra a diferença e como promovemos

Inovação
Fizemos a 1ª operação submarina 100% remota nas Américas — e por que isso é importante?

Sustentabilidade
Como se tornar jogadora de futebol: conheça o cenário brasileiro e principais iniciativas

Sustentabilidade
Equidade de gênero ou igualdade de gênero? Descubra a diferença e como promovemos

Sustentabilidade
Petrobras e o cinema nacional: uma parceria que parece coisa de filme

Sustentabilidade
A maior playlist para o país com a melhor música do mundo

Sustentabilidade
A história do futebol feminino: do primeiro time à proibição e o cenário atual

Transição Energética
Quem é Petra? A pesquisadora do universo em quadrinhos da Petrobras

Transição Energética
Segurança energética: o que está sendo feito para garantir energia para todos?

Transição Energética
Qual o papel dos combustíveis marítimos de baixo carbono na transição energética justa?

Transição Energética
BioQAV: veja como investimos em tecnologia rumo ao futuro dos combustíveis sustentáveis

Transição Energética
É hora de falar sobre mudanças climáticas: descubra seus impactos e causas!

Inovação
Fizemos a 1ª operação submarina 100% remota nas Américas — e por que isso é importante?

Inovação
Como se produz petróleo? Conheça 6 tecnologias inovadoras!

Inovação
Novos supercomputadores: veja como unimos liderança tecnológica com ecoeficiência

Inovação
25 anos de “Matrix” e os desafios da tecnologia

Inovação
Como a robótica está moldando o nosso futuro

Nossas Atividades
Soltar balão é crime: mas por que é proibido e o que isso tem a ver com você?

Nossas Atividades
Saiba mais sobre nosso desempenho em 2024

Nossas Atividades
Você sabe o que é um Super FPSO?

Nossas Atividades
Indústria naval impulsiona o crescimento do Brasil

Nossas Atividades
Cinco tecnologias que parecem futuristas mas já são reais
Últimas Notícias
ASSINE NOSSA NEWSLETTER NO LINKEDIN
Acompanhe como estamos nos preparando para o futuro de baixo carbono, conectados a um mundo em transformação.
Mais lidos

Sustentabilidade
5 autores negros que você precisa conhecer
Artigo
5 min

Sustentabilidade
Como cuidamos das florestas que nos abrigam
Artigo
6 min

Nossas Atividades
Nossa jornada começa na Bahia, vem conferir! | Mochileiras
Artigo
3 min

Sustentabilidade
O (en)canto que vem do oceano
Artigo
5 min

Inovação
10 filmes sobre tecnologia e inovação
Artigo
3 min

Transição Energética
Conheça a primeira gasolina carbono neutro do país
Artigo
6 min

Nossas Atividades
De onde vem a gasolina?
Artigo
3 min

Nossas Atividades
Pré-sal: 15 anos de uma conquista que fez história
Artigo
4 min
Podcast Nossa Energia - Transição Energética, Inovação e muito mais!
X

X

X

X

Mochileiras - viaje
X

X

X

X

Veja Mais
Um erro ocorreu enquanto processava o modelo.
Java method "com.sun.proxy.$Proxy194.getGroupVocabularies(long)" threw an exception when invoked on com.sun.proxy.$Proxy194 object "com.liferay.portlet.asset.service.impl.AssetVocabularyServiceImpl@4b8f13cf"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign vocabularies = assetVocabular... [in template "20099#20135#11569884" at line 16, column 1] ----
1<#-- Conteúdo Web -> Templates: Funções gerais -->
2<#include "${templatesPath}/1975398" />
3
4<#-- Conteúdo Web -> Templates: Busca pelas imagens do tipo de noticia -->
5<#include "${templatesPath}/18598756" />
6
7<#assign POST_TYPES_CATEGORIES = getPostTypeImages()!default([]) />
8
9<#-- Liferay Services -->
10<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
11<#assign fileEntryService = staticUtil["com.liferay.document.library.kernel.service.DLFileEntryLocalServiceUtil"] />
12<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
13<#assign assetVocabularyService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyService") />
14<#assign assetCategoryPropService = serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") />
15
16<#assign vocabularies = assetVocabularyService.getGroupVocabularies(groupId) />
17<#assign ourEnergyVocabulary = findVocabulary("Nossa Energia", vocabularies)/>
18<#assign typeOfNewsVocabulary = findVocabulary("Tipo de Notícia", vocabularies)/>
19
20<#-- Root Css -> Para poder instanciar dois elementos e não dar confusão no JS -->
21<#assign contentNumber = randomNumber(4586) />
22<#assign rootCss = "card-news-list-container_" + randomNumber(4586) />
23
24<#-- Nome das midias adaptativas de imagem para desktop e mobile -->
25<#assign adaptativeMediaDesktopResolutionName = "Preview-1000x0" />
26<#assign adaptativeMediaMobileResolutionName = "Thumbnail-300x300" />
27
28<#attempt>
29 <#assign ourEnergyStyles = [] />
30 <#list ourEnergyVocabulary.getCategories() as ourEnergyCategory >
31 <#assign shadowColorCategory = "" />
32 <#if (assetCategoryPropService.fetchCategoryProperty(ourEnergyCategory.getCategoryId(),"Cor da Sombra")??)>
33 <#assign categoryShadowColorByService = assetCategoryPropService.fetchCategoryProperty(ourEnergyCategory.getCategoryId(),"Cor da Sombra") />
34 <#assign shadowColorCategory = categoryShadowColorByService.value />
35 </#if>
36
37 <#assign backgroundColorCategory = "" />
38 <#if (assetCategoryPropService.fetchCategoryProperty(ourEnergyCategory.getCategoryId(),"Cor de Fundo")??)>
39 <#assign categoryBackgroundColorByService = assetCategoryPropService.fetchCategoryProperty(ourEnergyCategory.getCategoryId(),"Cor de Fundo") />
40 <#assign backgroundColorCategory = categoryBackgroundColorByService.value />
41 </#if>
42
43 <#assign textColorCategory = "" />
44 <#if (assetCategoryPropService.fetchCategoryProperty(ourEnergyCategory.getCategoryId(),"Cor do Texto")??)>
45 <#assign categoryTextColorByService = assetCategoryPropService.fetchCategoryProperty(ourEnergyCategory.getCategoryId(),"Cor do Texto") />
46 <#assign textColorCategory = categoryTextColorByService.value />
47 </#if>
48
49 <#assign textColorHighContrastCategory = "" />
50 <#if (assetCategoryPropService.fetchCategoryProperty(ourEnergyCategory.getCategoryId(),"Cor do Texto em Alto Contraste")??)>
51 <#assign categoryTextColorHighContrastByService = assetCategoryPropService.fetchCategoryProperty(ourEnergyCategory.getCategoryId(),"Cor do Texto em Alto Contraste") />
52 <#assign textColorHighContrastCategory = categoryTextColorHighContrastByService.value />
53 </#if>
54
55 <#assign ourEnergyStyles += [{"titleLocale": ourEnergyCategory.getTitle(locale),"shadowColor": shadowColorCategory, "backgroundColor": backgroundColorCategory, "textColor": textColorCategory, "textColorHighContrast": textColorHighContrastCategory}] />
56 </#list>
57
58 <#recover>
59 <#assign ourEnergyStyles = [] />
60
61</#attempt>
62
63<#-- Função para obter a primeira categoria associonada a um Vocabulário o qual está associado a um Jornal Article -->
64<#function getFirstCategoryOfVocabulary journalArticle vocabulary >
65 <#attempt>
66 <#assign categories = assetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", journalArticle.getClassPK()) />
67
68 <#list categories as category>
69 <#if vocabulary.getVocabularyId() == category.getVocabularyId()>
70 <#return category.getTitle(locale)>
71 </#if>
72 </#list>
73
74 <#return "">
75
76 <#recover>
77 <#return "" />
78
79 </#attempt>
80</#function>
81
82<#-- Função para obter os dados de um card do Post Externo Agência (Web Content) (Journal Article) -->
83<#function getDataForCardNews journalArticle fieldList xmlArticle>
84 <#attempt>
85 <#assign title = journalArticle.getTitle() />
86 <#assign ourEnergyCategory = "Agência Petrobras" />
87 <#assign subtitle = "" />
88 <#assign media = {"imageSrc": "", "imageAlt": "", "urlAdaptativeMedia": ""} />
89 <#assign urlNews = "" />
90
91
92 <#assign idNews = getFieldValue(fieldList, xmlArticle, "ID da Notícia do Agência") />
93
94 <#assign journalArticleResponse = restClient.get("/headless-delivery/v1.0/sites/10623376/structured-contents/by-key/${idNews}") />
95
96 <#if journalArticleResponse?? && journalArticleResponse?has_content && journalArticleResponse.contentFields??>
97 <#assign subtitleResponse = journalArticleResponse.contentFields?filter(field->field.label == "Subtítulo") />
98
99 <#if subtitleResponse?? && subtitleResponse[0]?? && subtitleResponse[0].contentFieldValue?? && subtitleResponse[0].contentFieldValue.data??>
100 <#assign subtitle = subtitleResponse[0].contentFieldValue.data />
101 </#if>
102
103 <#assign urlNews = journalArticleResponse.friendlyUrlPath />
104 <#if themeDisplay.getPortalURL()?contains("webserver")>
105 <#assign urlNews = themeDisplay.getPortalURL() + themeDisplay.getPathFriendlyURLPublic() + "/agencia/w/" + urlNews>
106 <#else>
107 <#assign urlNews = "https://agencia.petrobras.com.br/w/" + urlNews>
108 </#if>
109
110 <#assign imageResponse = journalArticleResponse.contentFields?filter(field->field.label == "Imagem de destaque da notícia")/>
111 <#if imageResponse?? && imageResponse[0]?? && imageResponse[0].nestedContentFields??>
112 <#assign imageResponse = imageResponse[0].nestedContentFields />
113 <#assign imageResponse = imageResponse[0]/>
114
115 <#if imageResponse?? && imageResponse.contentFieldValue?? && imageResponse.contentFieldValue.image??>
116 <#assign image = imageResponse.contentFieldValue.image />
117 <#assign imageUrl = image.contentUrl />
118 <#assign imageAlt = image.description />
119
120 <#assign media = {"imageSrc": imageUrl, "imageAlt": imageAlt } />
121 </#if>
122 </#if>
123
124 <#assign cardData = {"media": media, "title": title, "timeRead": "", "ourEnergyCategory": ourEnergyCategory, "typeOfNews": "", "urlNews": urlNews, "agency": true} />
125
126 <#return cardData>
127 </#if>
128
129 <#return {}>
130 <#recover>
131 <#return {}>
132 </#attempt>
133
134 <#-- cardData ->
135 image: url, alt
136 title
137 timeRead
138 ourEnergyCategory
139 typeOfNews
140 urlNews
141 -->
142</#function>
143
144<#-- Função para obter os dados de um card no Web Content (Journal Article) -->
145<#function getDataForCard entry >
146
147 <#assign journalArticle = journalArticleLocalService.getLatestArticle(entry.getClassPK()) />
148 <#assign ddmStructure = journalArticle.getDDMStructure() />
149 <#assign fieldList = getFieldListByStructure(ddmStructure) />
150 <#assign xmlArticle = journalArticle.getDocument().getRootElement() />
151
152 <#-- Tentando pegar Imagem -->
153 <#assign mediasGroup = getNodes(getIdFromFieldName(fieldList, "Mídia de destaque da notícia"), xmlArticle) />
154 <#if mediasGroup?? && mediasGroup?has_content>
155 <#assign media = "" />
156 <#list mediasGroup as mediaGroup >
157 <#assign media = getMediaInfo(fieldList, mediaGroup, "Imagem Destaque", fileEntryService) />
158
159 <#assign fileDataRequest = restClient.get("/headless-delivery/v1.0/documents/${media.fileEntryId}") />
160
161 <#assign urlAdaptativeMediaMobile = ""/>
162 <#assign urlAdaptativeMediaDesktop = ""/>
163 <#if media.url?? && media.url?has_content && fileDataRequest?? && fileDataRequest.adaptedImages?? >
164 <#assign dataAdaptativeMedia = fileDataRequest.adaptedImages />
165 <#list dataAdaptativeMedia as data>
166 <#if data.resolutionName == adaptativeMediaDesktopResolutionName>
167 <#assign urlAdaptativeMediaDesktop = data.contentUrl/>
168 </#if>
169 <#if data.resolutionName == adaptativeMediaMobileResolutionName>
170 <#assign urlAdaptativeMediaMobile = data.contentUrl/>
171 </#if>
172 </#list>
173 </#if>
174
175 <#assign media = {"imageSrc": media.url, "imageAlt": media.alt, "imageFileEntryId": media.fileEntryId, "urlAdaptativeMedia": {"mobile":urlAdaptativeMediaMobile, "desktop": urlAdaptativeMediaDesktop}} />
176
177
178 <#-- Se não tiver imagem, tentar pegar vídeo -->
179 <#if !media.imageSrc?? || !media.imageSrc?has_content>
180 <#assign youtubeID = getFieldValue(fieldList, mediaGroup, "ID do vídeo do YouTube do vídeo de destaque") />
181 <#if youtubeID?? && youtubeID?has_content>
182 <#assign media = {"videoYotubeID": youtubeID} />
183 <#else>
184 <#-- Tentar pegar vídeo Interno -->
185 <#assign internalVideo = getMediaInfo(fieldList, mediaGroup, "Fazer upload de um vídeo de destaque", fileEntryService) />
186 <#if internalVideo?? && internalVideo?has_content>
187 <#assign media = {"internalVideo": internalVideo} />
188 </#if>
189 </#if>
190 </#if>
191 </#list>
192
193 <#assign title = getFieldValue(fieldList, xmlArticle, "Título de destaque da notícia") />
194
195 <#assign timeRead = getFieldValue(fieldList, xmlArticle, "Tempo de Leitura") />
196
197 <#assign ourEnergyCategory = getFirstCategoryOfVocabulary(entry, ourEnergyVocabulary) />
198
199 <#assign typeOfNews = getFirstCategoryOfVocabulary(entry, typeOfNewsVocabulary) />
200
201 <#if themeDisplay.getPortalURL()?contains("webserver")>
202 <#assign urlNews = themeDisplay.getPortalURL() + themeDisplay.getPathFriendlyURLPublic() + layout.getGroup().friendlyURL + "/w/" + journalArticle.getUrlTitle()>
203 <#else>
204 <#assign urlNews = themeDisplay.getPortalURL() + "/w/" + journalArticle.getUrlTitle()>
205 </#if>
206
207 <#assign cardData = {"media": media, "title": title, "timeRead": timeRead, "ourEnergyCategory": ourEnergyCategory, "typeOfNews": typeOfNews, "urlNews": urlNews} />
208
209 <#return cardData>
210 </#if>
211
212 <#return getDataForCardNews(journalArticle, fieldList, xmlArticle) />
213
214 <#-- cardData -> image: url, alt
215 title
216 timeRead
217 ourEnergyCategory
218 typeOfNews
219 urlNews
220 -->
221</#function>
222
223
224<#-- Macro para renderizar os arrows-->
225<#macro renderArrows>
226 <div class="card-news-list-arrows-breakpoint breakpoint">
227 <div class="card-news-list-arrows col-11-12 md-col-7-8 sm-col-1-4">
228 <div class="card-news-arrow-left arrow-disable">
229 <svg width="34" height="34" viewBox="0 0 34 34" fill="none" xmlns="http://www.w3.org/2000/svg">
230 <path d="M1 17C1 8.16344 8.16344 1 17 1C25.8366 1 33 8.16344 33 17C33 25.8366 25.8366 33 17 33C8.16344 33 1 25.8366 1 17Z" stroke="#959595"/>
231 <path d="M22.5 17H11.5M11.5 17L16 12.5M11.5 17L16 21.5" stroke="#525252" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
232 </svg>
233 </div>
234 <div class="card-news-arrow-right">
235 <svg width="34" height="34" viewBox="0 0 34 34" fill="none" xmlns="http://www.w3.org/2000/svg">
236 <path d="M1 17C1 8.16344 8.16344 1 17 1C25.8366 1 33 8.16344 33 17C33 25.8366 25.8366 33 17 33C8.16344 33 1 25.8366 1 17Z" stroke="#008542"/>
237 <path d="M11.5 17H22.5M22.5 17L18 12.5M22.5 17L18 21.5" stroke="#008542" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
238 </svg>
239
240 </div>
241 </div>
242 </div>
243
244 <style>
245
246 .${rootCss} .card-news-list-arrows-breakpoint {
247 position: relative;
248 z-index: 1;
249 }
250
251 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows {
252 display: flex;
253 align-items: flex-start;
254 justify-self: flex-end;
255 gap: var(--space-xxs, 8px);
256 }
257
258 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-left,
259 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-right {
260 cursor: pointer;
261 }
262
263 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-left:not(.arrow-disable):hover path:nth-child(1),
264 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-right:not(.arrow-disable):hover path:nth-child(1) {
265 fill: rgb(0, 133, 66);
266 }
267
268 body.high-contrast-active .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-left:not(.arrow-disable):hover path:nth-child(1),
269 body.high-contrast-active .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-right:not(.arrow-disable):hover path:nth-child(1) {
270 fill: white;
271 }
272
273 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-left:not(.arrow-disable):hover path:nth-child(2),
274 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-right:not(.arrow-disable):hover path:nth-child(2) {
275 stroke: #fff;
276 }
277
278 body.high-contrast-active .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-left:not(.arrow-disable):hover path:nth-child(2),
279 body.high-contrast-active .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-right:not(.arrow-disable):hover path:nth-child(2) {
280 stroke: #010101;
281 }
282
283 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-left.arrow-disable,
284 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-right.arrow-disable {
285 opacity: 0.4;
286 cursor: auto;
287 }
288
289 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-left path,
290 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-right path {
291 stroke: rgb(0, 133, 66);
292 transition: all 300ms ease-in-out;
293 }
294
295 body.high-contrast-active .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-left path,
296 body.high-contrast-active .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-right path {
297 stroke: rgba(228, 247, 232, 1);
298 }
299
300 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-left.arrow-disable path:nth-child(1),
301 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-right.arrow-disable path:nth-child(1) {
302 stroke: rgb(149, 149, 149);
303 }
304
305 body.high-contrast-active .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-left.arrow-disable path:nth-child(1),
306 body.high-contrast-active .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-right.arrow-disable path:nth-child(1) {
307 stroke: rgba(215, 215, 215, 1);
308 }
309
310 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-left.arrow-disable path:nth-child(2),
311 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-right.arrow-disable path:nth-child(2) {
312 stroke: rgb(82, 82, 82);
313 }
314
315 body.high-contrast-active .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-left.arrow-disable path:nth-child(2),
316 body.high-contrast-active .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows .card-news-arrow-right.arrow-disable path:nth-child(2) {
317 stroke: rgba(149, 149, 149, 1);
318 }
319
320 @media screen and (min-width: 1440px) {
321 .${rootCss} .card-news-list-arrows-breakpoint {
322 width: 100%;
323 }
324 }
325
326 @media screen and (max-width: ${MAX_MOBILE_WIDTH}px) {
327
328 .${rootCss} .card-news-list-arrows-breakpoint .card-news-list-arrows {
329 justify-self: flex-start;
330 margin-top: var(--space-lg);
331 }
332 }
333
334 </style>
335
336</#macro>
337
338
339<#-- Macro para renderizar um Card -->
340<#macro renderCard cardData>
341 <#-- cardData -> image: url, alt, fileEntryId
342 title
343 timeRead
344 ourEnergyCategory
345 typeOfNews
346 urlNews
347 -->
348
349 <div class="card-news-container">
350 <a class="card-link" href="${cardData.urlNews}" style="display: none;" > Notícia: ${cardData.title} </a>
351 <div class="card-news-thumb">
352 <#assign noImage = "" />
353 <#if cardData.media.imageSrc?? && cardData.media.imageSrc?has_content>
354 <#assign imageSrc = cardData.media.imageSrc />
355 <#if cardData.media.urlAdaptativeMedia?? && cardData.media.urlAdaptativeMedia?has_content>
356 <#assign imageSrcDesktop = cardData.media.urlAdaptativeMedia.desktop />
357 <#assign imageSrcMobile = cardData.media.urlAdaptativeMedia.mobile />
358 </#if>
359 <picture >
360 <source media="(max-width:767px)" srcset="${imageSrcMobile}">
361 <img class="card-news-image" src="${imageSrcDesktop}" loading="lazy" alt="${cardData.media.imageAlt}"/>
362 </picture>
363 <#else>
364 <#if cardData.media.videoYotubeID?? && cardData.media.videoYotubeID?has_content>
365 <picture>
366 <source media="(max-width:767px)" srcset="https://img.youtube.com/vi/${cardData.media.videoYotubeID}/mqdefault.jpg">
367 <img class="card-news-image" loading="lazy" src="https://img.youtube.com/vi/${cardData.media.videoYotubeID}/maxresdefault.jpg" alt="YouTube Thumbnail"/>
368 </picture>
369 <#else>
370 <#if (cardData.media.internalVideo?? && cardData.media.internalVideo.url?has_content) >
371 <video class="card-news-image" loading="lazy">
372 <source src="${cardData.media.internalVideo.url}">
373 Your browser does not support the video tag.
374 </video>
375 <#else>
376 <#assign noImage = "no-image" />
377 </#if>
378 </#if>
379 <svg class="thumb-play-icon" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
380 <path d="M0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16Z" fill="white" fill-opacity="0.8"/>
381 <path d="M22.2563 15.5744L13.2625 10.0744C13.1868 10.0277 13.1 10.0021 13.0111 10.0001C12.9221 9.99816 12.8343 10.02 12.7566 10.0633C12.6789 10.1066 12.6141 10.1698 12.569 10.2465C12.5239 10.3232 12.5001 10.4105 12.5 10.4994V21.4994C12.5001 21.5884 12.5239 21.6757 12.569 21.7524C12.6141 21.8291 12.6789 21.8923 12.7566 21.9356C12.8343 21.9789 12.9221 22.0007 13.0111 21.9988C13.1 21.9968 13.1868 21.9712 13.2625 21.9244L22.2563 16.4244C22.3301 16.3808 22.3913 16.3186 22.4338 16.2441C22.4763 16.1696 22.4987 16.0852 22.4987 15.9994C22.4987 15.9137 22.4763 15.8293 22.4338 15.7548C22.3913 15.6803 22.3301 15.6181 22.2563 15.5744Z" fill="#008542"/>
382 </svg>
383 </#if>
384 </div>
385
386 <div class="card-news-category-container ${noImage}">
387 <div data-category="${cardData.ourEnergyCategory}" class="card-news-category paragraph-micro-regular"> ${cardData.ourEnergyCategory} </div>
388 </div>
389
390 <div class="card-news-text-content ${noImage}">
391 <div class="card-news-title h4"> ${cardData.title} </div>
392
393 <div class="card-news-info">
394 <div class="card-news-type">
395 <#if getPostTypeImageUrl(POST_TYPES_CATEGORIES, (cardData.typeOfNews)!default(""))?? >
396 <#assign postTypeIconUrl = getPostTypeImageUrl(POST_TYPES_CATEGORIES, (cardData.typeOfNews)!default("")) />
397 <img src="${postTypeIconUrl}" loading="lazy" alt="post type icon" />
398 <div class="card-news-type-text paragraph-micro-regular">${cardData.typeOfNews}</div>
399 <#else/>
400 <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
401 <path d="M6.25 7.5H13.75M6.25 10H13.75M6.25 12.5H13.75M3.125 3.75H16.875C17.2202 3.75 17.5 4.02982 17.5 4.375V15.625C17.5 15.9702 17.2202 16.25 16.875 16.25H3.125C2.77982 16.25 2.5 15.9702 2.5 15.625V4.375C2.5 4.02982 2.77982 3.75 3.125 3.75Z" stroke="#959595" stroke-linecap="round" stroke-linejoin="round"/>
402 </svg>
403 <div class="card-news-type-text paragraph-micro-regular">Artigo</div>
404 </#if>
405 </div>
406
407 <#if cardData.timeRead?? && cardData.timeRead?has_content>
408 <div class="card-news-time-read">
409 <svg class="card-news-icon-time-read" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
410 <path d="M10.5 5.625C10.5 5.34886 10.2761 5.125 10 5.125C9.72386 5.125 9.5 5.34886 9.5 5.625H10.5ZM10 10H9.5C9.5 10.2761 9.72386 10.5 10 10.5V10ZM14.375 10.5C14.6511 10.5 14.875 10.2761 14.875 10C14.875 9.72386 14.6511 9.5 14.375 9.5V10.5ZM17 10C17 13.866 13.866 17 10 17V18C14.4183 18 18 14.4183 18 10H17ZM10 17C6.13401 17 3 13.866 3 10H2C2 14.4183 5.58172 18 10 18V17ZM3 10C3 6.13401 6.13401 3 10 3V2C5.58172 2 2 5.58172 2 10H3ZM10 3C13.866 3 17 6.13401 17 10H18C18 5.58172 14.4183 2 10 2V3ZM9.5 5.625V10H10.5V5.625H9.5ZM10 10.5H14.375V9.5H10V10.5Z" fill="#959595"/>
411 </svg>
412
413 <div class="card-news-time-read-text paragraph-micro-regular">${cardData.timeRead} min</div>
414 </div>
415 </#if>
416 </div>
417 </div>
418 </div>
419</#macro>
420
421<style>
422 .${rootCss} .card-news-container {
423 width: 300px;
424 height: 370px;
425 display: flex;
426 flex-direction: column;
427 flex-shrink: 0;
428 align-items: flex-start;
429 border-radius: var(--border-radius-lg);
430 border: var(--border-width-hairline) solid var(--border-card-default, #EEE);
431 background: var(--background-surface-level-01, #FFF);
432 box-shadow: 0px 12px 60px -10px rgba(145, 147, 149, 0.12);
433 overflow: hidden;
434 scroll-snap-align: start;
435 cursor: pointer;
436 transition: border 300ms ease-in-out;
437 text-decoration: none;
438 position: relative;
439 }
440
441 body.high-contrast-active .${rootCss} .card-news-container {
442 border: var(--border-width-hairline) solid var(--border-card-default, #525252);
443 background: var(--background-surface-level-01, #010101);
444 }
445
446 .${rootCss} .card-news-container:hover {
447 border: var(--border-width-hairline) solid rgb(0, 133, 66);
448 }
449
450 body.high-contrast-active .${rootCss} .card-news-container:hover {
451 border: var(--border-width-hairline) solid var(--border-card-default, #E4F7E8);
452 }
453
454 .${rootCss} .card-news-container .card-news-link {
455 position: absolute;
456 top: 0;
457 width: 100%;
458 height: 100%;
459 z-index: 1;
460 }
461
462 .${rootCss} .card-news-container .card-news-thumb {
463 position: relative;
464 pointer-events: none;
465 }
466
467 .${rootCss} .card-news-container .card-news-thumb .card-news-image {
468 width: 298px;
469 height: 168px;
470 object-fit: cover;
471 pointer-events: none;
472 }
473
474 .${rootCss} .card-news-container .card-news-thumb .thumb-play-icon {
475 position: absolute;
476 left: 50%;
477 top: 50%;
478 transform: translate(-50%, -50%);
479 pointer-events: none;
480 }
481
482 body.high-contrast-active .${rootCss} .card-news-container .card-news-thumb .thumb-play-icon path:nth-child(1) {
483 fill: black;
484 }
485
486 body.high-contrast-active .${rootCss} .card-news-container .card-news-thumb .thumb-play-icon path:nth-child(2) {
487 fill: white;
488 }
489
490 .${rootCss} .card-news-container .card-news-category-container {
491 position: relative;
492 }
493
494 .${rootCss} .card-news-container .card-news-category-container .card-news-category {
495 display: flex;
496 justify-content: center;
497 align-items: center;
498 padding: var(--space-micro) var(--space-xs);
499 position: absolute;
500 z-index: 2;
501 left: var(--space-md);
502 top: -13px;
503 border-radius: var(--border-radius-pill);
504 background: linear-gradient(0deg, var(--background-surface-opacity-light-level-07, rgba(255, 255, 255, 0.96)) 0%, var(--background-surface-opacity-light-level-07, rgba(255, 255, 255, 0.96)) 100%), var(--default-sup-green-water, #006B65);
505 box-shadow: 0px 2px 6px 0px rgba(0, 178, 169, 0.10);
506 line-height: var(--line-height-lg, 144%);
507 color: var(--default-sup-green-water, #006B65);
508 white-space: nowrap;
509 pointer-events: none;
510 }
511
512 body.high-contrast-active .${rootCss} .card-news-container .card-news-category-container .card-news-category {
513 background: linear-gradient(0deg, var(--background-surface-opacity-light-level-07, #373737) 0%, var(--background-surface-opacity-light-level-07, #373737) 100%), var(--default-sup-green-water, #99E0DD);
514 color: var(--default-sup-green-water, #99E0DD);
515 }
516
517 .${rootCss} .card-news-container .card-news-category-container.no-image .card-news-category {
518 position: relative;
519 top: 0;
520 left: 0;
521 margin-left: var(--space-md);
522 margin-top: var(--space-md);
523 }
524
525 .${rootCss} .card-news-container .card-news-text-content {
526 display: flex;
527 padding: var(--space-lg, 32px) var(--space-md, 24px) var(--space-md, 24px) var(--space-md, 24px);
528 flex-direction: column;
529 justify-content: space-between;
530 align-items: flex-start;
531 flex: 1 0 0;
532 align-self: stretch;
533 pointer-events: none;
534 }
535
536 .${rootCss} .card-news-container .card-news-text-content.no-image {
537 padding-top: var(--space-sm);
538 }
539
540 .${rootCss} .card-news-container .card-news-text-content .card-news-title {
541 display: -webkit-box;
542 -webkit-box-orient: vertical;
543 -webkit-line-clamp: 4;
544 align-self: stretch;
545 overflow: hidden;
546 color: var(--text-primary-default, #373737);
547 text-overflow: ellipsis;
548 margin: 0;
549 pointer-events: none;
550 }
551
552 body.high-contrast-active .${rootCss} .card-news-container .card-news-text-content .card-news-title {
553 color: var(--text-primary-default, #FFF);
554 }
555
556 .${rootCss} .card-news-container .card-news-text-content .card-news-info {
557 display: flex;
558 align-items: center;
559 align-content: center;
560 gap: var(--space-sm, 16px);
561 align-self: stretch;
562 flex-wrap: wrap;
563 pointer-events: none;
564 }
565
566 .${rootCss} .card-news-container .card-news-text-content .card-news-info .card-news-type,
567 .${rootCss} .card-news-container .card-news-text-content .card-news-info .card-news-time-read {
568 display: flex;
569 align-items: center;
570 gap: var(--space-xxs, 8px);
571 }
572
573 body.high-contrast-active .${rootCss} .card-news-container .card-news-text-content .card-news-info .card-news-type path {
574 stroke: #D7D7D7;
575 }
576
577 .${rootCss} .card-news-container .card-news-text-content .card-news-info .card-news-type .card-news-type-text,
578 .${rootCss} .card-news-container .card-news-text-content .card-news-info .card-news-time-read .card-news-time-read-text {
579 color: var(--text-tertiary-default, #959595);
580 line-height: var(--line-height-lg, 144%);
581 }
582
583 body.high-contrast-active .${rootCss} .card-news-container .card-news-text-content .card-news-info .card-news-type .card-news-type-text,
584 body.high-contrast-active .${rootCss} .card-news-container .card-news-text-content .card-news-info .card-news-time-read .card-news-time-read-text {
585 color: var(--text-tertiary-default, #EEE);
586 }
587
588 .${rootCss} .card-news-container .card-news-text-content .card-news-info .card-news-time-read .card-news-icon-time-read {
589 transform: translateY(-0.5px);
590 }
591
592 body.high-contrast-active .${rootCss} .card-news-container .card-news-text-content .card-news-info .card-news-time-read .card-news-icon-time-read path {
593 fill: #D7D7D7;
594 }
595</style>
596
597
598
599
600<#-- Renderizar Lista de cards -->
601<#if entries?has_content>
602 <div class="${rootCss}">
603 <@renderArrows />
604
605 <div class="card-news-list-breakpoint breakpoint">
606 <div class="card-news-list col-1-12 md-col-1-8 sm-col-1-4">
607 <#list entries as entry>
608 <#assign cardData = getDataForCard(entry) />
609 <@renderCard cardData/>
610 </#list>
611 </div>
612 </div>
613 </div>
614</#if>
615
616
617<style>
618
619 .portlet {
620 margin: 0;
621 }
622
623 .${rootCss} {
624 width: 100%;
625 position: relative;
626 font-family: var(--font-family-base, "Petrobras Sans");
627 display: flex;
628 flex-direction: column;
629 gap: var(--space-lg);
630 }
631
632
633 .${rootCss} .card-news-list {
634 gap: var(--space-lg);
635 overflow: auto;
636 position: relative;
637 z-index: 1;
638 scroll-snap-type: x mandatory;
639 scrollbar-width: none;
640 display: none;
641 }
642
643 .${rootCss} .card-news-list.active {
644 display: flex;
645 }
646
647 .${rootCss} .card-news-list::-webkit-scrollbar {
648 display: none;
649 }
650
651 @media screen and (min-width: 1440px) {
652 .${rootCss} .card-news-list-breakpoint {
653 width: 100%;
654 }
655 }
656</style>
657
658<#list ourEnergyStyles as ourEnergyStyle>
659 <style>
660 .${rootCss} [data-category="${ourEnergyStyle.titleLocale}"] {
661 background: linear-gradient(0deg, var(--background-surface-opacity-light-level-07, rgba(255, 255, 255, 0.96)) 0%, var(--background-surface-opacity-light-level-07, rgba(255, 255, 255, 0.96)) 100%), #${ourEnergyStyle.backgroundColor} !important;
662 box-shadow: 0px 2px 6px 0px #${ourEnergyStyle.shadowColor} !important;
663 color: #${ourEnergyStyle.textColor} !important;
664 }
665
666 body.high-contrast-active .${rootCss} [data-category="${ourEnergyStyle.titleLocale}"] {
667 background: linear-gradient(0deg, var(--background-surface-opacity-light-level-07, rgba(55, 55, 55, 1)) 0%, var(--background-surface-opacity-light-level-07, rgba(55, 55, 55, 1)) 100%), #${ourEnergyStyle.backgroundColor} !important;
668 color: #${ourEnergyStyle.textColorHighContrast} !important;
669 }
670
671 </style>
672</#list>
673
674<script>
675
676 function disableEnableArrow(arrow, scrollBar, maxDistance, direction)
677 {
678 if(direction === "left") {
679 if (scrollBar.scrollLeft > 0) {
680 arrow.classList.contains("arrow-disable") && arrow.classList.remove("arrow-disable");
681 }
682 else {
683 !arrow.classList.contains("arrow-disable") && arrow.classList.add("arrow-disable");
684 }
685 }
686 else if(direction === "right") {
687 if (Math.ceil(scrollBar.scrollLeft + scrollBar.clientWidth) < maxDistance) {
688 arrow.classList.contains("arrow-disable") && arrow.classList.remove("arrow-disable");
689 }
690 else {
691 !arrow.classList.contains("arrow-disable") && arrow.classList.add("arrow-disable");
692 }
693 }
694 }
695
696 function scrollCarousel()
697 {
698 const root = document.querySelector(".${rootCss}");
699 const scrollBar = root.querySelector(".${rootCss} .card-news-list");
700 const gap = 32;// var(--space-lg);
701 const stepLength = scrollBar.querySelector(".card-news-container").offsetWidth + gap;
702 const arrowLeftBtn = root.querySelector(".card-news-arrow-left")
703 const arrowRightBtn = root.querySelector(".card-news-arrow-right")
704
705 let maxDistance = scrollBar.scrollWidth;
706
707 arrowLeftBtn.addEventListener('click', () => {
708 if (scrollBar.scrollLeft > 0) {
709 scrollBar.scroll({
710 left: scrollBar.scrollLeft - stepLength,
711 behavior: "smooth",
712 });
713 }
714 });
715
716 arrowRightBtn.addEventListener('click', () => {
717 if (scrollBar.scrollLeft < maxDistance) {
718 scrollBar.scroll({
719 left: scrollBar.scrollLeft + stepLength,
720 behavior: "smooth",
721 });
722 }
723 });
724
725 scrollBar.addEventListener("scroll", ()=>{
726 disableEnableArrow(arrowLeftBtn, scrollBar, maxDistance, "left");
727 disableEnableArrow(arrowRightBtn, scrollBar, maxDistance, "right");
728 });
729
730 disableEnableArrow(arrowLeftBtn, scrollBar, maxDistance, "left");
731 disableEnableArrow(arrowRightBtn, scrollBar, maxDistance, "right");
732 }
733
734 document.addEventListener('DOMContentLoaded', scrollCarousel);
735
736function setLinks${contentNumber}() {
737
738 const allCategoryCards = document.querySelectorAll(".${rootCss} .card-news-container");
739 allCategoryCards.forEach((card) => {
740 card.addEventListener('click', (event) => {
741 const element = event.target;
742 element.querySelector('a').click();
743 });
744 })
745
746 document.querySelector('.${rootCss} .card-news-list').classList.add('active');
747
748}
749
750setLinks${contentNumber}()
751
752
753
754</script>
Escolha um Canal:
Navegue nas Seções:
Acessibilidade
Idioma:
Selecione um idioma: