1
0
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:
Phuoc Nguyen
2019-11-23 21:00:03 +07:00
parent 351d0e7419
commit 10b00cf135
6 changed files with 141 additions and 2 deletions

View File

@@ -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>
);
})

View File

@@ -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';