Fix paste issue in editor, tweak jam page

This commit is contained in:
Ben Visness 2021-09-23 16:13:12 -05:00
parent f5708d1ea8
commit cad1c397c1
3 changed files with 30 additions and 9 deletions

View File

@ -270,8 +270,9 @@
});
textField.addEventListener("paste", function(ev) {
if (ev.clipboardData && ev.clipboardData.files) {
importUserFiles(ev.clipboardData.files)
const files = ev.clipboardData?.files ?? [];
if (files.length > 0) {
importUserFiles(files)
}
});

View File

@ -228,9 +228,18 @@
<h2 id="dates">September 27 - October 3</h2>
<div id="tagline" class="center">
A one-week jam to bring a fresh perspective to old ideas.
<b>
{{ if gt .DaysUntil 1 }}
Starting in {{ .DaysUntil }} days.
{{ else if eq .DaysUntil 1 }}
Starting tomorrow.
{{ else }}
Happening right now.
{{ end }}
</b>
</div>
<div id="actions" class="flex justify-center">
<a class="ba b--white br2 pv2 pv3-ns ph3 ph4-ns" target="_blank" href="https://handmade.network/whenisit?t=1632744000&n=HMN%20Wheel%20Reinvention%20Jam&u=https%3A%2F%2Fhandmade.network%2Fjam">Countdown</a>
<a class="ba b--white br2 pv2 pv3-ns ph3 ph4-ns" target="_blank" href="https://handmade.network/forums/jam/t/8074-register_here__jam_projects___teams%2521">Register</a>
<a class="ba b--white br2 pv2 pv3-ns ph3 ph4-ns ml3" target="_blank" href="https://discord.gg/hxWxDee">Join the Discord</a>
</div>
</div>
@ -301,7 +310,7 @@
Your submission post is required to have multiple screenshots of your software in action, and ideally should include a demo video. It doesnt need to be fancy, but people should be able to see it without needing to run the actual program.
</p>
<p>
We recommend ShareX for recording desktop video on Windows; on Mac, just press ⌘-Option-5 and record a video, or use QuickTime.
We recommend ShareX for recording desktop video on Windows. On Mac, just press ⌘-Option-5 and record a video, or use QuickTime.
</p>
</li>
<li>Publishing your source code, or builds, is encouraged but not required.</li>

View File

@ -1,6 +1,8 @@
package website
import (
"time"
"git.handmade.network/hmn/hmn/src/hmnurl"
"git.handmade.network/hmn/hmn/src/templates"
)
@ -8,10 +10,11 @@ import (
func JamIndex(c *RequestContext) ResponseData {
var res ResponseData
/*
ogimagepath = '%swheeljam/opengraph.png' % (settings.STATIC_URL)
ogimageurl = urljoin(current_site_host(), ogimagepath)
*/
jamStartTime := time.Date(2021, 9, 27, 0, 0, 0, 0, time.UTC)
daysUntil := jamStartTime.YearDay() - time.Now().UTC().YearDay()
if daysUntil < 0 {
daysUntil = 0
}
baseData := getBaseDataAutocrumb(c, "Wheel Reinvention Jam")
baseData.OpenGraphItems = []templates.OpenGraphItem{
@ -22,6 +25,14 @@ func JamIndex(c *RequestContext) ResponseData {
{Property: "og:url", Value: hmnurl.BuildJamIndex()},
}
res.MustWriteTemplate("wheeljam_index.html", baseData, c.Perf)
type JamPageData struct {
templates.BaseData
DaysUntil int
}
res.MustWriteTemplate("wheeljam_index.html", JamPageData{
BaseData: baseData,
DaysUntil: daysUntil,
}, c.Perf)
return res
}