Improvements

- Use Picture component for focus view
	- remove hover animation
	- bigger rows
	- avoid dangling, too-tall images
	- update node modules
This commit is contained in:
Aaron Gutierrez
2022-01-19 18:32:40 -07:00
parent e8b14c52c9
commit d96d63da8e
11 changed files with 7216 additions and 2492 deletions

View File

@@ -1,4 +1,5 @@
import * as Model from "../model";
import { Picture } from "./picture";
import * as React from "react";
@@ -6,6 +7,7 @@ export interface Props {
image: Model.Image;
onClose: () => void;
width: number;
height: number;
}
export class BigPicture extends React.PureComponent<Props, {}> {
@@ -20,14 +22,17 @@ export class BigPicture extends React.PureComponent<Props, {}> {
}
render() {
const src = `img/1600/${this.props.image.src}`;
const scaleWidth = this.props.image.width / this.props.width;
const scaleHeight = this.props.image.height / (this.props.height - 80);
const scale = Math.max(scaleWidth, scaleHeight);
return (
<div className="BigPicture">
<div
className="BigPicture-image"
style={{
backgroundImage: `url(${src})`
}}
<Picture
image={this.props.image}
onClick={() => {}}
height={this.props.image.height / scale}
width={this.props.image.width / scale}
/>
<div className="BigPicture-footer">
<a