79 lines
3.3 KiB
HTML
79 lines
3.3 KiB
HTML
<div class="ticker-wrapper-h">
|
|
<div class="heading">
|
|
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="2em" height="2em" viewBox="0 0 128 128">
|
|
<path fill="#F7F7FB"
|
|
d="M109.7,110H18.2c-5.1,0-9.2-4.1-9.2-9.2V22.6c0-2.5,2.1-4.6,4.6-4.6H96c2.5,0,4.6,2.1,4.6,4.6v23.1v55.2C100.6,105.9,104.7,110,109.7,110L109.7,110c5.1,0,9.2-4.1,9.2-9.2V50.2c0-2.5-2.1-4.6-4.6-4.6h-4.6">
|
|
</path>
|
|
<path fill="#DEDFE6"
|
|
d="M23 31.9h63.1c1.7 0 3 1.3 3 3v16.9c0 1.7-1.3 3-3 3H23c-1.7 0-3-1.3-3-3V34.9C20 33.2 21.3 31.9 23 31.9zM109.7 110L109.7 110c5.1 0 9.2-4.1 9.2-9.2V50.2c0-2.5-2.1-4.6-4.6-4.6h-13.8v55.2C100.6 105.9 104.7 110 109.7 110z">
|
|
</path>
|
|
<path fill="#464C55"
|
|
d="M109.7,113H18.2C11.5,113,6,107.5,6,100.8V22.6c0-4.2,3.4-7.6,7.6-7.6H96c4.2,0,7.6,3.4,7.6,7.6v78.3c0,3.4,2.8,6.2,6.2,6.2s6.2-2.8,6.2-6.2V50.2c0-0.9-0.7-1.6-1.6-1.6h-4.6c-1.7,0-3-1.3-3-3s1.3-3,3-3h4.6c4.2,0,7.6,3.4,7.6,7.6v50.6C121.9,107.6,116.4,113,109.7,113z M13.6,21c-0.9,0-1.6,0.7-1.6,1.6v78.3c0,3.4,2.8,6.2,6.2,6.2h81.1c-1.1-1.8-1.7-3.9-1.7-6.2V22.6c0-0.9-0.7-1.6-1.6-1.6L13.6,21z">
|
|
</path>
|
|
<path fill="#DEDFE6"
|
|
d="M41.2 72.9H23c-1.7 0-3-1.3-3-3s1.3-3 3-3h18.2c1.7 0 3 1.3 3 3S42.9 72.9 41.2 72.9zM41.2 98.7H23c-1.7 0-3-1.3-3-3s1.3-3 3-3h18.2c1.7 0 3 1.3 3 3S42.9 98.7 41.2 98.7zM41.2 85.7H23c-1.7 0-3-1.3-3-3s1.3-3 3-3h18.2c1.7 0 3 1.3 3 3S42.9 85.7 41.2 85.7z">
|
|
</path>
|
|
<path fill="#464C55"
|
|
d="M86,99.1H58c-1.7,0-3-1.3-3-3V68.6c0-1.7,1.3-3,3-3h28c1.7,0,3,1.3,3,3v27.5C89,97.7,87.7,99.1,86,99.1z M61,93.1h22V71.6H61V93.1z">
|
|
</path>
|
|
</svg>
|
|
</div>
|
|
<ul class="news-ticker-h">
|
|
<!-- <li>
|
|
<a href=""><i class="bi bi-bookmark-fill"></i>elit. 1</a>
|
|
</li> -->
|
|
</ul>
|
|
</div>
|
|
|
|
<script>
|
|
|
|
(()=>{
|
|
|
|
let lista = [0, 1, 2, 3, 4, 5, 6];
|
|
|
|
// Ordenar la lista de forma aleatoria usando el algoritmo de Fisher-Yates
|
|
for (let i = lista.length - 1; i > 0; i--) {
|
|
const j = Math.floor(Math.random() * (i + 1));
|
|
[lista[i], lista[j]] = [lista[j], lista[i]];
|
|
}
|
|
|
|
|
|
let url = location.origin + '/latest-posts';
|
|
let newsCont = document.querySelector('ul.news-ticker-h');
|
|
|
|
|
|
fetch(url)
|
|
.then(res => res.json())
|
|
.then(data => {
|
|
let i = 0;
|
|
let len = lista.length;
|
|
|
|
let a_ele = document.createElement('a');
|
|
let i_ele = document.createElement('i');
|
|
|
|
for (let i = 0; i < len; i++) {
|
|
let ele = data[i];
|
|
let title = `${ele[2]}`;
|
|
let section = `${ele[1]}`;
|
|
let tema = `${ele[0]}`;
|
|
let link = location.origin + `/section/${section}/tema/${tema}`;
|
|
let a_ele = document.createElement('a');
|
|
let li_ele = document.createElement('li');
|
|
|
|
a_ele.setAttribute('class', 'bi bi-bookmark-fill');
|
|
a_ele.setAttribute('href', link);
|
|
a_ele.innerText = ' ' + title;
|
|
li_ele.appendChild(a_ele);
|
|
|
|
newsCont.appendChild(li_ele);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
})();
|
|
|
|
|
|
</script> |