Skip to content

Instantly share code, notes, and snippets.

View andrzejewsky's full-sized avatar

Patryk Andrzejewski andrzejewsky

  • Wrocław
View GitHub Profile
@andrzejewsky
andrzejewsky / scale.css
Created March 2, 2019 13:21
Netflix slider scale element
.item:hover {
transform: scale(1.5) !important;
}
@andrzejewsky
andrzejewsky / translation.right
Created March 2, 2019 13:20
Netflix slider translation right
.item:hover ~ .item {
transform: translateX(25%);
}
@andrzejewsky
andrzejewsky / translationleft.scss
Created March 2, 2019 13:19
Netflix slider left translation
.container:hover .item {
transform: translateX(-25%);
}
@andrzejewsky
andrzejewsky / Netflix-slider.css
Created March 2, 2019 13:12
Netflix slider css
.container {
display: flex;
padding: 0 55px;
}
.item {
background: green;
flex: 0 0 19.7%;
text-align: center;
margin: 0 2px;
@andrzejewsky
andrzejewsky / Slider.htm
Created March 2, 2019 13:11
Netflix slider html
<div class="container">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
</div>
@andrzejewsky
andrzejewsky / ImageResource.jsx
Created January 10, 2019 21:27
ImageResource
import React, { Component } from "react";
class ImageResource extends Component {
constructor(props) {
super(props);
const image = new Image();
image.onload = this.handleLoadImage;
this.state = { image, src: props.lowQuality };
@andrzejewsky
andrzejewsky / calcDuration.js
Created January 10, 2019 21:26
calcDuration
const calcDuration = duration => {
const totalMinutes = duration / 60;
const minutes = ~~totalMinutes;
const seconds = ~~((totalMinutes - minutes) * 100);
return `${minutes}m ${seconds}s`;
};
export default calcDuration;
import List from "./List";
import Item from "./Item";
List.Item = Item;
export default List;
import React from "react";
import ListContext from "./context";
import "./Item.css";
const Item = ({ id, icon, className, info, children }) => (
<ListContext.Consumer>
{value => (
<button
className={["item", className].join(" ")}
key={id}
import React, { Component } from "react";
import ListContext from "./context";
import "./List.css";
class List extends Component {
state = {
selectedItem: null
};
handleSelectItem = selectedItem => {