<!DOCTYPE html>

    <html lang="vi" xmlns="http://www.w3.org/1999/xhtml" prefix="og: http://ogp.me/ns#">

    <head>
<title>Sinh hoạt ngoại khóa tiếng Anh với chủ đề Around the World</title>
<meta name="description" content="Sinh hoạt ngoại khóa tiếng Anh với chủ đề Around the World - Savefile - Tin bài hoạt động -...">
<meta name="author" content="PÉTRUS KÝ PRIMARY - HIGH SCHOOL">
<meta name="copyright" content="PÉTRUS KÝ PRIMARY - HIGH SCHOOL [pek@pek.edu.vn]">
<meta name="generator" content="NukeViet v4.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta property="og:title" content="Sinh hoạt ngoại khóa tiếng Anh với chủ đề Around the World">
<meta property="og:type" content="website">
<meta property="og:description" content="Savefile - Tin bài hoạt động - https&#x3A;&#x002F;&#x002F;pek.edu.vn&#x002F;vi&#x002F;hoat-dong-su-kien&#x002F;savefile&#x002F;hoat-dong-cua-hoc-sinh&#x002F;sinh-hoat-ngoai-khoa-tieng-anh-voi-chu-de-around-the-world-83.html">
<meta property="og:site_name" content="PÉTRUS KÝ PRIMARY - HIGH SCHOOL">
<meta property="og:url" content="https://pek.edu.vn/vi/hoat-dong-su-kien/savefile/hoat-dong-cua-hoc-sinh/sinh-hoat-ngoai-khoa-tieng-anh-voi-chu-de-around-the-world-83.html">
<link rel="shortcut icon" href="https://pek.edu.vn/uploads/logo-pek.png">
<link rel="canonical" href="https://pek.edu.vn/vi/hoat-dong-su-kien/savefile/hoat-dong-cua-hoc-sinh/sinh-hoat-ngoai-khoa-tieng-anh-voi-chu-de-around-the-world-83.html">
<link rel="alternate" href="https://pek.edu.vn/vi/hoat-dong-su-kien/rss/" title="Tin bài hoạt động" type="application/rss+xml">
<link rel="alternate" href="https://pek.edu.vn/vi/hoat-dong-su-kien/rss/hoat-dong-cua-hoc-sinh/" title="Tin bài hoạt động - Hoạt động của học sinh" type="application/rss+xml">
<link rel="alternate" href="https://pek.edu.vn/vi/hoat-dong-su-kien/rss/hoat-dong-cua-nha-truong/" title="Tin bài hoạt động - Hoạt động của nhà trường" type="application/rss+xml">
<link rel="alternate" href="https://pek.edu.vn/vi/hoat-dong-su-kien/rss/tuyen-truyen-dien-dan-giao-duc/" title="Tin bài hoạt động - Tuyên truyền-diễn đàn giáo dục" type="application/rss+xml">
<link rel="preload" as="font" href="/assets/tms/fonts/fontawesome-webfont.woff2" type="font/woff2" crossorigin>
<link rel="preload" as="image" href="/themes/default/images/header.png" type="image/png">
<link rel="preload" as="script" href="/assets/js/jquery/jquery.min.js?t=1792647660" type="text/javascript">
<link rel="preload" as="script" href="https://pek.edu.vn/assets/js/jquery/jquery.min.js" type="text/javascript">
<link rel="preload" as="script" href="https://pek.edu.vn/assets/js/language/vi.js" type="text/javascript">
<link rel="preload" as="script" href="https://pek.edu.vn/assets/js/DOMPurify/purify.js" type="text/javascript">
<link rel="preload" as="script" href="https://pek.edu.vn/assets/js/global.js" type="text/javascript">
<link rel="preload" as="script" href="https://pek.edu.vn/assets/js/site.js" type="text/javascript">
<link rel="preload" as="script" href="https://pek.edu.vn/themes/default/js/hoat-dong-su-kien.js" type="text/javascript">
<link rel="preload" as="script" href="https://pek.edu.vn/themes/default/js/main.js" type="text/javascript">
<link rel="preload" as="script" href="https://pek.edu.vn/themes/default/js/custom.js" type="text/javascript">
<link rel="preload" as="script" href="https://pek.edu.vn/themes/default/js/tms_menu.js" type="text/javascript">
<link rel="preload" as="script" href="https://pek.edu.vn/assets/tms/js/swiper.js" type="text/javascript">
<link rel="preload" as="script" href="https://pek.edu.vn/assets/tms/js/bootstrap.min.js" type="text/javascript">
<link rel="preload" as="style" href="https://pek.edu.vn/assets/tms/css/font-awesome.min.css" type="text/css">
<link rel="preload" as="style" href="https://pek.edu.vn/assets/tms/css/bootstrap.min.css" type="text/css">
<link rel="preload" as="style" href="https://pek.edu.vn/themes/default/css/style.css" type="text/css">
<link rel="preload" as="style" href="https://pek.edu.vn/themes/default/css/style.responsive.css" type="text/css">
<link rel="preload" as="style" href="https://pek.edu.vn/themes/default/css/custom.css" type="text/css">
<link rel="preload" as="style" href="https://pek.edu.vn/assets/css/default.vi.0.css" type="text/css">
<link rel="preload" as="style" href="https://pek.edu.vn/themes/default/css/tms_menu.css" type="text/css">
<link rel="preload" as="style" href="https://pek.edu.vn/assets/tms/css/swiper.css" type="text/css">
<link rel="stylesheet" href="https://pek.edu.vn/assets/tms/css/font-awesome.min.css">
<link rel="stylesheet" href="https://pek.edu.vn/assets/tms/css/bootstrap.min.css">
<link rel="stylesheet" href="https://pek.edu.vn/themes/default/css/style.css">
<link rel="stylesheet" href="https://pek.edu.vn/themes/default/css/style.responsive.css">
<link rel="stylesheet" href="https://pek.edu.vn/themes/default/css/custom.css">
<link rel="stylesheet" href="https://pek.edu.vn/assets/css/default.vi.0.css">
<link id="theme" rel="stylesheet" type="text/css" media="all" href="https://pek.edu.vn/themes/default/css/tms_menu.css" />
<link href="https://pek.edu.vn/assets/tms/css/swiper.css" type="text/css" rel="stylesheet" />
<style>
  .popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999999999;
  }

  .popup.hidden {
    display: none;
  }

  .popup-content {
    position: relative;
    background: #fff;
    width: 95%;
    height: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
  }
/* Khi màn hình nhỏ hơn hoặc bằng 480px */
@media (max-width: 576px) {
    .popup-content {
        width: 100%;
        height: 100%;
        border-radius: 0; /* Loại bỏ bo góc để full màn hình */
    }
}

  /* Thay đổi tên iframe thành popup-iframe */
  .popup-iframe {
    width: 100%;
    height: 100%;
    border: none;
  }

  .popup-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #d9534f;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    z-index: 10;
  }

  .popup-close-btn:hover {
    background: #c9302c;
  }
  .xpopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999999;
  }
  .xpopup.hidden {
    display: none;
  }

  /* Kích thước mặc định */
  .xpopup-content {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 768px;
    height: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
  }

  /* Các size khác nhau */
  .popup-small { max-width: 400px; height: 50%; }
  .popup-medium { max-width: 768px; height: 90%; }
  .popup-large { max-width: 95%; height: 90%; }

  @media (max-width: 576px) {
    .xpopup-content {
      width: 95%;
      height: 90%;
      border-radius: 8px;
    }
  }

  .xpopup-iframe {
    width: 100%;
    height: 100%;
    border: none;
  }

  .xpopup-close-btn {
  position: absolute; /* Đổi từ relative sang absolute */
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background-color: #f8d7da;
  color: #dc3545;
  font-size: 18px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  z-index: 10; /* Đảm bảo nằm trên iframe */
}

.xpopup-close-btn:hover {
  background-color: #dc3545;
  color: #fff;
  transform: rotate(90deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.xpopup-close-btn:focus {
  outline: none;
}
  /* Link auto mở */
  .xpopup-link-0 {
    display: none;
  }
    body{background: #fff;}
</style>
    </head>
<iframe src="https://pek.edu.vn/nenweb2025/index.html" frameborder="0" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index:-100000;"></iframe>
    <!-- HTML -->
<!-- HTML -->
<div id="iframe-popup" class="popup hidden">
  <div class="popup-content">
    <button id="close-popup" class="popup-close-btn">Đóng</button>
    <!-- Thay đổi id của iframe thành class -->
    <iframe class="popup-iframe" src="" frameborder="0"></iframe>
  </div>
</div>

<!-- CSS -->
<!-- JS -->
  <!-- HTML POPUP MỚI-->
  <div id="xpopup-container" class="xpopup hidden">
  <div class="xpopup-content">
    <button id="xpopup-close-btn" class="xpopup-close-btn"><span aria-hidden="true">&times;</span></button>
    <iframe class="xpopup-iframe" src="" frameborder="0"></iframe>
  </div>
</div>
<div class="container-fluid"style="background-color:#fff;">
<div id="print">
    <div id="hd_print">
        <h2 class="pull-left">PÉTRUS KÝ PRIMARY - HIGH SCHOOL</h2>
        <p class="pull-right"><a title="PÉTRUS KÝ PRIMARY - HIGH SCHOOL" href="https://pek.edu.vn/">https://pek.edu.vn</a></p>
    </div>
    <div class="clear"></div>
    <hr />
    <div id="content">
        <h1>Sinh hoạt ngoại khóa tiếng Anh với chủ đề Around the World</h1>
        <ul class="list-inline">
            <li>Thứ tư - 23/04/2025 22:47</li>
            <li class="hidden-print txtrequired"><em class="fa fa-print">&nbsp;</em><a title="In ra" href="https://pek.edu.vn/#" data-toggle="winCMD" data-cmd="print">In ra</a></li>
            <li class="hidden-print txtrequired"><em class="fa fa-power-off">&nbsp;</em><a title="Đóng cửa sổ này" href="https://pek.edu.vn/#"  data-toggle="winCMD" data-cmd="close">Đóng cửa sổ này</a></li>
        </ul>
        <div class="clear"></div>
        <div id="hometext">
        </div>
        <div id="bodytext" class="clearfix">
            <p style="text-align: justify;">Trong không khí vui tươi của những ngày đầu hè tháng 4/2025, tổ Tiếng Anh khối THCS đã tổ chức một buổi sinh hoạt ngoại khóa đầy sắc màu tại công viên Hiệp Thành 3 với chủ đề “<strong data-end="457" data-start="437">Around the World</strong>”. Chương trình là dịp để các em học sinh khối 7 rời khỏi lớp học quen thuộc, hòa mình vào thiên nhiên và khám phá thế giới qua lăng kính tiếng Anh.</p>

<blockquote>
<p style="text-align: justify;"><strong data-end="613" data-start="607">EN</strong> – In the cheerful atmosphere of early summer, April 2025, the Secondary School English Department held a colorful and engaging extracurricular activity at Hiep Thanh 3 Park, themed “<strong data-end="816" data-start="796">Around the World</strong>.” This special event gave Grade 7 students the chance to step outside the classroom, connect with nature, and explore the world through the lens of English language learning.</p>
</blockquote>

<div class="image-center"><img alt="2" height="1384" src="https://pek.edu.vn/uploads/english/2025_04/2.jpg" width="2048" /></div>

<p style="text-align: justify;"><strong>5 trạm thử thách - 5 chặng hành trình</strong><br />
Với mục tiêu “học mà chơi, chơi mà học”, ban tổ chức đã thiết kế 5 trạm thử thách theo hình thức trải nghiệm thực tế, nhằm giúp học sinh vận dụng linh hoạt kiến thức tiếng Anh đã học. Mỗi trạm là một quốc gia, một nền văn hóa và một phần kỹ năng tiếng Anh được rèn luyện.<br />
<strong data-end="1411" data-start="1380">Trạm 1: Vocabulary Matching</strong> – Các em ghép từ vựng với định nghĩa chính xác, đồng thời khám phá các từ khóa liên quan đến quốc gia mình đại diện.<br />
<strong data-end="1557" data-start="1531">Trạm 2: Grammar Puzzle</strong> – Các em xếp mảnh ghép ngữ pháp để hoàn chỉnh câu đúng, phát huy khả năng tư duy logic.<br />
<strong data-end="1679" data-start="1648">Trạm 3: Picture Description</strong> – Học sinh rèn luyện kỹ năng nói qua việc miêu tả tranh ảnh về danh lam thắng cảnh, món ăn và phong tục đặc trưng.<br />
<strong data-end="1825" data-start="1797">Trạm 4: Interactive Quiz</strong> – Kiến thức tổng hợp được kiểm tra qua trò chơi trắc nghiệm sôi động, thúc đẩy tinh thần đồng đội.<br />
<strong data-end="1954" data-start="1927">Trạm 5: Creative Poster</strong> – Các nhóm thiết kế poster sáng tạo giới thiệu về một đất nước bằng tiếng Anh, kết hợp yếu tố nghệ thuật và kỹ năng trình bày.<br />
<strong>Học dưới bóng cây - học từ trải nghiệm</strong><br />
Được tổ chức tại công viên, chương trình đã mang lại một môi trường học tập lý tưởng – không gian mở, không khí trong lành và sự hòa mình với thiên nhiên. Thay vì ngồi học trong lớp, các em được vận động, tương tác nhóm và thực hành ngôn ngữ trong tình huống thực tế. Điều này không chỉ giúp kiến thức “thấm” sâu hơn mà còn tăng cường sự tự tin khi sử dụng tiếng Anh trong giao tiếp.</p>

<blockquote>
<p style="text-align: justify;">5 CHALLENGING STATIONS – 5 LEARNING JOURNEYS<br />
<strong data-end="2089" data-start="2083">EN</strong> – With the motto “learning through play,” the organizers designed five experiential challenge stations. Each station represented a country and focused on a specific English skill:<br />
<strong data-end="2307" data-start="2273">Station 1: Vocabulary Matching</strong> – Students matched vocabulary with definitions and explored key words related to their assigned country.<br />
<strong data-end="2444" data-start="2415">Station 2: Grammar Puzzle</strong> – Students completed grammar puzzles, enhancing their logical thinking.<br />
<strong data-end="2553" data-start="2519">Station 3: Picture Description</strong> – Students practiced speaking skills by describing cultural landmarks, foods, and customs.<br />
<strong data-end="2678" data-start="2647">Station 4: Interactive Quiz</strong> – A dynamic quiz tested general knowledge and encouraged team collaboration.<br />
<strong data-end="2788" data-start="2758">Station 5: Creative Poster</strong> – Groups created posters introducing a country in English, showcasing creativity and presentation skills.<br />
<br />
LEARNING UNDER THE TREES – LEARNING THROUGH EXPERIENCE<br />
Held in a spacious green park, the program provided an ideal learning environment. Instead of sitting in classrooms, students moved around, worked in groups, and practiced English in real-life contexts. This approach not only reinforced learning but also boosted their confidence in using English to communicate.</p>
</blockquote>

<div class="image-center"><img alt="492835858 1110246981120446 434599122201583104 n" height="1474" src="https://pek.edu.vn/uploads/english/2025_04/492835858_1110246981120446_434599122201583104_n.jpg" width="2048" /></div>

<div class="image-center"><img alt="7" height="1518" src="https://pek.edu.vn/uploads/english/2025_04/7.jpg" width="2048" /></div>

<div class="image-center"><img alt="4" height="1573" src="https://pek.edu.vn/uploads/english/2025_04/4.jpg" width="2048" /></div>

<div class="image-center"><img alt="3" height="1365" src="https://pek.edu.vn/uploads/english/2025_04/3.jpg" width="2048" /></div>

<p style="text-align: justify;"><strong>Khép lại một hành trình - mở ra một khát vọng.</strong><br />
Buổi sinh hoạt khép lại trong tiếng cười, những cái bắt tay và ánh mắt lấp lánh niềm vui. Hơn cả một hoạt động học tập, đây là hành trình giúp học sinh mở rộng tầm nhìn, nuôi dưỡng tình yêu với ngôn ngữ và thế giới xung quanh.</p>

<blockquote>
<p style="text-align: justify;">CLOSING A JOURNEY – OPENING A NEW ASPIRATION<br />
<strong data-end="4891" data-start="4885">EN</strong> – The event ended with laughter, handshakes, and sparkling eyes full of excitement. More than just a learning activity, this was a journey that broadened students’ horizons and nurtured their love for language and the world beyond.</p>
</blockquote>

<div class="image-center"><img alt="8" height="1365" src="https://pek.edu.vn/uploads/english/2025_04/8.jpg" width="2048" /></div>

<div class="image-center"><img alt="1" height="1295" src="https://pek.edu.vn/uploads/english/2025_04/1.jpg" width="2048" /></div>
        </div>
    </div>
    <div id="footer" class="clearfix">
        <div id="url">
            <strong>URL của bản tin này: </strong><a href="https://pek.edu.vn/vi/hoat-dong-su-kien/savefile/hoat-dong-cua-hoc-sinh/sinh-hoat-ngoai-khoa-tieng-anh-voi-chu-de-around-the-world-83.html" title="Sinh hoạt ngoại khóa tiếng Anh với chủ đề Around the World">https://pek.edu.vn/vi/hoat-dong-su-kien/savefile/hoat-dong-cua-hoc-sinh/sinh-hoat-ngoai-khoa-tieng-anh-voi-chu-de-around-the-world-83.html</a>

        </div>
        <div class="clear"></div>
        <div class="copyright">
            &copy; PÉTRUS KÝ PRIMARY - HIGH SCHOOL
        </div>
        <div id="contact">
            <a href="mailto:pek@pek.edu.vn">pek@pek.edu.vn</a>
        </div>
    </div>
</div>

</div>
        <!-- Captcha-Modal Required!!! -->
        <div id="modal-img-captcha" class="modal fade" tabindex="-1" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <div class="modal-title">Xác minh bạn không phải là Robot</div>
                    </div>
                    <div class="modal-body text-center">
                        <div class="margin-bottom">
                            <img class="captchaImg mr-1" src="https://pek.edu.vn/assets/images/pix.svg" width="150" height="40" alt="" title="" /><span class="pointer" data-toggle="change_captcha" data-obj="#modal-captcha-value" title="Thay mới"><em class="fa fa-refresh"></em></span>
                        </div>
                        <div class="margin-bottom">
                            <div>
                                <p>Mã bảo mật</p>
                                <p><input type="text" id="modal-captcha-value" value="" class="form-control display-inline-block required" maxlength="6" style="width:200px" data-toggle="enterToEvent" data-obj="#modal-captcha-button" data-obj-event="click"/></p>
                                <div class="invalid-feedback"></div>
                            </div>
                        </div>
                        <p><button type="button" id="modal-captcha-button" class="btn btn-primary">Xác nhận</button></p>
                    </div>
                </div>
            </div>
        </div>
        <div id="timeoutsess" class="chromeframe">
            Bạn đã không sử dụng Site, <a data-toggle="timeoutsesscancel" href="https://pek.edu.vn/#">Bấm vào đây để duy trì trạng thái đăng nhập</a>. Thời gian chờ: <span id="secField"> 60 </span> giây
        </div>
        <div id="openidResult" class="nv-alert" style="display:none"></div>
        <div id="openidBt" data-result="" data-redirect=""></div>
<script src="https://pek.edu.vn/assets/js/jquery/jquery.min.js"></script>
<script>var nv_base_siteurl="/",nv_assets_dir="assets",nv_lang_data="vi",nv_lang_interface="vi",nv_name_variable="nv",nv_fc_variable="op",nv_lang_variable="language",nv_module_name="hoat-dong-su-kien",nv_func_name="savefile",nv_is_user=0, nv_my_ofs=-4,nv_my_abbr="EDT",nv_cookie_prefix="nv4",nv_check_pass_mstime=59878000,nv_area_admin=0,nv_safemode=0,theme_responsive=1,nv_recaptcha_ver=2,nv_recaptcha_sitekey="",nv_recaptcha_type="image",XSSsanitize=1;</script>
<script src="https://pek.edu.vn/assets/js/language/vi.js"></script>
<script src="https://pek.edu.vn/assets/js/DOMPurify/purify.js"></script>
<script src="https://pek.edu.vn/assets/js/global.js"></script>
<script src="https://pek.edu.vn/assets/js/site.js"></script>
<script src="https://pek.edu.vn/themes/default/js/hoat-dong-su-kien.js"></script>
<script src="https://pek.edu.vn/themes/default/js/main.js"></script>
<script src="https://pek.edu.vn/themes/default/js/custom.js"></script>
<script type="application/ld+json">

        {

            "@context": "https://schema.org",

            "@type": "Organization",

            "url": "https://pek.edu.vn",

            "logo": "https://pek.edu.vn/uploads/logo_web1.png"

        }

        </script>
<script type="text/javascript" src="https://pek.edu.vn/themes/default/js/tms_menu.js"></script>
<script type="text/javascript" src="https://pek.edu.vn/assets/tms/js/swiper.js"></script>
<script>
  // Hiển thị popup với URL được truyền vào
  function showIframePopup(url) {
    const iframe = document.querySelector('.popup-iframe'); // Thay đổi id thành class
    iframe.src = url; // Gán URL cho iframe
    document.getElementById('iframe-popup').classList.remove('hidden');
  }

  // Đóng popup
  function closeIframePopup() {
    // Gửi tín hiệu đến iframe để yêu cầu đăng xuất
    const iframe = document.querySelector('.popup-iframe');
    if (iframe && iframe.contentWindow) {
        iframe.contentWindow.postMessage({ action: "logout" }, "*");
    }

    // Đóng popup
    document.getElementById('iframe-popup').classList.add('hidden');

    // Xóa URL trong iframe để giải phóng tài nguyên
    iframe.src = '';
}
  // Gắn sự kiện cho nút Đóng
  document.getElementById('close-popup').addEventListener('click', closeIframePopup);

  // Gắn sự kiện cho các liên kết trong menu
  document.addEventListener('DOMContentLoaded', function () {
    const popupLinks = document.querySelectorAll('.popup-link');
    popupLinks.forEach(function (link) {
      link.addEventListener('click', function (e) {
        e.preventDefault(); // Ngăn chuyển hướng trang
        const url = link.getAttribute('data-url'); // Lấy URL từ thuộc tính data-url
        showIframePopup(url); // Hiển thị popup với URL tương ứng
      });
    });
  });

  // Lắng nghe sự kiện nhấn phím Esc để đóng popup
  document.addEventListener('keydown', function (e) {
    if (e.key === 'Escape') { // Kiểm tra nếu phím được nhấn là Esc
      closeIframePopup();
    }
  });
</script>
<script>
  function showXPopup(url, sizeClass) {
    const content = document.querySelector('.xpopup-content');
    const iframe = document.querySelector('.xpopup-iframe');

    // Xóa kích thước cũ
    content.classList.remove('popup-small', 'popup-medium', 'popup-large');

    // Thêm kích thước mới
    if (sizeClass) content.classList.add(sizeClass);

    iframe.src = url;
    document.getElementById('xpopup-container').classList.remove('hidden');
  }

  function closeXPopup() {
    const iframe = document.querySelector('.xpopup-iframe');
    if (iframe && iframe.contentWindow) {
      iframe.contentWindow.postMessage({ action: "logout" }, "*");
    }
    document.getElementById('xpopup-container').classList.add('hidden');
    iframe.src = '';
  }

  document.getElementById('xpopup-close-btn').addEventListener('click', closeXPopup);

  document.addEventListener('DOMContentLoaded', function () {
    const navType = performance.getEntriesByType("navigation")[0]?.type || performance.navigation.type;

    // ==== Auto mở nếu không phải reload ====
    if (
      (typeof navType === 'string' && navType !== 'reload') || 
      (typeof navType === 'number' && navType !== 1)
    ) {
      if (!sessionStorage.getItem('hasShownPopup')) {
        const autoLink = document.querySelector('.xpopup-link-0');
        if (autoLink) {
          const url = autoLink.getAttribute('data-url');
          const size = autoLink.getAttribute('data-size') || 'medium';
          if (url) {
            setTimeout(function () {
              showXPopup(url, 'popup-' + size);
            }, 3000);
            sessionStorage.setItem('hasShownPopup', 'true');
          }
        }
      }
    }

    // ==== Gắn sự kiện mở popup thủ công ====
    document.querySelectorAll('.xpopup-link').forEach(function(link) {
      link.addEventListener('click', function(e) {
        e.preventDefault();
        const url = link.getAttribute('data-url');
        const size = link.getAttribute('data-size') || 'medium';
        showXPopup(url, 'popup-' + size);
      });
    });
  });

  // Đóng popup bằng ESC
  document.addEventListener('keydown', function (e) {
    if (e.key === 'Escape') {
      closeXPopup();
    }
  });
</script>
<script>
// === Nhận message từ iframe ===
window.addEventListener('message', function(event) {
  if (!event.data || typeof event.data !== 'object') return;

  // --- MỞ POPUP MỚI ---
  if (event.data.action === 'showXPopup') {
    closeXPopup?.(); // đóng popup cũ nếu có

    const popupSize = event.data.size || 'popup-medium';
    showXPopup(event.data.url, popupSize);
  }

  // --- CẬP NHẬT POPUP ĐANG MỞ ---
  else if (event.data.action === 'updateXPopup') {
    const popup = document.querySelector('.xpopup');
    const iframe = popup?.querySelector('iframe');
    const popupContent = popup?.querySelector('.xpopup-content');

    if (popup && iframe) {
      // chỉ đổi nội dung, không đóng overlay
      iframe.src = event.data.url;

      // nếu có kích thước mới, đổi class luôn
      if (event.data.size) {
        popupContent.classList.remove('popup-small', 'popup-medium', 'popup-large');
        popupContent.classList.add(event.data.size);
      }
    }
  }
});

// === Hàm mở popup ===
function showXPopup(url, size = 'popup-medium') {
  const popup = document.querySelector('.xpopup');
  const popupContent = popup.querySelector('.xpopup-content');
  const iframe = popup.querySelector('iframe');

  // reset kích thước & src
  popupContent.classList.remove('popup-small', 'popup-medium', 'popup-large');
  popupContent.classList.add(size);
  iframe.src = url;

  popup.classList.remove('hidden'); // hiện popup + overlay
}

// === Hàm đóng popup ===
function closeXPopup() {
  const popup = document.querySelector('.xpopup');
  const iframe = popup.querySelector('iframe');
  iframe.src = ''; // clear để ngắt nội dung
  popup.classList.add('hidden'); // ẩn popup
}

// Nút đóng
document.addEventListener('DOMContentLoaded', () => {
  document.querySelector('.xpopup-close')?.addEventListener('click', closeXPopup);
});
</script>
<script src="https://pek.edu.vn/assets/tms/js/bootstrap.min.js"></script>
</body>
</html>