-
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 branch 'feat-mvp' of github.com:Mississippi-Labs/mississippi in…
…to feat-mvp
- Loading branch information
Showing
21 changed files
with
376 additions
and
60 deletions.
There are no files selected for viewing
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,36 @@ | ||
import React from 'react'; | ||
import './styles.scss'; | ||
|
||
export interface IEquipment { | ||
type: string; | ||
name?: string | undefined; | ||
} | ||
|
||
const Equipment = (props: IEquipment) => { | ||
|
||
const { name, type } = props; | ||
|
||
if (!name) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div className={'mi-equipment'} style={{ | ||
backgroundImage: `url("/assets/img/hero/${type}/${name}.png")`, | ||
}}> | ||
<div className="equipment-info"> | ||
<div className="equipment-info-content"> | ||
<ul className="loot-list"> | ||
<li className="loot-item"></li> | ||
<li className="loot-item"></li> | ||
<li className="loot-item"></li> | ||
</ul> | ||
|
||
<p className="equipment-desc">This piece of equipment is synthesized from 3 pieces of loot</p> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Equipment; |
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,72 @@ | ||
.mi-equipment { | ||
position: relative; | ||
width: 64px; | ||
height: 64px; | ||
background-repeat: no-repeat; | ||
image-rendering: pixelated; | ||
background-size: 1600%; | ||
background-position: 2px 4px; | ||
|
||
.equipment-info { | ||
display: none; | ||
position: absolute; | ||
z-index: 1; | ||
top: -80px; | ||
left: 99%; | ||
width: 440px; | ||
padding-left: 20px; | ||
height: 226px; | ||
|
||
|
||
.equipment-info-content { | ||
position: relative; | ||
width: 420px; | ||
height: 100%; | ||
padding: 12px; | ||
border-radius: 10px; | ||
border: 5px solid #DCC7AF; | ||
background: #FFF5E9; | ||
|
||
&::before, &::after { | ||
content: ''; | ||
position: absolute; | ||
right: 100%; | ||
top: 50%; | ||
transform: translate3d(0, -50%, 0); | ||
} | ||
|
||
&::before { | ||
border: 20px solid; | ||
border-color: transparent #DCC7AF transparent transparent; | ||
} | ||
|
||
&::after { | ||
border: 14px solid; | ||
transform: translate3d(1px, -50%, 0); | ||
border-color: transparent #FFF5E9 transparent transparent; | ||
} | ||
} | ||
|
||
.loot-list { | ||
display: flex; | ||
justify-content: space-between; | ||
|
||
.loot-item { | ||
width: 120px; | ||
height: 120px; | ||
background: #000; | ||
} | ||
} | ||
|
||
.equipment-desc { | ||
margin-top: 12px; | ||
font-size: 12px; | ||
line-height: 1.57; | ||
color: #BC8C61; | ||
} | ||
} | ||
|
||
&:hover .equipment-info { | ||
//display: block; | ||
} | ||
} |
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,7 @@ | ||
.log-content { | ||
scrollbar-width: none; | ||
-ms-overflow-style: none; | ||
&::-webkit-scrollbar { | ||
display: none; /* Chrome Safari */ | ||
} | ||
} |
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,36 @@ | ||
import React, { useState } from 'react'; | ||
import './styles.scss'; | ||
import Player from '@/components/PIXIPlayers/Player'; | ||
import Typewriter from '@/components/Typewriter'; | ||
import { Stage } from '@pixi/react'; | ||
import dark from '@/assets/img/duck_index.png'; | ||
|
||
const Talk = (props) => { | ||
const {position, text = 'I used to be an adventurer like you, then I took an arrow in the knee', curPlayer } = props; | ||
console.log('curPlayer', curPlayer); | ||
return ( | ||
<div className='talk'> | ||
<div className='talk-main'> | ||
<div className='player'> | ||
{ | ||
curPlayer?.equip ? ( | ||
<Stage width={238} height={281} options={{ resolution: 1, backgroundAlpha: 0 }} style={{transform: 'rotateY(180deg)', marginLeft: 'auto'}} > | ||
<Player | ||
size={128} | ||
x={0.5} | ||
y={0.5} | ||
equip={curPlayer?.equip} | ||
/> | ||
</Stage> | ||
) : <img src={dark} className='dark' /> | ||
} | ||
</div> | ||
<div className='text'> | ||
<Typewriter text={text} typingSpeed={50} name={curPlayer?.name || ''} /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Talk; |
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,42 @@ | ||
.talk { | ||
position: fixed; | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
z-index: 999; | ||
background: rgba(0, 0, 0, 0.5); | ||
.talk-main { | ||
width: 1280px; | ||
margin: auto; | ||
position: absolute; | ||
bottom: 40px; | ||
left: 0; | ||
right: 0; | ||
.player { | ||
|
||
} | ||
.dark { | ||
transform: rotateY(180deg) translateY(-80px); | ||
width: 200px; | ||
height: auto; | ||
margin-top: -100px; | ||
} | ||
.text { | ||
border-radius: 20px; | ||
border: 10px solid #DCC7AF; | ||
background: #6F391E; | ||
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25); | ||
width: 1280px; | ||
height: 190px; | ||
box-sizing: border-box; | ||
margin-top: -100px; | ||
position: relative; | ||
z-index: 9; | ||
padding: 16px 20px; | ||
color: #FFF; | ||
font-size: 22px; | ||
font-family: 'MISS'; | ||
} | ||
} | ||
} |
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,34 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
|
||
function Typewriter({ text, typingSpeed, step, name }) { | ||
const [displayText, setDisplayText] = useState(''); | ||
const [currentIndex, setCurrentIndex] = useState(0); | ||
|
||
useEffect(() => { | ||
const interval = setInterval(() => { | ||
if (currentIndex < text.length) { | ||
setDisplayText((prevText) => prevText + text[currentIndex]); | ||
setCurrentIndex((prevIndex) => prevIndex + 1); | ||
} else { | ||
clearInterval(interval); | ||
} | ||
}, typingSpeed); | ||
|
||
return () => { | ||
clearInterval(interval); | ||
}; | ||
}, [text, typingSpeed, currentIndex]); | ||
|
||
useEffect(() => { | ||
setDisplayText(''); | ||
setCurrentIndex(0); | ||
}, [step]); | ||
|
||
return <div style={{width: '100%', height: '100%', position: 'relative'}}> | ||
<div className='name' style={{marginBottom: '18px'}}>{name || 'Mistery Duck'}:</div> | ||
{displayText} | ||
<div style={{position: 'absolute', bottom: '0px', right: '0px', fontSize: '12px', color: 'rgba(255, 255, 255, 0.80)'}}>Click any button to continue</div> | ||
</div>; | ||
} | ||
|
||
export default Typewriter; |
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.