-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindexV6.html
162 lines (156 loc) · 5.21 KB
/
indexV6.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HCB Organization Info</title>
<style>
body {
font-family: "Phantom Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
line-height: 1.5;
font-weight: 400;
color: #1f2d3d;
margin: 0;
min-height: 100vh;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-color: #f9fafc;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}
.container {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
padding: 2rem;
position: relative;
}
h1 {
font-size: 2.5rem;
font-weight: bold;
line-height: 1.125;
letter-spacing: -0.009em;
margin-top: 0;
margin-bottom: 1rem;
color: #ec3750;
}
input {
background-color: #ffffff;
color: #1f2d3d;
font-family: inherit;
border-radius: 8px;
border: 2px solid #ec3750;
padding: 0.75rem 1rem;
font-size: 1.25rem;
width: 100%;
max-width: 400px;
margin-bottom: 1.5rem;
transition: all 0.3s ease;
}
input:focus {
outline: none;
box-shadow: 0 0 0 3px rgba(236, 55, 80, 0.3);
}
button {
cursor: pointer;
font-family: inherit;
font-weight: bold;
border-radius: 9999px;
display: inline-flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.125);
letter-spacing: 0.009em;
background-color: #ec3750;
color: #ffffff;
border: none;
padding: 0.75rem 2rem;
font-size: 1.25rem;
transition: all 0.3s ease;
}
button:hover, button:focus {
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.0625), 0 8px 12px rgba(0, 0, 0, 0.125);
transform: translateY(-2px);
}
.hidden {
display: none;
}
.org-name {
font-size: 4rem;
font-weight: bold;
margin-bottom: 2rem;
color: #ec3750;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}
.amount-raised {
font-size: 6rem;
color: #33d6a6;
font-weight: bold;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}
.decoration {
position: absolute;
font-size: 12rem;
opacity: 0.1;
color: #ec3750;
z-index: -1;
}
.decoration-1 {
top: 10%;
left: 5%;
transform: rotate(-15deg);
}
.decoration-2 {
bottom: 10%;
right: 5%;
transform: rotate(15deg);
}
</style>
</head>
<body>
<div class="container" id="startScreen">
<h1>Enter Organization ID or Slug</h1>
<input type="text" id="orgId" placeholder="Enter organization ID or slug">
<button onclick="showOrgInfo()">Next</button>
<div class="decoration decoration-1">★</div>
<div class="decoration decoration-2">★</div>
</div>
<div class="container hidden" id="infoScreen">
<div class="org-name" id="orgName"></div>
<div class="amount-raised" id="amountRaised"></div>
<div class="decoration decoration-1">$</div>
<div class="decoration decoration-2">$</div>
</div>
<script>
async function showOrgInfo() {
const orgId = document.getElementById('orgId').value;
const startScreen = document.getElementById('startScreen');
const infoScreen = document.getElementById('infoScreen');
const orgNameDiv = document.getElementById('orgName');
const amountRaisedDiv = document.getElementById('amountRaised');
try {
const response = await fetch(`https://hcb.hackclub.com/api/v3/organizations/${orgId}`);
if (!response.ok) {
throw new Error('Organization not found or not in Transparency Mode');
}
const data = await response.json();
const orgName = data.name;
const totalRaised = (data.balances.total_raised / 100).toFixed(2); // Convert cents to dollars
orgNameDiv.textContent = orgName;
amountRaisedDiv.textContent = `$${totalRaised}`;
startScreen.classList.add('hidden');
infoScreen.classList.remove('hidden');
} catch (error) {
alert(`Error: ${error.message}`);
}
}
</script>
</body>
</html>