Skip to content

Instantly share code, notes, and snippets.

View gyeongseokKang's full-sized avatar

Kang | Handy gyeongseokKang

View GitHub Profile
// let input = `4 2
// 4 2
// 3 1`
// .trim()
// .split("\n");
// input 파싱
// let input = require("fs").readFileSync("/dev/stdin").trim().split("\n");
// 위상정렬에 필요한 기본 그래프 생성
// input 파싱
let input = require("fs").readFileSync("/dev/stdin").toString().split("\n");
let requestLessonCount = Number(input[0]);
if (requestLessonCount === 0) {
return console.log(0);
}
let inputSchedual = new Array(requestLessonCount);
let dailyIncome = new Array(10000).fill(0);
const targets = document.querySelectorAll(".fade-class");
const options = { root: null, threshold: 0.1, rootMargin: "-0px" };
const observer = new IntersectionObserver(function (entries, observer) {
entries.forEach((entry) => {
const container = entry.target;
if (entry.isIntersecting) {
container.classList.add("fade-in");
} else {
container.classList.remove("fade-in");
}
//스크롤 연동 fade-in fade-out
$(window).on("load", function () {
function fade() {
let animation_height = $(window).innerHeight() * 0.5;
let ratio = Math.round((1 / animation_height) * 10000) / 10000;
$(".fade").each(function () {
let objectTop = $(this).offset().top;
let windowBottom = $(window).scrollTop() + $(window).innerHeight();
if (objectTop < windowBottom) {
if (objectTop < windowBottom - animation_height) {
@gyeongseokKang
gyeongseokKang / webpack.config-final.js
Created July 6, 2021 11:51
webpack 설정 완성본
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: "./src/index.tsx",
mode: "development",
devtool: "inline-source-map", // <- source map를 위한 코드
devServer: {
contentBase: "./dist", //
historyApiFallback: true, // <- dev-server를 위한 코드
@gyeongseokKang
gyeongseokKang / webpack.config5.js
Last active July 6, 2021 11:49
webpack-dev-sever 용 공식문서
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: "./src/index.tsx",
mode: "development",
devServer: {
contentBase: "./dist", // <- 추가된 부분
hot: true, // <- HMR 설정
},
@gyeongseokKang
gyeongseokKang / webpack.config5.js
Last active July 6, 2021 11:02
HtmlWebpackPlugin 설정 및 dist 제거 코드
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: "./src/index.tsx",
mode: "development",
module: {
rules: [
{
test: /\.css$/i,
@gyeongseokKang
gyeongseokKang / webpack.config3.js
Last active July 6, 2021 08:15
webpack.config.js - 웹팩에 확장자 알려주기
const path = require("path");
module.exports = {
entry: "./src/index.tsx",
mode: "development",
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist"),
},
module: {
@gyeongseokKang
gyeongseokKang / webpack.config4.js
Last active July 6, 2021 08:15
webpack.config.js에 시작경로 알려주기
const path = require("path");
module.exports = {
entry: "./src/index.tsx",
mode: "development",
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist"),
},
module: {