프론트엔드111 TOAST UI DateRangePicker 날짜 초기화 TOAST UI DateRangePicker 날짜 초기화 날짜 범위 선택 라이브러리 중 디자인이 이쁘고 사용성이 좋은 TOAST UI DateRangePicker가 있다. 특별히 선택된 날짜를 초기화 하는 기능을 구현할 때, 공식 document 에 나온 예제나 API 설명만으로는 기능 구현에 어려움이 있었는데, 얼마간 삽질 후 얻은 '초기화' 방법을 여기에 소개한다. close ~ close 선택된 날짜 초기화 방법을 간략히 얘기하자면, 1. default 상태에선 초기화 버튼이 보이지 않다가 2. 날짜가 입력되면 초기화 버튼이 보인다. - change:start, change:end 이벤트 일어나면 getStartDate(), getEndDate() 를 통해 날짜가 입력됐는지 파악 3. 초기화 버튼을.. 2023. 10. 17. SPA에서 History API 이해 SPA에서 History API 이해 주소 내역은 하나의 목록이다. 뒤로가기, 앞으로가기는 목록 안에서 이동하는 것이다. 따라서, 목록에 새로운 주소를 추가하면 페이지를 이동한 셈이 된다. 목록에 주소를 추가하기 위한 메소드(history.pushState(). history.replaceState())가 HTML5에서 생겼다. 예제를 만들고 테스트하며 목록에 주소를 추가하는 메소드 history.pushState(), historyreplaceState()를 비교하자. 아래 예제를 book 폴더 아래에 만든다. pushState replaceState ①'pushState' 버튼을 클릭하면, 페이지가 새로 갱신되지 않지만 주소만 바뀌고, 뒤로가기 버튼이 활성화된다. 주소 목록에 새로운 주소가 추가된다... 2023. 10. 16. 범위 계산 범위 계산x 가 a ~ b 사이일 때, y는 c~ d 이다.x 에 따른 y의 값 구하기 y = (x - a) * (d - c) / (b - a) + c 2022. 11. 3. 유니티 마우스 클릭 지점, 라인렌더러 유니티 마우스 클릭 지점, 라인렌더러마우스 클릭 지점using System.Collections;using System.Collections.Generic;using UnityEngine;public class ChangeCursor : MonoBehaviour{ void Start() { } void Update() { if(Input.GetMouseButtonDown(0)) { // 스크린의 마우스 위치로부터 Ray 생성 Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); // 월드에서 레이캐스팅 히트가 발생한 위치, Ray가 충돌한 물체.. 2022. 10. 24. Unity 마우스커서 변경 Unity 마우스커서 변경using UnityEngine;public class Player : MonoBehaviour{ [SerializeField] Texture2D cursorHover; [SerializeField] Texture2D cursorNormal; void Start() { Cursor.SetCursor(cursorNormal, Vector2.zero, CursorMode.ForceSoftware); } private void OnMouseOver() { Cursor.SetCursor(cursorHover, new Vector2(cursorHover.width/4,0), CursorMode.ForceSoftware); .. 2022. 10. 24. Unity ColorUtility Unity ColorUtility1. TryParseHtmlString Unity - Scripting API: ColorUtility.TryParseHtmlStringStrings that begin with '#' will be parsed as hexadecimal in the following way: #RGB (becomes RRGGBB) #RRGGBB #RGBA (becomes RRGGBBAA) #RRGGBBAA When not specified alpha will default to FF. Strings that do not begin with '#' will be parsed as literal colordocs.unity3d.comusing System.Collections;using S.. 2022. 10. 11. 이전 1 ··· 11 12 13 14 15 16 17 ··· 19 다음