본문 바로가기

웹/Front-end

[HTML/CSS] 포트폴리오 페이지 - CSS 소스코드

style.css 파일의 소스코드이다.

공부하며 주석으로 기록했던 부분들은

여기에 남겨두고 프로젝트 파일에서는 정리하는 작업 중..

 




/* Global */

:root {
    /* Color */
    --color-white: #ffffff;
    --color-light-white: #eeeeee;
    --color-dark-white: #bdbdbd;
    --color-pink: #fe918d;
    --color-dark-pink: #ff6863;
    --color-dark-grey: #4d4d4d;
    --color-grey: #616161;
    --color-light-grey: #7c7979;
    --color-blue: #73aace;
    --color-blue-blue: #3091FF;
    --color-dark-blue: #2a7ba3;
    --color-green-blue: #15b2d3;
    --color-yellow: #fff7d1;
    --color-orange: #feb546;
    --color-red-orange: #EB532E;
    --color-black: #000000;
    --color-dark: #343a40;
    --color-purple-pink: #ca42ef;
    --color-navy: #0c0f38;
  
    /* Font size */
    --font-large: 48px;
    --font-toggle: 42px;
    --font-logo: 32px;
    --font-medium: 28px;
    --font-regular: 18px;
    --font-small: 16px;
    --font-micro: 14px;
  
    /* Font weight */
    --weight-bold: 700;
    --weight-semi-bold: 600;
    --weight-regular: 400;
    
    /* Size */
    --size-border-radius: 4px;
    /* Animation */
    --animation-duration: 300ms;
}

/* Universal tags */
*{
box-sizing: border-box;
}

/* border-box: box-sizing 속성을 border-box로 지정하면  테두리를 포함한 크기를 지정할 수 있기 때문에 예측 용이.
즉, 패딩을 줬을 때 높이와 너비가 그 패딩을 포함했을 때도 동일한 높이와 너비가 되도록 함.  */


body{
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    cursor: default;
    background-color: #e6e6e6;
}
a{
    text-decoration: none;
    color: var(--color-white);
}
ul{
    list-style: none;
    padding-left: 0;
}
li{
    list-style: none;
}
button{
    background-color: transparent;
    cursor: pointer;
    border: none;
    outline: none;
    padding: 0;
}

/* Typography */
h1 {
    font-size: var(--font-large);
    font-weight: var(--weight-bold);
    color: var(--color-black);
    margin: 16px 0px;
}
h2 {
    font-size: var(--font-medium);
    font-weight: var(--weight-semi-bold);
    color: var(--color-black);
    margin: 8px 0;
}
h3 {
    font-size: var(--font-regular);
    font-weight: var(--weight-regular);
    color: var(--color-black);
    margin: 8px 0;
}
p {
    font-size: var(--font-regular);
    font-weight: var(--weight-regular);
    color: var(--color-black);
    margin: 4px 0;
}

/* Navbar */
#navbar{
    position: fixed;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: transparent;
    color: var(--color-white);
    transition: all var(--animation-duration) ease-in-out;
}
#navbar.navbar__dark{
    background-color: var(--color-black);
    opacity: 0.9;
    padding: 8px;
    z-index: 1;
}
.navbar__logo{
    padding-left: 8px;
    font-size: var(--font-logo);
    font-weight: var(--weight-semi-bold);
    display: none;
}
.navbar__menu{
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    margin: auto;
}
.navbar__menu__item{
    padding: 8px 12px;
    margin: 0 4px;
    cursor: pointer;
    border-radius: var(--size-border-radius);
    font-weight: bolder;
}
.navbar__menu__item:hover{
    color: var(--color-red-orange);
}
.navbar__toggle-btn{
    position: absolute;
    top: 16px;
    right: 32px;
    font-size: var(--font-toggle);
    color: var(--color-white);
    display: none;
}

/* Home */
#home{
    display: flex;
    flex-direction: column;
    background: url('assets/imgs/home-bg.jpg') center/cover no-repeat;
    padding: 40px;
    padding-top: 120px;
    text-align: center;
    min-height: 500px;
    height: 100vh;
    overflow:auto;
}
.home__container{
    height: 100%;
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
}
.home__title,
.home__description {
    color: var(--color-white);
}
.home__contact{
    color: var(--color-white);
    font-size: var(--font-regular);
    font-weight: var(--weight-bold);
    margin: 24px;
    margin-top: 40px;
    padding: 8px 12px;
    border: 2px solid white;
    border-radius: var(--size-border-radius);
}
.home__contact:hover{
    background-color: var(--color-white);
    color: var(--color-black);
    transition: all var(--animation-duration) ease-in;
}
/* Section common */
.section{
    margin: auto;
    padding: 50px;
    text-align: center;
}
.section__container{
    max-width: 1200px;
    margin: auto;
}

/* About */
.about__wrapper{
    margin: 40px;
}
.about__intro{
    display: flex;
    margin: 32px;
}
.my__avatar{
    width: 150px;
    height: 130px;
    border-radius: 50%;
    margin-right: 40px;
    border: 2px solid #f2f2f2;
}
.about__text{
    border-left:  1px solid var(--color-dark-white);
    margin-left: 40px;
    padding-left: 50px;
    text-align: left;
}
.about__majors{
    display: flex;
    justify-content: space-between;
    margin: 80px 0;
}
.major__icon{
    width: 170px;
    height: 170px;
    line-height: 170px;
    font-size: 70px;
    margin: auto;
    background-color: var(--color-white);
    margin-bottom: 16px;
    border: 1px solid #e6e6e6;
    box-shadow: 0px 0px 20px 10px #dbdbdb;
}
.major__icon.first{
    color: var(--color-red-orange);
    border-bottom: 2px solid var(--color-red-orange);
}
.major__icon.second{
    color: #f9bf3f;
    border-bottom: 2px solid #f9bf3f;
}
.major__icon.third{
    color: var(--color-green-blue);
    border-bottom: 2px solid var(--color-green-blue);
}
.major__title, .major__description{
    color: var(--color-black);
}
.major__icon i{
    transition: all var(--animation-duration) ease;
}
.major__icon:hover i {
    transform: rotate(-10deg) scale(1.1);
}
.major__icon:hover{
    opacity: 0.7;
    background-color: var(--color-black);
}
.major__description{
    font-size: var(--font-small);
}
.job,
.school{
    display: flex;
    align-items: center;
}
.job__logo,
.school__logo{
    width: 50px;
    height: 50px;
    border-radius: 5%;
}
.job__description,
.school__description{
    margin: 0 16px;
    text-align: left;
}
.job__name,
.job__period,
.school__name,
.school__period{
    color: var(--color-light-grey);
}

/* Skill */
#skills{
    background: url('assets/imgs/skills.jpg') center/cover no-repeat;
    background-attachment: fixed;
    align-items: center;
    justify-content: center;
}
#skills p, 
#skills h2,
#skills h1{
    color: var(--color-white);
}
.skillset{
    display: flex;
    background-color: var(--color-light-grey);
    color: var(--color-light-white);
    margin: 20px 0;
}
.skillset__title{
    color: var(--color-white);
    font-weight: var(--weight-bold);
}
.skillset__left{
    flex-basis: 60%;
    background-color: var(--color-dark-grey);
    padding: 20px 40px;
}
.skill{
    margin-bottom: 32px;
}
.skill_description{
    display: flex;
    justify-content: space-between;
}
.skill__bar{
    width: 100%;
    height: 5px;
    background-color: var(--color-grey);
    margin-bottom: 15px;
}
.skill__value{
    width: 70%;
    height: 5px;
    background-color: var(--color-green-blue);
}
.skillset__right{
    flex-basis: 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.tools{
    background-color: var(--color-grey);
}
.tools,
.etc{
    padding: 20px;
    width: 100%;
    height: 100%;
}

/* Work */
#work{
    background-color: var(--color-white);
}
.work__categories{
    margin: 40px;
}
.category__btn{
    border: 1px solid var(--color-dark-white);
    border-radius: var(--size-border-radius);
    font-size: var(--font-regular);
    padding: 8px 48px;
    position: relative;
}
.category__btn.selected,
.category__btn:hover{
    background-color: var(--color-grey);
    color: var(--color-white);
}
.category__btn.selected .category__count,
.category__btn:hover .category__count{
    opacity: 1;
    top: 0;
    background-color: var(--color-green-blue);
}
.category__btn.all.selected .category__count,
.category__btn.all:hover .category__count{
    font-weight: bolder;
    background-color: var(--color-red-orange);
}
.category__count{
    background-color: var(--color-light-white);
    border-radius: 30%;
    color: var(--color-white);
    width: 24px;
    height: 24px;
    line-height: 24px;
    display: inline-block;
    position: absolute;
    margin-top: 5px;
    right: 16px;
    opacity: 0;
    font-size: var(--font-micro);
}
.work__projects{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    opacity: 1;
    transition: all var(--animation-duration) ease-out;
}
.work__projects.anim-out {
    opacity: 0.6;
    transform: scale(0.96) translateY(40px);
}
.project{
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 280px;
    height: 250px;
    margin: 2px;
    background-color: var(--color-light-white);
}
.project.invisible{
    display: none;
}
.project__img{
    max-width: 100%;
    max-height: 100%;
    align-self: center;
}
.project__description{
    position: absolute;
    background-color: var(--color-black);
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--animation-duration) ease-in;
}
.project:hover .project__description{
    opacity: 0.8;
    transform: translateY(0px);
}
.project__description h3{
    color: var(--color-orange);
}
.project__description h3::after{
    content: '';
    display: block;
    position: relative;
    left: 50%;
    width: 50px;
    height: 2px;
    transform: translateX(-50%);
    margin-top: 8px;
    background-color: var(--color-dark-white);
}

/* Contact */
#contact{
    background-color: var(--color-dark);
}
.contact__title,
.contact__email,
.contact__rights{
    color: var(--color-white);
}
.contact__title{
    margin: 32px 0;
}
.contact__links{
    display: flex;
    justify-content: center;
    font-size: var(--font-large);
    margin: 24px 0;
}
.contact__icons{
    margin: 0 18px;
}
.contact__links i:hover{
    transform: scale(1.2);
}
.arrow-up{
    position: fixed;
    bottom: 50px;
    right: 50px;
    width: 60px;
    height: 60px;
    font-size: 50px;
    color: var(--color-white);
    background-color: var(--color-red-orange);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transition: all 300ms ease-in;
}
.arrow-up.visible{
    opacity: 1;
    pointer-events: auto;
}


/* For below 768px screen width */
@media screen and (max-width: 768px){
    :root{
        --font-large: 30px;
        --font-toggle: 28px;
        --font-logo: 24px;
        --font-medium: 18px;
        --font-regular: 16px;
        --font-small: 14px;
        --font-micro: 12px;
    }
    .navbar__logo{
        display: block;
        padding-left: 3px;
    }
    
    .navbar__toggle-btn{
        display: block;
        top: 16px;
        right: 16px;
        padding-top: 4px;
    }
    #navbar{
        flex-direction: column;
        align-items: flex-start;
        background-color: var(--color-black); 
    }
    #navbar.navbar__dark{
        padding: 18px;
    }
    .navbar__menu{
        flex-direction: column;
        text-align: center;
        width: 100%;
        display: none;
    }
    .navbar__menu.open{
        margin: 16px 0 16px 0;
        display: block;
        z-index: 1;
    }
    .section{
        padding: 16px;
        padding-top: 40px;
    }
    .about__wrapper{
        flex-direction: column;
        margin: 8px;
    }
    .about__intro{
        flex-direction: column;
        align-items: center;
        margin: 0;
    }
    .my__avatar{
        width: 150px;
        height: 150px;
        margin: 8px;
    }
    .about__text{
        border-left: none;
        margin: 16px 0 16px 0;
        padding-left: 0px;
        text-align: center;
        order: 1;
    }
    .about__majors{
        flex-direction: column;
        margin-top: 30px;
        margin-bottom: 0px;
    }
    .major{
        margin-bottom: 30px;
    }
    .skillset{
        flex-direction: column;
    }
    .category__btn{
        margin: 4px 0;
        width: 100%;
    }
    .category__count{
        margin-top: 5px;
    }
    .project{
        flex-grow: 1;
    }
    .arrow-up{
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        line-height: normal;
        font-size: 30px;
    }
}