UNPKG

react-sn-question

Version:

A react component to easily create a toggleable question.

194 lines (172 loc) 5.22 kB
@import url(https://fonts.googleapis.com/css?family=Muli); /* Switch -> The container *------------------------* | | | | *------------------------* */ /* Item -> Every Item inside the container *------*-----------------* | Item | | | | | *------*-----------------* */ /* Overlay -> The layer that covers every item when item is active. *------*-----------------* | On | | | | | *------*-----------------* */ .abg-switch__overlay { position: absolute; height: 100%; border-radius: 100px; background-color: rgba(249, 249, 249, 0.5); box-shadow: 0 0 6px 1px #e66549; border: 1px solid transparent; box-sizing: border-box; transition: all 0.4s ease; outline: none; } /* Switch -> The container *------------------------* | | | | *------------------------* */ /* Item -> Every Item inside the container *------*-----------------* | Item | | | | | *------*-----------------* */ /* Overlay -> The layer that covers every item when item is active. *------*-----------------* | On | | | | | *------*-----------------* */ .abg-switch__item { display: flex; justify-content: center; align-items: center; letter-spacing: inherit; cursor: pointer; width: 100%; height: 100%; padding: 15px; font-weight: bold; background: transparent; overflow: visible; color: inherit; font: inherit; border: none; outline: none; } .abg-switch__item:not(.switch__item--disable):hover { color: #e6e6e6; } .abg-switch__item input { display: none; } .abg-switch__item.abg-switch__item--on { z-index: 2; color: #901e06; font-weight: bold; outline: none; } .abg-switch__item.abg-switch__item--on:hover { color: #901e06; } .abg-switch__item.abg-switch__item--disable { opacity: 0.3; } .abg-switch__item.abg-switch__item--disable:hover { color: inherit; } /* Switch -> The container *------------------------* | | | | *------------------------* */ /* Item -> Every Item inside the container *------*-----------------* | Item | | | | | *------*-----------------* */ /* Overlay -> The layer that covers every item when item is active. *------*-----------------* | On | | | | | *------*-----------------* */ .abg-switch { width: 100%; min-height: 45px; box-sizing: border-box; margin: 10px; outline: none; } .abg-switch__container { position: relative; display: flex; align-items: center; width: 100%; height: 100%; min-height: 45px; border: 1px solid white; border-radius: 100px; z-index: 1; outline: none; } .abg-switch--disable { opacity: 0.3; } .snquestion { display: flex; flex-direction: column; justify-content: center; max-width: 710px; min-height: 365px; box-sizing: border-box; padding: 30px; align-items: center; border-radius: 8px; transition: background-image 0.4s; font-family: Muli; font-size: 14px; letter-spacing: 0.4px; line-height: 18px; color: white; } .snquestion .abg-switch__state { text-align: center; } .snquestion .snquestion__title { font-size: 17px; } .snquestion .snquestion__result { font-weight: 700; } .snquestion.snquestion--success { background-image: linear-gradient(#47e4c1, #07cddd); box-shadow: 0 2px 12px 6px #a0f1df; } .snquestion.snquestion--success .abg-switch__state--on { color: #059fac !important; } .snquestion.snquestion--success .abg-switch__overlay { box-shadow: 0 0 6px 1px #07cddd; } .snquestion.snquestion--almost { background-image: linear-gradient(#fade61, #f7a01c); box-shadow: 0 2px 12px 6px #fdf3c4; } .snquestion.snquestion--almost .abg-switch__state--on { color: #d88508 !important; } .snquestion.snquestion--almost .abg-switch__overlay { box-shadow: 0 0 6px 1px #f7a01c; } .snquestion.snquestion--medium { background-image: linear-gradient(#fab761, #f76d1c); box-shadow: 0 2px 12px 6px #fde4c4; } .snquestion.snquestion--medium .abg-switch__state--on { color: #d85508 !important; } .snquestion.snquestion--medium .abg-switch__overlay { box-shadow: 0 0 6px 1px #f76d1c; } .snquestion.snquestion--hot { background-image: linear-gradient(#f9a54f, #f9631b); box-shadow: 0 2px 12px 6px #fcd7b2; } .snquestion.snquestion--hot .abg-switch__state--on { color: #db4b06 !important; } .snquestion.snquestion--hot .abg-switch__overlay { box-shadow: 0 0 6px 1px #f9631b; } .snquestion.snquestion--failure { background-image: linear-gradient(#fa9161, #f73b1c); box-shadow: 0 2px 12px 6px #fdd6c4; } .snquestion.snquestion--failure .abg-switch__state--on { color: #d82508 !important; } .snquestion.snquestion--failure .abg-switch__overlay { box-shadow: 0 0 6px 1px #f73b1c; }