diff --git a/css/base.css b/css/base.css index 0a16d2d..8683964 100644 --- a/css/base.css +++ b/css/base.css @@ -33,7 +33,11 @@ img { } a { - color: var(--accent-yellow); + color: inherit; +} + +nav a, footer a { + color: black; text-decoration: none; } @@ -55,30 +59,44 @@ main h1 { main h2 { position: relative; - margin: 4% auto; + margin: 12% auto 5% auto; text-align: center; - font-size: clamp(1.5em, 4vw, 3em); + font-size: clamp(1.5em, 12vw, 4em); font-family: segoesc; } +main h2:first-of-type { + font-size: clamp(1.5em, 5vw, 5em); + margin: 1em auto 0.5em auto; +} + main h3 { position: relative; - text-align: center; margin: auto; width: 100%; - font-size: clamp(2em, 4vw, 4em); + font-size: clamp(1.8em, 3vw, 4em); margin-top: 5%; + margin-bottom: 2%; + font-weight: lighter; + text-align: center; +} + +main section h3 { + text-align: left; +} + +main h4 { + margin: 0.8em 0; } main p { - margin: 1%; - padding: 1%; - /* border: solid 1px; */ - opacity: 0.90; + margin: 0 0 min(1em, 2%) 1%; display: inline-block; z-index: 3; - background-color: black; +} +main p:last-child { + margin-bottom: 0; } section { @@ -89,9 +107,14 @@ section { margin: auto; margin-bottom: 100px; padding: 2%; - padding-left: 0px; + padding-left: min(1em, 2%); z-index: 1000; box-shadow: -5px 5px 0px var(--accent-yellow), -10px 10px 0px var(--accent-orange), -15px 15px 0px var(--accent-violet); + background-color: #000000b8; +} + +section :is(h1, h2, h3, h4, h5, h6) { + line-height: 1em; } nav, footer, aside { @@ -139,15 +162,21 @@ main > img { object-fit: scale-down; } +figcaption { + font-size: 0.6em; + line-height: initial; +} + .btn-nice { color: #FFFFFF; - text-shadow: -5px 5px 0px var(--accent-orange), -10px 10px 0px var(--accent-violet); + text-shadow: -2px 2px 0px var(--accent-orange), -4px 4px 0px var(--accent-violet); color: var(--accent-yellow); font-size: 1.2em; text-align: center; margin: auto; position: relative; display: block; + font-weight: bold; } #camp { @@ -163,3 +192,23 @@ main > img { margin-right: 10%; line-height: 0.5em; } + +code { + background: #ffffff1f; + padding: 0.2em 0.4em; + border-radius: 0.2em; + margin-right: 0.5ex; +} + +.btn-nice code { + background: none; + padding: 0; + margin-right: 0; +} + +@media (max-width: 500px) { + /* Hide stickers on mobile */ + .randomStart { + display: none; + } +} \ No newline at end of file diff --git a/css/home.css b/css/home.css index f637eb9..91028e9 100644 --- a/css/home.css +++ b/css/home.css @@ -15,4 +15,44 @@ justify-content: center; align-items: center; height: 200px; -} \ No newline at end of file +} + +/* Barre de progression */ + +.progression { +animation: 3s loadbar; +width:auto; +background-color: white; +display: inline-block; +padding: 0.7em 0.5em 0.5em 0.5em; +text-wrap: nowrap; +} + +@keyframes loadbar { + 0% { width:0%; } +} + +.bar { +width : 50%; +margin : auto; +border : 2px solid white; +display: inline-block; +} +.progression > span { + +display: inline-block; +width: 100%; +font-family: MonTrappist; +font-size : 1.5em; +} + +.lessthanhalf span { + padding-left: 100%; + color: white; + padding-left: calc(100% + 1em); +} + +.morethanhalf { +text-align : end; +color:black; +} diff --git a/guide.template.html b/guide.template.html index f5a33db..7c88b2c 100644 --- a/guide.template.html +++ b/guide.template.html @@ -26,20 +26,20 @@ BISOUS
- - - - + + + + - - - - + + + + - - - - + + + +

camp diff --git a/index.html b/index.html index 626f0dc..7979449 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,5 @@ - + + @@ -7,6 +8,7 @@ + Camp Interhack @@ -19,20 +21,15 @@
- - - - + + + + - - - - - - - - - + + + +

camp @@ -84,8 +81,18 @@ Seule exigence, respecter toutes les marginalités, originalités, bizarreries et normaleries de chacun·es.

- - +

+ Où en est-on ? +

+
+

Il y a

+
?/200
+

places déjà réservées. Ouverture prochaine des inscriptions !

+
+

Et nous avons reçu

+
? %
+

des dons dont nous avons besoin (voir le détail des comptes)

+

Iels y participent

@@ -123,4 +130,5 @@ + diff --git a/js/progress.js b/js/progress.js new file mode 100644 index 0000000..ea1bdf2 --- /dev/null +++ b/js/progress.js @@ -0,0 +1,91 @@ +const gauge_url = "https://api.camp.interhacker.space/api/gauge" +const fundraising_url = "https://api.camp.interhacker.space/api/fundraising" +const gaugeMax = 250; +const fundraisingTotalMax = 20000; + +async function getGauge() { + // REMOVE WHEN SIGNUP FORM IS OPEN + return 0; + + try { + const response = await fetch(gauge_url); + if (!response.ok) { + throw new Error(`Response status: ${response.status}`); + } + + const result = await response.json(); + + return result.gauge + } catch (error) { + console.error(error.message); + + return null; + } +} + +async function getFundraisingTotal() { + try { + const response = await fetch(fundraising_url); + if (!response.ok) { + throw new Error(`Response status: ${response.status}`); + } + + const result = await response.json(); + + return result.total + } catch (error) { + console.error(error.message); + + return null; + } +} + +function percentRatio(ratio) { + return Math.floor(ratio * 100); +} + +function setAboveHalf(ratio, element) { + if (ratio > 0.5) { + element.classList.remove("lessthanhalf"); + element.classList.add("morethanhalf"); + } +} + +async function setGauge() { + const gauge = await getGauge(); + + if (gauge !== null) { + const gaugeBar = document.getElementById("gauge-bar"); + const gaugeText = document.getElementById("gauge-text"); + + const gaugeRatio = gauge / gaugeMax; + + gaugeBar.style.setProperty("width", percentRatio(gaugeRatio) + "%"); + gaugeText.innerText = gauge + "/" + gaugeMax; + + setAboveHalf(gaugeRatio, gaugeBar); + } +} + +async function setFundraisingTotal() { + const fundraising_total = await getFundraisingTotal(); + + if (fundraising_total !== null) { + const fundraisingBar = document.getElementById("fundraising-bar"); + const fundraisingText = document.getElementById("fundraising-text"); + + const fundraisingRatio = fundraising_total / fundraisingTotalMax; + + fundraisingBar.style.setProperty("width", percentRatio(fundraisingRatio) + "%"); + fundraisingText.innerText = percentRatio(fundraisingRatio) + " %"; + + setAboveHalf(fundraisingRatio, fundraisingBar); + } +} + +async function setProgress() { + setGauge(); + setFundraisingTotal(); +} + +document.addEventListener("DOMContentLoaded", setProgress);