newspapers / index.html
note6's picture
Add 3 files
a886463 verified
Raw History Blame Contribute Delete
8.8 kB
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Resumen de Noticias Españolas</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
background-color: #f5f5f5;
color: #333;
line-height: 1.6;
}
header {
background-color: #1a365d;
color: white;
padding: 1rem 2rem;
text-align: center;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
h1 {
margin-bottom: 0.5rem;
}
.controls {
display: flex;
justify-content: center;
gap: 1rem;
padding: 1rem;
background-color: #2c5282;
}
button {
background-color: #4299e1;
color: white;
border: none;
padding: 0.5rem 1rem;
border-radius: 4px;
cursor: pointer;
font-weight: bold;
transition: background-color 0.3s;
}
button:hover {
background-color: #3182ce;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 1rem;
}
.news-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 1.5rem;
margin-top: 1rem;
}
.news-card {
background-color: white;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
transition: transform 0.3s;
}
.news-card:hover {
transform: translateY(-5px);
}
.news-header {
padding: 1rem;
background-color: #2b6cb0;
color: white;
}
.news-source {
font-size: 0.8rem;
opacity: 0.8;
}
.news-title {
margin: 0.5rem 0;
font-size: 1.1rem;
font-weight: bold;
}
.news-content {
padding: 1rem;
}
.news-summary {
margin-bottom: 1rem;
}
.news-actions {
display: flex;
justify-content: space-between;
padding: 0 1rem 1rem;
}
.read-more {
color: #2b6cb0;
text-decoration: none;
font-weight: bold;
}
.read-more:hover {
text-decoration: underline;
}
.loading {
text-align: center;
padding: 2rem;
font-size: 1.2rem;
color: #666;
}
@media (max-width: 768px) {
.news-grid {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<header>
<h1>Resumen de Noticias Españolas</h1>
<p>Los titulares más importantes de los principales periódicos de España</p>
</header>
<div class="controls">
<button id="refresh-btn">Actualizar Noticias</button>
<button id="read-all-btn">Leer Todas</button>
</div>
<div class="container">
<div id="news-container" class="news-grid">
<div class="loading">Cargando noticias...</div>
</div>
</div>
<script>
// Lista de periódicos españoles importantes
const newspapers = [
{ name: "El País", url: "https://elpais.com" },
{ name: "El Mundo", url: "https://www.elmundo.es" },
{ name: "La Vanguardia", url: "https://www.lavanguardia.com" },
{ name: "ABC", url: "https://www.abc.es" },
{ name: "20 Minutos", url: "https://www.20minutos.es" },
{ name: "El Periódico", url: "https://www.elperiodico.com/es/" },
{ name: "La Razón", url: "https://www.larazon.es" },
{ name: "El Confidencial", url: "https://www.elconfidencial.com" },
{ name: "Público", url: "https://www.publico.es" },
{ name: "El Diario", url: "https://www.eldiario.es" }
];
// Elementos del DOM
const newsContainer = document.getElementById('news-container');
const refreshBtn = document.getElementById('refresh-btn');
const readAllBtn = document.getElementById('read-all-btn');
// Función para generar resúmenes ficticios (en una app real usarías una API)
function generateSummary(title) {
const summaries = [
`Este titular aborda un tema de actualidad que está generando mucha discusión en la sociedad española. ${title} es un asunto que afecta a diversos sectores y que probablemente tendrá repercusiones en los próximos días.`,
`La noticia sobre ${title.toLowerCase()} refleja una situación compleja que requiere atención inmediata. Expertos opinan que se trata de un desarrollo importante que podría marcar un antes y un después en este ámbito.`
];
return summaries;
}
// Función para cargar noticias
function loadNews() {
newsContainer.innerHTML = '<div class="loading">Cargando noticias...</div>';
// Simulación de carga de noticias (en una app real usarías fetch a una API)
setTimeout(() => {
newsContainer.innerHTML = '';
// Generamos noticias ficticias para cada periódico
newspapers.forEach((paper, index) => {
const newsItem = document.createElement('div');
newsItem.className = 'news-card';
// Título ficticio basado en el periódico
const title = `Noticia destacada de ${paper.name} - ${new Date().toLocaleDateString()}`;
const summary = generateSummary(title);
newsItem.innerHTML = `
<div class="news-header">
<div class="news-source">${paper.name}</div>
<h3 class="news-title">${title}</h3>
</div>
<div class="news-content">
<p class="news-summary">${summary[0]}</p>
<p class="news-summary">${summary[1]}</p>
</div>
<div class="news-actions">
<button class="read-castellano" data-id="${index}">Leer en Castellano</button>
<a href="${paper.url}" target="_blank" class="read-more">Leer más</a>
</div>
`;
newsContainer.appendChild(newsItem);
});
// Añadir event listeners a los botones "Leer en Castellano"
document.querySelectorAll('.read-castellano').forEach(btn => {
btn.addEventListener('click', function() {
const newsId = this.getAttribute('data-id');
alert(`Mostrando la noticia de ${newspapers[newsId].name} en castellano. En una aplicación real, aquí se traduciría el contenido.`);
});
});
}, 1000);
}
// Event listeners
refreshBtn.addEventListener('click', loadNews);
readAllBtn.addEventListener('click', () => {
alert("En una aplicación real, aquí se abrirían todas las noticias o se marcarían como leídas.");
});
// Cargar noticias al iniciar
loadNews();
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=note6/newspapers" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>