added card and mobile scaling with menu

This commit is contained in:
Notoric 2024-05-23 03:51:04 +01:00
parent 07eadd5d9e
commit 3506d64c1d
5 changed files with 279 additions and 11 deletions

BIN
assets/headshot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

13
assets/plus.svg Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg fill="#fff" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="800px" height="800px" viewBox="0 0 45.402 45.402"
xml:space="preserve">
<g>
<path d="M41.267,18.557H26.832V4.134C26.832,1.851,24.99,0,22.707,0c-2.283,0-4.124,1.851-4.124,4.135v14.432H4.141
c-2.283,0-4.139,1.851-4.138,4.135c-0.001,1.141,0.46,2.187,1.207,2.934c0.748,0.749,1.78,1.222,2.92,1.222h14.453V41.27
c0,1.142,0.453,2.176,1.201,2.922c0.748,0.748,1.777,1.211,2.919,1.211c2.282,0,4.129-1.851,4.129-4.133V26.857h14.435
c2.283,0,4.134-1.867,4.133-4.15C45.399,20.425,43.548,18.557,41.267,18.557z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 874 B

View File

@ -5,7 +5,8 @@
<link rel="stylesheet" type="text/css" href="styles/global.css"> <link rel="stylesheet" type="text/css" href="styles/global.css">
</head> </head>
<body> <body>
<header> <img id="menu" src="/assets/plus.svg">
<div id="header">
<p id="logo">[Notoric]</p> <p id="logo">[Notoric]</p>
<div id="nav"> <div id="nav">
<a href="projects.html">Projects</a> <a href="projects.html">Projects</a>
@ -22,10 +23,19 @@
GitHub GitHub
</a> </a>
</div> </div>
</header> </div>
<main> <main>
<h1>Home</h1> <div id="homepage">
<p>Welcome to the home page.</p> <div class="card">
<div id="homepage-text">
<p id="hi">Hi, my name is</p>
<p id="name">Tom Cornes</p>
<p id="desc">I'm a <em>Software Developer</em> based in <em>Leicestershire, England.</em></p>
</div>
<div id="homepage-img">
</div>
</div>
</main> </main>
<script src="/scripts/homepage.js"></script>
</body> </body>
</html> </html>

View File

@ -0,0 +1,8 @@
const menu = document.getElementById('menu');
menu.addEventListener('click', () => {
const header = document.getElementById('header');
header.classList.toggle('expanded');
menu.classList.toggle('expanded');
});

View File

@ -8,24 +8,42 @@ body {
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
font-size: 16px; font-size: 16px;
width: 100vw;
overflow: hidden;
} }
header { #menu {
display: none;
}
#header {
background-color: black; background-color: black;
margin: 0; margin: 0;
overflow: hidden; overflow: hidden;
padding-inline: 16px; padding-inline: 16px;
font-size: 22px; font-size: 1.4em;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
height: 60px;
}
main {
max-width: 1300px;
margin: 0 auto;
padding-inline: 30px;
}
em {
color: hsl(30, 100%, 65%);
font-style: normal;
} }
#logo { #logo {
font-weight: 500; font-weight: 500;
} }
header p { #header p {
margin: 16px; margin: 16px;
margin-inline: 0; margin-inline: 0;
} }
@ -77,11 +95,230 @@ header p {
#links a svg { #links a svg {
fill: #eee; fill: #eee;
width: 20px; width: 1em;
height: 20px; height: 1em;
padding-right: 8px; padding-right: 8px;
} }
main { #homepage {
padding-inline: 20px; width: 100%;
height: calc(100vh - 60px);
display: flex;
justify-content: center;
align-items: center;
gap: 70px;
}
.card {
border-radius: 4em;
display: flex;
justify-content: center;
align-items: center;
backdrop-filter: blur(10px);
background-color: #111c;
position: relative;
overflow: hidden;
background-image: linear-gradient(
135deg,
hsl(263, 80%, 40%),
hsl(341, 80%, 40%) 12%,
hsl(30, 80%, 40%) 25%,
#161616 35%,
#161616 65%,
#252525 100%
);
&::after {
content: "";
position: absolute;
height: calc(100% - 0.5em);
width: calc(100% - 0.5em);
z-index: -2;
border-radius: 3.8em;
background-image: linear-gradient(
135deg,
hsl(263, 25%, 10%),
hsl(341, 25%, 10%) 10%,
hsl(30, 25%, 10%) 20%,
#161616 32%
);
}
}
#homepage .card {
flex-direction: row;
padding-block: 80px;
gap: 70px;
width: fit-content;
padding: 50px;
}
#homepage-text {
width: auto;
text-align: right;
}
#homepage-img {
background-image: url("/assets/headshot.jpg");
background-size: cover;
background-position: center;
width: 22em;
height: 22em;
aspect-ratio: 1/1;
border-radius: 50%;
position: relative;
}
#homepage-img::before {
content: "";
display: block;
width: 100%;
height: 100%;
position: absolute;
background-image: repeating-conic-gradient(
#ff0050 0%,
#ff8000 33.333%,
#7520ff 66.666%,
#ff0050 100%
);
border-radius: 50%;
z-index: -1;
filter: blur(14px);
}
#homepage p {
margin: 0;
max-width: 800px;
}
#hi {
font-size: 1.5em;
color: hsl(263, 50%, 65%);
}
#name {
font-size: 5em;
color: #f05;
font-weight: 700;
}
@media screen and (max-width: 1100px) {
#logo {
display: none;
}
body {
font-size: 30px;
}
#menu {
content: "";
display: block;
position: absolute;
top: 0.5em;
right: 0.5em;
font-size: 5em;
z-index: 11;
margin: 0;
background-image: url("/assets/plus.svg");
background-size: contain;
height: 0.6em;
width: 0.6em;
padding: 0px;
transition: transform 0.5s ease;
}
body::before {
content: "[N]";
display: flex;
position: absolute;
top: 1.1em;
left: 1.1em;
font-size: 2.5em;
font-weight: 700;
z-index: 11;
margin: 0;
padding: 0px;
}
#menu.expanded {
transform: rotate(225deg);
}
#header {
flex-direction: column;
height: calc(100vh - 120px);
width: 100vw;
justify-content: space-between;
position: absolute;
z-index: 10;
font-size: 3em;
margin: 0;
border: 0;
padding-block: 60px;
padding-inline: 0;
transform: translateX(-100vw);
transition: transform 0.5s ease;
background-color: #000a;
backdrop-filter: blur(10px);
}
#header.expanded {
transform: translateX(0);
}
#links, #nav {
position: static;
display: flex;
flex-direction: column;
gap: 20px;
width: 100%;
transform: none;
}
#links a, #nav a {
justify-content: center;
width: 100%;
text-align: right;
}
#nav {
transform: translatey(2em);
}
#links a svg {
padding-right: 30px;
}
#homepage .card {
flex-direction: column-reverse;
padding-block: 80px;
gap: 70px;
width: fit-content;
padding: 80px;
}
.card::after {
height: calc(100% - 0.35em);
width: calc(100% - 0.35em);
border-radius: 3.9em;
}
#homepage-text {
text-align: center;
max-width: 550px;
}
#homepage-img {
width: 16em;
height: 16em;
}
#hi {
font-size: 1.2em;
}
#name {
font-size: 3em;
}
} }