Skip to content

Commit

Permalink
언어별 레딧 경로 다르게 설정. 한국어일때만 카톡아이콘 보이게, 디스코드는 초대장 만료로 일단 숨겨버림.
Browse files Browse the repository at this point in the history
  • Loading branch information
dalnim committed Sep 25, 2024
1 parent 3865954 commit 2d43755
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
6 changes: 6 additions & 0 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -710,4 +710,10 @@ footer .copyright__wrapp {
height: 100%;
}

.kakao-visible {
display: inline-block !important; /* !important를 사용하여 기존 스타일을 덮어씌움 */
}

.kakao-hidden {
display: none !important; /* !important를 사용하여 기존 스타일을 덮어씌움 */
}
File renamed without changes.
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -630,13 +630,15 @@ <h2 class="display-4 fw-bold text-white text-center mb-4 app__title" data-aos="f
To prevent any potential problems, videos start in a muted state and automatically pause when the app goes into the background.
</p>
<div class="d-flex gap-3 gap-lg-4 justify-content-center align-items-center py-5">
<a href="https://www.reddit.com/r/AraMultiPlayer/comments/1e9fk9t/about_aramultiplayer_app" target="_blank" class="d-inline-block app__btn" aria-label="Google PLay Store" data-aos="fade-right">
<a id="redditLink" href="https://www.reddit.com/r/AraMultiPlayer/" target="_blank" class="d-inline-block app__btn" aria-label="Google PLay Store" data-aos="fade-right">
<img src="assets/images/home/reddit.png" class="img-fluid" loading="lazy" alt="Google Play Store">
</a>
<!--
<a href="https://discord.gg/pS3rqVRb" target="_blank" class="d-inline-block app__btn" aria-label="App Store" data-aos="fade-left" data-aos-delay="300">
<img src="assets/images/home/discord.png" class="img-fluid" loading="lazy" alt="App Store">
</a>
<a href="https://open.kakao.com/o/gcDPqRkg" target="_blank" class="d-inline-block app__btn" aria-label="KakaoTalk" data-aos="fade-left" data-aos-delay="300">
-->
<a id="kakaoLink" href="https://open.kakao.com/o/gcDPqRkg" target="_blank" class="d-inline-block app__btn" aria-label="KakaoTalk" data-aos="fade-left" data-aos-delay="300">
<img src="assets/images/home/kakaotalk.png" class="img-fluid" loading="lazy" alt="KakaoTalk">
</a>
</div>
Expand Down
34 changes: 32 additions & 2 deletions language.js
Original file line number Diff line number Diff line change
Expand Up @@ -2192,12 +2192,20 @@ function getLanguageData(language) {
return languageData[language] || languageData['en']; // Default to English if language is not recognized
}

// 기본 언어를 반환하는 함수
function getStoredLanguage() {
return localStorage.getItem('selectedLanguage') || 'en';
}

// Main function to update language
function updateLanguage(language) {
const { jsonData, metaData } = getLanguageData(language);
const { jsonData, metaData } = getLanguageData(language);
const storedLanguage = getStoredLanguage();

updateTextContent(jsonData);
updateMetaTags(metaData);
updateRedditLink(storedLanguage);
updateKakaoLinkVisibility(storedLanguage);
updateImageSources(language);
}

Expand All @@ -2210,7 +2218,7 @@ document.querySelector("#language").addEventListener('change', function () {
})
// on page load, set the selected language from local storage
document.addEventListener('DOMContentLoaded', function () {
const storedLanguage = localStorage.getItem('selectedLanguage') || 'en';
const storedLanguage = getStoredLanguage();
document.querySelector("#language").value = storedLanguage;
updateLanguage(storedLanguage);
console.log('stored lang', storedLanguage);
Expand All @@ -2222,4 +2230,26 @@ document.addEventListener('DOMContentLoaded', function () {
}
})

// 언어에 따른 Reddit 링크 설정
function updateRedditLink(language) {
const redditLink = document.getElementById('redditLink');
if (language === 'ko') {
redditLink.href = 'https://www.reddit.com/r/AraMultiPlayer/comments/1e9h787/아라_멀티플레이어/';
} else {
redditLink.href = 'https://www.reddit.com/r/AraMultiPlayer/comments/1e9fk9t/about_aramultiplayer_app/';
}
}
// 언어에 따른 KakaoTalk 링크 표시 여부 설정
function updateKakaoLinkVisibility(language) {
const kakaoLink = document.getElementById('kakaoLink');
if (language === 'ko') {
kakaoLink.classList.remove('kakao-hidden'); // 한국어일 때만 보이도록 설정
kakaoLink.classList.add('kakao-visible');
} else {
kakaoLink.classList.remove('kakao-visible'); // 다른 언어일 경우 숨김
kakaoLink.classList.add('kakao-hidden');
}
}



0 comments on commit 2d43755

Please sign in to comment.