tattica
Version:
Tactical and adaptive asset loading library
292 lines (248 loc) • 5.45 kB
CSS
:root {
--background: #FAF8F5;
--box-background: #B197CE;
--box-num: #F8F0FF;
--priority-background: rgb(255, 203, 203);
--priority-color: rgb(252, 23, 23);
--block-background: rgb(212, 238, 255);
--block-color: rgb(0, 46, 250);
--text-color: rgb(94, 94, 94);
--heading-color: #000;
--shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14),
0 1px 5px 0 rgba(0, 0, 0, 0.12);
--pulse-color: #FBBEA9;
}
body {
background: var(--background);
font-family: monospace;
}
h1 {
color: var(--heading-color);
}
p, li {
color: var(--text-color);
font-size: 16px;
line-height: 1.5;
}
code {
background: rgba(0,0,0,.05);
border-radius: 2px;
padding: 3px 5px;
color: var(--priority-color);
}
.container {
max-width: 700px;
margin: 50px auto 100px auto;
}
.main-title {
text-align: center;
}
.main-title h1 {
font-size: 48px;
margin-bottom: 10px;
}
.title {
margin-bottom: 20px;
}
.article {
margin-top: 60px;
}
.gallery {
display: flex;
flex-wrap: wrap;
direction: row;
}
.box {
display: block;
position: relative;
width: 200px;
height: 200px;
margin: 10px;
background: var(--box-background);
border-radius: 7px;
box-shadow: var(--shadow);
}
.box img {
border-radius: 7px;
object-fit: fill;
}
.box .num,
.box .priority,
.box .block {
position: absolute;
margin: 10px;
padding: 0 5px;
border-radius: 5px;
background: var(--box-num);
}
.box .priority,
.box .block {
bottom: 0;
font-size: 16px;
color: #f9f9f9;
}
.box .num {
font-size: 21px;
color: var(--heading-color);
}
.box .priority {
background: var(--priority-background);
color: var(--priority-color);
}
.box .block {
background: var(--block-background);
color: var(--block-color);
}
.carousel {
width: 100px ;
height: 100px ;
margin: 10px 15px;
}
.carousel img {
max-width: 100%;
max-height: 200%;
}
.pulse {
box-shadow: 0 0 0 0 var(--pulse-color);
-webkit-animation: pulse 2.2s cubic-bezier(0.66, 0, 0, 1);
-moz-animation: pulse 2.2s cubic-bezier(0.66, 0, 0, 1);
-ms-animation: pulse 2.2s cubic-bezier(0.66, 0, 0, 1);
animation: pulse 2.2s cubic-bezier(0.66, 0, 0, 1);
}
@-webkit-keyframes pulse {
to {
box-shadow: 0 0 0 15px rgba(232, 76, 61, 0);
}
}
@-moz-keyframes pulse {
to {
box-shadow: 0 0 0 15px rgba(232, 76, 61, 0);
}
}
@-ms-keyframes pulse {
to {
box-shadow: 0 0 0 15px rgba(232, 76, 61, 0);
}
}
@keyframes pulse {
to {
box-shadow: 0 0 0 15px rgba(232, 76, 61, 0);
}
}
/* button credits to @finnhvman */
.button {
position: relative;
display: inline-block;
box-sizing: border-box;
border: none;
border-radius: 4px;
padding: 0 16px;
min-width: 64px;
height: 36px;
vertical-align: middle;
text-align: center;
text-overflow: ellipsis;
text-transform: uppercase;
color: rgb(var(--pure-material-onprimary-rgb, 255, 255, 255));
background-color: rgb(var(--pure-material-primary-rgb, 33, 150, 243));
box-shadow: var(--shadow);
font-family: monospace;
font-size: 14px;
font-weight: 500;
line-height: 36px;
overflow: hidden;
outline: none;
cursor: pointer;
transition: box-shadow 0.2s;
}
.button::-moz-focus-inner {
border: none;
}
/* Overlay */
.button::before {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: rgb(var(--pure-material-onprimary-rgb, 255, 255, 255));
opacity: 0;
transition: opacity 0.2s;
}
/* Ripple */
.button::after {
content: "";
position: absolute;
left: 50%;
top: 50%;
border-radius: 50%;
padding: 50%;
width: 32px;
/* Safari */
height: 32px;
/* Safari */
background-color: rgb(var(--pure-material-onprimary-rgb, 255, 255, 255));
opacity: 0;
transform: translate(-50%, -50%) scale(1);
transition: opacity 1s, transform 0.5s;
}
/* Hover, Focus */
.button:hover,
.button:focus {
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14),
0 1px 10px 0 rgba(0, 0, 0, 0.12);
}
.button:hover::before {
opacity: 0.08;
}
.button:focus::before {
opacity: 0.24;
}
.button:hover:focus::before {
opacity: 0.3;
}
/* Active */
.button:active {
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
}
.button:active::after {
opacity: 0.32;
transform: translate(-50%, -50%) scale(0);
transition: transform 0s;
}
/* Disabled */
.button:disabled {
color: rgba(var(--pure-material-onsurface-rgb, 0, 0, 0), 0.38);
background-color: rgba(var(--pure-material-onsurface-rgb, 0, 0, 0), 0.12);
box-shadow: none;
cursor: initial;
}
.button:disabled::before {
opacity: 0;
}
.button:disabled::after {
opacity: 0;
}
@media screen and (max-width: 700px) {
.box {
margin: 3px;
}
.box,
.box img {
width: 100px;
height: 100px;
}
.carouselGallery .carousel,
.carouselGallery .box img {
width: 60px ;
height: 100px;
}
.box .block,
.box .priority {
margin: 2px;
padding: 3px;
font-size: 10.5px;
}
}