my-portfolio/src/css/main.css

378 lines
7.8 KiB
CSS
Raw Normal View History

/******** Imports ********/
@import "/node_modules/normalize.css/normalize.css";
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,400;0,700;1,400;1,700&family=Share+Tech+Mono&family=Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900&display=swap');
/****** Root Style ******/
2021-07-31 11:49:38 +01:00
:root {
/* colours */
--primaryDefault: hsla(79, 62%, 51%, 1);
--primaryHover: hsla(79, 75%, 41%, 1);
--errorDefault: hsla(0, 62%, 51%, 1);
--grey: hsla(0, 0%, 39%, 1);
2021-07-09 17:14:02 +01:00
--mutedGrey: hsla(0, 0%, 67%, 0.58);
2021-07-31 11:49:38 +01:00
--mutedBlack: hsla(0, 0%, 0%, 0.25);
--navBack: hsl(0, 0%, 30%);
/* font sizes */
--titleFS: 2.25rem;
--generalFS: 1.125rem;
--headingFS: 1.5rem;
}
/*** Template Styles ****/
2021-07-09 17:14:02 +01:00
html {
scroll-behavior: smooth;
}
2021-07-31 16:39:53 +01:00
body {
font-family: Noto Sans KR, sans-serif;
font-style: normal;
font-weight: 500;
font-size: 1.125rem;
line-height: 1.625rem;
}
2021-07-31 11:49:38 +01:00
a:visited {
2021-07-09 17:14:02 +01:00
color: inherit;
}
2021-07-31 11:49:38 +01:00
h1, nav {
font-family: Share Tech Mono, monospace;
font-style: normal;
font-weight: normal;
font-size: 2.25rem;
line-height: 2.5625rem;
text-transform: lowercase;
}
2021-07-31 11:49:38 +01:00
h2 {
font-family: Noto Sans KR, sans-serif;
font-style: normal;
font-weight: 500;
font-size: 1.5rem;
line-height: 2.1875rem;
}
2021-07-31 11:49:38 +01:00
a.btn, form input[type="submit"] {
2021-07-09 17:14:02 +01:00
text-decoration: none;
display: inline-block;
padding: 1rem 2rem;
border-radius: 0.625em;
border: 0.3215em solid var(--primaryDefault);
color: #FFFFFF;
}
2021-07-31 11:49:38 +01:00
a.btn:hover {
border: 0.3215em solid var(--primaryHover);
2021-07-09 17:14:02 +01:00
}
2021-07-31 11:49:38 +01:00
a.btnPrimary, form input[type="submit"] {
2021-07-09 17:14:02 +01:00
background: var(--primaryDefault);
2021-07-17 19:08:13 +01:00
cursor: pointer;
2021-07-09 17:14:02 +01:00
}
2021-07-31 11:49:38 +01:00
a.btnOutline {
2021-07-09 17:14:02 +01:00
background: #FFFFFF;
color: var(--primaryDefault);
}
2021-07-31 11:49:38 +01:00
a.btnPrimary:hover, form input[type="submit"]:hover {
2021-07-09 17:14:02 +01:00
background: var(--primaryHover);
}
2021-07-31 11:49:38 +01:00
a.btn:active, form input[type="submit"]:active {
padding: 0.8rem 1.8rem;
2021-07-09 17:14:02 +01:00
}
2021-07-31 11:49:38 +01:00
.boxShadowOut:hover {
box-shadow: 0 6px 4px 0 var(--mutedBlack);
2021-07-09 17:14:02 +01:00
}
2021-07-31 11:49:38 +01:00
.boxShadowIn:active {
box-shadow: inset 0 6px 4px 0 var(--mutedBlack);
2021-07-09 17:14:02 +01:00
}
2021-07-31 11:49:38 +01:00
.textShadow:hover {
text-shadow: 0 6px 4px var(--mutedBlack);
}
2021-07-31 16:39:53 +01:00
/*** Navigation Styles **/
2021-07-09 17:14:02 +01:00
2021-07-31 11:49:38 +01:00
header {
background: #6A6A6A url("../imgs/hero.jpg") no-repeat bottom;
2021-07-09 17:14:02 +01:00
background-size: cover;
height: 40%;
color: #FFFFFF;
backdrop-filter: grayscale(100%);
position: relative;
2021-07-09 17:14:02 +01:00
}
2021-07-31 11:49:38 +01:00
nav {
2021-07-09 17:14:02 +01:00
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0.25em;
position: fixed;
2021-07-31 11:49:38 +01:00
top: 0;
width: 100%;
transition: background-color 0.4s ease-in;
}
nav.scrolled {
background-color: var(--navBack);
2021-07-31 11:49:38 +01:00
}
nav #nav-check {
display: none;
}
nav .nav-btn {
display: none;
2021-07-09 17:14:02 +01:00
}
nav h1 {
margin: 0;
}
2021-07-31 11:49:38 +01:00
nav a {
2021-07-09 17:14:02 +01:00
text-decoration: none;
color: #FFFFFF;
2021-07-09 17:14:02 +01:00
}
nav ul {
display: flex;
flex-direction: row;
gap: 1em;
margin: 0;
2021-07-31 11:49:38 +01:00
justify-content: flex-end;
2021-07-09 17:14:02 +01:00
align-items: flex-end;
}
nav ul li {
list-style: none;
}
2021-07-31 11:49:38 +01:00
nav ul li span {
visibility: hidden;
2021-07-09 17:14:02 +01:00
}
nav ul li a:hover span, nav ul li .active span {
visibility: visible;
2021-07-09 17:14:02 +01:00
}
2021-07-31 11:49:38 +01:00
header div {
2021-07-09 17:14:02 +01:00
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding-top: 10em;
}
header div .btn {
margin: 2em 0;
}
2021-07-31 11:49:38 +01:00
header div button {
2021-07-09 17:14:02 +01:00
background: none;
border: none;
display: inline-block;
text-align: center;
text-decoration: none;
font-size: 2rem;
cursor: pointer;
}
2021-07-31 11:49:38 +01:00
i.fa-chevron-down {
2021-07-09 17:14:02 +01:00
color: var(--mutedGrey);
font-size: 3.75em;
margin: 1.5rem 0;
}
2021-07-31 16:32:18 +01:00
div h1 span {
visibility: visible;
animation: caret 1s steps(1) infinite;
}
@keyframes caret {
50% {
visibility: hidden;
}
}
2021-07-31 16:39:53 +01:00
/**** Media Queries *****/
@media screen and (max-width: 75em) {
2021-07-31 16:39:53 +01:00
/*** Navigation styles **/
2021-07-31 11:49:38 +01:00
nav {
display: block;
height: 50px;
width: 100%;
background-color: var(--navBack);
position: fixed;
top: 0;
2021-07-31 11:49:38 +01:00
padding: 0;
}
2021-07-31 11:49:38 +01:00
nav a h1{
margin-left: 1ch;
}
nav .nav-btn {
display: inline-block;
position: absolute;
right: 75px;
top: -360px;
2021-07-31 11:49:38 +01:00
}
nav ul {
position: fixed;
2021-07-31 11:49:38 +01:00
display: block;
width: 100%;
background-color: #333;
transition: all 0.4s ease-in;
overflow-y: hidden;
padding-left: 0;
margin-top: 7px;
}
nav ul li a {
display: block;
width: 100%;
transform: translateX(-30px);
transition: all 0.4s ease-in;
opacity: 0;
}
.nav-btn label {
display: inline-block;
cursor: pointer;
width: 60px;
height: 50px;
position: fixed;
2021-07-31 11:49:38 +01:00
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: .5s ease-in;
-moz-transition: .5s ease-in;
-o-transition: .5s ease-in;
transition: .5s ease-in;
}
.nav-btn label span {
display: block;
position: absolute;
height: 5px;
width: 100%;
background-color: #FFFFFF;
opacity: 1;
right: 0;
top: 20px;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: .25s ease-in;
-moz-transition: .25s ease-in;
-o-transition: .25s ease-in;
transition: .25s ease-in;
}
2021-07-31 16:39:53 +01:00
/** burger not clicked **/
2021-07-31 11:49:38 +01:00
nav #nav-check:not(:checked) ~ ul{
height: auto;
max-height: 0;
}
nav #nav-check:not(:checked) ~ .nav-btn label span:nth-child(1) {
top: 8px;
2021-07-31 11:49:38 +01:00
-webkit-transform-origin: left center;
-moz-transform-origin: left center;
-o-transform-origin: left center;
transform-origin: left center;
}
nav #nav-check:not(:checked) ~ .nav-btn label span:nth-child(2) {
top: 23px;
2021-07-31 11:49:38 +01:00
-webkit-transform-origin: left center;
-moz-transform-origin: left center;
-o-transform-origin: left center;
transform-origin: left center;
}
nav #nav-check:not(:checked) ~ .nav-btn label span:nth-child(3) {
top: 38px;
2021-07-31 11:49:38 +01:00
-webkit-transform-origin: left center;
-moz-transform-origin: left center;
-o-transform-origin: left center;
transform-origin: left center;
}
2021-07-31 16:39:53 +01:00
nav .nav-btn label:hover, nav #nav-check:checked ~ .nav-btn label {
2021-07-31 11:49:38 +01:00
background-color: rgba(-1, 0, 0, 0.3);
}
2021-07-31 16:39:53 +01:00
/**** burger clicked ****/
2021-07-31 11:49:38 +01:00
nav #nav-check:checked ~ ul{
max-height: 50vh;
overflow-y: hidden;
}
nav #nav-check:checked ~ ul li a {
opacity: 1;
transform: translateX(0px);
}
nav #nav-check:checked ~ ul li:nth-child(1) a {
transition-delay: 0.15s;
}
nav #nav-check:checked ~ ul li:nth-child(2) a {
transition-delay: 0.25s;
}
nav #nav-check:checked ~ ul li:nth-child(3) a {
transition-delay: 0.35s;
}
nav #nav-check:checked ~ ul li:nth-child(4) a {
transition-delay: 0.45s;
}
nav #nav-check:checked ~ ul li:nth-child(5) a {
transition-delay: 0.55s;
}
nav #nav-check:checked ~ .nav-btn label span:first-child {
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
nav #nav-check:checked ~ .nav-btn label span:nth-child(2){
width: 0;
opacity: 0;
}
nav #nav-check:checked ~ .nav-btn label span:last-child {
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
}
@media screen and (max-width: 31em) {
2021-07-31 16:39:53 +01:00
/** not to squish name **/
2021-07-31 11:49:38 +01:00
header div h1{
width: min-content;
}
}