Compare commits

...

5 Commits

Author SHA1 Message Date
n loewen 9ba2d60449 (css) Change details of monogram sizing 2023-09-23 15:18:30 -07:00
n loewen df02bbe888 (css) Remove unused code 2023-09-23 15:00:35 -07:00
n loewen 1fe069b4f6 Change the monogram to have one background image, which changes when a link is hovered 2023-09-23 14:58:22 -07:00
n loewen 9f25e6d488 Change font size, gap between links 2023-09-23 13:45:11 -07:00
n loewen ea52f6986b Add key links below monogram 2023-09-22 11:28:56 -07:00
3 changed files with 99 additions and 112 deletions

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 600 900" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g id="Artboard1" transform="matrix(0.133333,0,0,0.1875,0,0)">
<rect x="0" y="0" width="4500" height="4800" style="fill:none;"/>
<clipPath id="_clip1">
<rect x="0" y="0" width="4500" height="4800"/>
</clipPath>
<g clip-path="url(#_clip1)">
<g transform="matrix(1,0,0,1,-6960,-6096)">
<g transform="matrix(3.30882,0,0,2.35294,3710.74,3458.35)">
<path d="M1662,1801L982,1121L982,1801L1662,1801Z" style="fill:rgb(35,31,32);"/>
</g>
<g transform="matrix(3.30882,0,0,2.35294,5960.74,3458.35)">
<path d="M1662,1801L982,1121L982,1801L1662,1801Z" style="fill:rgb(35,31,32);"/>
</g>
<g transform="matrix(2.02607e-16,2.35294,-3.30882,1.44076e-16,15169.2,5385.41)">
<path d="M1662,1801L982,1121L982,1801L1662,1801Z" style="fill:rgb(35,31,32);"/>
</g>
<g transform="matrix(3.30882,0,0,2.35294,3710.74,5058.35)">
<path d="M1662,1801L982,1121L982,1801L1662,1801Z" style="fill:rgb(35,31,32);"/>
</g>
<g transform="matrix(3.30882,0,0,2.35294,3710.74,6658.35)">
<path d="M1662,1801L982,1121L982,1801L1662,1801Z" style="fill:rgb(35,31,32);"/>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -10,44 +10,48 @@
<div class="main"> <div class="main">
<div class="monogram"> <div class="monogram">
<div class="column">
<a href="#" class="triangle triangle-bottom">
<img src="https://placekitten.com/300/300">
<div class="triangle-label">Linguist</div>
</a>
<a href="#" class="triangle triangle-bottom">
<img src="https://placekitten.com/300/300">
<div class="triangle-label">Quilter</div>
</a>
<a href="#" class="triangle triangle-bottom">
<img src="https://placekitten.com/300/300">
<div class="triangle-label">Blog</div>
</a>
</div>
<div class="column">
<a href="#" class="triangle triangle-bottom">
<img src="https://placekitten.com/300/300">
<div class="triangle-label multiline">Applied<br>Statistician</div>
</a>
<a href="#" class="triangle triangle-top">
<img src="https://placekitten.com/200/200">
<div class="triangle-label">Knitter</div>
</a>
</div>
</div> </div>
<div class="intro">
<div class="navigation"> <div class="bio"> I'm <h1>Elizabeth Pankratz</h1>,<br>
<h1> Elizabeth Pankratz </h1> a <a class="linguist" href="#">linguist</a>,
<a href="#">about</a> <a class="textileartist" href="#">textile&nbsp;artist</a>,
<a href="#">blog</a> and <a class="statistician" href="#">applied&nbsp;statistician</a>
<a href="#">contact</a> </div>
<div class="links">
<a href="#">about</a>
<a href="#">blog</a>
<a href="#">contact</a>
</div>
</div> </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> </body>
</html> </html>

108
style.css
View File

@ -26,7 +26,7 @@ body {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
display: grid; display: grid;
grid-template-columns: [gutter-left] 1fr [content-column] 1fr [gutter-right] 1fr; grid-template-columns: [gutter-left] 1fr [content-column] max(25vw) [gutter-right] 1fr;
grid-template-rows: [header] 1fr [center] 1fr [footer] 1fr; grid-template-rows: [header] 1fr [center] 1fr [footer] 1fr;
font-family: 'Fira Sans', sans-serif; font-family: 'Fira Sans', sans-serif;
} }
@ -40,98 +40,52 @@ body {
/* Monogram */ /* Monogram */
.monogram { .monogram {
display: flex;
}
.triangle {
display: block; /* Because these are <a> tags */
background-color: black;
position: relative; /* Required for the absolute positioning of the triangle-label */
width: 20vh;
height: 20vh;
max-width: 40vw;
max-height: 40vw;
}
.triangle-bottom {
clip-path: polygon(0 0, 0 100%, 100% 100%);
}
.triangle-top {
clip-path: polygon(0 0, 0 100%, 100% 0);
}
.triangle img {
display: block; /* Prevents the annoying inline-block gap after */
filter: grayscale(100%);
mix-blend-mode: overlay;
width: 100%; width: 100%;
height: 100%; aspect-ratio: 2 / 3;
} mask-image: url('assets/images/monogram.svg');
background: black;
.triangle:hover { background-size: cover;
background-color: hsl(50, 90%, 50%);
}
.triangle-label {
position: absolute;
color: black;
left: 0.5rem;
bottom: 0.5rem;
}
.triangle-label.multiline {
margin-top: -2rem;
}
.triangle-top .triangle-label {
top: 0.5rem;
} }
/* Title and links */ /* Title and links */
h1 { h1 {
display: inline;
font-weight: bold; font-weight: bold;
font-size: 1.7rem; font-size: 1em;
margin-top: 1em;
} }
.navigation { .intro {
font-size: 1.4rem; margin-top: 2em;
font-size: 1.5rem;
line-height: 1.4;
} }
.navigation a { .intro .bio {
margin-bottom: 1em;
}
.intro .links {
display: flex;
gap: 1.5ch;
}
.intro a {
color: black; color: black;
text-decoration: none; border-left: 0.33ch solid rgba(0,0,0,0);
margin-left: -0.25ch; border-right: 0.33ch solid rgba(0,0,0,0);
border-left: 0.25ch solid rgba(0,0,0,0); margin-left: -0.33ch;
border-right: 0.25ch solid rgba(0,0,0,0); margin-right: -0.33ch;
margin-right: 0.75ch;
} }
.navigation a:visited { .intro a:visited {
color: black; color: black;
} }
.navigation a:active, .intro a:active,
.navigation a:hover { .intro a:hover {
background-color:hsl(50, 100%, 70%); background-color:hsl(50, 100%, 70%);
border-left: 0.25ch solid hsl(50, 100%, 70%); border-left: 0.33ch solid hsl(50, 100%, 70%);
border-right: 0.25ch solid hsl(50, 100%, 70%); border-right: 0.33ch solid hsl(50, 100%, 70%);
} }
/* Adjustments for touchscreen devices */
@media (hover: none) {
.triangle-label {
color: white;
opacity: 0.75;
}
.triangle:hover .triangle-label {
color: black;
opacity: 1;
}
}