Skip to content

Commit

Permalink
Merge pull request #37 from SchBenedikt/Background
Browse files Browse the repository at this point in the history
Background Image
  • Loading branch information
SchBenedikt authored Mar 2, 2024
2 parents 28a3b44 + eacee77 commit 7e53667
Show file tree
Hide file tree
Showing 6 changed files with 382 additions and 293 deletions.
22 changes: 22 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h2>About Me</h2>
onkeydown="handleKeyDown(event)"
/>
<button onclick="updateUsername()">Update</button>

</div>
<select
class="gh-search-list"
Expand Down Expand Up @@ -86,5 +87,26 @@ <h2 id="overlay-title"></h2>
<script type="text/javascript" src="js/predict.js"></script>
<script type="text/javascript" src="js/settings.js"></script>
<script type="text/javascript" src="js/index.js"></script>

<script>
if (isUnsplashEnabled()) {
fetch('https://source.unsplash.com/1600x900/?nature')
.then(response => {
document.body.style.backgroundImage = `url(${response.url})`;
})
.catch(error => console.error('Fehler beim Laden des Hintergrundbilds:', error));
}

window.addEventListener('resize', () => {
const windowHeight = window.innerHeight;
const formHeight = document.getElementById('form').offsetHeight;
const padding = (windowHeight - formHeight) / 2;
document.body.style.paddingTop = padding + 'px';
});

window.dispatchEvent(new Event('resize'));


</script>
</body>
</html>
Loading

0 comments on commit 7e53667

Please sign in to comment.