57 lines
1.5 KiB
HTML
57 lines
1.5 KiB
HTML
<!doctype HTML>
|
|
<html>
|
|
<head>
|
|
<title> Quilt logo sketch </title>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="style.css">
|
|
</head>
|
|
<body>
|
|
|
|
<div class="main">
|
|
<div class="monogram">
|
|
</div>
|
|
<div class="intro">
|
|
<div class="bio"> I'm <h1>Elizabeth Pankratz</h1>,<br>
|
|
a <a class="linguist" href="#">linguist</a>,
|
|
<a class="textileartist" href="#">textile artist</a>,
|
|
and <a class="statistician" href="#">applied statistician</a>
|
|
</div>
|
|
<div class="links">
|
|
<a href="#">about</a>
|
|
<a href="#">blog</a>
|
|
<a href="#">contact</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
|
|
const monogram = document.querySelector('.monogram');
|
|
|
|
const links = [
|
|
{ element: document.querySelector('.intro a.linguist'), name: 'linguist' },
|
|
{ element: document.querySelector('.intro a.statistician'), name: 'statistician' },
|
|
{ element: document.querySelector('.intro a.textileartist'), name: 'textileartist' },
|
|
];
|
|
|
|
const bgs = {
|
|
linguist: 'http://placekitten.com/200/300',
|
|
textileartist: 'http://placekitten.com/500/300',
|
|
statistician: 'http://placekitten.com/200/400',
|
|
};
|
|
|
|
links.forEach((link) => {
|
|
console.log(link);
|
|
link.element.addEventListener('mouseover', (event) => {
|
|
monogram.style.backgroundImage = `url(${bgs[link.name]})`;
|
|
});
|
|
link.element.addEventListener('mouseout', (event) => {
|
|
monogram.style.backgroundImage = 'none';
|
|
});
|
|
})
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html> |