mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-07 14:46:38 +02:00
Add questions and answers
This commit is contained in:
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
|
||||
import random from '../helpers/random';
|
||||
|
||||
const Block = ({ justify = 'start', numberOfBlocks }) => {
|
||||
const Block = ({ justify = 'start', numberOfBlocks = 1, blockHeight = 4 }) => {
|
||||
return (
|
||||
<div className={`flex flex-wrap w-100 justify-${justify}`}>
|
||||
{
|
||||
@@ -10,7 +10,7 @@ const Block = ({ justify = 'start', numberOfBlocks }) => {
|
||||
const s = random(1, 5);
|
||||
return (
|
||||
<div key={i} className={`mr2 mb2 w-${s * 10}`}>
|
||||
<div className="w-100 bg-black-30 br-pill" style={{ height: '8px' }} />
|
||||
<div className="w-100 bg-black-30 br-pill" style={{ height: `${blockHeight}px` }} />
|
||||
</div>
|
||||
);
|
||||
})
|
||||
|
@@ -4,6 +4,16 @@ const Triangle = ({ size = 16, corner = 'tl' }) => {
|
||||
let bw = '';
|
||||
let bc = '';
|
||||
switch (corner) {
|
||||
case 't':
|
||||
bw = `0 ${size}px ${size}px ${size}px`;
|
||||
bc = 'transparent transparent rgba(0, 0, 0, .3) transparent';
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
bw = `${size}px ${size}px 0 ${size}px`;
|
||||
bc = 'rgba(0, 0, 0, .3) transparent transparent transparent';
|
||||
break;
|
||||
|
||||
case 'tr':
|
||||
bw = `0 ${size}px ${size}px 0`;
|
||||
bc = 'transparent rgba(0, 0, 0, .3) transparent transparent';
|
||||
|
Reference in New Issue
Block a user