improve sidebar styling
This commit is contained in:
		
							parent
							
								
									051f8adcfb
								
							
						
					
					
						commit
						0ce8c27960
					
				
							
								
								
									
										61
									
								
								src/App.css
								
								
								
								
							
							
						
						
									
										61
									
								
								src/App.css
								
								
								
								
							| 
						 | 
					@ -48,30 +48,41 @@ main {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#sidebar {
 | 
					#sidebar {
 | 
				
			||||||
  flex-basis: calc(var(--poster-width)*2);
 | 
					  flex-basis: 20%;
 | 
				
			||||||
 | 
					  max-height: 100%;
 | 
				
			||||||
 | 
					  min-height: 100%;
 | 
				
			||||||
  font-size: 1.6rem;
 | 
					  font-size: 1.6rem;
 | 
				
			||||||
 | 
					  text-align: center;
 | 
				
			||||||
  background-color: rgba(0, 0, 0, 0.5);
 | 
					  background-color: rgba(0, 0, 0, 0.5);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  min-height: 100%;
 | 
					  display: grid;
 | 
				
			||||||
  display: flex;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  flex-direction: column;
 | 
					  grid-template-rows: 1fr 3fr 2fr 1fr;
 | 
				
			||||||
  justify-content: space-evenly;
 | 
					  ;
 | 
				
			||||||
  align-content: stretch;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  h1 {
 | 
					  h1 {
 | 
				
			||||||
    font-size: 2em;
 | 
					    font-size: 2em;
 | 
				
			||||||
    margin: 0;
 | 
					    margin: 1rem 0 0 0;
 | 
				
			||||||
    /* line-height: 0.8em; */
 | 
					 | 
				
			||||||
    font-family: RobotoBold;
 | 
					    font-family: RobotoBold;
 | 
				
			||||||
    padding: 0.1em 0.2em 0.1em 0.2em;
 | 
					    padding: 0.1em 0.2em 0.1em 0.2em;
 | 
				
			||||||
    align-self: flex-start;
 | 
					    grid-row: 1/ span 1;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  figure {
 | 
				
			||||||
 | 
					    width: 100%;
 | 
				
			||||||
 | 
					    margin: 0;
 | 
				
			||||||
 | 
					    grid-row: 2/ span 1;
 | 
				
			||||||
 | 
					    place-self: center;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    img {
 | 
				
			||||||
 | 
					      aspect-ratio: 2/1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #summary {
 | 
					  #summary {
 | 
				
			||||||
    overflow: scroll;
 | 
					    overflow: scroll;
 | 
				
			||||||
    flex-grow: 2;
 | 
					 | 
				
			||||||
    max-height: 24rem;
 | 
					    max-height: 24rem;
 | 
				
			||||||
 | 
					    grid-row: 3/ span 1;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  p {
 | 
					  p {
 | 
				
			||||||
| 
						 | 
					@ -80,14 +91,8 @@ main {
 | 
				
			||||||
    margin: 0.1em 0.2em 0.1em 0.2em;
 | 
					    margin: 0.1em 0.2em 0.1em 0.2em;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  figure {
 | 
					  footer {
 | 
				
			||||||
    width: 100%;
 | 
					    grid-row: 4/ span 1;
 | 
				
			||||||
    margin: 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    img {
 | 
					 | 
				
			||||||
      aspect-ratio: 2/3;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -160,20 +165,36 @@ main {
 | 
				
			||||||
  filter: blur(1rem) brightness(0.4);
 | 
					  filter: blur(1rem) brightness(0.4);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#watch-providers {
 | 
					#watch-providers-container {
 | 
				
			||||||
 | 
					  max-width: 100%;
 | 
				
			||||||
  display: flex;
 | 
					  display: flex;
 | 
				
			||||||
 | 
					  gap: 0.2rem;
 | 
				
			||||||
 | 
					  justify-content: space-around;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .watch-providers {
 | 
				
			||||||
 | 
					    text-align: center;
 | 
				
			||||||
 | 
					    border: 1rem white;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    h1 {
 | 
					    h1 {
 | 
				
			||||||
      font-size: 1.6rem;
 | 
					      font-size: 1.6rem;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .watch-logos-container {
 | 
					  .watch-logos-container {
 | 
				
			||||||
    display: flex;
 | 
					    display: flex;
 | 
				
			||||||
 | 
					    flex-wrap: nowrap;
 | 
				
			||||||
    gap: 0.4rem;
 | 
					    gap: 0.4rem;
 | 
				
			||||||
 | 
					    justify-content: center;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    .watch-logo {
 | 
					    .watch-logo {
 | 
				
			||||||
      width: 30px;
 | 
					 | 
				
			||||||
      aspect-ratio: 1/1;
 | 
					      aspect-ratio: 1/1;
 | 
				
			||||||
 | 
					      max-height: 2rem;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      img {
 | 
				
			||||||
 | 
					        width: 100%;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,7 +25,6 @@ export default {
 | 
				
			||||||
          page
 | 
					          page
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
    console.log(res)
 | 
					 | 
				
			||||||
    if (res.status === 200) {
 | 
					    if (res.status === 200) {
 | 
				
			||||||
      res = res.data.results
 | 
					      res = res.data.results
 | 
				
			||||||
      callback(res)
 | 
					      callback(res)
 | 
				
			||||||
| 
						 | 
					@ -44,7 +43,6 @@ export default {
 | 
				
			||||||
        page
 | 
					        page
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    console.log(res)
 | 
					 | 
				
			||||||
    if (res.status === 200) {
 | 
					    if (res.status === 200) {
 | 
				
			||||||
      const array: Array<Movie> = res.data.results
 | 
					      const array: Array<Movie> = res.data.results
 | 
				
			||||||
        .filter((e: Movie) => {
 | 
					        .filter((e: Movie) => {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -61,26 +61,35 @@ interface ProviderIconsProps extends React.ComponentPropsWithRef<"div"> {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
function ProviderIcons({ providerList, link }: ProviderIconsProps) {
 | 
					function ProviderIcons({ providerList, link }: ProviderIconsProps) {
 | 
				
			||||||
  const list = providerList.map((e: any, i: number) => {
 | 
					  const list = providerList.map((e: any, i: number) => {
 | 
				
			||||||
    return <a href={link}><img src={tmdb.makeLogoPath(e.logo_path)} className="watch-logo" key={e.provider_id + "_" + i} /></a>
 | 
					    return <div className="watch-logo">
 | 
				
			||||||
 | 
					      <a href={link}>
 | 
				
			||||||
 | 
					        <img src={tmdb.makeLogoPath(e.logo_path)} key={e.provider_id + "_" + i} /></a>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
  return <div className="watch-logos-container">
 | 
					  return <div className="watch-logos-container">
 | 
				
			||||||
    {list}
 | 
					    {list}
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					function watchProvidersExist(watchProviders: any) {
 | 
				
			||||||
 | 
					  return watchProviders?.link
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
export function WhereToWatch({ watchProviders }: WhereToWatchProps) {
 | 
					export function WhereToWatch({ watchProviders }: WhereToWatchProps) {
 | 
				
			||||||
  if (!watchProviders?.link) {
 | 
					  console.log("Watch providers exist?" + watchProvidersExist(watchProviders))
 | 
				
			||||||
 | 
					  if (!watchProvidersExist(watchProviders)) {
 | 
				
			||||||
    console.group()
 | 
					    console.group()
 | 
				
			||||||
    console.log("Watch providers (WhereToWatch)")
 | 
					    console.log("Watch providers (WhereToWatch)")
 | 
				
			||||||
    console.log(watchProviders)
 | 
					    console.log(watchProviders)
 | 
				
			||||||
    console.groupEnd()
 | 
					    console.groupEnd()
 | 
				
			||||||
    return <div id="no-watch"></div>
 | 
					    return <p>Por el momento no hay opciónes streaming.</p>
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  return <><div id="watch-providers">
 | 
					  return <><footer id="sidebar-footer">
 | 
				
			||||||
    {watchProviders?.flatrate?.length > 0 ? <div><h1>Streaming:</h1><ProviderIcons providerList={watchProviders.flatrate} link={watchProviders.link} /></div> : ""}
 | 
					    <div id="watch-providers-container">
 | 
				
			||||||
    {watchProviders?.rent?.length > 0 ? <div><h1>Alquiler:</h1><ProviderIcons providerList={watchProviders.rent} link={watchProviders.link} /></div> : ""}
 | 
					      {watchProviders?.flatrate?.length > 0 ? <div className="watch-providers"><h1>Streaming:</h1><ProviderIcons providerList={watchProviders.flatrate} link={watchProviders.link} /></div> : ""}
 | 
				
			||||||
    {watchProviders?.buy?.length > 0 ? <div><h1>Comprar:</h1><ProviderIcons providerList={watchProviders.buy} link={watchProviders.link} /></div> : ""}
 | 
					      {watchProviders?.rent?.length > 0 ? <div className="watch-providers"><h1>Alquiler:</h1><ProviderIcons providerList={watchProviders.rent} link={watchProviders.link} /></div> : ""}
 | 
				
			||||||
 | 
					      {watchProviders?.buy?.length > 0 ? <div className="watch-providers"><h1>Comprar:</h1><ProviderIcons providerList={watchProviders.buy} link={watchProviders.link} /></div> : ""}
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <p>Powered by Just Watch.</p>
 | 
					    <p>Powered by Just Watch.</p>
 | 
				
			||||||
 | 
					  </footer>
 | 
				
			||||||
  </>
 | 
					  </>
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue