Skip to content

Commit

Permalink
fix: countdown props
Browse files Browse the repository at this point in the history
  • Loading branch information
robsongajunior committed Oct 18, 2023
1 parent 34797ca commit 2297b5a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
21 changes: 14 additions & 7 deletions 2023/_buildwithastro/src/components/Countdown.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
---
const eventDate = 'december 02, 2023';
interface Props {
eventDate: string;
}
const { eventDate } = Astro.props;
---

<div class="countdown-content">
<div class="countdown-content" eventDate={eventDate}>
<ul class="countdown">
<li class="countdown-day">
<span id="day">00</span>
Expand Down Expand Up @@ -51,9 +55,15 @@ const eventDate = 'december 02, 2023';
}

setInterval(function () {
let c = countdown('december 02, 2023');
let coundowncontent = document.querySelectorAll('.countdown')[0];
let eventDate = document.querySelectorAll('[eventDate]')[0]?.getAttribute('eventDate');

if(!eventDate) {
return;
};

let coundowncontent = document.querySelectorAll('.countdown')[0];
let c = countdown(eventDate);

coundowncontent.querySelector('#day').innerHTML = c.days;
coundowncontent.querySelector('#hour').innerHTML = c.hours;
coundowncontent.querySelector('#minutes').innerHTML = c.minutes;
Expand All @@ -63,9 +73,6 @@ const eventDate = 'december 02, 2023';
</script>

<style lang="scss" scoped>
@import "../styles/helpers";
@import "../styles/settings";

.countdown-content {
position: absolute;
left: 2rem;
Expand Down
2 changes: 1 addition & 1 deletion 2023/_buildwithastro/src/components/Hero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const c4pURL = 'https://forms.gle/1ARUc7nHxkyXsdZ58';
</div>
</div>

<Countdown />
<Countdown eventDate="december 02, 2023"/>
</header>

<style lang="scss">
Expand Down
19 changes: 2 additions & 17 deletions 2023/_buildwithastro/src/components/Schedule.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="wrapper">
<h2 class="section-title section-title-highlight">Programação</h2>
<p>
Entre no Discord da Azion para ficar sabendo sobre os próximos palestrantes em primeira mão.
Entre no Discord da Azion para acompanhar e ficar sabendo sobre os próximos palestrantes em primeira mão.
<br>
<a
href="https://discord.gg/S34PzD3gFS"
Expand All @@ -11,22 +11,7 @@
target="_blank"
data-astro-cid-v2cbyr3p="">
<span class="call-action-text" data-astro-cid-v2cbyr3p="">
<svg width="48px" height="48px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>discord_line</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Logo" transform="translate(-480.000000, -96.000000)" fill-rule="nonzero">
<g id="discord_line" transform="translate(480.000000, 96.000000)">
<path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero">

</path>
<path d="M15.0032,4 C15.2619,4 15.5872,4.06833 15.8484,4.13172 C16.7581,4.35245 17.837,4.62534 18.6032,5.19999 C19.3162,5.73471 19.8701,6.66836 20.2976,7.61613 C21.1883,9.59078 21.8068,12.2238 22.021,14.2256 C22.1228,15.1766 22.1484,16.1321 21.9648,16.7747 C21.8743,17.0912 21.6797,17.3288 21.5425,17.4743 C21.1246429,17.9175286 20.5867367,18.2487163 20.0552959,18.550044 L19.7907,18.6986 C19.618675,18.794725 19.4422188,18.8900812 19.2661281,18.9830547 L18.74375,19.2532125 L18.74375,19.2532125 L18.0272551,19.610458 L18.0272551,19.610458 L17.4504,19.8944 L17.4504,19.8944 C16.9565,20.1414 16.3558,19.9412 16.1088,19.4472 C15.9139,19.0574 15.9975,18.6011 16.2842,18.3046 L15.8498,17.4359 C14.6764,17.8001 13.369,17.9999 11.9999,17.9999 C10.6308,17.9999 9.32337,17.8001 8.14996,17.4359 L7.71679,18.3023 C8.00534,18.5987 8.08992,19.0563 7.89448,19.4472 C7.64749,19.9412 7.04682,20.1414 6.55284,19.8944 L6.0092,19.6247 C5.40514,19.326 4.80125,19.0275 4.21253,18.6986 C3.59915,18.356 2.94824,17.9914 2.46079,17.4743 C2.32361,17.3288 2.12894,17.0912 2.03851,16.7747 C1.85493,16.1321 1.88051,15.1766 1.98227,14.2256 C2.19645,12.2238 2.81496,9.59078 3.70567,7.61613 C4.13319,6.66836 4.68708,5.73471 5.40007,5.19999 C6.1663,4.62534 7.24521,4.35245 8.15486,4.13172 C8.41608,4.06833 8.74137,4 9.00004,4 C9.55232,4 10,4.44772 10,5 C10,5.05003 9.99636,5.09921 9.98927,5.14727 C10.6366,5.05075 11.3099,5 12.0001,5 C12.6914,5 13.3657,5.05092 14.0141,5.14776 C14.0069,5.09954 14.0032,5.0502 14.0032,5 C14.0032,4.44772 14.451,4 15.0032,4 Z M16.3574,6.36276 C16.20725,6.31506 16.1705,6.33631687 16.1176344,6.4257375 L16.0546,6.53785 L16.0546,6.53785 C15.7151,7.12398 15.0435,7.38999 14.4197,7.25419 C13.6666,7.09025 12.8522,7.00007 12,7.00007 C11.1477,7.00007 10.3333,7.09025 9.58022,7.25419 C8.95641,7.38999 8.28475,7.12398 7.94534,6.53785 L7.88287734,6.42657062 C7.83049313,6.33756812 7.7940825,6.3156325 7.64529,6.36289 C7.28935,6.47596 6.90712,6.59738 6.60046,6.79976 C6.31343,7.01503 5.92929,7.55042 5.52868,8.43856 C4.76306,10.1359 4.16287,12.6434 3.97082,14.4384 C3.93022909,14.8177636 3.90999562,15.1425612 3.90458897,15.410595 L3.90486391,15.7048483 C3.90931983,15.8826653 3.92184909,16.0235909 3.93962,16.1265 C4.193724,16.37474 4.5079112,16.570308 4.82285104,16.7491464 L5.50542875,17.125525 L5.50542875,17.125525 L5.95132,17.3609 L6.31538,16.6328 C6.0008,16.3379 5.90272,15.8606 6.10573,15.4554 C6.35312,14.9616 6.95396,14.7619 7.44774,15.0093 C8.66373,15.6185 10.2463,16 11.9998,16 C13.7533,16 15.3359,15.6185 16.5519,15.0093 C17.0456,14.7619 17.6465,14.9616 17.8939,15.4554 C18.0784455,15.8237636 18.0141479,16.251714 17.7645687,16.5480416 L17.6842,16.6328 L18.049,17.3624 C18.3468,17.2089 18.646,17.0463 18.9456,16.8803 C19.3351,16.6644 19.7458,16.4368 20.0634,16.1265 C20.0811818,16.0235909 20.0937273,15.8826653 20.0981994,15.7048483 L20.098498,15.410595 C20.0931099,15.1425612 20.0728909,14.8177636 20.0323,14.4384 C19.8402,12.6434 19.24,10.1359 18.4744,8.43856 C18.0738,7.55042 17.6902,7.01534 17.4031,6.80008 C17.0962,6.59748 16.7136,6.47595 16.3574,6.36276 Z M8.75,10.5 C9.7165,10.5 10.5,11.2835 10.5,12.25 C10.5,13.2165 9.7165,14 8.75,14 C7.7835,14 7,13.2165 7,12.25 C7,11.2835 7.7835,10.5 8.75,10.5 Z M15.25,10.5 C16.2165,10.5 17,11.2835 17,12.25 C17,13.2165 16.2165,14 15.25,14 C14.2835,14 13.5,13.2165 13.5,12.25 C13.5,11.2835 14.2835,10.5 15.25,10.5 Z" id="形状" fill="#09244B">

</path>
</g>
</g>
</g>
</svg>
Entrar
Acompanhar
</span>
</a>
</p>
Expand Down

0 comments on commit 2297b5a

Please sign in to comment.