-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change welcome banner; edit selected publications;
- Loading branch information
seilk
committed
Jun 9, 2024
1 parent
4768b74
commit 2cdbc9f
Showing
11 changed files
with
421 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,8 +65,3 @@ | |
height: auto; | ||
} */ | ||
|
||
|
||
.next-btn { | ||
margin-top: 3rem !important; | ||
margin-left: 5rem !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,78 @@ | ||
// 페이지가 로드되면 show 클래스를 body 요소에 추가 | ||
window.addEventListener('load', function() { | ||
document.body.classList.add('show'); | ||
}); | ||
window.addEventListener("load", function () { | ||
document.body.classList.add("show"); | ||
}); | ||
|
||
// welcome image slider | ||
document.addEventListener("DOMContentLoaded", function () { | ||
var imageFolder = "media/welcome/"; | ||
var imageExtensions = ["jpg", "jpeg", "png", "gif"]; | ||
var targetWidth = 1600; // 기본 목표 너비 | ||
var targetHeight = 1200; // 기본 목표 높이 | ||
|
||
// 이미지 파일 목록을 가져와서 캐러셀에 추가 | ||
var images = []; | ||
var carouselInner = document.getElementById("carousel-images"); | ||
var carouselIndicators = document.getElementById("carousel-indicators"); | ||
|
||
function loadImages() { | ||
var imagePaths = []; | ||
|
||
imageExtensions.forEach(function (extension) { | ||
for (var i = 1; i <= 10; i++) { | ||
// 1~10번 이미지 파일을 시도 | ||
var imagePath = imageFolder + "welcome" + i + "." + extension; | ||
imagePaths.push(imagePath); | ||
} | ||
}); | ||
|
||
// 이미지 경로 정렬 | ||
imagePaths.sort(); | ||
|
||
imagePaths.forEach(function (imagePath, index) { | ||
var img = new Image(); | ||
img.src = imagePath; | ||
img.onload = function () { | ||
var resizedImage = resizeImage(this, targetWidth, targetHeight); | ||
images.push(resizedImage); | ||
var activeClass = images.length === 1 ? "active" : ""; | ||
var carouselItem = ` | ||
<div class="carousel-item ${activeClass}"> | ||
<img src="${resizedImage}" class="d-block w-100" alt="" style="object-fit: cover;"> | ||
</div> | ||
`; | ||
var indicatorItem = `<li data-target="#heroCarousel" data-slide-to="${images.length - 1}" class="${activeClass}"></li>`; | ||
carouselInner.innerHTML += carouselItem; | ||
carouselIndicators.innerHTML += indicatorItem; | ||
}; | ||
img.onerror = function () { | ||
// 이미지가 존재하지 않으면 무시 | ||
}; | ||
}); | ||
|
||
// 이미지가 1개인 경우 캐러셀 비활성화 | ||
setTimeout(function () { | ||
if (images.length <= 1) { | ||
document.querySelector(".carousel-control-prev").style.display = "none"; | ||
document.querySelector(".carousel-control-next").style.display = "none"; | ||
$("#heroCarousel").carousel("pause"); | ||
} else { | ||
// 슬라이딩 속도 조절 (슬라이드 속도는 1초) | ||
$("#heroCarousel").on("slide.bs.carousel", function () { | ||
$(".carousel-item").css("transition", "transform 1.0s ease"); | ||
}); | ||
} | ||
}, 500); // 이미지 로드 후 0.5초 대기 | ||
} | ||
|
||
function resizeImage(img, width, height) { | ||
var canvas = document.createElement("canvas"); | ||
canvas.width = width; | ||
canvas.height = height; | ||
var ctx = canvas.getContext("2d"); | ||
ctx.drawImage(img, 0, 0, width, height); | ||
return canvas.toDataURL("image/jpeg"); | ||
} | ||
|
||
loadImages(); | ||
}); |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes