Skip to content

Commit

Permalink
exp
Browse files Browse the repository at this point in the history
  • Loading branch information
KimTeddy committed Dec 23, 2024
1 parent 541437a commit 72a94b1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 16 deletions.
45 changes: 29 additions & 16 deletions assets/js/load_experiences.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,38 @@ document.addEventListener('DOMContentLoaded', () => {
const experienceContainer = document.querySelector('.experience-container');

if (experiencesData.experiences) {
experiencesData.experiences.forEach(experience => {
const experienceCard = document.createElement('div');
experienceCard.className = 'experience-card';
experiencesData.experiences.forEach(experienceGroup => {
experienceGroup.positions.forEach(position => {
const experienceCard = document.createElement('div');
experienceCard.className = 'experience-card';

const year = document.createElement('h3');
year.textContent = experience.year;
const year = document.createElement('h3');
year.textContent = position.designation;

const awardList = document.createElement('ul');
experience.awards.forEach(award => {
const listItem = document.createElement('li');
const codeElement = document.createElement('code');
codeElement.textContent = award; // 수상 내역을 <code> 태그로 감싸기
listItem.appendChild(codeElement);
awardList.appendChild(listItem);
});
const awardList = document.createElement('ul');
position.responsibilities.forEach(responsibility => {
const listItem = document.createElement('li');

// 수상 내역 중 강조 부분만 <code>로 감싸기
const match = responsibility.match(/(.*? - )(.*)/);
if (match) {
const textPart = document.createTextNode(match[1]);
const codeElement = document.createElement('code');
codeElement.textContent = match[2];

listItem.appendChild(textPart);
listItem.appendChild(codeElement);
} else {
listItem.textContent = responsibility; // 매칭 실패 시 전체 텍스트 출력
}

experienceCard.appendChild(year);
experienceCard.appendChild(awardList);
experienceContainer.appendChild(experienceCard);
awardList.appendChild(listItem);
});

experienceCard.appendChild(year);
experienceCard.appendChild(awardList);
experienceContainer.appendChild(experienceCard);
});
});
}
})
Expand Down
9 changes: 9 additions & 0 deletions experiences.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ <h2>Experiences</h2>

<!-- CSS for experiences -->
<style>
.experience-card code {
background-color: #f5f5f5; /* 밝은 회색 배경 */
color: #333; /* 텍스트 색상 */
padding: 2px 6px; /* 내부 여백 */
border-radius: 6px; /* 둥근 모서리 */
font-family: 'Courier New', Courier, monospace; /* 코딩 폰트 */
font-size: 0.9rem; /* 적당한 크기 */
border: 1px solid #ddd; /* 외곽선 */
}
.experience-container {
display: grid;
flex-direction: column;
Expand Down

0 comments on commit 72a94b1

Please sign in to comment.