Skip to content

Commit

Permalink
feat(project): update styling to meet designs
Browse files Browse the repository at this point in the history
  • Loading branch information
royschut committed May 26, 2021
1 parent 8fab1dd commit df01d5a
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 48 deletions.
91 changes: 57 additions & 34 deletions src/components/Card/Card.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,46 @@
&:hover {
z-index: 10;
transform: scale(1.05);
position: relative;

& .poster {
box-shadow: 0 0 0 3px var(--highlight-color, variables.$white), 0 8px 10px rgb(0 0 0 / 14%),
0 3px 14px rgb(0 0 0 / 12%), 0 4px 5px rgb(0 0 0 / 20%);
}
}
}

.featured {
&:hover {
transform: scale(1.02);
}
&.featured {
&:hover {
transform: scale(1.02);
}

.meta {
padding: 12px;
background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
.title {
font-size: 34px;
font-family: var(--body-font-family);
@include responsive.mobile-only {
font-size: 24px;
}
}
.tag {
font-size: 16px;
padding: 9px 16px;
@include responsive.mobile-only {
padding: 4px 8px;
}
}
.meta {
padding: 16px;
background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
}
}
}

.disabled {
&:hover {
transform: scale(1);
cursor: default;
& .poster {
box-shadow: none;
&.disabled {
&:hover {
transform: scale(1);
cursor: default;
& .poster {
box-shadow: none;
}
}
}
}
Expand All @@ -58,29 +73,32 @@ $aspects: ((1, 1), (2, 1), (2, 3), (4, 3), (5, 3), (16, 9), (9, 16));
}
}

.tag {
@include responsive.mobile-only {
font-size: 14px;
}
padding: 4px 8px;
color: var(--card-color);
font-family: var(--body-font-family);
font-size: 13px;
font-weight: 600;
background-color: rgba(variables.$black, 0.7);
border-radius: 4px;
.titleContainer {
width: 100%;
min-height: 19px;
margin-top: 8px;
margin-bottom: 0;
overflow: hidden;
}

.title {
@include responsive.mobile-only {
font-size: 14px;
}
flex: 1;
color: var(--card-color);
font-family: var(--body-alt-font-family);
font-weight: 700;
white-space: nowrap;
font-size: 16px;
text-align: left;
text-overflow: ellipsis;
overflow: hidden;
@supports (-webkit-line-clamp: 2) {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}

height: 2.3em;
}

.meta {
Expand All @@ -97,10 +115,15 @@ $aspects: ((1, 1), (2, 1), (2, 3), (4, 3), (5, 3), (16, 9), (9, 16));
}
}

.titleContainer {
width: 100%;
min-height: 19px;
margin-top: 8px;
margin-bottom: 0;
overflow: hidden;
.tag {
@include responsive.mobile-only {
font-size: 14px;
}
padding: 4px 8px;
color: var(--card-color);
font-family: var(--body-font-family);
font-size: 13px;
font-weight: 600;
background-color: rgba(variables.$black, 0.6);
border-radius: 4px;
}
8 changes: 7 additions & 1 deletion src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ function Card({
</div>
{!featured && (
<div className={styles.titleContainer}>
<div className={styles.title}>{title}</div>
<div className={styles.title}>
{title}
{title}
{title}
{title}
{title}
</div>
</div>
)}
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/components/Dropdown/Dropdown.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ $select-focus: theme.$primary-color;
min-width: 10ch;
max-width: 20ch;
margin-left: 24px;
padding: 0.2em 0.4em;
padding: 9px;
font-size: 1.25rem;
line-height: 1.1;
background-color: rgba(0, 0, 0, 0.7);
background-color: rgba(0, 0, 0, 0.54);
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 0.25em;
cursor: pointer;
Expand All @@ -25,8 +25,8 @@ $select-focus: theme.$primary-color;
// Custom arrow
&::after {
z-index: 1;
width: 0.4em;
height: 0.3em;
width: 10px;
height: 5px;
background-color: $select-arrow;
clip-path: polygon(100% 0%, 0 0%, 50% 100%);
content: '';
Expand All @@ -43,7 +43,7 @@ $select-focus: theme.$primary-color;
font-weight: 700;
font-size: 1rem;
line-height: inherit;
background-color: rgba(0, 0, 0, 1);
background: none;
border: none;
outline: none;
cursor: inherit;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Filter/Filter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, Fragment, FC } from 'react';
import MenuButton from '../../components/MenuButton/MenuButton';

import MenuButton from '../../components/MenuButton/MenuButton';
import Dropdown from '../Dropdown/Dropdown';
import FilterModal from '../FilterModal/FilterModal';
import Button from '../Button/Button';
Expand Down
1 change: 1 addition & 0 deletions src/components/Shelf/Shelf.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

.arrow {
cursor: pointer;
padding: 12px 0px;
transition: transform 0.2s ease-out, -webkit-transform 0.2s ease-out;
> svg {
width: 30px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Shelf/Shelf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const Shelf: React.FC<ShelfProps> = ({
cycleMode={'restart'}
showControls={!matchMedia('(hover: none)').matches}
transitionTime={loading ? '0s' : '0.3s'}
spacing={12}
spacing={8}
renderLeftControl={(handleClick) => (
<div
className={didSlideBefore ? styles.arrow : styles.arrowDisabled}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "../../styles/mixins/responsive";

.tileDock {
position: relative;
}
Expand Down Expand Up @@ -25,10 +27,17 @@
top: calc(50% + 20px);
transform: translateY(-100%);
z-index: 1;
@include responsive.tablet-only {
left: -32px;
}
}
.tileDock .rightControl {
position: absolute;
right: -40px;
top: calc(50% + 20px);
transform: translateY(-100%);

@include responsive.tablet-only {
right: -32px;
}
}
10 changes: 6 additions & 4 deletions src/components/TileDock/TileDock.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
import './TileDock.css';

// import './TileDock.css';
import styles from './TileDock.module.scss';

export type CycleMode = 'stop' | 'restart' | 'endless';
type Direction = 'left' | 'right';
Expand Down Expand Up @@ -176,9 +178,9 @@ const TileDock = <T extends unknown>({
const slideOffset = index - slideToIndex;

return (
<div className="tileDock">
<div className={styles.tileDock}>
{showLeftControl && !!renderLeftControl && (
<div className="leftControl">{renderLeftControl(() => slide('left'))}</div>
<div className={styles.leftControl}>{renderLeftControl(() => slide('left'))}</div>
)}
<ul
ref={frameRef}
Expand Down Expand Up @@ -212,7 +214,7 @@ const TileDock = <T extends unknown>({
})}
</ul>
{showRightControl && !!renderRightControl && (
<div className="rightControl">{renderRightControl(() => slide('right'))}</div>
<div className={styles.rightControl}>{renderRightControl(() => slide('right'))}</div>
)}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const Home = (): JSX.Element => {
const tilesToShow: number = item.featured ? featuredTileBreakpoints[breakpoint] : tileBreakpoints[breakpoint];
const shelfTitlesHeight = config.options.shelveTitles ? 40 : 0;
const shelfMetaHeight = item.featured ? 24 : shelfTitlesHeight + 24;
const cardMetaHeight = item.featured ? 0 : 27;
const cardMetaHeight = item.featured ? 0 : 40;
const shelfHorizontalMargin = (isMobile && item.featured ? 20 : 56) * featuredTileBreakpoints[breakpoint];
const cardHorizontalMargin = 0;
const cardWidth = (document.body.offsetWidth - shelfHorizontalMargin) / tilesToShow - cardHorizontalMargin;
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Playlist/Playlist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function Playlist({
<Filter name="categories" value={filter} defaultLabel="All" options={categories} setValue={setFilter} />
</header>
<main className={styles.main}>
<VirtualizedGrid rowCount={playlistRows.length} cols={cols} cellRenderer={cellRenderer} spacing={30} />
<VirtualizedGrid rowCount={playlistRows.length} cols={cols} cellRenderer={cellRenderer} spacing={50} />
</main>
</div>
);
Expand Down

0 comments on commit df01d5a

Please sign in to comment.