Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
deploy: 56116ed
Browse files Browse the repository at this point in the history
  • Loading branch information
eoussama committed Jan 12, 2024
1 parent 08849d9 commit 9685e1d
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 7 deletions.
12 changes: 10 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
href="styles/table.css"
>

<link
rel="stylesheet"
href="styles/maximize.css"
>

<link
rel="stylesheet"
href="styles/particles.css"
Expand Down Expand Up @@ -133,7 +138,7 @@ <h5 class="card-title">Recovered</h5>
</div>

<div class="row gap-4 mt-md-5 mt-4">
<div class="col">
<div class="col maximizeable">
<div
data-aos="fade-right"
data-aos-delay="400"
Expand Down Expand Up @@ -174,7 +179,7 @@ <h5 class="card-title">Yearly Stats</h5>
</div>
</div>

<div class="col">
<div class="col maximizeable">
<div
data-aos="fade-left"
data-aos-delay="600"
Expand Down Expand Up @@ -290,6 +295,8 @@ <h5 class="card-title">Countries and Provinces Ranked by Total Cases</h5>
<script src="verbose/chart.js/chart.umd.js"></script>
<script src="verbose/chart.js/index.umd.min.js"></script>
<script src="verbose/countup.js/countUp.umd.js"></script>
<script src="verbose/gsap/Flip.min.js"></script>
<script src="verbose/gsap/gsap.min.js"></script>
<script src="verbose/aos/aos.js"></script>

<script
Expand All @@ -298,6 +305,7 @@ <h5 class="card-title">Countries and Provinces Ranked by Total Cases</h5>
></script>

<script src="scripts/aos.js"></script>
<script src="scripts/gsap.js"></script>
<script src="scripts/particles.js"></script>

<script
Expand Down
2 changes: 1 addition & 1 deletion scripts/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ window.addEventListener('DOMContentLoaded', async () => {
const yearRange = Math.abs(endYear - startYear + 1);
const years = Array(yearRange).fill(startYear).map((_, i) => startYear + i);

toggleButton('chart-line-btn', console.log);
toggleButton('chart-line-btn');

sendLoadEvent(() => {
populateSelect('chart-line-select', years, loadChart, data);
Expand Down
3 changes: 3 additions & 0 deletions scripts/gsap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
window.addEventListener('DOMContentLoaded', () => {
gsap.registerPlugin(Flip);
});
2 changes: 1 addition & 1 deletion scripts/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ window.addEventListener('DOMContentLoaded', async () => {
const yearRange = Math.abs(endYear - startYear + 1);
const years = Array(yearRange).fill(startYear).map((_, i) => startYear + i);

toggleButton('chart-map-btn', console.log);
toggleButton('chart-map-btn');

sendLoadEvent(() => {
populateSelect('chart-map-select', years, loadChart, data);
Expand Down
13 changes: 12 additions & 1 deletion scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ export function toggleButton(buttonId, callback) {
img.setAttribute('src', iconPath);
}

callback(maximized);
const parent = btn.closest('.maximizeable');
const state = Flip.getState(parent);

if (parent) {
if (maximized) {
parent.classList.add('maximized');
} else {
parent.classList.remove('maximized');
}
}

Flip.from(state, { absolute: true, duration: 0.2, ease: "power1.inOut" });
});
}
4 changes: 2 additions & 2 deletions styles/card.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
transform: translateY(-50%);
}

.card .btn {
.card.card-cust .btn {
width: 35px;
height: 36px;

Expand All @@ -57,7 +57,7 @@
--bs-btn-active-border-color: transparent;
}

.card .btn img {
.card.card-cust .btn img {
width: 20px;

opacity: 0.7;
Expand Down
4 changes: 4 additions & 0 deletions styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ body {
background-color: #f0f0ff;
}

/* .container {
position: relative;
} */

*::selection {
background-color: #d3d6ff;
}
29 changes: 29 additions & 0 deletions styles/maximize.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.maximizeable.maximized {
z-index: 10;

top: 0;
left: 0;
position: fixed;

width: 100%;
height: 100%;

max-width: 100vw;
max-height: 100vh;

display: flex;
align-items: center;
justify-content: center;
}

.maximizeable.maximized>.card {
z-index: 11;

width: 100%;
height: 100%;

max-width: 1000px;
max-height: 700px;

backdrop-filter: blur(15px);
}
11 changes: 11 additions & 0 deletions verbose/gsap/Flip.min.js

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions verbose/gsap/gsap.min.js

Large diffs are not rendered by default.

0 comments on commit 9685e1d

Please sign in to comment.