Skip to content

Commit

Permalink
update banner
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Sep 18, 2024
1 parent 39cde82 commit bc55235
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
31 changes: 19 additions & 12 deletions src/components/Home/Banner.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,31 @@ interface Data {
const StatsData = [
{
id: "Testing",
prefix: "with ",
postfix: " ARCs",
dataUrl: URLS.S3_DATAHUB_STATS,
dataAccess: [["total", "internal"], ["total", "private"], ["total", "public"]],
},
{
id: "Testing2",
dataUrl: URLS.S3_DATAHUB_STATS,
dataAccess: [["total", "commits"]],
},
{
id: "Testing3",
dataUrl: URLS.S3_DATAHUB_STATS,
dataAccess: [["total", "size"]],
width: "120px",
postfix: " GB",
isBytes: true
}
},
{
id: "Testing2",
dataUrl: URLS.S3_DATAHUB_STATS,
postfix: " contributions",
dataAccess: [["total", "commits"]],
},
]
const data: Data[] = [
{ id: 1, cx: 1975, cy: 200, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'Total ARCs', angle: 270, data: StatsData[0] },
{ id: 2, cx: 1175.5, cy: 1168, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'ARC Contributions', angle: 185, data: StatsData[1] },
{ id: 3, cx: 2967.5, cy: 532, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'Total Size', angle: 120, data: StatsData[2] },
{ id: 1, cx: 1975, cy: 200, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'open source your research', angle: 270, data: StatsData[0] },
{ id: 2, cx: 1175.5, cy: 1168, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'connect your \n research data \n to the world', angle: 185, data: StatsData[1] },
{ id: 3, cx: 2967.5, cy: 532, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'bring your research \n data to life', angle: 120, data: StatsData[2] },
];
// Function to calculate positions for text and arcs
Expand Down Expand Up @@ -563,9 +567,12 @@ const calculatePositions = (cx: number, cy: number, r: number, angleDegrees: num
class="fill-base-content"
font-size="100"
>
<tspan x={textX}>
{circle.text}
</tspan>
{/* split text by \n and create one tspan per */}
{circle.text.split('\n').map((text, index) => (
<tspan x={textX} dy={index === 0 ? 0 : '1.2em'}>
{text}
</tspan>
))}
<MeterUp {...circle.data} x={textX} />
</text>
</g>)
Expand Down
6 changes: 3 additions & 3 deletions src/components/MeterUp.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
const { number, id, width, dataUrl, dataAccess, isBytes, x } = Astro.props;
const { number, id, width, dataUrl, dataAccess, isBytes, x, prefix, postfix } = Astro.props;
---

Expand Down Expand Up @@ -83,6 +83,6 @@ document.addEventListener("DOMContentLoaded", function () {

</script>

<tspan id={id} style={{width: (width || "auto")}} dy="1.2em" x={x-20}>
<tspan id={id + "-number"}>0</tspan> {isBytes && "GB"}
<tspan id={id} style={{width: (width || "auto")}} dy="1.2em" x={x-20} class="font-light italic">
{prefix} <tspan id={id + "-number"}>0</tspan> {postfix}
</tspan>
2 changes: 0 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import HeroText from '../components/Home/HeroText.astro';
import ResearchGraphNavigation from '../components/Home/ResearchGraphNavigation.astro';
import DeveloperCards from '../components/Home/DeveloperCards.astro';
import RDMGraphNavigation from '../components/Home/RDMGraphNavigation.astro';
import MeterUp from '../components/MeterUp.astro';
---

Expand Down

0 comments on commit bc55235

Please sign in to comment.