1import React from 'react';
4 * A very useful Flutter widget reimplemented with
5 * the world's dumbest css hack.
7 * Simply: container div with appropriate relative padding,
8 * then absolutely pin the child.
10 * via: https://www.w3schools.com/howto/howto_css_aspect_ratio.asp
12export default function AspectRatio({ aspectRatio = 1, children }) {
13 const percent = `${(1 / aspectRatio) * 100}%`;
16 <div className="rel" style={{ paddingTop: percent }}>
17 <div className="abs" style={{ top: 0, bottom: 0, left: 0, right: 0 }}>
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list