본문 바로가기

반응형

javascript

(11)
Drag and Drop Let's see how we can implement drag and drop using JavaScript Set Up In the HTML file, add the draggable="true" to the element you want to drag and drop. Add styles /* main.css */ * { margin: 0; padding: 0; box-sizing: border-box; } body { height: 100vh; display: flex; align-items: center; justify-content: center; gap: 10px; } .img-box { height: 200px; width: 200px; border: solid 3px #000; borde..
Module System As the size of the project grows bigger, it becomes harder to navigate through the files. To solve this problem, many lagnuages separate the files into small chunk of files such as library of package. JavaScript uses module to solve this. A module is a group of functions stored separatly in a file to better manage codes. Let's see how we can create module Implementation Add the type="module" att..
Day / Night Mode with JavaScript Lots of applications, nowadays, have a feature to change day and night modes. Let’s see how to make one using HTML, CSS, JS. This feature is quite straight forward so I am going to explain why to implement of what it does. Having said that let’s get into the code. (I tried to omit the unnecessary codes) Implementation HTML Custom welcome CSS /* html에 전역변수 지정 */ :root { --bg-light-alt: rgba(0, 0,..
Modal A modal in web programming refers to a popup or a dialog box that appears on top of the page to interact with users. Modal is a great way to get users’ attention. Let’s see how to implement is with HTML, CSS and JavaScript Implementation First, we need a modal in the HTML. In this example, I kept the code as simple as possible so that we can focus on the topic. In the HTML, create a div and add ..
Infinite Scrolling When developing a website there comes many occasions when you need to populate a page with a list of images or items. Since the screen is finite there is a limitation about how much you can show to the user no matter how big the list. Infinite scrolling is a technique that allows you to load a small amount of data when it is needed which can improve the response time from the server. In this wri..
React React is the most popular framework followed by Angular and Vue. React, like Angular uses components to build an application. However, React does not come with native features like Angular. Instead, it uses other libraries which makes React compact and small in terms of size.Creating a React AppThe easiest way to create a new React app is to use the command below. Run the command in the terminal..
What is Angular? Developing a front end application using Vanilla JavaScript can become tedious and unproductive as the size of the application grows because anything that needs to be in the template should be written by the developer. Angular is a JavaScript framework that is packed with powerful features such as routing, forms validation, animations and rich libraries. Let’s have a look at how it started and s..
JavaScript? 웹프로그래밍을 논할 때 빠질 수 없는 세 가지가 있는데요. 첫 번째는 구조를 담당하는 HTML 그리고 스타일을 담당하는 CSS 마지막으로 기능 (동작)을 담당하는 JavaScript(JS)입니다. 자바스크립트는 모질라 그룹의 공동 창시자인 Brendan Eich에 의해 1995년에 웹사이트에 동적기능을 추가하여 웹과 사용자의 상호작용을 위해 출시되었는데요. 설정과 사용의 간편함, 다양한 기능과 지속적인 업데이트로 자바스크립트의 인기는 식을 기미가 보이지 않는데요. 2022년 기준 전 세계의 98%에 달하는 웹사이트의 Frontend가 자바스크립트를 사용하고 있으며 앵귤러, 리액트, TypeScript 등 인기를 끌고 있는 다른 프레임워크나 언어도 작동기반은 자바스크립트라는 점에서 당대에 웹 개발자들에게는..

728x90