Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add view-transition for description and time fields from create to event #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions templates/create.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
<link href="/assets/bootstrap.min.css" rel="stylesheet">
<title>{{ .title }}</title>
<style>
@view-transition {
navigation: auto;
}
#Description {
view-transition-name: description;
}
#Start {
view-transition-name: when;
}
.container {
margin-top: 20px;
max-width: 600px; /* Sets a maximum width for the container */
Expand Down
13 changes: 11 additions & 2 deletions templates/event.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
<link href="/assets/nice-forms.css" rel="stylesheet">
<title>{{ .title }}</title>
<style>
@view-transition {
navigation: auto;
}
#Description {
view-transition-name: description;
}
#When {
view-transition-name: when;
}
.form-label {
margin-right: 10px;
white-space: nowrap; /* Prevents label from wrapping */
Expand Down Expand Up @@ -84,8 +93,8 @@
<body>
<div class="section-group">
<div class="section-primary">
<h1>{{.event.Description}}</h1>
<p><script>document.write(new Date("{{.event.PrettyStart}}").toLocaleDateString('en-US', {weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: '2-digit'}));</script></p>
<h1 id="Description">{{.event.Description}}</h1>
<p id="When"><script>document.write(new Date("{{.event.PrettyStart}}").toLocaleDateString('en-US', {weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: '2-digit'}));</script></p>
<form action="/rsvp" method="post" class="form">
<fieldset class="nice-form-group">
<legend>{{ .rsvpHeader }}</legend>
Expand Down