Heise News Ticker und Abstand meets auf der Welcome Seite
This commit is contained in:
15
config.json
15
config.json
@@ -5,7 +5,7 @@
|
|||||||
{
|
{
|
||||||
"url": "https://wbxroompresence.cancom.io/standort?find=Stuttgart",
|
"url": "https://wbxroompresence.cancom.io/standort?find=Stuttgart",
|
||||||
"zoom": 0.8,
|
"zoom": 0.8,
|
||||||
"enabled": true
|
"enabled": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -23,11 +23,20 @@
|
|||||||
{
|
{
|
||||||
"url": "https://www.meteoblue.com/en/meteotv/d7b0fd",
|
"url": "https://www.meteoblue.com/en/meteotv/d7b0fd",
|
||||||
"zoom": 1.0,
|
"zoom": 1.0,
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Cancom_Leitsatz.JPG",
|
"name": "Cancom_Leitsatz.JPG",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "http://localhost:5005/static/heise.html",
|
||||||
|
"zoom": 0.9,
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "heise.html",
|
||||||
|
"enabled": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"newsticker_text": "Herzlich Willkommen bei der CANCOM - wir begr\u00fc\u00dfen unsere G\u00e4ste und w\u00fcnschen Ihnen einen angenehmen Tag! !",
|
"newsticker_text": "Herzlich Willkommen bei der CANCOM - wir begr\u00fc\u00dfen unsere G\u00e4ste und w\u00fcnschen Ihnen einen angenehmen Tag! !",
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ def generate_welcome_html(customer_name, logo_url):
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
gap: 20px;
|
gap: 10px;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}}
|
}}
|
||||||
.cancom-logo {{
|
.cancom-logo {{
|
||||||
@@ -140,6 +140,23 @@ def generate_welcome_html(customer_name, logo_url):
|
|||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
|
filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
|
||||||
}}
|
}}
|
||||||
|
.meets {{
|
||||||
|
font-size: 2.5rem;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #000;
|
||||||
|
margin-top: -8px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
}}
|
||||||
|
.customer-logo {{
|
||||||
|
max-width: 300px;
|
||||||
|
max-height: 180px;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
object-fit: contain;
|
||||||
|
filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
|
||||||
|
margin-top: 18px;
|
||||||
|
}}
|
||||||
.customer-logo {{
|
.customer-logo {{
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
max-height: 180px;
|
max-height: 180px;
|
||||||
|
|||||||
107
static/heise.html
Normal file
107
static/heise.html
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Heise News Ticker</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
background-color: #F4F6F8;
|
||||||
|
color: #212121;
|
||||||
|
margin: 0;
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 1.2em;
|
||||||
|
margin-bottom: .7em;
|
||||||
|
color: #DA002D;
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
margin-bottom: 1em;
|
||||||
|
background: #fff;
|
||||||
|
border-left: 6px solid #DA002D;
|
||||||
|
padding: 0.8em 0.7em 0.8em 1em;
|
||||||
|
font-size: 1.05em;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 2px 6px rgba(218, 0, 45, 0.03);
|
||||||
|
transition: box-shadow 0.2s;
|
||||||
|
}
|
||||||
|
li:hover {
|
||||||
|
box-shadow: 0 4px 18px rgba(218,0,45,0.08), 0 1.5px 4px #DA002D22;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #DA002D;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
color: #B00024;
|
||||||
|
}
|
||||||
|
.time {
|
||||||
|
display: block;
|
||||||
|
color: #6c757d;
|
||||||
|
font-size: 0.95em;
|
||||||
|
font-weight: 400;
|
||||||
|
margin-top: 0.15em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Heise TOP IT-News</h1>
|
||||||
|
<ul id="news-list"></ul>
|
||||||
|
<script>
|
||||||
|
const FEED_URL = 'https://www.heise.de/rss/heise-atom.xml';
|
||||||
|
|
||||||
|
async function loadNews() {
|
||||||
|
try {
|
||||||
|
const response = await fetch(FEED_URL);
|
||||||
|
const text = await response.text();
|
||||||
|
const parser = new DOMParser();
|
||||||
|
const xml = parser.parseFromString(text, 'application/xml');
|
||||||
|
|
||||||
|
// Atom Feed uses <entry>, not <item>
|
||||||
|
const items = Array.from(xml.getElementsByTagName('entry')).slice(0, 6);
|
||||||
|
const list = document.getElementById('news-list');
|
||||||
|
if (items.length === 0) {
|
||||||
|
list.innerHTML = '<li>Momentan keine News gefunden.</li>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
items.forEach(item => {
|
||||||
|
const title = item.querySelector('title')?.textContent || 'Unbenannt';
|
||||||
|
const link = item.querySelector('link')?.getAttribute('href') || '#';
|
||||||
|
const pubDateRaw = item.querySelector('updated')?.textContent || '';
|
||||||
|
const summaryRaw = item.querySelector('summary')?.textContent || '';
|
||||||
|
|
||||||
|
let formattedDate = '';
|
||||||
|
if (pubDateRaw) {
|
||||||
|
const d = new Date(pubDateRaw);
|
||||||
|
// Format zu TT-MM-JJJJ hh:mm
|
||||||
|
const pad = n => (n<10 ? '0'+n : n);
|
||||||
|
formattedDate = `${pad(d.getDate())}.${pad(d.getMonth()+1)}.${d.getFullYear()} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const li = document.createElement('li');
|
||||||
|
li.innerHTML = `
|
||||||
|
<span class="time">${formattedDate}</span>
|
||||||
|
<a href="${link}" target="_blank">${title}</a>
|
||||||
|
<div class="summary" style="color:#555;font-size:1em;line-height:1.5;margin-top:0.35em;font-weight:400;">
|
||||||
|
${summaryRaw}
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
list.appendChild(li);
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
document.getElementById('news-list').innerHTML = '<li>Fehler beim Laden des Feeds!</li>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
loadNews();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user