From fd93ad4f902ef1f6913edfcb645399dc17ddabaa Mon Sep 17 00:00:00 2001 From: JiWoong Sul Date: Fri, 27 Mar 2026 17:15:35 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20Phase=201=20=EC=9E=94=EC=97=AC=20?= =?UTF-8?q?=E2=80=94=20=ED=8F=B0=ED=8A=B8=20=EB=9D=BC=EC=9D=B4=EC=84=A0?= =?UTF-8?q?=EC=8A=A4,=20=EC=A4=91=EB=B3=B5=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0,=20CI=20=ED=8C=8C=EC=9D=B4=ED=94=84=EB=9D=BC?= =?UTF-8?q?=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - assets/fonts/: JetBrainsMono + PressStart2P 라이선스 파일 추가 - arena/widgets/ascii_disintegrate_widget.dart 삭제 (shared/ 중복) - .github/workflows/ci.yml: format+analyze+test 자동화 --- .github/workflows/ci.yml | 25 ++ assets/fonts/JetBrainsMono-LICENSE.txt | 93 ++++++++ assets/fonts/PressStart2P-LICENSE.txt | 93 ++++++++ .../widgets/ascii_disintegrate_widget.dart | 219 ------------------ 4 files changed, 211 insertions(+), 219 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 assets/fonts/JetBrainsMono-LICENSE.txt create mode 100644 assets/fonts/PressStart2P-LICENSE.txt delete mode 100644 lib/src/features/arena/widgets/ascii_disintegrate_widget.dart diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..27c4678 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + analyze-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: subosito/flutter-action@v2 + with: + channel: stable + cache: true + + - run: flutter pub get + + - run: dart format --set-exit-if-changed . + + - run: flutter analyze + + - run: flutter test diff --git a/assets/fonts/JetBrainsMono-LICENSE.txt b/assets/fonts/JetBrainsMono-LICENSE.txt new file mode 100644 index 0000000..675d198 --- /dev/null +++ b/assets/fonts/JetBrainsMono-LICENSE.txt @@ -0,0 +1,93 @@ +Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/fonts/PressStart2P-LICENSE.txt b/assets/fonts/PressStart2P-LICENSE.txt new file mode 100644 index 0000000..550abb6 --- /dev/null +++ b/assets/fonts/PressStart2P-LICENSE.txt @@ -0,0 +1,93 @@ +Copyright 2012 The Press Start 2P Project Authors (cody@zone38.net), with Reserved Font Name "Press Start 2P". + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/lib/src/features/arena/widgets/ascii_disintegrate_widget.dart b/lib/src/features/arena/widgets/ascii_disintegrate_widget.dart deleted file mode 100644 index 2073a85..0000000 --- a/lib/src/features/arena/widgets/ascii_disintegrate_widget.dart +++ /dev/null @@ -1,219 +0,0 @@ -import 'dart:math'; - -import 'package:flutter/material.dart'; - -/// ASCII 문자 분해 파티클 -class AsciiParticle { - AsciiParticle({ - required this.char, - required this.initialX, - required this.initialY, - required this.vx, - required this.vy, - required this.delay, - }) : x = initialX, - y = initialY, - opacity = 1.0; - - final String char; - final double initialX; - final double initialY; - final double vx; // X 속도 - final double vy; // Y 속도 - final double delay; // 분해 시작 지연 (0.0 ~ 0.3) - - double x; - double y; - double opacity; - - /// 진행도에 따라 파티클 상태 업데이트 - void update(double progress) { - // 지연 적용 - final adjustedProgress = ((progress - delay) / (1.0 - delay)).clamp( - 0.0, - 1.0, - ); - - if (adjustedProgress <= 0) { - // 아직 분해 시작 전 - x = initialX; - y = initialY; - opacity = 1.0; - return; - } - - // 이징 적용 (가속) - final easedProgress = Curves.easeOutQuad.transform(adjustedProgress); - - // 위치 업데이트 (초기 위치에서 이동) - x = initialX + vx * easedProgress * 3.0; - y = initialY + vy * easedProgress * 3.0; - - // 중력 효과 - y += easedProgress * easedProgress * 2.0; - - // 페이드 아웃 (후반부에 급격히) - opacity = (1.0 - easedProgress * easedProgress).clamp(0.0, 1.0); - } -} - -/// ASCII 캐릭터 분해 애니메이션 위젯 -/// -/// 캐릭터의 각 ASCII 문자가 파티클로 분해되어 흩어지는 효과 -class AsciiDisintegrateWidget extends StatefulWidget { - const AsciiDisintegrateWidget({ - super.key, - required this.characterLines, - this.charWidth = 8.0, - this.charHeight = 12.0, - this.duration = const Duration(milliseconds: 1500), - this.textColor, - this.onComplete, - }); - - /// ASCII 캐릭터 문자열 (줄 단위) - final List characterLines; - - /// 문자 너비 (픽셀) - final double charWidth; - - /// 문자 높이 (픽셀) - final double charHeight; - - /// 애니메이션 지속 시간 - final Duration duration; - - /// 텍스트 색상 (null이면 테마 색상) - final Color? textColor; - - /// 완료 콜백 - final VoidCallback? onComplete; - - @override - State createState() => - _AsciiDisintegrateWidgetState(); -} - -class _AsciiDisintegrateWidgetState extends State - with SingleTickerProviderStateMixin { - late AnimationController _controller; - late List _particles; - final Random _random = Random(); - - @override - void initState() { - super.initState(); - _initParticles(); - _controller = AnimationController(duration: widget.duration, vsync: this) - ..addListener(() => setState(() {})) - ..addStatusListener((status) { - if (status == AnimationStatus.completed) { - widget.onComplete?.call(); - } - }) - ..forward(); - } - - @override - void dispose() { - _controller.dispose(); - super.dispose(); - } - - void _initParticles() { - _particles = []; - - for (int y = 0; y < widget.characterLines.length; y++) { - final line = widget.characterLines[y]; - for (int x = 0; x < line.length; x++) { - final char = line[x]; - // 공백은 파티클로 변환하지 않음 - if (char != ' ') { - _particles.add( - AsciiParticle( - char: char, - initialX: x.toDouble(), - initialY: y.toDouble(), - // 랜덤 속도 (위쪽 + 좌우로 퍼짐) - vx: (_random.nextDouble() - 0.5) * 4.0, - vy: -_random.nextDouble() * 2.0 - 0.5, // 위쪽으로 - // 랜덤 지연 (안쪽에서 바깥쪽으로 분해) - delay: _random.nextDouble() * 0.3, - ), - ); - } - } - } - } - - @override - Widget build(BuildContext context) { - // 파티클 상태 업데이트 - for (final particle in _particles) { - particle.update(_controller.value); - } - - final textColor = - widget.textColor ?? Theme.of(context).textTheme.bodyMedium?.color; - - return CustomPaint( - size: Size( - widget.characterLines.isNotEmpty - ? widget.characterLines - .map((l) => l.length) - .reduce((a, b) => a > b ? a : b) * - widget.charWidth - : 0, - widget.characterLines.length * widget.charHeight, - ), - painter: _DisintegratePainter( - particles: _particles, - charWidth: widget.charWidth, - charHeight: widget.charHeight, - textColor: textColor ?? Colors.white, - ), - ); - } -} - -/// 분해 파티클 페인터 -class _DisintegratePainter extends CustomPainter { - _DisintegratePainter({ - required this.particles, - required this.charWidth, - required this.charHeight, - required this.textColor, - }); - - final List particles; - final double charWidth; - final double charHeight; - final Color textColor; - - @override - void paint(Canvas canvas, Size size) { - for (final particle in particles) { - if (particle.opacity <= 0) continue; - - final textPainter = TextPainter( - text: TextSpan( - text: particle.char, - style: TextStyle( - fontFamily: 'JetBrainsMono', - fontSize: charHeight * 0.9, - color: textColor.withValues(alpha: particle.opacity), - ), - ), - textDirection: TextDirection.ltr, - )..layout(); - - final x = particle.x * charWidth; - final y = particle.y * charHeight; - - textPainter.paint(canvas, Offset(x, y)); - } - } - - @override - bool shouldRepaint(covariant _DisintegratePainter oldDelegate) => true; -}