본문 바로가기
개발/UI

알림 디자인-1 (notification Design-1 with CSS)

by kxxxgs 2023. 5. 2.
728x90

알림 디자인 1

 

알림 창을 띄워 다른화면으로 이동시키는 용도로 활용할 수 있다.

 

 

 

 

✔️ HTML

<div class="notification">
    <span class="material-icons-outlined icon">info</span>
    <div class="messages">
        <div class="title">Info</div>
        <div class="sub">Add your info message here.</div>
    </div>
    <a class="button" href="javascript:;">Next</a>
</div>

 

✔️ CSS

.notification {
    display: inline-flex;
    padding: 10px 20px;
    background: #fff;
    border-radius: 10px;
    justify-content: space-between;
    color: #212121;
    gap: 15px;
    box-shadow: 0px 10px 20px 13px rgba(0,0,0,0.1);
    animation: scale .5s linear alternate-reverse infinite;
    text-align: left;
}
@keyframes scale {
    from {
        transform: scale(0.98);
    }

    to {
        transform: scale(1);
    }
}
.notification .icon {
    font-size: 40px;
    line-height: 65px;
    color: #303f9f;
}
.notification .messages {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
}
.notification .messages .title {
    font-size: 16px;
    font-family: 'NotoSansKR-Medium';
    text-transform: uppercase;
    color: #494949;
}
.notification .messages .sub {
    font-size: 13px;
}
.notification .button {
    line-height: 65px;
    padding: 0px 15px;
    font-size: 15px;
    text-align: center;
    background-color: #303f9f;
    color: #ffffff;
    text-transform: uppercase;
    border-radius: 10px;
    text-decoration: none;
}
.notification .button:hover {
    background-color: #1a237e;
    font-family: 'NotoSansKR-Medium';
}
@media all and (max-width: 350px) {
    .notification .messages .sub {
        display: none;
    }
}

 

✔️ GitHub

https://github.com/rudtn082/UI/tree/main/notification1

반응형

댓글