Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | /* eslint-disable jsx-a11y/click-events-have-key-events */ /* eslint-disable jsx-a11y/no-static-element-interactions */ import { css } from '@emotion/react'; import { useGameStateContext } from '@lib/providers/GameState'; import { useModalContext } from '@lib/providers/Modal'; import { color } from '@uniquegood/realworld-studio-design'; interface ModalProps { isOpen: boolean; onClose: () => void; title: string; content: string; } export function ExitModal({ isOpen, onClose, title, content }: ModalProps) { const { resetOnServer } = useGameStateContext(); const { openModal } = useModalContext(); return isOpen ? ( <div css={modalWrapper}> <div css={backDrop} onClick={onClose}> <div css={modalBody} onClick={(e) => e.stopPropagation()}> <div css={textContainer}> <div css={titleStyle}>{title}</div> <div css={contentStyle}>{content}</div> </div> <div css={buttonContainer}> <button type="button" css={buttonPrimary} onClick={() => { window.open('', '_self', ''); window.close(); return false; }} > 종료하기 </button> <button type="button" css={buttonPrimaryTonal} onClick={() => { onClose(); openModal({ title: '다시하기', content: '게임을 처음부터 다시 플레이할까요?', onConfirm: async () => { await resetOnServer(); window.location.reload(); } }); }} > 다시하기 </button> <button type="button" css={buttonDefault} onClick={onClose}> 계속하기 </button> </div> </div> </div> </div> ) : null; } const modalWrapper = css` position: absolute; display: flex; justify-content: center; align-items: center; padding: 0 8px; `; const backDrop = css` position: fixed; display: flex; justify-content: center; align-items: center; top: 0; right: 0; bottom: 0; left: 0; padding: 0 16px; background: rgba(0, 0, 0, 0.4); z-index: 100; `; const modalBody = css` max-width: min(327px, 90%); width: 100%; display: flex; flex-direction: column; gap: 24px; padding: 24px; background: #ffffff; border-radius: 24px; box-shadow: 0 10px 130px 0 rgba(0, 0, 0, 0.15), 0 4px 20px 0 rgba(0, 0, 0, 0.15); `; const textContainer = css` display: flex; flex-direction: column; gap: 16px; `; const titleStyle = css` color: #1a1a1a; text-align: center; font-family: Pretendard sans-serif; font-size: 20px; font-style: normal; font-weight: 800; line-height: 28px; word-break: keep-all; white-space: pre-wrap; `; const contentStyle = css` color: #555; text-align: center; font-family: Pretendard sans-serif; font-size: 14px; font-style: normal; font-weight: 400; line-height: 20px; word-break: keep-all; white-space: pre-wrap; `; const buttonContainer = css` display: flex; flex-direction: column; gap: 8px; `; const button = css` width: 100%; border: none; margin: 0; border-radius: 16px; padding: 12px 16px; font-family: Pretendard sans-serif; font-size: 16px; font-style: normal; font-weight: 700; line-height: 22px; cursor: pointer; `; const buttonDefault = css` ${button}; background: #e8e8e8; color: #555; `; const buttonPrimary = css` ${button}; background: ${color.palette_primary_purple_100}; color: white; `; const buttonPrimaryTonal = css` ${button}; background: ${color.palette_primary_purple_tint_01}; color: ${color.palette_primary_purple_100}; `; |