From 635cee8bf421f821859876ca652c89c86aeb4a7a Mon Sep 17 00:00:00 2001 From: Maggie Bauer Date: Tue, 22 Aug 2023 14:38:19 -0700 Subject: [PATCH] hackweek tamagotchi project --- static/app/icons/tamagotchi/tamagotchi.tsx | 130 ++++++++++++++++++ .../app/views/projectDetail/projectDetail.tsx | 2 + static/images/tamagotchi/egg.gif | Bin 0 -> 4058 bytes static/images/tamagotchi/happy.gif | Bin 0 -> 1136 bytes static/images/tamagotchi/meh.gif | Bin 0 -> 1056 bytes static/images/tamagotchi/sad.gif | Bin 0 -> 1123 bytes 6 files changed, 132 insertions(+) create mode 100644 static/app/icons/tamagotchi/tamagotchi.tsx create mode 100644 static/images/tamagotchi/egg.gif create mode 100644 static/images/tamagotchi/happy.gif create mode 100644 static/images/tamagotchi/meh.gif create mode 100644 static/images/tamagotchi/sad.gif diff --git a/static/app/icons/tamagotchi/tamagotchi.tsx b/static/app/icons/tamagotchi/tamagotchi.tsx new file mode 100644 index 0000000000000..f002ac81cfa8a --- /dev/null +++ b/static/app/icons/tamagotchi/tamagotchi.tsx @@ -0,0 +1,130 @@ +import {useEffect, useMemo, useState} from 'react'; +import styled from '@emotion/styled'; + +import tamagotchiEgg from 'sentry-images/tamagotchi/egg.gif'; +import tamagotchiHappy from 'sentry-images/tamagotchi/happy.gif'; +import tamagotchiMeh from 'sentry-images/tamagotchi/meh.gif'; +import tamagotchiSad from 'sentry-images/tamagotchi/sad.gif'; + +import {t} from 'sentry/locale'; + +function Tamagotchi() { + const [currentScore, setCurrentScore] = useState(0); + const [currentStage, setCurrentStage] = useState(tamagotchiEgg); + const [currentStageName, setCurrentStageName] = useState('Hatching Your Tamagatchi'); + + const tamagotchiStages = useMemo(() => { + const stages = { + 0: { + stage: tamagotchiEgg, + stageName: 'Egg', + }, + 1: { + stage: tamagotchiSad, + stageName: 'Sad', + }, + 2: { + stage: tamagotchiMeh, + stageName: 'Meh', + }, + 3: { + stage: tamagotchiHappy, + stageName: 'Happy', + }, + }; + return stages; + }, []); + + useEffect(() => { + // Currently allowing 3 seconds for egg to hatch and then set the initial data to the Sad stage + setTimeout(() => { + setCurrentScore(1); + setCurrentStage(tamagotchiStages[1].stage); + setCurrentStageName(tamagotchiStages[1].stageName); + }, 3000); + }, [tamagotchiStages]); + + // These handle clicks are placeholders to allow the buttons to cycle through the stages + const handleIncreaseClick = () => { + setCurrentScore(currentScore + 1); + setCurrentStage(tamagotchiStages[currentScore].stage); + setCurrentStageName(tamagotchiStages[currentScore].stageName); + }; + + const handleDecreaseClick = () => { + setCurrentScore(currentScore - 1); + setCurrentStage(tamagotchiStages[currentScore].stage); + setCurrentStageName(tamagotchiStages[currentScore].stageName); + }; + + return ( + +

{t('Tamagotchi Status: ')}

+

{currentStageName}

+ tamagotchi + + {t('This is where we can give some message')} + + + + + +
+ ); +} + +export default Tamagotchi; + +const TamagotchiWrapper = styled('div')` + font-family: monospace; +`; + +const FirstTitle = styled('h4')` + font-weight: 600; + font-size: 16px; + padding: 0px 8px 8px; + margin: 0; +`; + +const Wrapper = styled('div')` + width: 400px; + max-height: 500px; + height: fit-content; + background-color: #fbf1c7; + border: 1px solid transparent; + border-radius: 2px; + padding: 16px 12px; + font-weight: 600; + font-size: 14px; + position: relative; + white-space: pre-wrap; + word-break: break-word; + + :before { + content: ''; + width: 0px; + height: 0px; + position: absolute; + border-left: 14px solid transparent; + border-right: 15px solid #fbf1c7; + border-top: 18px solid transparent; + border-bottom: 18px solid #fbf1c7; + top: -36px; + } +`; + +const Button = styled('button')` + background-color: transparent; + border: 1px solid rgba(0, 0, 0, 0.25); + border-radius: 2px; + width: 100px; + :hover { + text-decoration: underline; + } +`; + +const ButtonWrapper = styled('div')` + display: flex; + justify-content: space-between; + padding: 6px 0 0 0; +`; diff --git a/static/app/views/projectDetail/projectDetail.tsx b/static/app/views/projectDetail/projectDetail.tsx index d71af6dc78dd5..edf0814a9eefe 100644 --- a/static/app/views/projectDetail/projectDetail.tsx +++ b/static/app/views/projectDetail/projectDetail.tsx @@ -21,6 +21,7 @@ import PageFiltersContainer from 'sentry/components/organizations/pageFilters/co import MissingProjectMembership from 'sentry/components/projects/missingProjectMembership'; import {DEFAULT_RELATIVE_PERIODS} from 'sentry/constants'; import {IconSettings} from 'sentry/icons'; +import Tamagotchi from 'sentry/icons/tamagotchi/tamagotchi'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import {Organization, PageFilters, Project} from 'sentry/types'; @@ -319,6 +320,7 @@ class ProjectDetail extends DeprecatedAsyncView { )} + !CnMrymYl-MSyrIuJ~4|-dzHKMKM+HXT*4;r!6(kfL;&@ydFFzrxc zNwn73s!FXBu2>@0qKF_gjH1d+&$(}NALiV1=A3!(|G$4P-}jy0XK8I=XoQFcAOTx| z|DN12pEVlchq6QX1^5IB`XSJ0gsB!pSMS>cll|^KCl5O#@0<{)autH38XCSMW0P84MY{K z@s(+a(sy<4+9iBG-%i+10fRfOU^U4dPdV0?RZFg;lp{&PwVLFH6{iR7_1gU~HvAT| zj_B#tGRHy3ze)7j+`|=7=~17`mgOl(rUg-gSf97c6xr8{ad3?QJyXfs9|clkqPJYF z6pY7G^ZT1vjC4z5VZMF0ig06>79HDef>inx68~|Hs1}KH#~DgXKZ)bfXg=g$#|5Iz zH}IL$@zl5$H32gluNe<^loyAT&;?OHIwC+s?%K5pWMq&0P__A!P9pCv70Ar;;!55X zZ3x;+`k;Nm^I@b)1k%mL_osWi1RJkwI$o8cwt-gSPLhJ{kG!a=p0*6bR z@|n)8s^0Bo`{>I{0*d%t_;B1gJ(?R!NcC;$xi6z8ZjUNP6Wwbg3-`qQZx+G}Z7Kps zOI@pdI!H5&rvVd1$YJ?k%h@EC)}_Myb9>iS>`fkSPwG3?*7KE8md$`W1b9EldMv1*@maX{D_G1~y+02S%5_x6({CI1pk2Mc&SAx%?vY zxbFjJ46F0=knkA2Du+B$wY$8b)c!$x95#N~PpL!6+;36l*vAVtMeXc`LqkRz-};HE zSW!?D4-Mb#E%6f1`vZVC8R2O;pxOW$@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R{y@ y@8Ql|Z*Dp+9Avb3hfS8pZ!X6c*er?lJ(%;dWAAS>X+93s@B`z>wku}<0O)Udg0__a literal 0 HcmV?d00001 diff --git a/static/images/tamagotchi/happy.gif b/static/images/tamagotchi/happy.gif new file mode 100644 index 0000000000000000000000000000000000000000..5402a70930c8b71202c3489ee30963ab3582edbf GIT binary patch literal 1136 zcmZ?wbhEHbtYAoC_`m=KivPL&TtkAL9RpmA^bD98fxxvZuk99xwZQmli&a7nRoVj`N!qYly;=Na9bg11K zG2`aV4o)l8s7;Yx&EGSvJh~?A++KA>OS;=QJKTC!^{V8LRb|o+M_;-0%vzEqWaLxb z^IGQU6!l&XUCA>sZyP^a?|tp{R{Y%WD`$ViX4I~TmD_XfAz#nGx&%Ete|?$vYyT-{ z&1X=ssJZj+Z8Ceuf{k(8M1EOGoK-xO#&gs`W%>qro6diNrk5U`&~86aB|f_%Mr~8X zt}Y|5ARo?4D&Cdq-3RVWD_pjJhJOB`RVV$^_fD;PwYrV?!Rk0l(-)@cZd&*|=;#%IFHrKCqxNkr-l-R!vNoyFJAPqFOItG0ac@>uBq zZ(F%bKkmA*{^_N>*dO1ruIvbXFZXxz_V~N|JKvk_llqzYbkWT6vc8`mk6n4bf`6h7 z`)}h*S9iwS&zAl3ZA;jZ;zeC{dq32?y4`*DtzBKl?N6`S)spT1{}Ny&JHhZTo&!oS z_xAkeZ+ql1?OErtSEshU<39e$=eknE^Id1nfAPQI6h3hGL&O=`i6{ni=)BO? z>uV;hyS(Pxv$tyd9~fTqx%TJOjxDLOO}o`U`PcI8EdTPO*gEgZ_55diAL)O7Zt`uGJ5^ytnKQ z(ssRFJ>eAFp9R*{IyqUh#l?D_&8hj+9pke7P2k+K(razr&OFOntLs>^kyp;}-`zDQ zeYy4*)~!C5)8p>nXTRM4q5i3R`!zl-+4;I`0<&WbH)~P?i-6E@JzU@Xf;o>_TCra z&x>5zTuRUJtP)vzZvNy1Kieo#O~2)l?ca{vG8GSAn8;rDHSC(ggtZ}CH#qMw(>2@T z{qmG(Fkk+i-C1i3=YH9oYdbTJlbKC>+8f0q1wXxdPnjD$uIM@|6&F+a?y2i!d26;? zH(#Y+n0dDKnc~hZv#-qlJXg%7`D^@{wZ5zUl&eeLo!>2cSZ(ixV_ss1vqi!SZOYuA ooSr&8<=>skf>VyG_rFcI-5q=9*6#Ug?`&(XeR$+6!oXk+0M8aFMgRZ+ literal 0 HcmV?d00001 diff --git a/static/images/tamagotchi/meh.gif b/static/images/tamagotchi/meh.gif new file mode 100644 index 0000000000000000000000000000000000000000..3a39d0317a84c4bdc05cf4e2a72a5a9972ad028e GIT binary patch literal 1056 zcmZ?wbhEHbtYAoC_`m=KivPL&TtkAL9RpmA^bD98fxxvZuk99xwZQmli&a7nRoVj`N!qYly;=Na9bg109 z@$(Ajj>?J;ksiucS372&+WG2cm%G&@%imQYyPc%1D!Nx?pPW4*dlq|5m`&B0i82DO zx9hBNev^IKCv2~EZP#X*qPHhvS?r$oTC9nc^VQuq_c2SB-nM(U-))?JS6ALAKZ##| za({yS{_>ZP?sBUOC~RuJ^k;5%#0UAq?W$^4n>{AZJuH8Vi+^JBwTYr`Inu^aKYncF zKQ%$id0ETTNvdZia=)B;Wc&I>XJ-qnWDz;BSzS2VvN`UKr^w2SlO1MHiOKr#(tE|J zO}L&fwzJW{1; zS34tx%l?XQi(AVXeQ9g4bkJp$t?7Jhn`Z~+c^)j~|325CGXMOk+2Z=IZK@v3zOcM#i~j|u@PWG@ zBF@N8Jo(_$)e@sc=Y_6bUo&alBBo1ZRzy|MaI^+c&TuRlmD)AmWHUi%pDHTmWAot(Gu-&;R*dD+%F|M=Yg{xh@p@8#!^&V2k!l;_9#XeT9ZK?Mz%coBWj=HTQSv`&~?|Rrx+WB#eDmC zbDG)VWiB$GGi;XiS^9sT^YeMySy9JorkGhJC)(FUPS4?$HokUaOY5VRz0n^Y-Pv=u JN`ryH8UP$e{j>l8 literal 0 HcmV?d00001 diff --git a/static/images/tamagotchi/sad.gif b/static/images/tamagotchi/sad.gif new file mode 100644 index 0000000000000000000000000000000000000000..1b726ccb6cd5278476881ec93afec51ea2d4bf5b GIT binary patch literal 1123 zcmZ?wbhEHbtYAoC_`m=KivPL&TtkAL9RpmA^bD98fxxvZuk99xwZQmli&a7nRoVj`N!qYly;=Na9bg109 z@$(Ajj>?J;ksiucS372&+WG2cm%A0y^vRyPrCyh3XV2Qcy7)`fukOdvkF0y7xR&kC zj=6Ird%4Z8JGXgybtG%NY;&8v+3a?ll~u?qT=#0NWNh3fJ?Fl{IeB{aeDN;x^Y6-? zU!N#{Acpz*U1xQJ+cTRx{^*MASgv5#Za*V%%25NaW99F}-+H?I*tqae*Xvg^?{xG& z_UKVG-4?7F{wYNdrio%z?jWj=acVXq$X`#2b z-;UqYXv_C5>c_LNq;6sP>@L%di5q$Zt=EOk{Pgr#-Q#tCU;fm|IN9VZ{KUG<;?apagPn&u{*=M;_CjbuN2#YTG;R zXddb=LeB{|ipx19v|}oROV)^1-L8B}R+R3thdwX41OLYrZ{utG54v;WeLY ze@^Y#k}BJ@Tm6%NE#J=aFF%T{^R8?^kS?m>u_N_HyTzd&PdQeoWH4|B-7M~$B)K{B z66ewrl2%`4YD9+KvhbRG>XOvY_Fb<&tqRIEKVAHKWA&x#gA!A<=KPix^pT04xMoel zobWR}2X#zmoDO@d!@EcK+8gP)Hg|JtXHEJk(@@7d`|X5%dFxKrG5Gseo}Zns|9{^8 z?eFKeRNTMSJK6p1IfKUI5|5l`2qf)q5-*pz*Fn)0z}-O(%#{io*M-n#bI?uyr|j&e^( zvs!mz1JgRqh&PF)56|e;?JhOAdZ(o#QK; z=at=_rDu6yV|&!Ks%XO}ciJ=y<~7dVns;P%~uQSX8Sx7 b>sijXcJqrry=(pO!z1;{@9P#ZFjxZs