Modèle:Library homepage/style.css

De ProleWiki
/* STYLING LIBRARY CARD CONTAINER */
.library-container{
	width:100%;
	display:flex;
	flex-flow:row wrap;
	justify-content:center;
	align-items:flex-start;
}

/* styling big library cards */
.library-card{
	width:200px;
	margin:20px 0 0 20px;
	padding:0;
	border:1px gray solid;
    border-radius:10px 10px 4px 4px;
    overflow:hidden;
    z-index:10;
    box-shadow: 3px 1px 8px 1px gray;
	transition: box-shadow 0.4s, transform 0.4s;
}

.library-card:hover{
	box-shadow: 5px 4px 11px 3px #666;
	transform:scale(1.02);
}

.library-card-TOC{
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

.library-card-image {
	height:300px;
	padding:0;
	margin:0;
	z-index:-1;
}

.library-card-image img{
	width:auto;
	height:100%;
	transform: scale(1.1);
	overflow:hidden;
	padding:0;
	margin:0;
	transition: transform 0.4s, filter 0.4s;
	z-index:-1;
	filter:grayscale(1);
}

.library-card-image img:hover{
	transform:scale(1.2);
	filter:grayscale(0.3);
}

.library-card-content{
	padding:15px 2px;
	margin:0;
	text-align:center;
	display:block;
	z-index:10;
	overflow:hidden;
	position:relative;
	border-top:1px solid gray;
}

.library-card-title{
	font-size:1.2rem;
	font-weight:normal;
}

.library-card-works{
	font-size:0.8rem;
}

.library-card-works,.library-card-title , .library-card p{
	display:inline;
}

.library-card-content p{
	line-height:0.1rem;
}



/* STYLING MINI LIBRARY CARD CONTAINER */

/*	it's weird but for some reason this grid specifically
	only wants to use 1 column out of 2, so I just added
	empty columns in between the actual ones and reduced
	the gap by half (10px instead of 20px) because these
	empty columns still apply their gap. ¯\_(ツ)_/¯
*/
.library-container-mini{
	display:grid;
	grid-template-columns: repeat(4, 1fr 0fr); 
	grid-gap: 0 10px;
	width:100%;
}

/* styling mini library cards */
.library-card-mini-content{
	display: inline-grid;
	grid-template-columns: 45px 155px;
	grid-template-rows: 1fr;
	height:75px;
	overflow:hidden; /* you get three lines of text, no more */
	align-items:center;
}

.library-card-mini img{
	height:35px;
	width:35px;
	object-fit:cover;
	overflow:hidden;
	border-radius:5px;
	padding:0;
	margin:0;
	transition: filter 0.4s;
	z-index:-1;
	filter:grayscale(1);
	transform:scale(1); /* cancels any scale-in effect that may apply*/
}

.library-card-mini img:hover{
	filter:grayscale(0.3);
}

.library-card-mini-text{
	grid-column-start:2;
	grid-column-end:3;
}

.library-card-mini-title{
	height:0;
	width:0;
	position:relative;
}

.library-card-mini-TOC{
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}


/* MOBILE STYLING */
@media only screen and (max-width: 768px) {
	.library-container-mini{ /* resize grid on mobile so there's only one column */
		display: grid;
		grid-template-columns: 1fr;
		grid-gap: 10px 0;
	}
	
	.library-container-mini > p{ /* the every other row bug happens here too, but they're just empty <p> tags. Fixed with this. */
		display:none; 
	}
	
	.library-card-mini > p{ /* reduce space between mini cards on mobile so we can fit more in the viewport */
		margin:0;
	}
	
	.library-card-mini-content{ /* legit don't remember if this is required or what it does */
		height:25px;	
	}
}