Files
turmlibar-calendar/test_logo.html
2025-10-30 13:33:08 +01:00

229 lines
7.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Logo Display Test</title>
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
}
.test-container {
max-width: 800px;
margin: 0 auto;
background: white;
padding: 20px;
border-radius: 10px;
}
h2 {
color: #333;
border-bottom: 2px solid #667eea;
padding-bottom: 10px;
}
.test-section {
margin: 30px 0;
padding: 20px;
border: 1px solid #ddd;
border-radius: 5px;
}
.logo-test {
display: inline-block;
margin: 10px;
text-align: center;
}
.logo-test img {
display: block;
margin-bottom: 10px;
}
.logo-test span {
display: block;
font-size: 12px;
color: #666;
}
/* Test 1: Raw display */
.test1 img {
width: 150px;
height: auto;
}
/* Test 2: With white background */
.test2 img {
width: 150px;
height: auto;
background: white;
padding: 10px;
border-radius: 10px;
}
/* Test 3: With object-fit contain */
.test3 img {
width: 150px;
height: 150px;
object-fit: contain;
background: #f0f0f0;
padding: 10px;
border-radius: 10px;
}
/* Test 4: With shadow */
.test4 img {
width: 150px;
height: auto;
filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
/* Test 5: In a circle container */
.test5 {
width: 150px;
height: 150px;
background: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.test5 img {
width: 80%;
height: 80%;
object-fit: contain;
}
/* Test 6: In a square container with border */
.test6 {
width: 150px;
height: 150px;
background: white;
border-radius: 15px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
padding: 10px;
}
.test6 img {
width: 100%;
height: 100%;
object-fit: contain;
}
.error {
color: red;
font-weight: bold;
}
.success {
color: green;
font-weight: bold;
}
</style>
</head>
<body>
<div class="test-container">
<h1>Turmli Bar Logo Display Tests</h1>
<div class="test-section">
<h2>Direct File Access Tests</h2>
<div class="logo-test test1">
<img src="Vektor-Logo.svg" alt="Logo from root" onerror="this.parentElement.innerHTML+='<span class=error>Failed to load from root</span>'" onload="this.parentElement.innerHTML+='<span class=success>Loaded from root</span>'">
<span>Direct from root</span>
</div>
<div class="logo-test test1">
<img src="static/logo.svg" alt="Logo from static" onerror="this.parentElement.innerHTML+='<span class=error>Failed to load from static</span>'" onload="this.parentElement.innerHTML+='<span class=success>Loaded from static</span>'">
<span>From static folder</span>
</div>
<div class="logo-test test1">
<img src="/static/logo.svg" alt="Logo with absolute path" onerror="this.parentElement.innerHTML+='<span class=error>Failed with /static/</span>'" onload="this.parentElement.innerHTML+='<span class=success>Loaded with /static/</span>'">
<span>Absolute /static/ path</span>
</div>
</div>
<div class="test-section">
<h2>Display Style Tests</h2>
<div class="logo-test test2">
<img src="static/logo.svg" alt="With white background">
<span>White background + padding</span>
</div>
<div class="logo-test test3">
<img src="static/logo.svg" alt="Object-fit contain">
<span>Object-fit: contain</span>
</div>
<div class="logo-test test4">
<img src="static/logo.svg" alt="With drop shadow">
<span>Drop shadow filter</span>
</div>
</div>
<div class="test-section">
<h2>Container Tests</h2>
<div class="logo-test">
<div class="test5">
<img src="static/logo.svg" alt="In circle">
</div>
<span>Circle container</span>
</div>
<div class="logo-test">
<div class="test6">
<img src="static/logo.svg" alt="In square">
</div>
<span>Square container</span>
</div>
</div>
<div class="test-section">
<h2>Inline SVG Test</h2>
<div style="width: 150px; height: 150px; background: white; padding: 10px; border-radius: 10px; display: inline-block;">
<object data="static/logo.svg" type="image/svg+xml" style="width: 100%; height: 100%;">
<span class="error">SVG as object failed</span>
</object>
</div>
<span style="display: block; margin-top: 10px; font-size: 12px;">Using &lt;object&gt; tag</span>
</div>
<div class="test-section">
<h2>Debug Information</h2>
<ul>
<li>Open this file directly in your browser (file:// protocol)</li>
<li>Check which display methods work</li>
<li>Check browser console for any errors</li>
<li>The SVG has a gray background (#7F7F7F) which might be part of the issue</li>
</ul>
</div>
</div>
<script>
console.log('Logo test page loaded');
// Check if images are loading
document.querySelectorAll('img').forEach((img, index) => {
img.addEventListener('load', () => {
console.log(`Image ${index} loaded successfully:`, img.src);
});
img.addEventListener('error', () => {
console.error(`Image ${index} failed to load:`, img.src);
});
});
</script>
</body>
</html>