-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #361 from pshenmic/feat/background
Implement Christmas elements
- Loading branch information
Showing
26 changed files
with
318 additions
and
94 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,8 @@ | |
|
||
&__Avatar { | ||
margin-right: 4px; | ||
width: 16px; | ||
height: 16px; | ||
} | ||
|
||
&__Separator { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
} | ||
|
||
&__Avatar { | ||
@include mixins.AvatarSize; | ||
flex-shrink: 0; | ||
margin-right: 10px; | ||
} | ||
|
22 changes: 22 additions & 0 deletions
22
packages/frontend/src/components/imageGenerator/ImageGenerator.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.ImageGenerator { | ||
position: relative; | ||
|
||
&__Hat { | ||
position: absolute; | ||
top: 0; | ||
left: 50%; | ||
|
||
&--Christmas { | ||
background: url('/images/christmas-hat.svg') center no-repeat; | ||
background-size: contain; | ||
transform: translate(-45%, -35%); | ||
width: 100%; | ||
height: 48%; | ||
} | ||
} | ||
|
||
&__Image { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
import Image from 'next/image' | ||
import { minidenticon } from 'minidenticons' | ||
import { useMemo } from 'react' | ||
import './ImageGenerator.scss' | ||
|
||
export default function ImageGenerator ({ username, saturation, lightness, ...props }) { | ||
export default function ImageGenerator ({ username, className, hat = null, saturation, lightness, ...props }) { | ||
const svgURI = useMemo( | ||
() => 'data:image/svg+xml;utf8,' + encodeURIComponent(minidenticon(username, saturation, lightness)), | ||
[username, saturation, lightness] | ||
) | ||
|
||
return (<Image src={svgURI} alt={username || ''} {...props} />) | ||
const ImageElement = <Image src={svgURI} alt={username || ''} className={'ImageGenerator__Image'} {...props}/> | ||
|
||
const hatClasses = { | ||
christmas: 'ImageGenerator__Hat--Christmas' | ||
} | ||
|
||
return ( | ||
<div className={`ImageGenerator ${className || ''}`}> | ||
{hat && <div className={`ImageGenerator__Hat ${hatClasses?.[hat] || ''}`}></div>} | ||
{ImageElement} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use client' | ||
|
||
import './Snow.scss' | ||
|
||
function Snow () { | ||
return ( | ||
<div className={'Snow'}> | ||
<div className={'Snow__TopContainer'}> | ||
{Array.from({ length: 50 }).map((_, i) => ( | ||
<div key={i} className={'Snow__Snowflake'}>❄</div> | ||
))} | ||
</div> | ||
<div className={'Snow__BottomContainer'}> | ||
{Array.from({ length: 50 }).map((_, i) => ( | ||
<div key={i} className={'Snow__Snowflake'}>❄</div> | ||
))} | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Snow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
.Snow { | ||
&__BottomContainer, &__TopContainer { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
pointer-events: none; | ||
overflow: hidden; | ||
} | ||
|
||
&__TopContainer { | ||
z-index: 9999; | ||
} | ||
|
||
&__BottomContainer { | ||
z-index: -1; | ||
opacity: .3; | ||
} | ||
|
||
&__Snowflake { | ||
position: absolute; | ||
top: -10%; | ||
font-size: 1em; | ||
color: white; | ||
opacity: 0.8; | ||
animation: fall linear infinite, drift infinite ease-in-out; | ||
|
||
&:nth-child(odd) { | ||
font-size: 1.5em; | ||
opacity: 0.9; | ||
} | ||
|
||
&:nth-child(even) { | ||
font-size: 0.8em; | ||
opacity: 0.7; | ||
} | ||
} | ||
|
||
&__TopContainer & { | ||
&__Snowflake { | ||
&:nth-child(1) { left: 5%; animation-duration: 10s, 4s; animation-delay: 0s, 1s; } | ||
&:nth-child(2) { left: 30%; animation-duration: 12s, 6s; animation-delay: 1s, 0s; } | ||
&:nth-child(3) { left: 50%; animation-duration: 8s, 5s; animation-delay: 2s, 2s; } | ||
&:nth-child(4) { left: 70%; animation-duration: 14s, 7s; animation-delay: 3s, 1s; } | ||
&:nth-child(5) { left: 95%; animation-duration: 10s, 4s; animation-delay: 4s, 3s; } | ||
} | ||
} | ||
|
||
&__BottomContainer & { | ||
&__Snowflake { | ||
&:nth-child(1) { left: 2%; animation-duration: 17s, 7s; animation-delay: 1s, 2.5s; } | ||
&:nth-child(2) { left: 32%; animation-duration: 13s, 4s; animation-delay: 3s, 3s; } | ||
&:nth-child(3) { left: 50%; animation-duration: 15s, 6s; animation-delay: 0s, 0s; } | ||
&:nth-child(4) { left: 72%; animation-duration: 17s, 5s; animation-delay: 1s, 2s; } | ||
&:nth-child(5) { left: 98%; animation-duration: 20s, 7s; animation-delay: 0s, 1s; } | ||
} | ||
} | ||
|
||
@keyframes fall { | ||
0% { | ||
top: calc(-10px); | ||
} | ||
100% { | ||
top: calc(100% + 10px); | ||
} | ||
} | ||
|
||
@keyframes drift { | ||
0% { | ||
margin-left: 0; | ||
} | ||
50% { | ||
margin-left: 40px; | ||
} | ||
100% { | ||
margin-left: 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.