Skip to content

Commit f0cb035

Browse files
committed
download update
1 parent aa375da commit f0cb035

4 files changed

Lines changed: 138 additions & 0 deletions

File tree

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,11 @@ app.get("/share/:slug", async (req,res) => {
14411441
res.redirect(response.properties.URL.url)
14421442
})
14431443

1444+
app.get("/download/:filename", async (req,res) => {
1445+
let file = "/downloadable/"+req.params.filename
1446+
res.render("download", {file:file})
1447+
})
1448+
14441449
// app.get("/blog/:slug", async (req,res) => {
14451450
// //filter by slug here
14461451
// console.log(req.params.slug)

public/downloadable/hershey.ttf

36.3 KB
Binary file not shown.

public/downloadable/sfpc-logo.png

10.6 KB
Loading

public/templates/download.hbs

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
6+
<title>Downloading Your File...</title>
7+
8+
<meta charset="UTF-8">
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
10+
<meta name="title" content="School for Poetic Computation">
11+
<meta name="description"
12+
content="The School for Poetic Computation is an experimental school in New York City supporting interdisciplinary study in art, code, hardware and critical theory. It's a place for learning and unlearning.">
13+
<meta property="og:type" content="website">
14+
<meta property="og:url" content="https://sfpc.study/">
15+
<meta property="og:title" content="School for Poetic Computation">
16+
<meta property="og:description"
17+
content="The School for Poetic Computation is an experimental school in New York City supporting interdisciplinary study in art, code, hardware and critical theory. It's a place for learning and unlearning.">
18+
<meta property="og:image" content="https://sfpc.study/images/sessions/meta.jpg">
19+
<meta property="twitter:card" content="summary_large_image">
20+
<meta property="twitter:url" content="https://sfpc.study/">
21+
<meta property="twitter:title" content="School for Poetic Computation">
22+
<meta property="twitter:description"
23+
content="The School for Poetic Computation is an experimental school in New York City supporting interdisciplinary study in art, code, hardware and critical theory. It's a place for learning and unlearning.">
24+
<meta property="twitter:image" content="https://sfpc.study/images/sessions/meta.jpg">
25+
<link href="/styles.css" rel="stylesheet">
26+
<link id="mode" rel="stylesheet" type="text/css" href="/crt.css" />
27+
<link rel="shortcut icon" type="image/png" href="https://sfpc.study/images/sessions/favicon.ico" />
28+
29+
<script src="/jquery-3.6.0.min.js"></script>
30+
31+
<style>
32+
33+
.spinner {
34+
border: 4px solid #f3f3f3;
35+
border-top: 4px solid #3498db;
36+
border-radius: 50%;
37+
width: 40px;
38+
height: 40px;
39+
animation: spin 1s linear infinite;
40+
margin: 20px auto;
41+
}
42+
@keyframes spin {
43+
0% { transform: rotate(0deg); }
44+
100% { transform: rotate(360deg); }
45+
}
46+
a { color: #3498db; text-decoration: none; font-weight: bold; }
47+
a:hover { text-decoration: underline; }
48+
</style>
49+
<!-- <script data-goatcounter="https://sfpc.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script> -->
50+
51+
52+
<!-- end stats -->
53+
</head>
54+
55+
56+
<body>
57+
{{> header}}
58+
{{> footer}}
59+
60+
<div class="crt-overlay crt-overlay-fullsize"></div>
61+
62+
63+
<div id="shell" class="shell shell-fullsize projects sfpc winter-26">
64+
65+
66+
67+
<div class="container">
68+
<h2>Your download will begin automatically in a moment.</h2>
69+
70+
71+
<div class="loader-content">
72+
<p tabindex="0" class="large">
73+
loading<span>...</span>
74+
</p>
75+
</div>
76+
<br>
77+
<p style="font-size: 0.9em; color: #666;">
78+
Not starting? <a id="pdf-link" href="{{file}}">Click here to download directly</a>.
79+
</p>
80+
<br>
81+
82+
<img src="/images/fundraiser/winter-23/fundraiser-23-icons-4.png">
83+
<h1><a href="/">Return to SFPC Home Page</a></h1>
84+
</div>
85+
86+
<script>
87+
// 1. CONFIGURATION: Change this to the actual URL of your PDF
88+
const fileURL = document.getElementById("pdf-link").href
89+
console.log(fileURL);
90+
// 2. AUTOMATIC DOWNLOAD TIMER (2000 milliseconds = 3 seconds)
91+
// This delay ensures Statcounter has time to fire completely before the browser shifts focus.
92+
setTimeout(function() {
93+
window.location.href = fileURL;
94+
}, 2000);
95+
</script>
96+
97+
</div>
98+
99+
100+
101+
102+
103+
104+
105+
106+
107+
108+
<script src="/outside.js"></script>
109+
<script src="/carousel.js"></script>
110+
111+
112+
<script type="text/javascript">
113+
var sc_project = 12714909;
114+
var sc_invisible = 1;
115+
var sc_security = "6086a46c";
116+
</script>
117+
<script type="text/javascript" src="https://www.statcounter.com/counter/counter.js" async></script>
118+
<noscript>
119+
<div class="statcounter"><a title="website statistics" href="https://statcounter.com/" target="_blank"><img
120+
class="statcounter" src="https://c.statcounter.com/12714909/0/6086a46c/1/" alt="website statistics"
121+
referrerPolicy="no-referrer-when-downgrade"></a></div>
122+
</noscript>
123+
</body>
124+
125+
</html>
126+
127+
128+
129+
130+
131+
132+
</body>
133+
</html>

0 commit comments

Comments
 (0)