"LCWHA"의 두 판 사이의 차이
North Korea Humanities
| 1번째 줄: | 1번째 줄: | ||
| + | ==1== | ||
<html> | <html> | ||
<style> | <style> | ||
| 69번째 줄: | 70번째 줄: | ||
</script> | </script> | ||
</html> | </html> | ||
| + | ==2== | ||
| + | <html> | ||
| + | <style> | ||
| + | #searchForm { | ||
| + | background-color: #fff; | ||
| + | border-radius: 5px; | ||
| + | padding: 20px; | ||
| + | display: flex; | ||
| + | align-items: center; | ||
| + | max-width: 400px; /* 최대 너비 설정 */ | ||
| + | margin: 20px auto; /* 가운데 정렬 */ | ||
| + | } | ||
| + | #searchInput { | ||
| + | flex: 1; | ||
| + | padding: 10px; | ||
| + | border: 1px solid #ccc; | ||
| + | border-radius: 5px; | ||
| + | font-size: 16px; | ||
| + | margin-right: 10px; | ||
| + | transition: border-color 0.3s; | ||
| + | } | ||
| + | #searchInput:focus { | ||
| + | border-color: #007bff; | ||
| + | outline: none; | ||
| + | } | ||
| + | input[type="submit"] { | ||
| + | background-color: #007bff; | ||
| + | color: #fff; | ||
| + | border: none; | ||
| + | border-radius: 5px; | ||
| + | padding: 10px 15px; | ||
| + | cursor: pointer; | ||
| + | font-size: 16px; | ||
| + | transition: background-color 0.3s; | ||
| + | } | ||
| + | input[type="submit"]:hover { | ||
| + | background-color: #0056b3; | ||
| + | } | ||
| + | </style> | ||
| + | <form id="searchForm"> | ||
| + | <input type="text" id="searchInput" placeholder="검색어를 입력하세요" required> | ||
| + | <input type="submit" value="검색"> | ||
| + | </form> | ||
| + | |||
| + | <script> | ||
| + | document.getElementById('searchForm').onsubmit = function(event) { | ||
| + | event.preventDefault(); // 폼 제출 방지 | ||
| + | |||
| + | var searchInput = document.getElementById('searchInput').value; | ||
| + | var baseURL = "https://dh.aks.ac.kr/~nkh/wiki/index.php"; | ||
| + | var title = "특수:검색"; | ||
| + | var profile = "advanced"; | ||
| + | var fulltext = "1"; | ||
| + | var additionalKeywords = ["이청원", "디지털", "아카이브"]; // 추가 검색어 배열 | ||
| + | additionalKeywords.push(searchInput); // 사용자 입력 추가 | ||
| + | |||
| + | // advancedSearch JSON 구조 생성 | ||
| + | var advancedSearch = '{"namespaces":["0"]}'; // namespaces 배열만 포함 | ||
| + | |||
| + | // 최종 URL 생성 | ||
| + | var finalURL = baseURL + '?search=' + encodeURIComponent(additionalKeywords.join(' ')) + | ||
| + | '&title=' + encodeURIComponent(title) + | ||
| + | '&profile=' + encodeURIComponent(profile) + | ||
| + | '&fulltext=' + fulltext + | ||
| + | '&advancedSearch-current=' + encodeURIComponent(advancedSearch) + | ||
| + | '&ns0=1'; | ||
| + | |||
| + | // 새로운 URL로 리디렉션 | ||
| + | window.location.href = finalURL; | ||
| + | }; | ||
| + | </script> | ||
| + | </html> | ||
[[분류:김지선]] | [[분류:김지선]] | ||
2024년 10월 24일 (목) 19:43 판
1
2