Skip to content

Commit

Permalink
Implement christmas styles to block icon
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyTripleA committed Dec 13, 2024
1 parent c44284f commit fb986c9
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 81 deletions.
14 changes: 14 additions & 0 deletions packages/frontend/public/images/icons/block-present.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/frontend/src/app/home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function Home () {
documents={status.data?.documentsCount}
identities={status.data?.identitiesCount}
loading={status.loading}
event={'christmas'}
/>
</Container>

Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/components/blocks/BlocksTotal.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default function BlocksTotal () {

return (
<TotalCards
event={'christmas'}
cards={[
{
title: 'Epoch:',
Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/src/components/total/TotalCards.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ValueBlock from './ValueBlock'
import { Box } from '@chakra-ui/react'
import './TotalCards.scss'

export default function TotalCards ({ cards, loading = false }) {
export default function TotalCards ({ cards, event = null, loading = false }) {
return (
<div className={'TotalCards'}>
{cards.map((card, i) => (
Expand All @@ -14,6 +14,7 @@ export default function TotalCards ({ cards, loading = false }) {
value={card.value}
icon={card.icon}
formats={card.format}
event={event}
/>
: <Box h={'27px'}/>
}
Expand Down
16 changes: 14 additions & 2 deletions packages/frontend/src/components/total/TotalInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@ import './TotalInfoItem.scss'
import { Container, Flex } from '@chakra-ui/react'
import Link from 'next/link'

export default function TotalInfo ({ blocks, transactions, dataContracts, documents, identities, loading }) {
export default function TotalInfo ({
blocks,
transactions,
dataContracts,
documents,
identities,
loading,
event = null
}) {
const eventClasses = {
christmas: 'TotalInfo--Christmas'
}

return (
<Container
className={'TotalInfo'}
className={`TotalInfo ${event ? eventClasses?.[event] : ''}`}
maxW={'none'}
borderColor={'gray.800'}
p={0}
Expand Down
14 changes: 13 additions & 1 deletion packages/frontend/src/components/total/TotalInfoItem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,19 @@
background-size: contain;
}
}


.TotalInfo--Christmas & {
&--Blocks {
&::before {
background: url('/images/icons/block-present.svg') no-repeat center;
background-size: contain;
height: 48px;
width: 48px;
margin-bottom: 16px;
}
}
}

&__Title {
color: $color-brand-normal;
font-size: 0.875rem;
Expand Down
7 changes: 5 additions & 2 deletions packages/frontend/src/components/total/ValueBlock.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import './ValueBlock.scss'

export default function ValueBlock ({ title, value, icon, formats = [], className }) {
export default function ValueBlock ({ title, value, icon, formats = [], event = null, className }) {
const iconClass = `ValueBlock--${icon}`
const eventClasses = {
christmas: 'ValueBlock--Christmas'
}

const formatClass = formats.map(format => {
if (format === 'elipsed') return 'ValueBlock__Value--Elipsed'
return ''
}).join(' ')

return (
<div className={`ValueBlock ${iconClass} ${className}`}>
<div className={`ValueBlock ${iconClass || ''} ${className || ''} ${event ? eventClasses?.[event] : ''}`}>
{icon &&
<div className={'ValueBlock__Icon'}></div>
}
Expand Down
162 changes: 87 additions & 75 deletions packages/frontend/src/components/total/ValueBlock.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,101 +2,113 @@
@import '../../styles/variables.scss';

.ValueBlock {
position: relative;
display: flex;
align-items: center;
padding-left: 44px;
position: relative;
display: flex;
align-items: center;
padding-left: 44px;

&::before {
content: '';
display: block;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 28px;
height: 28px;
}

&--Blocks {
&::before {
content: '';
display: block;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 28px;
height: 28px;
background: url('/images/icons/block.svg') no-repeat center;
background-size: contain;
}
}

&--Blocks {
&::before {
background: url("/images/icons/transactions.svg") no-repeat center;
background-size: contain;
}
&--Transactions {
&::before {
background: url('/images/icons/transactions.svg') no-repeat center;
background-size: contain;
}
}

&--Transactions {
&::before {
background: url('/images/icons/block.svg') no-repeat center;
background-size: contain;
}
&--Timer {
&::before {
background: url('/images/icons/timer.svg') no-repeat center;
background-size: contain;
}
}

&--Timer {
&::before {
background: url('/images/icons/timer.svg') no-repeat center;
background-size: contain;
}
&--Epoch {
&::before {
background: url('/images/icons/timer.svg') no-repeat center;
background-size: contain;
}
}

&--Epoch {
&::before {
background: url('/images/icons/timer.svg') no-repeat center;
background-size: contain;
}
&--Sandglass {
&::before {
background: url('/images/icons/sandglass.svg') no-repeat center;
background-size: contain;
}
}

&--Sandglass {
&::before {
background: url('/images/icons/sandglass.svg') no-repeat center;
background-size: contain;
}
&--Nodes {
&::before {
background: url('/images/icons/nodes.svg') no-repeat center;
background-size: contain;
}
}

&--Nodes {
&::before {
background: url('/images/icons/nodes.svg') no-repeat center;
background-size: contain;
}
&--Coins {
&::before {
background: url('/images/icons/coins.svg') no-repeat center;
background-size: contain;
}
}

&--Coins {
&::before {
background: url('/images/icons/coins.svg') no-repeat center;
background-size: contain;
}
&--StarCheck {
&::before {
background: url('/images/icons/star-check.svg') no-repeat center;
background-size: contain;
}
}

&--StarCheck {
&::before {
background: url('/images/icons/star-check.svg') no-repeat center;
background-size: contain;
}
&--Christmas.ValueBlock {
&--Blocks {
&::before {
background: url('/images/icons/block-present.svg') no-repeat center;
background-size: contain;
width: 30px;
height: 30px;
margin: -1px;
}
}
}

&__Title {
color: var(--chakra-colors-brand-deep);
font-size: 1rem;
margin-right: 10px;
white-space: nowrap;
}

&__Title {
color: var(--chakra-colors-brand-deep);
font-size: 1rem;
margin-right: 10px;
white-space: nowrap;
&__Value {
font-size: 1.125rem;

&--Loading {
@include mixins.LoadingLine;

opacity: .5;
border-radius: 5px;
animation-delay: 100ms;
}

&__Value {
font-size: 1.125rem;

&--Loading {
@include mixins.LoadingLine;

opacity: .5;
border-radius: 5px;
animation-delay: 100ms;
}

&--Elipsed {
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

&--Elipsed {
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}

0 comments on commit fb986c9

Please sign in to comment.