📝 Making notes on coder_coder tutorial

This commit is contained in:
z3rOR0ne 2023-02-05 00:51:55 -08:00
parent 2fed06de52
commit b9f2e01d22
2 changed files with 239 additions and 0 deletions

160
coder_coder.css Normal file
View file

@ -0,0 +1,160 @@
/* LEFT OFF AT BEGINNING OF PART 2 */
/* This document contains boilerplate css tips/tricks
* garnered from the youtuber, coder_coder's youtube series, "Building a
* portfolio website with HTML & CSS 4 Part Series */
/* :root */
/* custom css variables should be set in root so they do not have to redefined
* each time and keeps a consistent look, reference using var(--variable-name) syntax*/
/* note the naming scheme is changed from generic color names to descriptions of
* the elements they are applied to */
/* coder coder prefers hsl */
:root {
--body-bg: #151515;
--contact-bg: #242424;
--accent: #4ee1a0;
--text1: #ffffff;
--text2: #d9d9d9;
--invalid: #ff6f5b;
/* font-sizes */
/* note the use of --fs-pxl-size to indicate pixel size converted from rem */
--fs-18: 1.125rem;
--fs-24: 1.5rem;
--fs-32: 2rem;
--fs-40: 2.5rem;
--fs-72: 4.5rem;
--fs-88: 5.5rem;
--fs-48: 3rem;
--container: 69.375rem;
--transition: 250ms ease-in-out;
}
/* html */
/* Padding doesn't add to the width or height of elements */
/* font-size is set to 100% so that fonts reference browser's font-styles */
html {
box-sizing: border-box;
font-size: 100%;
}
/* * */
/* box-sizing is inhereted from the html element */
*,
*::before,
**::after {
box-sizing: inherit;
}
/* body */
/* 0 out all margin all body to clear default margins */
body {
margin: 0;
}
a {
/* automatically adds an ease-in-out animation on color property whenever
* there's a hover event change */
transition: color var(--transition);
}
a:hover {
color: var(--accent);
}
/* taken from https://www.accessibility-developer-guide.com/examples/hiding-elements/visually/
* see notes in coder_coder.html by the nav element */
.visually-hidden {
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
}
.wrapper {
/* width is always contained by 16px */
width: calc(100% - 2rem);
max-width: var(--container);
/* centers margin on a left-right orientation */
margin-inline: auto;
}
/* she calculates the rough difference between tablet and mobile */
/* note that she uses ems instead of pixels for accessibility reasons
* simply stating that the break points happen at times when you don't want them
* to when using pixels*/
@media (min-width: 37.5em) {
/* 600px */
.wrapper {
width: calc(100% -3.75rem);
}
}
/* HEADER */
.header {
margin-top: 20px;
}
.header__nav {
display: flex;
flex-wrap: wrap;
justify-content: center;
text-align: center;
/* gap: row-gap column-gap */
/* note the use of px here, this is intentionally keeping the gap inbetween
* the header__nav children at these fixed px amounts*/
gap: 20px 25px;
}
/* uses fluid-typography-calculator: https://royalfig.github.io/fluid-typography-calculator/ */
/* she uses it to calculate a clamp function using dimensions retrieved from figma layout
* min-font-size: 24px max-font-size: 32px min-viewport: 375px max-viewport: 768px */
.header__home {
font-size: 1.5rem;
font-size: clamp(1.5rem, 1.02rem + 2.04vw, 2rem);
line-height: 1;
color: var(--text1);
text-decoration: none;
/* tells flex box to place items on its own row as it takes up 100% width ,
* this is utilized with the parent elem(header__nav) flex-wrap*/
/* flex: flex-grow flex-shrink flex-basis*/
flex: 1 0 100%;
}
/* .header__social, */
.header__social svg { /* she got stuck here for a while... */
/* display: inline-block; */
display: block;
/* outline: 2px solid red; */
}
.header__social > svg > path {
/* automatically adds an ease-in-out animation on fill property whenver there's
* a hover event change */
transition: fill var(--transition);
}
.header__social:hover > svg > path {
fill: var(--accent);
}
@media (min-width: 37.5em) {
/* 600px */
.header__nav {
justify-content: flex-start;
align-items: center; /* vertically centered */
text-align: left;
gap: 32px;
}
.header__home {
/* flex: 1 0 0%; */
flex: 1;
margin-inline-end: auto;
}
}

79
coder_coder.html Normal file
View file

@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="./coder_coder.css" rel="stylesheet">
</head>
<!-- This html is soley meant to be used as an accompying template to
coder_coder.css to demonstrate some basic best practices when using css. -->
<body>
<header class="header">
<div class="wrapper">
<nav class="header__nav">
<!-- from https://www.accessibility-developer-guide.com
the span class="visually-hidden" is for screen readers and
good practice on headers/
-->
<a href="/" class="header__home">
adamkeys
<span class="visually-hidden">(to home page)</span>
</a>
<!-- note the use of specific width and height aspect ratios-->
<!-- she notes that this is so that the browser can accommodate
space appropriately on the page-->
<!-- so that she can change colors on hover, she uses inline
svg tags instead of img tags-->
<!-- svg accessibility practices (note the inline title tag):
<svg
xmlns="http://www.w3.org/2000/svg"
width="25"
height="24"
aria-lablel="socialGithub"
role="img"
<title id="socialGithub">Github</title>
>
</svg>
-->
<a class="header__social" href="">
<img
src="/assets/images/icon-github.svg"
alt="Github"
width="24.61"
height="24">
</a>
<a class="header__social" href="">
<img
src="/assets/images/icon-frontend-mentor.svg"
alt="Frontend Mentor"
width="24.6"
height="22">
</a>
<a class="header__social" href="">
<img
src="/assets/images/icon-linkedin.svg"
alt="LinkedIn"
width="24"
height="24">
</a>
<a class="header__social" href="">
<img
src="/assets/images/icon-twitter.svg"
alt="Twitter"
width="23.28"
height="18.93">
</nav>
</div>
</header>
<main id="main">
<div class="wrapper">
<h1>Nice to meet you! I'm Adam Keyes.</h1>
</div>
</main>
<footer class="footer">
</footer>
</body>
</html>