文章内容:
为什么选择它
${mdm_html(data_joueur.cdm_oui)}
为什么要排除它呢?
${mdm_html(data_player.cdm_non)}
`; // 左领结束 myinfos += ''; /* 在 EDF 中 */ let ms = data_joueur["选择中的匹配项"];我的信息 += `在法国队
匹配${ms > 1 ? "s" : ""} 玩了 ${ms > 1 ? “s”:“”}: $ {ms}
`;我的信息 += `最后选择: ${可读日期}
`;我的信息 += `你的选择 :
${is_holder? “取消选择”:“选择”}
`; infobox.style.display = "内联块"; //overlay.style.display = "block"; infobox.innerHTML = myinfo; if (!isMobile) { infobox.style.top = footeux_elt.getBoundingClientRect().top - document.querySelector("#nosvingttrois").getBoundingClientRect().top + footeux_elt.getBoundingClientRect().height + 20 + "px"; } const select_btn = infobox.querySelector(".titu"); select_btn.addEventListener("click", (e) => { select_player( +select_btn.dataset.id, "ti", select_btn.dataset.titu === "true" ); e.stopPropagation(); }); const cross = document.querySelector(".close-content"); cross.addEventListener("click", () => { close_infobox(); e.stopPropagation(); }); e.stopPropagation(); }); }); // 选择玩家 function select_player(player_id, type, is_owner) { const player = footix[player_id]; const player_elt = document.querySelector( ".footeux[data-id='" + player_id + "']" ); if (is_holder) { 玩家[玩家位置][类型] = 玩家[玩家位置][类型].filter( (id) => id !== player_id); player_elt.classList.remove("已选择"); n_total_players--; infobox.querySelector(".titu").textContent = "选择"; infobox.querySelector(".titu").classList.remove("current"); infobox.querySelector(".titu").dataset.titu = "false"; } else { if (players[player.position][type].length 1 ? maxima[player.position].plur: maxima[player.position].sing); } function go_to_next_post(post) { if (n_total_players == n_max_players) { document.querySelector("#we send").classList.remove("disabled_btn"); } document .querySelector("#we send") .scrollIntoView({behavior: "smooth" });返回;让 next_poste = "atta"; switch (position) { case "gard": for (let p of ["defe", "mili", "atta"]) { if (players[p]["ti"].length { const player_list =generateTeam() ; History.pushState({}, "", window.location.href + "?selection=" + player_list(",") );函数generateTeam() { document.querySelector("#result").style.display = "block"; document.querySelector("#result").scrollIntoView({ 行为: "平滑" }); document.querySelector("#nosvingttrois").style.display = "无";让玩家列表 = []; for (让 Object.keys(players) 的位置) {player_list =player_list.concat(players[position].ti); constplayers_position=players[position].ti; for (让玩家位置的玩家id) { const 玩家= footix[玩家id]; const photo = "//assets-decoders.lemonde.fr/decoders/assets/cdm2022/" + slugify(player.name) + "_" + slugify(player.firstname).slice(0, 2) + ".jpg ”; let html = '"; if (player.position == "gard") { document.querySelector("#resultat .gard .selectionnes").innerHTML += html; } else if (player.position == "defe") { document.querySelector("#resultat .defe .selectionnes").innerHTML += html; } else if (player.position == "mili") { document.querySelector("#resultat .mili .selectnes").innerHTML + = html; } else if (player.post == "atta") { document.querySelector("#result .atta .selected").innerHTML += } } } return list_players; ) { document.querySelector(".overcoat" ).style.display = "block"; document.querySelector( "#alert" ).textContent = `您已经选择了太多 ${maxima[post].plur}` } document.querySelector(".overcoat") .addEventListener("click", () => { document.querySelector(".overcoat").style.display = "none"; }); // 结果 document.querySelector( "#start Again").addEventListener(" click", () => { History.pushState({}, "", window.location.href.split("?")[0]); reset(); document .querySelector("#nosvingttrois") .scrollIntoView ({ 行为:“平滑”}); }); document.querySelector("#twitterbouton").addEventListener("click", () => { const text = "这是我选择的参加 2024 年欧洲杯的法国队 26 名球员,请使用解码器编写您的选择" ; window. open( getTwitterShareLink({ text, url: window.location.href, hashtags: ["euro2024", "edf", "decoders"], via: "lemondefr", }), "_blank" ); open(url_share, " _空白的”); function getTwitterShareLink({ text, url, hashtags, via }) { // Twitter 共享的基本 URL const baseURL = "https://twitter.com/intent/tweet"; // 通过编码来准备 URL 参数 const params = new URLSearchParams({ text: text, url: url, hashtags:encodeURI(hashtags.join(",")), via:encodeURIComponent(via), }); // 将基本 URL 与查询参数连接起来 return `${baseURL}?${params.toString()}`; } function getWhatsAppShareLink({ text, url }) { // WhatsApp 共享的基本 URL const baseURL = "https://api.whatsapp.com/send"; // 通过将 URL 附加到文本来构造消息 const message = `${text}\n${url}`; // 通过编码来准备 URL 参数 const params = new URLSearchParams({ text: message, }); // 将基本 URL 与查询参数连接起来 return `${baseURL}?${params.toString()}`; } document.querySelector("#whatsappbouton").addEventListener("click", () => { const text = "这是我选择的参加 2024 年欧洲杯的法国队 26 名球员,请使用解码器编写您的选择"; window .open( getWhatsAppShareLink({ text, url: window.location.href }), "_blank" ); // document.querySelector("#facebookbouton").addEventListener("click", () => { // window.open( // "https://www.facebook.com/sharer/sharer.php?u= " + window.location.href, // "_blank" // ); // }); document.querySelector("#copylink").addEventListener("click", () => { navigator.clipboard.writeText(window.location.href); document.querySelector("#copylink").classList.add("vertclair "); setTimeout(() => { document.querySelector("#copylink").classList.remove("lightgreen"); }, 500); });文档 .querySelector("#nosvingttrois") .addEventListener("click", close_infobox); // 从 URL 生成 functiongenerateTeamFromURL() { const url = new URL(window.location.href); const params = new URLSearchParams(url.search); const 选择 = params.get("选择"); if (选择) { const Selection_array = Selection.split(","); console.log(“选择”,选择数组); Selection_array.forEach((id) => { const footeux_elt = document.querySelector( ".footeux[data-id='" + id + "']" ); if (footeux_elt) { select_joueur(id, "ti", false ); } else { console.warn(`玩家 ${id} 不存在!`)生成团队(); document.querySelector("#start Again").textContent = "进行我自己的选择"; } }generateTeamFromURL(); // UTILS function formatDateFrench(dateString) { const Months = [ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月 十一月 十二月",]; const [日、月、年] = dateString.split("/"); const 月份名称 = 月份[parseInt(月份, 10) - 1];让dayStr = +day; if (dayStr === 1) { dayStr = "1st"; } return mdm_html(`${dayStr} ${monthName} ${year}`); } 函数 slugify(str) { str = str.replace(/^\s+|\s+$/g, ""); // 修剪 str = str.toLowerCase(); // 删除重音符号,将 à 替换为 n 等 var from = "àáäâèéëêìíïïòóöôùúüûñç·/_,:;"; var to = "aaaaeeeeiiiiooooouuuunc-----"; for (var i = 0, l = from.length; i
分类:
标签:
留言