|
<!DOCTYPE html> |
|
<html lang="en"> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
<title>FocusedAI Embedded</title> |
|
<style> |
|
|
|
body, html { |
|
margin: 0; |
|
padding: 0; |
|
width: 100%; |
|
height: 100%; |
|
overflow: hidden; |
|
} |
|
|
|
|
|
.iframe-container { |
|
position: absolute; |
|
top: 0; |
|
left: 0; |
|
width: 100%; |
|
height: 100%; |
|
border: none; |
|
} |
|
|
|
|
|
.custom-controls { |
|
position: fixed; |
|
top: 10px; |
|
right: 10px; |
|
z-index: 1000; |
|
background-color: rgba(0, 0, 0, 0.7); |
|
color: white; |
|
padding: 10px; |
|
border-radius: 5px; |
|
font-family: Arial, sans-serif; |
|
} |
|
|
|
.custom-controls button { |
|
background-color: #4CAF50; |
|
border: none; |
|
color: white; |
|
padding: 5px 10px; |
|
text-align: center; |
|
text-decoration: none; |
|
display: inline-block; |
|
font-size: 14px; |
|
margin: 2px; |
|
cursor: pointer; |
|
border-radius: 3px; |
|
} |
|
</style> |
|
</head> |
|
<body> |
|
|
|
<div class="custom-controls"> |
|
<button id="toggleSearchBar">Toggle Search</button> |
|
<button id="goHome">Home</button> |
|
</div> |
|
|
|
|
|
<iframe id="focusedai-frame" class="iframe-container" src="https://focusedai.web.app" allowfullscreen></iframe> |
|
|
|
<script> |
|
document.addEventListener('DOMContentLoaded', function() { |
|
|
|
const iframe = document.getElementById('focusedai-frame'); |
|
let searchBarHidden = false; |
|
|
|
|
|
iframe.onload = function() { |
|
hideSearchBar(); |
|
}; |
|
|
|
|
|
document.getElementById('toggleSearchBar').addEventListener('click', function() { |
|
if (searchBarHidden) { |
|
showSearchBar(); |
|
searchBarHidden = false; |
|
} else { |
|
hideSearchBar(); |
|
searchBarHidden = true; |
|
} |
|
}); |
|
|
|
|
|
document.getElementById('goHome').addEventListener('click', function() { |
|
iframe.src = 'https://focusedai.web.app'; |
|
}); |
|
|
|
|
|
function hideSearchBar() { |
|
try { |
|
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; |
|
|
|
const searchBar = iframeDocument.querySelector('.search-bar'); |
|
|
|
if (searchBar) { |
|
searchBar.style.display = 'none'; |
|
searchBarHidden = true; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
} catch (e) { |
|
console.error('Could not access iframe content:', e); |
|
} |
|
} |
|
|
|
|
|
function showSearchBar() { |
|
try { |
|
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; |
|
const searchBar = iframeDocument.querySelector('.search-bar'); |
|
|
|
if (searchBar) { |
|
searchBar.style.display = 'block'; |
|
searchBarHidden = false; |
|
} |
|
} catch (e) { |
|
console.error('Could not access iframe content:', e); |
|
} |
|
} |
|
|
|
|
|
window.addEventListener('message', function(event) { |
|
|
|
if (event.origin !== 'https://focusedai.web.app') return; |
|
|
|
|
|
console.log('Message from iframe:', event.data); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
}); |
|
|
|
|
|
function sendMessageToIframe(message) { |
|
const iframe = document.getElementById('focusedai-frame'); |
|
iframe.contentWindow.postMessage(message, 'https://focusedai.web.app'); |
|
} |
|
</script> |
|
</body> |
|
</html> |