Compare commits

...

2 Commits

Author SHA1 Message Date
Ben Visness 5dd4880d4c heaaaghghghghg jam time yayaya 2024-03-12 23:20:35 -05:00
Ben Visness ee491c7696 Learning jam final design phase 1 2024-03-12 21:13:05 -05:00
14 changed files with 539 additions and 361 deletions

View File

@ -140,6 +140,13 @@ func BuildJamFeed2024_Learning() string {
return Url("/jam/learning-2024/feed", nil) return Url("/jam/learning-2024/feed", nil)
} }
var RegexJamGuidelines2024_Learning = regexp.MustCompile("^/jam/learning-2024/guidelines$")
func BuildJamGuidelines2024_Learning() string {
defer CatchPanic()
return Url("/jam/learning-2024/guidelines", nil)
}
func BuildJamIndexAny(slug string) string { func BuildJamIndexAny(slug string) string {
defer CatchPanic() defer CatchPanic()
return Url(fmt.Sprintf("/jam/%s", slug), nil) return Url(fmt.Sprintf("/jam/%s", slug), nil)

View File

@ -0,0 +1,23 @@
<div class="mw7 margin-center link--white">
<div class="flex flex-column pv4 tc">
<img class="jam-logo margin-center" src="{{ static "learningjam2024/logo.svg" }}">
<div class="margin-center mt3 mt4-ns">
<a class="jam-title db mb3" href="{{ .JamUrl }}">Learning Jam</a>
<div class="flex flex-column flex-row-ns justify-between lh-solid g3 g0-ns">
<div>
<div class="fw7 f3 mb1">Learn</div>
<div class="fw3 f4">March 15-17, 2024</div>
</div>
<div>
<div class="fw7 f3 mb1">Share</div>
<div class="fw3 f4">March 22-24, 2024</div>
</div>
</div>
</div>
{{ if gt .DaysUntilEnd 0 }}
<div class="flex g3 justify-center mt4">
<a href="{{ .DiscordInviteUrl }}" class="btn--jam">Join the Discord</a>
</div>
{{ end }}
</div>
</div>

View File

@ -0,0 +1,19 @@
<div class="mw7 margin-center link--white">
<div class="flex flex-column flex-row-ns justify-center items-center pv4 g3 tc tl-ns">
<img class="jam-logo-small" src="{{ static "learningjam2024/logo.svg" }}">
<div class="flex flex-column justify-between">
<div>
<a class="jam-title db small" href="{{ .JamUrl }}">Learning Jam</a>
<div class="fw6 f5 mb3">March 15 - 24, 2024</div>
</div>
<div class="flex items-center g2">
{{ if and (not .SubmittedProjectUrl) (gt .DaysUntilEnd 0) }}
<a href="{{ .NewProjectUrl }}" class="btn--jam">Create your project</a>
{{ else }}
<a href="{{ .DiscordInviteUrl }}" class="btn--jam">Join the Discord</a>
{{ end }}
<a href="{{ .GuidelinesUrl }}" class="flex items-baseline pa2">Guidelines <div class="dib svgicon f8 ml1">{{ svg "chevron-right" }}</div></a>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,14 @@
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="dib c--theme-gradient-light">What is a Learning Jam?</h2>
<div class="post-content">
<p>
The <b class="c--theme-gradient-light">Learning Jam</b> is an opportunity for you to learn something new.
</p>
<p>
Unlike traditional game jams, and unlike our previous programming jams, the goal of the <b class="c--theme-gradient-light">Learning Jam</b> is <em>knowledge</em>. It's an opportunity to throw yourself at a topic and learn everything you can about it—and then, to turn around and share that knowledge with others.
</p>
<p>
The jam takes place over <b>two weekends</b>. On the first weekend, you'll learn as much as you can about your topic of choice. On the second, you'll share what you learned in whatever form you like—writeup, video, Minecraft mod, whatever.
</p>
</div>
</div>

View File

@ -0,0 +1,41 @@
{{ range . }}
<div class="flex flex-column g3 bg--rich-gray pa3">
<div class="flex flex-row g3 items-start">
{{ if .OwnerAvatarUrl }}
<a class="flex flex-shrink-0 br-100 square items-center justify-center overflow-hidden" href="{{ .OwnerUrl }}">
<img class="user-avatar w2-5" src="{{ .OwnerAvatarUrl }}" />
</a>
{{ end }}
<div class="flex flex-column">
<div class="">
<a title="{{ (index .Projects 0).Blurb }}" href="{{ (index .Projects 0).Url }}" class="link--white fw6">{{ (index .Projects 0).Name }}</a>
by
<a href="{{ .OwnerUrl }}" class="link--white fw6">{{ .OwnerName }}</a>
<span class="f7 c--gray nowrap">{{ timehtml (relativedate .Date) .Date }}</span>
</div>
<div>{{ trim .Description }}</div>
</div>
</div>
{{ range .EmbedMedia }}
<div class="flex flex-column {{ if eq .Type mediaembed }}wide-screen{{ end }} justify-stretch iframe-fill">
{{ if eq .Type mediaimage }}
<img src="{{ .AssetUrl }}">
{{ else if eq .Type mediavideo }}
{{ if .ThumbnailUrl }}
<video src="{{ .AssetUrl }}" poster="{{ .ThumbnailUrl }}" preload="none" controls>
{{ else }}
<video src="{{ .AssetUrl }}" preload="metadata" controls>
{{ end }}
{{ else if eq .Type mediaaudio }}
<audio src="{{ .AssetUrl }}" controls>
{{ else if eq .Type mediaembed }}
{{ .EmbedHTML }}
{{ else }}
<div class="">
<a href="{{ .AssetUrl }}" target="_blank">💾{{ .Filename }} ({{ filesize .FileSize }})</a>
</div>
{{ end }}
</div>
{{ end }}
</div>
{{ end }}

View File

@ -0,0 +1,100 @@
<style>
.lightbulb-icon {
--mask-url: url("{{ static "learningjam2024/lightbulb.svg" }}");
}
.books-icon {
--mask-url: url("{{ static "learningjam2024/books.svg" }}");
}
.presentation-icon {
--mask-url: url("{{ static "learningjam2024/presentation.svg" }}");
}
</style>
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="dib c--theme-gradient-light">What is a Learning Jam?</h2>
<div class="post-content">
<p>
The <b class="c--theme-gradient-light">Learning Jam</b> is an opportunity for you to learn something new.
</p>
<p>
Unlike traditional game jams, and unlike our previous programming jams, the goal of the <b class="c--theme-gradient-light">Learning Jam</b> is <em>knowledge</em>. It's an opportunity to throw yourself at a topic and learn everything you can about it—and then, to turn around and share that knowledge with others.
</p>
<p>
The jam takes place over <b>two weekends</b>. On the first weekend, you'll learn as much as you can about your topic of choice. On the second, you'll share what you learned in whatever form you like—writeup, video, Minecraft mod, whatever.
</p>
</div>
</div>
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="mb3 dib c--theme-gradient-light">How to participate</h2>
<div class="flex flex-column g2">
<div class="pa3 flex flex-column flex-row-ns g3 items-center bg--rich-gray">
<div class="flex-shrink-0 w4 flex justify-center items-center">
<div class="flex svg-mask lightbulb-icon bg--theme-gradient-light" style="width: 5.2rem">
<img class="invisible" src="{{ static "learningjam2024/lightbulb.svg" }}" />
</div>
</div>
<div class="post-content">
<h3 class="f4">Choose a topic.</h3>
<p>
Decide what you'll spend your weekend learning about. Maybe there's an area of programming you've been meaning to dig into, or maybe there's a specialization in your field that you've been curious about. Maybe you just need a reason to read papers for a weekend.
</p>
<p>
You're welcome to work in teams or work solo.
</p>
</div>
</div>
<div class="pa3 flex flex-column flex-row-ns g3 items-center bg--rich-gray">
<div class="flex-shrink-0 w4 flex justify-center items-center">
<div class="flex flex-shrink-0 svg-mask books-icon bg--theme-gradient-light" style="width: 3.6rem">
<img class="invisible" src="{{ static "learningjam2024/books.svg" }}" />
</div>
</div>
<div class="post-content">
<h3 class="f4">Mar 15-17: Learn!</h3>
<p>
{{ if and (eq .DaysUntilStart 0) (not .SubmittedProjectUrl) }}
<a href="{{ .NewProjectUrl }}">Create a Handmade Network project</a>
{{ else }}
Create a Handmade Network project
{{ end }}
to track your progress. Then go down the rabbit hole. Absorb as much information as you can in a weekend.
</p>
<p>
As you learn, we encourage you to share updates on Discord using the <b>!til</b> command. These updates will be published as part of your submission.
</p>
</div>
</div>
<div class="pa3 flex flex-column flex-row-ns g3 items-center bg--rich-gray">
<div class="flex-shrink-0 w4 flex justify-center items-center">
<div class="flex flex-shrink-0 svg-mask presentation-icon bg--theme-gradient-light" style="width: 5rem">
<img class="invisible" src="{{ static "learningjam2024/presentation.svg" }}" />
</div>
</div>
<div class="post-content">
<h3 class="f4">Mar 22-24: Share!</h3>
<p>
Share what you learned with the rest of the community. You can present the information in any form you like—whatever helps you communicate most effectively.
</p>
<p>
Your post doesn't have to be the authoritative resource on a subject. It doesn't even have to do much "teaching" at all. The point is just to share what you learned, what surprised you, what you found interesting, and where you want to go from here.
</p>
<p>
Your Handmade Network project is your final submission. Make sure the description gives adequate context, and either attach or link to your final presentation.
</p>
</div>
</div>
</div>
</div>
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="dib c--theme-gradient-light">Why?</h2>
<div class="post-content">
<p>
The Handmade Network's goal is to change the software industry by building back up from new foundations. But in order to do that, we need to understand those foundations.
</p>
<p>
Our other programming jams are great opportunities to try building new things. But what should those new things be? We want to give the community a chance to focus just on learning and research, to gather information and share it with others, to boost the entire community's knowledge on a topic.
</p>
<p>
We hope that the results of the <b class="c--theme-gradient-light">Learning Jam</b> inspire new ideas for the community to explore in the Visibility and Wheel Reinvention jams later in the year. There is so much bad software out in the world, and this is the first step toward reinventing it.
</p>
</div>
</div>

View File

@ -0,0 +1,35 @@
{{ if .Projects }}
<div class="flex flex-row flex-wrap g2 link--white">
{{ range .Projects }}
<div class="flex-basis-40-ns flex-grow-1 flex-shrink-1 bg--rich-gray pa3 flex flex-column g1">
{{ if gt (len .Owners) 1 }}
<div class="flex g2">
{{ range .Owners }}
<a href="{{ .ProfileUrl }}" class="flex">
<img src="{{ .AvatarUrl }}" class="user-avatar w2">
</a>
{{ end }}
</div>
{{ else }}
{{ range .Owners }}
<a href="{{ .ProfileUrl }}" class="fw6 link--white flex g2 items-center">
<img src="{{ .AvatarUrl }}" class="user-avatar w2">
<div>
{{ .Name }}
</div>
</a>
{{ end }}
{{ end }}
<div class="f3 mt2">
<a href="{{ .Url }}" class="fw6 db">{{ .Name }}</a>
</div>
<div class="flex-grow-1">{{ .Blurb }}</div>
</div>
{{ end }}
{{ if isodd (len .Projects) }}
<div class="flex-basis-40-ns flex-grow-1 flex-shrink-1"></div>
{{ end }}
</div>
{{ else }}
No projects have been created yet. <a href="{{ .NewProjectUrl }}">Be the first!</a>
{{ end }}

View File

@ -1,113 +1,26 @@
{{ template "jam_2024_learning_base.html" . }} {{ template "jam_2024_learning_base.html" . }}
{{ define "content-top" }} {{ define "content-top" }}
<div class="mw7 margin-center"> {{ template "jam_2024_lj_bannersmall.html" . }}
<div class="flex flex-column pv4 tc">
<img class="jam-logo margin-center" src="{{ static "learningjam2024/logo.svg" }}">
<div class="margin-center mt3 mt4-ns mb4">
<div class="jam-title mb3">Learning Jam</div>
<div class="flex flex-column flex-row-ns justify-between lh-solid g3 g0-ns">
<div>
<div class="fw7 f3 mb1">Learn</div>
<div class="fw3 f4">March 15-17, 2024</div>
</div>
<div>
<div class="fw7 f3 mb1">Share</div>
<div class="fw3 f4">March 22-24, 2024</div>
</div>
</div>
</div>
<div class="flex g3 justify-center link--white">
{{ if and (eq .DaysUntilStart 0) (gt .DaysUntilEnd 0) }}
{{ if .SubmittedProjectUrl }}
<a class="btn--jam" href="{{ .SubmittedProjectUrl }}">Share your progress</a>
{{ else }}
<a class="btn--jam" href="{{ .ProjectSubmissionUrl }}">Create your project</a>
{{ end }}
{{ end }}
<a href="{{ .DiscordInviteUrl }}" class="btn--jam">Join the Discord</a>
</div>
</div>
</div>
{{ end }} {{ end }}
{{ define "content" }} {{ define "content" }}
<div class="mw7 margin-center flex flex-column"> <div class="mw7 margin-center flex flex-column">
<div class="ph3 pv4 bb b--rich-gray"> <div class="ph3 pv4 bb b--rich-gray">
<h2 class="c--theme-gradient-light">Projects</h2> <h2 class="c--theme-gradient-light mb3">Projects</h2>
<div class="flex flex-row flex-wrap g2"> {{ template "jam_2024_lj_projects.html" .Projects }}
{{ if .Projects }}
{{ range .Projects }}
<div class="flex-basis-40-ns flex-grow-1 flex-shrink-1 bg--rich-gray pa3 flex flex-column g1">
<div class="f3">
<a href="{{ .Url }}" class="fw6">{{ .Name }}</a>
</div> </div>
<div class="flex-grow-1">{{ .Blurb }}</div>
<div class="f7">
by
{{ $owners := .Owners }}
{{ range $idx, $owner := .Owners }}
<a href="{{ $owner.ProfileUrl }}" class="fw6 link--white">{{ $owner.Name }}</a>{{ if not (lastidx $idx (len $owners)) }},{{ end }}
{{ end }}
</div>
</div>
{{ end }}
{{ if isodd (len .Projects) }}
<div class="flex-basis-40-ns flex-grow-1 flex-shrink-1"></div>
{{ end }}
{{ end }}
</div>
</div>
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="c--theme-gradient-light">Recent activity</h2>
<div class="flex flex-column g2">
{{ if .TimelineItems }} {{ if .TimelineItems }}
{{ range .TimelineItems }} <div class="ph3 pv4 bb b--rich-gray">
<div class="flex flex-column g3 bg--rich-gray pa3"> <h2 class="c--theme-gradient-light">All updates</h2>
<div class="flex flex-row g3 items-start"> <p>
{{ if .OwnerAvatarUrl }} See what community members are learning about their topics. You can share your own updates via your <a href="{{ or .SubmittedProjectUrl .NewProjectUrl }}">project page</a> or using the <b>!til</b> command on Discord.
<a class="flex flex-shrink-0 br-100 square items-center justify-center overflow-hidden bg--gray" href="{{ .OwnerUrl }}"> </p>
<img class="w2-5" src="{{ .OwnerAvatarUrl }}" /> <div class="flex flex-column g2 mt3">
</a> {{ template "jam_2024_lj_feeditems.html" .TimelineItems }}
{{ end }}
<div class="flex flex-column">
<div class="">
<a title="{{ (index .Projects 0).Blurb }}" href="{{ (index .Projects 0).Url }}" class="link--white fw6">{{ (index .Projects 0).Name }}</a>
by
<a href="{{ .OwnerUrl }}" class="link--white fw6">{{ .OwnerName }}</a>
<span class="f7 c--gray nowrap">{{ timehtml (relativedate .Date) .Date }}</span>
</div> </div>
<div>{{ trim .Description }}</div>
</div>
</div>
{{ range .EmbedMedia }}
<div class="flex flex-column {{ if eq .Type mediaembed }}wide-screen{{ end }} justify-stretch iframe-fill">
{{ if eq .Type mediaimage }}
<img src="{{ .AssetUrl }}">
{{ else if eq .Type mediavideo }}
{{ if .ThumbnailUrl }}
<video src="{{ .AssetUrl }}" poster="{{ .ThumbnailUrl }}" preload="none" controls>
{{ else }}
<video src="{{ .AssetUrl }}" preload="metadata" controls>
{{ end }}
{{ else if eq .Type mediaaudio }}
<audio src="{{ .AssetUrl }}" controls>
{{ else if eq .Type mediaembed }}
{{ .EmbedHTML }}
{{ else }}
<div class="">
<a href="{{ .AssetUrl }}" target="_blank">💾{{ .Filename }} ({{ filesize .FileSize }})</a>
</div> </div>
{{ end }} {{ end }}
</div>
{{ end }}
</div>
{{ end }}
{{ else }}
Be the first!
{{ end }}
</div>
</div>
<div> <div>
<div class="mv5 h3 fill-current link--white"> <div class="mv5 h3 fill-current link--white">
<a href="{{ .Header.HMNHomepageUrl }}">{{ svg "hmn_circuit" }}</a> <a href="{{ .Header.HMNHomepageUrl }}">{{ svg "hmn_circuit" }}</a>

View File

@ -0,0 +1,16 @@
{{ template "jam_2024_learning_base.html" . }}
{{ define "content-top" }}
{{ template "jam_2024_lj_bannersmall.html" . }}
{{ end }}
{{ define "content" }}
<div class="mw7 margin-center flex flex-column">
{{ template "jam_2024_lj_guidelines.html" . }}
<div>
<div class="mv5 h3 fill-current link--white">
<a href="{{ .Header.HMNHomepageUrl }}">{{ svg "hmn_circuit" }}</a>
</div>
</div>
</div>
{{ end }}

View File

@ -1,142 +1,83 @@
{{ template "jam_2024_learning_base.html" . }} {{ template "jam_2024_learning_base.html" . }}
{{ define "content-top" }} {{ define "content-top" }}
<div class="mw7 margin-center"> {{ if or (gt .DaysUntilStart 0) (eq .DaysUntilEnd 0) }}
<div class="flex flex-column pv4 tc"> {{ template "jam_2024_lj_bannerbig.html" . }}
<img class="jam-logo margin-center" src="{{ static "learningjam2024/logo.svg" }}">
<div class="margin-center mt3 mt4-ns mb4">
<div class="jam-title mb3">Learning Jam</div>
<div class="flex flex-column flex-row-ns justify-between lh-solid g3 g0-ns">
<div>
<div class="fw7 f3 mb1">Learn</div>
<div class="fw3 f4">March 15-17, 2024</div>
</div>
<div>
<div class="fw7 f3 mb1">Share</div>
<div class="fw3 f4">March 22-24, 2024</div>
</div>
</div>
</div>
<div class="flex g3 justify-center link--white">
{{ if eq .DaysUntilStart 0 }}
{{ if gt .DaysUntilEnd 0 }}
{{ if .SubmittedProjectUrl }}
<a class="btn--jam" href="{{ .SubmittedProjectUrl }}">Share your progress</a>
{{ else }} {{ else }}
<a class="btn--jam" href="{{ .ProjectSubmissionUrl }}">Create your project</a> {{ template "jam_2024_lj_bannersmall.html" . }}
{{ end }} {{ end }}
<a class="btn--jam" href="{{ .JamFeedUrl }}">Recent activity</a>
{{ else }}
<a class="btn--jam" href="{{ .JamFeedUrl }}">See the results</a>
{{ end }}
{{ end }}
<a href="{{ .DiscordInviteUrl }}" class="btn--jam">Join the Discord</a>
</div>
</div>
</div>
{{ end }} {{ end }}
{{ define "content" }} {{ define "content" }}
<style>
.lightbulb-icon {
--mask-url: url("{{ static "learningjam2024/lightbulb.svg" }}");
}
.books-icon {
--mask-url: url("{{ static "learningjam2024/books.svg" }}");
}
.presentation-icon {
--mask-url: url("{{ static "learningjam2024/presentation.svg" }}");
}
</style>
<div class="mw7 margin-center flex flex-column"> <div class="mw7 margin-center flex flex-column">
<div class="ph3 pv4 bb b--rich-gray"> {{ if gt .DaysUntilStart 0 }}
<h2 class="dib c--theme-gradient-light">What is a Learning Jam?</h2> {{ template "before-jam" . }}
<div class="post-content"> {{ else if gt .DaysUntilEnd 0 }}
<p> {{ template "during-jam" . }}
The <b class="c--theme-gradient-light">Learning Jam</b> is an opportunity for you to learn something new. {{ else }}
</p> {{ template "after-jam" . }}
<p> {{ end }}
Unlike traditional game jams, and unlike our previous programming jams, the goal of the <b class="c--theme-gradient-light">Learning Jam</b> is <em>knowledge</em>. It's an opportunity to throw yourself at a topic and learn everything you can about it—and then, to turn around and share that knowledge with others.
</p>
<p>
The jam takes place over <b>two weekends</b>. On the first weekend, you'll learn as much as you can about your topic of choice. On the second, you'll share what you learned in whatever form you like—writeup, video, Minecraft mod, whatever.
</p>
</div>
</div>
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="mb3 dib c--theme-gradient-light">How to participate</h2>
<div class="flex flex-column g2">
<div class="pa3 flex flex-column flex-row-ns g3 items-center bg--rich-gray">
<div class="flex-shrink-0 w4 flex justify-center items-center">
<div class="flex svg-mask lightbulb-icon bg--theme-gradient-light" style="width: 5.2rem">
<img class="invisible" src="{{ static "learningjam2024/lightbulb.svg" }}" />
</div>
</div>
<div class="post-content">
<h3 class="f4">Choose a topic.</h3>
<p>
Decide what you'll spend your weekend learning about. Maybe there's an area of programming you've been meaning to dig into, or maybe there's a specialization in your field that you've been curious about. Maybe you just need a reason to read papers for a weekend.
</p>
<p>
You're welcome to work in teams or work solo.
</p>
</div>
</div>
<div class="pa3 flex flex-column flex-row-ns g3 items-center bg--rich-gray">
<div class="flex-shrink-0 w4 flex justify-center items-center">
<div class="flex flex-shrink-0 svg-mask books-icon bg--theme-gradient-light" style="width: 3.6rem">
<img class="invisible" src="{{ static "learningjam2024/books.svg" }}" />
</div>
</div>
<div class="post-content">
<h3 class="f4">Mar 15-17: Learn!</h3>
<p>
Create a Handmade Network project to track your progress. Then go down the rabbit hole. Absorb as much information as you can in a weekend.
</p>
<p>
As you learn, we encourage you to share updates on Discord using the <b>!til</b> command. These updates will be published as part of your submission.
</p>
</div>
</div>
<div class="pa3 flex flex-column flex-row-ns g3 items-center bg--rich-gray">
<div class="flex-shrink-0 w4 flex justify-center items-center">
<div class="flex flex-shrink-0 svg-mask presentation-icon bg--theme-gradient-light" style="width: 5rem">
<img class="invisible" src="{{ static "learningjam2024/presentation.svg" }}" />
</div>
</div>
<div class="post-content">
<h3 class="f4">Mar 22-24: Share!</h3>
<p>
Share what you learned with the rest of the community. You can present the information in any form you like—whatever helps you communicate most effectively.
</p>
<p>
Your post doesn't have to be the authoritative resource on a subject. It doesn't even have to do much "teaching" at all. The point is just to share what you learned, what surprised you, what you found interesting, and where you want to go from here.
</p>
<p>
Your Handmade Network project is your final submission. Make sure the description gives adequate context, and either attach or link to your final presentation.
</p>
</div>
</div>
</div>
</div>
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="dib c--theme-gradient-light">Why?</h2>
<div class="post-content">
<p>
The Handmade Network's goal is to change the software industry by building back up from new foundations. But in order to do that, we need to understand those foundations.
</p>
<p>
Our other programming jams are great opportunities to try building new things. But what should those new things be? We want to give the community a chance to focus just on learning and research, to gather information and share it with others, to boost the entire community's knowledge on a topic.
</p>
<p>
We hope that the results of the <b class="c--theme-gradient-light">Learning Jam</b> inspire new ideas for the community to explore in the Visibility and Wheel Reinvention jams later in the year. There is so much bad software out in the world, and this is the first step toward reinventing it.
</p>
</div>
</div>
<div> <div>
<div class="mv5 h3 fill-current"> <div class="mv5 h3 fill-current link--white">
<a href="{{ .Header.HMNHomepageUrl }}">{{ svg "hmn_circuit" }}</a> <a href="{{ .Header.HMNHomepageUrl }}">{{ svg "hmn_circuit" }}</a>
</div> </div>
</div> </div>
</div> </div>
{{ end }} {{ end }}
{{ define "before-jam" }}
{{ template "jam_2024_lj_guidelines.html" . }}
{{ end }}
{{ define "during-jam" }}
{{ if .Projects.Projects }}
{{ template "jam_2024_lj_description.html" . }}
{{ if .TimelineItems }}
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="c--theme-gradient-light">Recent updates</h2>
<p>
See what community members are learning about their topics. You can share your own updates via your <a href="{{ or .SubmittedProjectUrl .NewProjectUrl }}">project page</a> or using the <b>!til</b> command on Discord.
</p>
<div class="flex flex-column g2 mt3">
{{ template "jam_2024_lj_feeditems.html" .TimelineItems }}
<a href="{{ .JamFeedUrl }}" class="link--white tc pa1">
See all updates<div class="dib svgicon f8 ml1">{{ svg "chevron-right" }}</div>
</a>
</div>
</div>
{{ end }}
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="c--theme-gradient-light mb3">Projects</h2>
{{ template "jam_2024_lj_projects.html" .Projects }}
</div>
{{ else }}
{{ template "jam_2024_lj_guidelines.html" . }}
{{ end }}
{{ end }}
{{ define "after-jam" }}
{{ template "jam_2024_lj_description.html" . }}
{{ with .TwitchEmbedUrl }}
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="dib c--theme-gradient-light">Recap show</h2>
<p>
Watch the livestream celebrating all the submissions:
</p>
<div class="mt3" style="aspect-ratio: 16 / 9;">
<iframe src="{{ . }}" allowfullscreen width="100%" height="100%" frameborder="0"></iframe>
</div>
</div>
{{ end }}
<div class="ph3 pv4 bb b--rich-gray">
<div class="flex justify-between items-baseline">
<h2 class="c--theme-gradient-light mb0">Submitted projects</h2>
<a href="{{ .JamFeedUrl }}" class="link--white tc">
See all updates<div class="dib svgicon f8 ml1">{{ svg "chevron-right" }}</div>
</a>
</div>
<div class="mt3">
{{ template "jam_2024_lj_projects.html" .Projects }}
</div>
</div>
{{ end }}

View File

@ -55,7 +55,7 @@
--spacing-7: 16rem; --spacing-7: 16rem;
--border-radius-2: 0.25rem; --border-radius-2: 0.25rem;
--link-color: #8Bd5FF; --link-color: transparent;
} }
body { body {
@ -115,10 +115,13 @@
color: transparent; color: transparent;
} }
.c--theme-gradient-light { a, .c--theme-gradient-light {
background: var(--theme-gradient-light); background: var(--theme-gradient-light);
background-clip: text; background-clip: text;
-webkit-background-clip: text; -webkit-background-clip: text;
}
.c--theme-gradient-light {
color: transparent; color: transparent;
} }
@ -134,6 +137,10 @@
background-color: var(--bg-button); background-color: var(--bg-button);
} }
.btn--jam.small {
padding: var(--spacing-1) var(--spacing-2);
}
.btn--jam:hover { .btn--jam:hover {
background-color: var(--bg-button-hover); background-color: var(--bg-button-hover);
} }
@ -187,16 +194,23 @@
padding-right: 0.6rem; padding-right: 0.6rem;
} }
.user-avatar-header { .user-avatar {
width: 1.8rem;
border-radius: 999px; border-radius: 999px;
background-color: rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.4);
} }
.user-avatar.header {
width: 1.8rem;
}
.jam-logo { .jam-logo {
max-width: 18rem; max-width: 18rem;
} }
.jam-logo-small {
max-width: 8rem;
}
.jam-title { .jam-title {
/* align with the width of the logo */ /* align with the width of the logo */
font-size: 2.76rem; font-size: 2.76rem;
@ -208,6 +222,15 @@
margin-right: -0.03em; margin-right: -0.03em;
} }
.jam-title.small {
font-size: 2.25rem;
/* align with the text's actual bounding box */
line-height: 1.18;
margin-top: -0.18em;
margin-left: -0.03em;
margin-right: -0.03em;
}
/* not small */ /* not small */
@media screen and (min-width: 35em) { @media screen and (min-width: 35em) {
.jam-logo { .jam-logo {
@ -241,7 +264,7 @@
<a href="{{ .Header.ProjectIndexUrl }}">Projects</a> <a href="{{ .Header.ProjectIndexUrl }}">Projects</a>
<a href="{{ .Header.JamsUrl }}">Jams</a> <a href="{{ .Header.JamsUrl }}">Jams</a>
<a class="db" href="{{ or .Header.UserProfileUrl .LoginPageUrl }}"> <a class="db" href="{{ or .Header.UserProfileUrl .LoginPageUrl }}">
<img class="user-avatar-header" src="{{ .UserAvatarUrl }}"> <img class="user-avatar header" src="{{ .UserAvatarUrl }}">
</a> </a>
</div> </div>
</div> </div>

View File

@ -132,6 +132,8 @@
2023 Wheel Reinvention Jam 2023 Wheel Reinvention Jam
{{- else if eq . "visibility-2023" -}} {{- else if eq . "visibility-2023" -}}
2023 Visibility Jam 2023 Visibility Jam
{{- else if eq . "learning-2024" -}}
2024 Learning Jam
{{- else -}} {{- else -}}
??? ???
{{- end -}} {{- end -}}

View File

@ -46,11 +46,101 @@ func JamsIndex(c *RequestContext) ResponseData {
func JamIndex2024_Learning(c *RequestContext) ResponseData { func JamIndex2024_Learning(c *RequestContext) ResponseData {
var res ResponseData var res ResponseData
daysUntilStart := daysUntil(hmndata.LJ2024.StartTime)
daysUntilEnd := daysUntil(hmndata.LJ2024.EndTime)
baseData := getBaseDataAutocrumb(c, hmndata.LJ2024.Name) baseData := getBaseDataAutocrumb(c, hmndata.LJ2024.Name)
baseData.OpenGraphItems = []templates.OpenGraphItem{ baseData.OpenGraphItems = opengraphLJ2024
jamBaseData, err := getLJ2024BaseData(c)
if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, err)
}
feedData, err := getLJ2024FeedData(c, 5)
if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, err)
}
type JamPageData struct {
templates.BaseData
JamBaseDataLJ2024
TwitchEmbedUrl string
Projects JamProjectDataLJ2024
TimelineItems []templates.TimelineItem
}
tmpl := JamPageData{
BaseData: baseData,
JamBaseDataLJ2024: jamBaseData,
TwitchEmbedUrl: getTwitchEmbedUrl(c),
Projects: feedData.Projects,
TimelineItems: feedData.TimelineItems,
}
res.MustWriteTemplate("jam_2024_lj_index.html", tmpl, c.Perf)
return res
}
func JamFeed2024_Learning(c *RequestContext) ResponseData {
baseData := getBaseDataAutocrumb(c, hmndata.LJ2024.Name)
baseData.OpenGraphItems = opengraphLJ2024
jamBaseData, err := getLJ2024BaseData(c)
if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, err)
}
feedData, err := getLJ2024FeedData(c, 0)
if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, err)
}
type JamFeedData struct {
templates.BaseData
JamBaseDataLJ2024
Projects JamProjectDataLJ2024
TimelineItems []templates.TimelineItem
}
tmpl := JamFeedData{
BaseData: baseData,
JamBaseDataLJ2024: jamBaseData,
Projects: feedData.Projects,
TimelineItems: feedData.TimelineItems,
}
var res ResponseData
res.MustWriteTemplate("jam_2024_lj_feed.html", tmpl, c.Perf)
return res
}
func JamGuidelines2024_Learning(c *RequestContext) ResponseData {
baseData := getBaseDataAutocrumb(c, hmndata.LJ2024.Name)
baseData.OpenGraphItems = opengraphLJ2024
jamBaseData, err := getLJ2024BaseData(c)
if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, err)
}
type JamGuidelinesData struct {
templates.BaseData
JamBaseDataLJ2024
}
tmpl := JamGuidelinesData{
BaseData: baseData,
JamBaseDataLJ2024: jamBaseData,
}
var res ResponseData
res.MustWriteTemplate("jam_2024_lj_guidelines_index.html", tmpl, c.Perf)
return res
}
var opengraphLJ2024 = []templates.OpenGraphItem{
{Property: "og:title", Value: "Learning Jam"}, {Property: "og:title", Value: "Learning Jam"},
{Property: "og:site_name", Value: "Handmade Network"}, {Property: "og:site_name", Value: "Handmade Network"},
{Property: "og:type", Value: "website"}, {Property: "og:type", Value: "website"},
@ -59,45 +149,42 @@ func JamIndex2024_Learning(c *RequestContext) ResponseData {
{Property: "og:url", Value: hmnurl.BuildJamIndex2024_Learning()}, {Property: "og:url", Value: hmnurl.BuildJamIndex2024_Learning()},
{Name: "twitter:card", Value: "summary_large_image"}, {Name: "twitter:card", Value: "summary_large_image"},
{Name: "twitter:image", Value: hmnurl.BuildPublic("learningjam2024/2024LJTwitterCard.png", true)}, {Name: "twitter:image", Value: hmnurl.BuildPublic("learningjam2024/2024LJTwitterCard.png", true)},
} }
type JamPageData struct { type JamBaseDataLJ2024 struct {
templates.BaseData
UserAvatarUrl string UserAvatarUrl string
DaysUntilStart, DaysUntilEnd int DaysUntilStart, DaysUntilEnd int
TwitchEmbedUrl string JamUrl string
ProjectSubmissionUrl string
SubmittedProjectUrl string
JamFeedUrl string JamFeedUrl string
} NewProjectUrl string
SubmittedProjectUrl string
GuidelinesUrl string
}
twitchEmbedUrl := "" type JamProjectDataLJ2024 struct {
twitchStatus, err := db.QueryOne[models.TwitchLatestStatus](c, c.Conn, Projects []templates.Project
` NewProjectUrl string
SELECT $columns }
FROM twitch_latest_status
WHERE twitch_login = $1
`,
"handmadenetwork",
)
if err == nil {
if twitchStatus.Live {
hmnUrl, err := url.Parse(config.Config.BaseUrl)
if err == nil {
twitchEmbedUrl = fmt.Sprintf("https://player.twitch.tv/?channel=%s&parent=%s", twitchStatus.TwitchLogin, hmnUrl.Hostname())
}
}
}
tmpl := JamPageData{ type JamFeedDataLJ2024 struct {
BaseData: baseData, Projects JamProjectDataLJ2024
TimelineItems []templates.TimelineItem
projects []hmndata.ProjectAndStuff
}
func getLJ2024BaseData(c *RequestContext) (JamBaseDataLJ2024, error) {
daysUntilStart := daysUntil(hmndata.LJ2024.StartTime)
daysUntilEnd := daysUntil(hmndata.LJ2024.EndTime)
tmpl := JamBaseDataLJ2024{
UserAvatarUrl: templates.UserAvatarDefaultUrl("dark"), UserAvatarUrl: templates.UserAvatarDefaultUrl("dark"),
DaysUntilStart: daysUntilStart, DaysUntilStart: daysUntilStart,
DaysUntilEnd: daysUntilEnd, DaysUntilEnd: daysUntilEnd,
ProjectSubmissionUrl: hmnurl.BuildProjectNewJam(), JamUrl: hmnurl.BuildJamIndex2024_Learning(),
SubmittedProjectUrl: "",
JamFeedUrl: hmnurl.BuildJamFeed2024_Learning(), JamFeedUrl: hmnurl.BuildJamFeed2024_Learning(),
TwitchEmbedUrl: twitchEmbedUrl, NewProjectUrl: hmnurl.BuildProjectNewJam(),
GuidelinesUrl: hmnurl.BuildJamGuidelines2024_Learning(),
} }
if c.CurrentUser != nil { if c.CurrentUser != nil {
@ -108,7 +195,7 @@ func JamIndex2024_Learning(c *RequestContext) ResponseData {
Limit: 1, Limit: 1,
}) })
if err != nil { if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, oops.New(err, "failed to fetch jam projects for current user")) return JamBaseDataLJ2024{}, oops.New(err, "failed to fetch jam projects for current user")
} }
if len(projects) > 0 { if len(projects) > 0 {
urlContext := hmndata.UrlContextForProject(&projects[0].Project) urlContext := hmndata.UrlContextForProject(&projects[0].Project)
@ -116,61 +203,23 @@ func JamIndex2024_Learning(c *RequestContext) ResponseData {
} }
} }
res.MustWriteTemplate("jam_2024_lj_index.html", tmpl, c.Perf) return tmpl, nil
return res
} }
func JamFeed2024_Learning(c *RequestContext) ResponseData { // 0 for no limit on timeline items.
daysUntilStart := daysUntil(hmndata.LJ2024.StartTime) func getLJ2024FeedData(c *RequestContext, maxTimelineItems int) (JamFeedDataLJ2024, error) {
daysUntilEnd := daysUntil(hmndata.LJ2024.EndTime)
baseData := getBaseDataAutocrumb(c, hmndata.LJ2024.Name)
baseData.OpenGraphItems = []templates.OpenGraphItem{
{Property: "og:title", Value: "Learning Jam"},
{Property: "og:site_name", Value: "Handmade Network"},
{Property: "og:type", Value: "website"},
{Property: "og:image", Value: hmnurl.BuildPublic("learningjam2024/2024LJOpenGraph.png", true)},
{Property: "og:description", Value: "A two-weekend jam where you dive deep into a topic, then teach it to the rest of the community."},
{Property: "og:url", Value: hmnurl.BuildJamFeed2024_Learning()},
{Name: "twitter:card", Value: "summary_large_image"},
{Name: "twitter:image", Value: hmnurl.BuildPublic("learningjam2024/2024LJTwitterCard.png", true)},
}
type JamFeedData struct {
templates.BaseData
UserAvatarUrl string
DaysUntilStart, DaysUntilEnd int
TwitchEmbedUrl string
ProjectSubmissionUrl string
SubmittedProjectUrl string
Projects []templates.Project
TimelineItems []templates.TimelineItem
}
twitchEmbedUrl := ""
twitchStatus, err := db.QueryOne[models.TwitchLatestStatus](c, c.Conn,
`
SELECT $columns
FROM twitch_latest_status
WHERE twitch_login = $1
`,
"handmadenetwork",
)
if err == nil {
if twitchStatus.Live {
hmnUrl, err := url.Parse(config.Config.BaseUrl)
if err == nil {
twitchEmbedUrl = fmt.Sprintf("https://player.twitch.tv/?channel=%s&parent=%s", twitchStatus.TwitchLogin, hmnUrl.Hostname())
}
}
}
jamProjects, err := hmndata.FetchProjects(c, c.Conn, c.CurrentUser, hmndata.ProjectsQuery{ jamProjects, err := hmndata.FetchProjects(c, c.Conn, c.CurrentUser, hmndata.ProjectsQuery{
JamSlugs: []string{hmndata.LJ2024.Slug}, JamSlugs: []string{hmndata.LJ2024.Slug},
}) })
if err != nil { if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, oops.New(err, "failed to fetch jam projects for current user")) return JamFeedDataLJ2024{}, oops.New(err, "failed to fetch jam projects for current user")
}
projects := make([]templates.Project, 0, len(jamProjects))
for _, jp := range jamProjects {
urlContext := hmndata.UrlContextForProject(&jp.Project)
projectUrl := urlContext.BuildHomepage()
projects = append(projects, templates.ProjectAndStuffToTemplate(&jp, projectUrl, c.Theme))
} }
projectIds := make([]int, 0, len(jamProjects)) projectIds := make([]int, 0, len(jamProjects))
@ -182,9 +231,10 @@ func JamFeed2024_Learning(c *RequestContext) ResponseData {
if len(projectIds) > 0 { if len(projectIds) > 0 {
snippets, err := hmndata.FetchSnippets(c, c.Conn, c.CurrentUser, hmndata.SnippetQuery{ snippets, err := hmndata.FetchSnippets(c, c.Conn, c.CurrentUser, hmndata.SnippetQuery{
ProjectIDs: projectIds, ProjectIDs: projectIds,
Limit: maxTimelineItems,
}) })
if err != nil { if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, oops.New(err, "failed to fetch snippets for jam showcase")) return JamFeedDataLJ2024{}, oops.New(err, "failed to fetch snippets for jam showcase")
} }
timelineItems = make([]templates.TimelineItem, 0, len(snippets)) timelineItems = make([]templates.TimelineItem, 0, len(snippets))
@ -195,44 +245,37 @@ func JamFeed2024_Learning(c *RequestContext) ResponseData {
} }
} }
projects := make([]templates.Project, 0, len(jamProjects)) return JamFeedDataLJ2024{
for _, jp := range jamProjects { Projects: JamProjectDataLJ2024{
urlContext := hmndata.UrlContextForProject(&jp.Project)
projectUrl := urlContext.BuildHomepage()
projects = append(projects, templates.ProjectAndStuffToTemplate(&jp, projectUrl, c.Theme))
}
tmpl := JamFeedData{
BaseData: baseData,
UserAvatarUrl: templates.UserAvatarDefaultUrl("dark"),
DaysUntilStart: daysUntilStart,
DaysUntilEnd: daysUntilEnd,
TwitchEmbedUrl: twitchEmbedUrl,
ProjectSubmissionUrl: hmnurl.BuildProjectNewJam(),
SubmittedProjectUrl: "",
Projects: projects, Projects: projects,
NewProjectUrl: hmnurl.BuildProjectNewJam(),
},
TimelineItems: timelineItems, TimelineItems: timelineItems,
}
if c.CurrentUser != nil { projects: jamProjects,
tmpl.UserAvatarUrl = templates.UserAvatarUrl(c.CurrentUser, "dark") }, nil
projects, err := hmndata.FetchProjects(c, c.Conn, c.CurrentUser, hmndata.ProjectsQuery{ }
OwnerIDs: []int{c.CurrentUser.ID},
JamSlugs: []string{hmndata.LJ2024.Slug}, func getTwitchEmbedUrl(c *RequestContext) string {
Limit: 1, twitchEmbedUrl := ""
}) twitchStatus, err := db.QueryOne[models.TwitchLatestStatus](c, c.Conn,
`
SELECT $columns
FROM twitch_latest_status
WHERE twitch_login = $1
`,
"handmadenetwork",
)
if err != nil { if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, oops.New(err, "failed to fetch jam projects for current user")) c.Logger.Warn().Err(err).Msg("failed to query Twitch status for the HMN account")
} } else if twitchStatus.Live {
if len(projects) > 0 { hmnUrl, err := url.Parse(config.Config.BaseUrl)
urlContext := hmndata.UrlContextForProject(&projects[0].Project) if err == nil {
tmpl.SubmittedProjectUrl = urlContext.BuildHomepage() twitchEmbedUrl = fmt.Sprintf("https://player.twitch.tv/?channel=%s&parent=%s", twitchStatus.TwitchLogin, hmnUrl.Hostname())
} }
} }
var res ResponseData return twitchEmbedUrl
res.MustWriteTemplate("jam_2024_lj_feed.html", tmpl, c.Perf)
return res
} }
func JamIndex2023(c *RequestContext) ResponseData { func JamIndex2023(c *RequestContext) ResponseData {

View File

@ -73,6 +73,7 @@ func NewWebsiteRoutes(conn *pgxpool.Pool) http.Handler {
hmnOnly.GET(hmnurl.RegexJamFeed2023, JamFeed2023) hmnOnly.GET(hmnurl.RegexJamFeed2023, JamFeed2023)
hmnOnly.GET(hmnurl.RegexJamIndex2024_Learning, JamIndex2024_Learning) hmnOnly.GET(hmnurl.RegexJamIndex2024_Learning, JamIndex2024_Learning)
hmnOnly.GET(hmnurl.RegexJamFeed2024_Learning, JamFeed2024_Learning) hmnOnly.GET(hmnurl.RegexJamFeed2024_Learning, JamFeed2024_Learning)
hmnOnly.GET(hmnurl.RegexJamGuidelines2024_Learning, JamGuidelines2024_Learning)
hmnOnly.GET(hmnurl.RegexTimeMachine, TimeMachine) hmnOnly.GET(hmnurl.RegexTimeMachine, TimeMachine)
hmnOnly.GET(hmnurl.RegexTimeMachineSubmissions, TimeMachineSubmissions) hmnOnly.GET(hmnurl.RegexTimeMachineSubmissions, TimeMachineSubmissions)