• SEARCH

    통합검색
세모계
    • Dark Mode
    • GNB Always Open
    • GNB Height Maximize
    • Color
    • Brightness
    • SINCE 2015.01.19.
    • 세모계 세모계
    •   SEARCH
    • 세상의 모든 계산기
      • 자유(질문) 게시판
      • 계산기 뉴스/정보
      • 수학, 과학, 공학 이야기
      • 세모계 : 공지 게시판
        • 구글 맞춤검색
    • TI
    • CASIO
    • HP
    • SHARP
    • 일반(쌀집) 계산기
    • 기타계산기
    • by OrangeDay
  • 세상의 모든 계산기 자유(질문) 게시판
    • 세상의 모든 계산기 자유(질문) 게시판 일반 ()
    • 불티 움직임 시뮬레이션 (html5)

    • Profile
      • 세상의모든계산기
      • 2025.01.18 - 09:07 2025.01.18 - 08:54 9254

    1
    1
    1
    1

     

    image.png

    <!DOCTYPE html>
    <html>
    <head>
        <style>
            body {
                background: #1a1a1a;
                color: #fff;
                font-family: Arial, sans-serif;
                margin: 0;
                padding: 20px;
                display: flex;
                flex-direction: column;
                align-items: center;
            }
            canvas {
                background: #1a1a1a;
                border: 1px solid #333;
                margin: 20px 0;
            }
            .controls {
                background: rgba(0, 0, 0, 0.7);
                padding: 20px;
                border-radius: 10px;
                width: 380px;
            }
            .control-group {
                margin: 15px 0;
            }
            .control-group label {
                display: block;
                margin-bottom: 5px;
                color: #ffa500;
            }
            .slider-container {
                display: flex;
                align-items: center;
                gap: 10px;
            }
            input[type="range"] {
                flex: 1;
                height: 10px;
                -webkit-appearance: none;
                background: #333;
                border-radius: 5px;
                outline: none;
            }
            input[type="range"]::-webkit-slider-thumb {
                -webkit-appearance: none;
                width: 20px;
                height: 20px;
                background: #ffa500;
                border-radius: 50%;
                cursor: pointer;
            }
            .value-display {
                min-width: 50px;
                text-align: center;
                background: #333;
                padding: 5px;
                border-radius: 3px;
            }
        </style>
    </head>
    <body>
        <canvas id="sparkCanvas"></canvas>
        <div class="controls">
            <div class="control-group">
                <label>크기 배율 (Size Scale)</label>
                <div class="slider-container">
                    <input type="range" id="sizeScale" min="0.5" max="3" step="0.1" value="1">
                    <span class="value-display" id="sizeValue">1</span>
                </div>
            </div>
            <div class="control-group">
                <label>온도 배율 (Temperature Scale)</label>
                <div class="slider-container">
                    <input type="range" id="tempScale" min="0.5" max="2" step="0.1" value="1">
                    <span class="value-display" id="tempValue">1</span>
                </div>
            </div>
            <div class="control-group">
                <label>무게 배율 (Weight Scale)</label>
                <div class="slider-container">
                    <input type="range" id="weightScale" min="0.5" max="2" step="0.1" value="1">
                    <span class="value-display" id="weightValue">1</span>
                </div>
            </div>
            <div class="control-group">
                <label>수명 배율 (Life Scale)</label>
                <div class="slider-container">
                    <input type="range" id="lifeScale" min="0.5" max="2" step="0.1" value="1">
                    <span class="value-display" id="lifeValue">1</span>
                </div>
            </div>
        </div>
        <script>
            const canvas = document.getElementById('sparkCanvas');
            const ctx = canvas.getContext('2d');
    
            // 캔버스 크기 설정
            canvas.width = 400;
            canvas.height = 600;
    
            // 컨트롤 요소
            const controls = {
                sizeScale: document.getElementById('sizeScale'),
                tempScale: document.getElementById('tempScale'),
                weightScale: document.getElementById('weightScale'),
                lifeScale: document.getElementById('lifeScale')
            };
    
            // 값 표시 요소
            const displays = {
                sizeValue: document.getElementById('sizeValue'),
                tempValue: document.getElementById('tempValue'),
                weightValue: document.getElementById('weightValue'),
                lifeValue: document.getElementById('lifeValue')
            };
    
            // 컨트롤 값 업데이트 함수
            Object.keys(controls).forEach(key => {
                controls[key].addEventListener('input', (e) => {
                    displays[key.replace('Scale', 'Value')].textContent = e.target.value;
                });
            });
    
            class Spark {
                constructor() {
                    this.reset();
                }
    
                reset() {
                    this.x = canvas.width/2 + (Math.random() * 40 - 20);
                    this.y = canvas.height - 20;
                    
                    // 슬라이더 값을 반영한 특성 설정
                    this.baseSize = Math.random() * 3 + 1;
                    this.size = this.baseSize * parseFloat(controls.sizeScale.value);
                    
                    this.baseTemp = Math.random() * 0.5 + 0.5;
                    this.temperature = this.baseTemp * parseFloat(controls.tempScale.value);
                    
                    this.baseWeight = Math.random() * 0.3 + 0.1;
                    this.weight = this.baseWeight * parseFloat(controls.weightScale.value);
                    
                    this.vx = 0;
                    this.vy = -2 - (this.temperature * 2);
                    
                    this.baseLife = 1.0;
                    this.life = this.baseLife * parseFloat(controls.lifeScale.value);
                    
                    this.color = `rgba(255, ${150 + Math.random() * 105}, 0, ${this.life})`;
                }
    
                update() {
                    // 현재 슬라이더 값으로 특성 업데이트
                    this.size = this.baseSize * parseFloat(controls.sizeScale.value);
                    this.temperature = this.baseTemp * parseFloat(controls.tempScale.value);
                    this.weight = this.baseWeight * parseFloat(controls.weightScale.value);
                    
                    this.vx += Math.sin(Date.now() * 0.001) * 0.1 * this.weight;
                    this.x += this.vx;
                    this.y += this.vy * this.temperature;
                    
                    this.life -= 0.005 / parseFloat(controls.lifeScale.value);
                    this.size *= 0.999;
                    
                    if (this.life <= 0 || this.y < 0 || this.x < 0 || this.x > canvas.width) {
                        this.reset();
                    }
                    
                    this.color = `rgba(255, ${150 + Math.random() * 105}, 0, ${this.life})`;
                }
    
                draw() {
                    ctx.beginPath();
                    ctx.fillStyle = this.color;
                    ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
                    ctx.fill();
                }
            }
    
            const sparks = Array(50).fill().map(() => new Spark());
    
            function animate() {
                ctx.fillStyle = 'rgba(26, 26, 26, 0.2)';
                ctx.fillRect(0, 0, canvas.width, canvas.height);
    
                sparks.forEach(spark => {
                    spark.update();
                    spark.draw();
                });
    
                requestAnimationFrame(animate);
            }
    
            animate();
        </script>
    </body>
    </html>


     

    Attached file
    image.png 10.6KB 52
    이 게시물을..
    N
    0
    0
    • 세상의모든계산기 25
      세상의모든계산기

      계산기는 거들 뿐
      혹은
      계산기를 거들 뿐

    세상의모든계산기 님의 최근 글

    큐넷 시험의 공학용 계산기 제도, AI시대에 이대로 충분할까? 27 1 2026 11.15 [데이터 분석/역산] 완벽하지 않은 현실 세계에서 'UI 양자화 오차'를 활용해 숨겨진 데이터 파악하기 131 2026 11.09 양자화 오차의 미학: 게임 경험치 UI와 데이터 압축의 공통점 115 2026 11.09 작게 끊으면 넓어지고, 자주 찍으면 좁아진다: 양자화 오차와 교집합의 수학 151 1 2026 11.07 ban 설정 강화 98011 1 2026 05.09

    세상의모든계산기 님의 최근 댓글

    https://v.daum.net/v/20261116194430905 [단독]로봇고 출신 세무사 수석, ‘개조 계산기’로 AI 답안 받은듯 본문은 2017년 글이니, 9년간 계획을 실행에 옮겼을 리는 없고...?  34세? 설마 아니겠지?? 2026 11.16 https://v.daum.net/v/20261115103924120 2026 11.15 언제 추가되었는지 확인은 못하였습니다만, 델리(DELI) D991EX 가 허용군에 추가되어 본문 갱신하였습니다 2026 11.10 좋은 정보 감사드립니다. 링크 글은 수정하였습니다. 2026 11.10 게임에서는 왜 굳이 버림을 쓸까요? 반올림이면 이런 일이 생깁니다.   진짜 99.99996% → 반올림하면 표시 100.0000%   눈에는 100%인데 렙업이 안 된 거죠. 이건 플레이어 입장에서 명백한 버그로 보입니다. 버림이면 표시가 진짜를 절대 초과하지 않습니다. 진짜 99.99996% → 표시 99.9999% 진짜 100.00000% → 표시 100.0000% = 딱 렙업 즉, 표시가 100%가 되는 순간 = 진짜로 렙업되는 순간이 일치합니다. 2026 11.08
    글쓴이의 서명작성글 감추기 
    • 댓글 입력
    • 에디터 전환
    댓글 쓰기 에디터 사용하기 닫기
    • view_headline 목록
    • 14px
    • 목록
      view_headline
    × CLOSE
    전체 일반 393 질문 509 웃김 2 팁 & 정보 16 퀴즈 2 리뷰 11 퍼옴 & 링크 6 공지 1
    기본 (0) 제목 날짜 수정 조회 댓글 추천 비추
    분류 정렬 검색
    등록된 글이 없습니다.
    • 글쓰기
    • 세상의 모든 계산기 자유(질문) 게시판
    • 세상의모든계산기
    • 사업자등록번호 703-91-02181
    • 세모계 all rights reserved.