Compare commits
8 Commits
0e7d53b582
...
d7bcb418d4
Author | SHA1 | Date |
---|---|---|
|
d7bcb418d4 | |
|
77bcf87cd1 | |
|
8c0318c4e2 | |
|
080b47a9a6 | |
|
01ec722ea0 | |
|
e6f36dc0bd | |
|
27e19d4494 | |
|
5d0f58edc1 |
|
@ -0,0 +1 @@
|
|||
use flake
|
|
@ -1,118 +0,0 @@
|
|||
# Frontend Mentor - Multi-step form solution
|
||||
|
||||
This is a solution to the [Multi-step form challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/multistep-form-YVAnSdqQBJ). Frontend Mentor challenges help you improve your coding skills by building realistic projects.
|
||||
|
||||
## Table of contents
|
||||
|
||||
- [Overview](#overview)
|
||||
- [The challenge](#the-challenge)
|
||||
- [Screenshot](#screenshot)
|
||||
- [Links](#links)
|
||||
- [My process](#my-process)
|
||||
- [Built with](#built-with)
|
||||
- [What I learned](#what-i-learned)
|
||||
- [Continued development](#continued-development)
|
||||
- [Useful resources](#useful-resources)
|
||||
- [Author](#author)
|
||||
- [Acknowledgments](#acknowledgments)
|
||||
|
||||
**Note: Delete this note and update the table of contents based on what sections you keep.**
|
||||
|
||||
## Overview
|
||||
|
||||
### The challenge
|
||||
|
||||
Users should be able to:
|
||||
|
||||
- Complete each step of the sequence
|
||||
- Go back to a previous step to update their selections
|
||||
- See a summary of their selections on the final step and confirm their order
|
||||
- View the optimal layout for the interface depending on their device's screen size
|
||||
- See hover and focus states for all interactive elements on the page
|
||||
- Receive form validation messages if:
|
||||
- A field has been missed
|
||||
- The email address is not formatted correctly
|
||||
- A step is submitted, but no selection has been made
|
||||
|
||||
### Screenshot
|
||||
|
||||

|
||||
|
||||
Add a screenshot of your solution. The easiest way to do this is to use Firefox to view your project, right-click the page and select "Take a Screenshot". You can choose either a full-height screenshot or a cropped one based on how long the page is. If it's very long, it might be best to crop it.
|
||||
|
||||
Alternatively, you can use a tool like [FireShot](https://getfireshot.com/) to take the screenshot. FireShot has a free option, so you don't need to purchase it.
|
||||
|
||||
Then crop/optimize/edit your image however you like, add it to your project, and update the file path in the image above.
|
||||
|
||||
**Note: Delete this note and the paragraphs above when you add your screenshot. If you prefer not to add a screenshot, feel free to remove this entire section.**
|
||||
|
||||
### Links
|
||||
|
||||
- Solution URL: [Add solution URL here](https://your-solution-url.com)
|
||||
- Live Site URL: [Add live site URL here](https://your-live-site-url.com)
|
||||
|
||||
## My process
|
||||
|
||||
### Built with
|
||||
|
||||
- Semantic HTML5 markup
|
||||
- CSS custom properties
|
||||
- Flexbox
|
||||
- CSS Grid
|
||||
- Mobile-first workflow
|
||||
- [React](https://reactjs.org/) - JS library
|
||||
- [Next.js](https://nextjs.org/) - React framework
|
||||
- [Styled Components](https://styled-components.com/) - For styles
|
||||
|
||||
**Note: These are just examples. Delete this note and replace the list above with your own choices**
|
||||
|
||||
### What I learned
|
||||
|
||||
Use this section to recap over some of your major learnings while working through this project. Writing these out and providing code samples of areas you want to highlight is a great way to reinforce your own knowledge.
|
||||
|
||||
To see how you can add code snippets, see below:
|
||||
|
||||
```html
|
||||
<h1>Some HTML code I'm proud of</h1>
|
||||
```
|
||||
```css
|
||||
.proud-of-this-css {
|
||||
color: papayawhip;
|
||||
}
|
||||
```
|
||||
```js
|
||||
const proudOfThisFunc = () => {
|
||||
console.log('🎉')
|
||||
}
|
||||
```
|
||||
|
||||
If you want more help with writing markdown, we'd recommend checking out [The Markdown Guide](https://www.markdownguide.org/) to learn more.
|
||||
|
||||
**Note: Delete this note and the content within this section and replace with your own learnings.**
|
||||
|
||||
### Continued development
|
||||
|
||||
Use this section to outline areas that you want to continue focusing on in future projects. These could be concepts you're still not completely comfortable with or techniques you found useful that you want to refine and perfect.
|
||||
|
||||
**Note: Delete this note and the content within this section and replace with your own plans for continued development.**
|
||||
|
||||
### Useful resources
|
||||
|
||||
- [Example resource 1](https://www.example.com) - This helped me for XYZ reason. I really liked this pattern and will use it going forward.
|
||||
- [Example resource 2](https://www.example.com) - This is an amazing article which helped me finally understand XYZ. I'd recommend it to anyone still learning this concept.
|
||||
|
||||
**Note: Delete this note and replace the list above with resources that helped you during the challenge. These could come in handy for anyone viewing your solution or for yourself when you look back on this project in the future.**
|
||||
|
||||
## Author
|
||||
|
||||
- Website - [Add your name here](https://www.your-site.com)
|
||||
- Frontend Mentor - [@yourusername](https://www.frontendmentor.io/profile/yourusername)
|
||||
- Twitter - [@yourusername](https://www.twitter.com/yourusername)
|
||||
|
||||
**Note: Delete this note and add/remove/edit lines above based on what links you'd like to share.**
|
||||
|
||||
## Acknowledgments
|
||||
|
||||
This is where you can give a hat tip to anyone who helped you out on this project. Perhaps you worked in a team or got some inspiration from someone else's solution. This is the perfect place to give them some credit.
|
||||
|
||||
**Note: Delete this note and edit this section's content as necessary. If you completed this challenge by yourself, feel free to delete this section entirely.**
|
|
@ -1,101 +0,0 @@
|
|||
# Frontend Mentor - Multi-step form
|
||||
|
||||

|
||||
|
||||
## Welcome! 👋
|
||||
|
||||
Thanks for checking out this front-end coding challenge.
|
||||
|
||||
[Frontend Mentor](https://www.frontendmentor.io) challenges help you improve your coding skills by building realistic projects.
|
||||
|
||||
**To do this challenge, you need a good understanding of HTML, CSS and JavaScript.**
|
||||
|
||||
## The challenge
|
||||
|
||||
Your challenge is to build out this multi-step form and get it looking as close to the design as possible.
|
||||
|
||||
You can use any tools you like to help you complete the challenge. So if you've got something you'd like to practice, feel free to give it a go.
|
||||
|
||||
Your users should be able to:
|
||||
|
||||
- Complete each step of the sequence
|
||||
- Go back to a previous step to update their selections
|
||||
- See a summary of their selections on the final step and confirm their order
|
||||
- View the optimal layout for the interface depending on their device's screen size
|
||||
- See hover and focus states for all interactive elements on the page
|
||||
- Receive form validation messages if:
|
||||
- A field has been missed
|
||||
- The email address is not formatted correctly
|
||||
- A step is submitted, but no selection has been made
|
||||
|
||||
Want some support on the challenge? [Join our Slack community](https://www.frontendmentor.io/slack) and ask questions in the **#help** channel.
|
||||
|
||||
## Where to find everything
|
||||
|
||||
Your task is to build out the project to the designs inside the `/design` folder. You will find both a mobile and a desktop version of the design.
|
||||
|
||||
The designs are in JPG static format. Using JPGs will mean that you'll need to use your best judgment for styles such as `font-size`, `padding` and `margin`.
|
||||
|
||||
If you would like the design files (we provide Sketch & Figma versions) to inspect the design in more detail, you can [subscribe as a PRO member](https://www.frontendmentor.io/pro).
|
||||
|
||||
All the required assets for this project are in the `/assets` folder. The images are already exported for the correct screen size and optimized.
|
||||
|
||||
We also include variable and static font files for the required fonts for this project. You can choose to either link to Google Fonts or use the local font files to host the fonts yourself. Note that we've removed the static font files for the font weights that aren't needed for this project.
|
||||
|
||||
There is also a `style-guide.md` file containing the information you'll need, such as color palette and fonts.
|
||||
|
||||
## Building your project
|
||||
|
||||
Feel free to use any workflow that you feel comfortable with. Below is a suggested process, but do not feel like you need to follow these steps:
|
||||
|
||||
1. Initialize your project as a public repository on [GitHub](https://github.com/). Creating a repo will make it easier to share your code with the community if you need help. If you're not sure how to do this, [have a read-through of this Try Git resource](https://try.github.io/).
|
||||
2. Configure your repository to publish your code to a web address. This will also be useful if you need some help during a challenge as you can share the URL for your project with your repo URL. There are a number of ways to do this, and we provide some recommendations below.
|
||||
3. Look through the designs to start planning out how you'll tackle the project. This step is crucial to help you think ahead for CSS classes to create reusable styles.
|
||||
4. Before adding any styles, structure your content with HTML. Writing your HTML first can help focus your attention on creating well-structured content.
|
||||
5. Write out the base styles for your project, including general content styles, such as `font-family` and `font-size`.
|
||||
6. Start adding styles to the top of the page and work down. Only move on to the next section once you're happy you've completed the area you're working on.
|
||||
|
||||
## Deploying your project
|
||||
|
||||
As mentioned above, there are many ways to host your project for free. Our recommend hosts are:
|
||||
|
||||
- [GitHub Pages](https://pages.github.com/)
|
||||
- [Vercel](https://vercel.com/)
|
||||
- [Netlify](https://www.netlify.com/)
|
||||
|
||||
You can host your site using one of these solutions or any of our other trusted providers. [Read more about our recommended and trusted hosts](https://medium.com/frontend-mentor/frontend-mentor-trusted-hosting-providers-bf000dfebe).
|
||||
|
||||
## Create a custom `README.md`
|
||||
|
||||
We strongly recommend overwriting this `README.md` with a custom one. We've provided a template inside the [`README-template.md`](./README-template.md) file in this starter code.
|
||||
|
||||
The template provides a guide for what to add. A custom `README` will help you explain your project and reflect on your learnings. Please feel free to edit our template as much as you like.
|
||||
|
||||
Once you've added your information to the template, delete this file and rename the `README-template.md` file to `README.md`. That will make it show up as your repository's README file.
|
||||
|
||||
## Submitting your solution
|
||||
|
||||
Submit your solution on the platform for the rest of the community to see. Follow our ["Complete guide to submitting solutions"](https://medium.com/frontend-mentor/a-complete-guide-to-submitting-solutions-on-frontend-mentor-ac6384162248) for tips on how to do this.
|
||||
|
||||
Remember, if you're looking for feedback on your solution, be sure to ask questions when submitting it. The more specific and detailed you are with your questions, the higher the chance you'll get valuable feedback from the community.
|
||||
|
||||
## Sharing your solution
|
||||
|
||||
There are multiple places you can share your solution:
|
||||
|
||||
1. Share your solution page in the **#finished-projects** channel of the [Slack community](https://www.frontendmentor.io/slack).
|
||||
2. Tweet [@frontendmentor](https://twitter.com/frontendmentor) and mention **@frontendmentor**, including the repo and live URLs in the tweet. We'd love to take a look at what you've built and help share it around.
|
||||
3. Share your solution on other social channels like LinkedIn.
|
||||
4. Blog about your experience building your project. Writing about your workflow, technical choices, and talking through your code is a brilliant way to reinforce what you've learned. Great platforms to write on are [dev.to](https://dev.to/), [Hashnode](https://hashnode.com/), and [CodeNewbie](https://community.codenewbie.org/).
|
||||
|
||||
We provide templates to help you share your solution once you've submitted it on the platform. Please do edit them and include specific questions when you're looking for feedback.
|
||||
|
||||
The more specific you are with your questions the more likely it is that another member of the community will give you feedback.
|
||||
|
||||
## Got feedback for us?
|
||||
|
||||
We love receiving feedback! We're always looking to improve our challenges and our platform. So if you have anything you'd like to mention, please email hi[at]frontendmentor[dot]io.
|
||||
|
||||
This challenge is completely free. Please share it with anyone who will find it useful for practice.
|
||||
|
||||
**Have fun building!** 🚀
|
|
@ -0,0 +1,158 @@
|
|||
* Frontend Mentor - Multi-step form solution
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: frontend-mentor---multi-step-form-solution
|
||||
:END:
|
||||
This is a solution to the
|
||||
[[https://www.frontendmentor.io/challenges/multistep-form-YVAnSdqQBJ][Multi-step
|
||||
form challenge on Frontend Mentor]]. Frontend Mentor challenges help you
|
||||
improve your coding skills by building realistic projects.
|
||||
|
||||
** Overview
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: overview
|
||||
:END:
|
||||
*** The challenge
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: the-challenge
|
||||
:END:
|
||||
Users should be able to:
|
||||
|
||||
- Complete each step of the sequence
|
||||
- Go back to a previous step to update their selections
|
||||
- See a summary of their selections on the final step and confirm their
|
||||
order
|
||||
- View the optimal layout for the interface depending on their device's
|
||||
screen size
|
||||
- See hover and focus states for all interactive elements on the page
|
||||
- Receive form validation messages if:
|
||||
- A field has been missed
|
||||
- The email address is not formatted correctly
|
||||
- A step is submitted, but no selection has been made
|
||||
|
||||
*** Screenshot
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: screenshot
|
||||
:END:
|
||||
[[screenshot-desktop.png]]
|
||||
[[screenshot-mobile.png]]
|
||||
|
||||
*** Links
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: links
|
||||
:END:
|
||||
- Solution URL
|
||||
- [[https://efim-frontentmentor-multi-step-form.onrender.com][Live Site URL]]
|
||||
|
||||
** My process
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: my-process
|
||||
:END:
|
||||
*** Built with
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: built-with
|
||||
:END:
|
||||
- Semantic HTML5 markup
|
||||
well, i tried, but yeah
|
||||
- TailwinCSS
|
||||
- Mobile-first workflow
|
||||
- Server-side rendering, in Scala and Cask
|
||||
- htmx
|
||||
- Thymeleaf html templates
|
||||
|
||||
|
||||
*** What I learned
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: what-i-learned
|
||||
:END:
|
||||
**** hx-get and hx-post
|
||||
***** How i show correct form stage for each user on same URL
|
||||
on 'index.html' i use "initial loading" element
|
||||
#+begin_src html
|
||||
<section hx-get="/get-form" hx-trigger="load" hx-swap="outerHTML">
|
||||
<!-- here be immediate hx-get for the form. to subscitute the body -->
|
||||
<img class="w-14 text-green-500 fill-current" src="../public/images/tail-spin.svg" alt="loading..." />
|
||||
</section>
|
||||
#+end_src
|
||||
|
||||
This element will do single GET request to server to /get-form
|
||||
And user already has cookie with sessionId set from visiting the root enpoint, which returned 'index.html'
|
||||
|
||||
So request to /get-form already includes 'sessionId' cookie, and server can find \ initialize Answers data for this particular session,
|
||||
and 'currentStep' is part of the Answers
|
||||
|
||||
so reloading 'index.html' would trigger /get-form, which would render correct step.
|
||||
***** hx-post
|
||||
This will make POST request.
|
||||
If we do GET request from <input> only current input value is included, as query para.
|
||||
POST request from <input> or from <form> would include all filelds of the form.
|
||||
|
||||
So form submittion on "Next" and "Back" done via htmx POST requests, which parse and save passed attributes, but also server selects required next form step, renders it and returns for the 'hx-swap="outerHTML"'
|
||||
|
||||
hx-post on <input> allows for 'inline validation' (see useful resources)
|
||||
this allows for validating field value - in isolation or together with all other form field values.
|
||||
|
||||
**** Learned format in which browser sends POST attributes to the server
|
||||
Request payload as text:
|
||||
name=e&email=emails%40la.la&phone=%2B7%20(911)%2084-35644%20ext%20155
|
||||
|
||||
I chose this exercise also because i wanted more experience in working with forms.
|
||||
Single form would still be much nicer, even with htmx, but yeah.
|
||||
Current exercise felt like full-fledged application.
|
||||
|
||||
**** Styling of the checkbox and radiobuttons as big selectable areas
|
||||
This was first time I attempted something like this.
|
||||
Insight was to use <label> as overall container for the input and other data - descriptions and icons.
|
||||
|
||||
Because user clicking on label automatically translates into toggling of the input, no js needed.
|
||||
|
||||
Either hide (for radio button part on step 2) or keep (for checkboxes on step 3) the input, and put descriptions and icons as next element.
|
||||
|
||||
So that =peer-= styling can be used.
|
||||
|
||||
**** htmx inline validation of the phone number field
|
||||
Almost exactly as in example.
|
||||
Separate rest endpoint for the input field, which returns new rendered state.
|
||||
|
||||
hx-post is triggered on input field default trigger = "changed",
|
||||
and i guess only on focus leaving field. So this seems quite efficient.
|
||||
|
||||
This way validation can be done with very heavy libraries and access to DB and such. Over single field, or over all of them at once.
|
||||
Seems unusual, but cool
|
||||
*** Continued development
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: continued-development
|
||||
:END:
|
||||
I want to learn more about Thymeleaf - how to use files for efficient fragment
|
||||
storage. Currently it feels that i have separate files, and it's nice, but some
|
||||
files have several fragments, and maybe need more documentation or markings.
|
||||
|
||||
Look for other templating solutions for java \ scala, maybe there are others
|
||||
with 'fragment' functionality
|
||||
|
||||
Would be nice to refactor the code, to have smaller and more directed files.
|
||||
|
||||
I am also getting better at doing flex \ grid layouts without specific
|
||||
paddings\margins on the lements, but feel that i'm still abusing that, and that
|
||||
future tinkering with layouts could be painful due to free space being
|
||||
constructed from manual paddings\margings
|
||||
|
||||
For htmx - would be nice to learn transition animations, and try to use it in a bigger exercise already.
|
||||
|
||||
*** Useful resources
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: useful-resources
|
||||
:END:
|
||||
- htmx inline validation
|
||||
https://htmx.org/examples/inline-validation/
|
||||
- htmx control of parameters sent with response
|
||||
https://htmx.org/docs/#parameters
|
||||
** Acknowledgments
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: acknowledgments
|
||||
:END:
|
||||
- svg animated spinner - from SamHerbert
|
||||
https://github.com/SamHerbert/SVG-Loaders/tree/master
|
||||
http://samherbert.net/svg-loaders/
|
||||
- tailwind elements - for their example of 'switch styled' checkbox
|
||||
which I used as inspiration for my styling
|
||||
https://tailwind-elements.com/docs/standard/forms/switch/
|
|
@ -11,6 +11,7 @@ lazy val multiStepForm = (project in file("."))
|
|||
libraryDependencies ++= Seq(
|
||||
"com.lihaoyi" %% "cask" % "0.9.1",
|
||||
"com.lihaoyi" %% "mainargs" % "0.5.0",
|
||||
"org.thymeleaf" % "thymeleaf" % "3.1.1.RELEASE"
|
||||
"org.thymeleaf" % "thymeleaf" % "3.1.1.RELEASE",
|
||||
"com.googlecode.libphonenumber" % "libphonenumber" % "8.13.16"
|
||||
)
|
||||
)
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
{ pkgs, lib, sbt-derivation }:
|
||||
|
||||
let
|
||||
pname = "multi-step-form";
|
||||
package = sbt-derivation.lib.mkSbtDerivation {
|
||||
inherit pkgs pname;
|
||||
# ...and the rest of the arguments
|
||||
version = "0.0.1";
|
||||
src = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
|
||||
nativeBuildInputs = [ pkgs.nodePackages.tailwindcss ];
|
||||
buildPhase = ''
|
||||
tailwindcss -i ./src/input.css -o ./src/main/resources/public/output.css
|
||||
sbt assembly
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp target/scala-*/${pname}-assembly-*.jar $out/bin/${pname}.jar
|
||||
'';
|
||||
|
||||
depsSha256 = "sha256-Y5RktcE3fxUJci4o7LTuNlBEybTdVRqsG551AkVeRPw=";
|
||||
};
|
||||
|
||||
module = { config, pkgs, ... }:
|
||||
let cfg = config.services.${pname};
|
||||
in {
|
||||
options.services.${pname} = {
|
||||
enable = lib.mkEnableOption "My frontendmentor exercise ${pname}";
|
||||
|
||||
port = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 8080;
|
||||
description = "Port to listen on.";
|
||||
};
|
||||
|
||||
host = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "localhost";
|
||||
description = "Host to bind to.";
|
||||
};
|
||||
|
||||
useNginx = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to use Nginx to proxy requests.";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.groups."${pname}-group" = { };
|
||||
users.users."${pname}-user" = {
|
||||
isSystemUser = true;
|
||||
group = "${pname}-group";
|
||||
};
|
||||
|
||||
systemd.services.${pname} =
|
||||
let serverHost = if cfg.useNginx then "localhost" else cfg.host;
|
||||
in {
|
||||
description = "Exercise app ${pname}";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
startLimitIntervalSec = 30;
|
||||
startLimitBurst = 10;
|
||||
serviceConfig = {
|
||||
ExecStart =
|
||||
"${pkgs.jdk}/bin/java -jar ${package}/bin/${pname}.jar -p ${
|
||||
toString cfg.port
|
||||
} --host ${serverHost}";
|
||||
WorkingDirectory = "${package}/bin";
|
||||
Restart = "on-failure";
|
||||
User = "${pname}-user";
|
||||
Group = "${pname}-group";
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx = lib.mkIf cfg.useNginx {
|
||||
virtualHosts.${cfg.host} = {
|
||||
locations."/".proxyPass = "http://127.0.0.1:${toString cfg.port}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
image = pkgs.dockerTools.buildLayeredImage {
|
||||
name = pname;
|
||||
tag = "latest";
|
||||
created = "now";
|
||||
config = {
|
||||
Cmd = [ "${pkgs.jdk}/bin/java" "-jar" "${package}/bin/${pname}.jar" "--host" "0.0.0.0" ];
|
||||
ExposedPorts = {
|
||||
"8080/tcp" = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
# image = pkgs.dockerTools.buildLayeredImage { # so, wow, this works
|
||||
# name = "hello2";
|
||||
# tag = "latest";
|
||||
# config.Cmd = [ "${pkgs.hello}/bin/hello" ];
|
||||
# };
|
||||
in {
|
||||
package = package;
|
||||
module = module;
|
||||
image = image;
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 112 KiB |
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
|
@ -576,40 +576,21 @@ video {
|
|||
grid-row-start: 1;
|
||||
}
|
||||
|
||||
.m-3 {
|
||||
margin: 0.75rem;
|
||||
}
|
||||
|
||||
.my-7 {
|
||||
margin-top: 1.75rem;
|
||||
margin-bottom: 1.75rem;
|
||||
}
|
||||
|
||||
.my-3 {
|
||||
margin-top: 0.75rem;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.mx-3 {
|
||||
margin-left: 0.75rem;
|
||||
margin-right: 0.75rem;
|
||||
}
|
||||
|
||||
.mx-9 {
|
||||
margin-left: 2.25rem;
|
||||
margin-right: 2.25rem;
|
||||
}
|
||||
|
||||
.my-4 {
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.my-5 {
|
||||
margin-top: 1.25rem;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.my-7 {
|
||||
margin-top: 1.75rem;
|
||||
margin-bottom: 1.75rem;
|
||||
}
|
||||
|
||||
.-mt-20 {
|
||||
margin-top: -5rem;
|
||||
}
|
||||
|
@ -618,6 +599,14 @@ video {
|
|||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.mb-4 {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.ml-16 {
|
||||
margin-left: 4rem;
|
||||
}
|
||||
|
||||
.ml-2 {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
|
@ -638,42 +627,18 @@ video {
|
|||
margin-right: 0.75rem;
|
||||
}
|
||||
|
||||
.mt-\[0\.3rem\] {
|
||||
margin-top: 0.3rem;
|
||||
}
|
||||
|
||||
.mt-3 {
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
.mb-4 {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.mt-2 {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.ml-16 {
|
||||
margin-left: 4rem;
|
||||
}
|
||||
|
||||
.mb-10 {
|
||||
margin-bottom: 2.5rem;
|
||||
}
|
||||
|
||||
.mb-3 {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.mt-4 {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.mt-5 {
|
||||
margin-top: 1.25rem;
|
||||
}
|
||||
|
||||
.mt-\[0\.3rem\] {
|
||||
margin-top: 0.3rem;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
|
@ -686,6 +651,10 @@ video {
|
|||
display: inline-grid;
|
||||
}
|
||||
|
||||
.contents {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
@ -702,6 +671,10 @@ video {
|
|||
height: 3.5rem;
|
||||
}
|
||||
|
||||
.h-16 {
|
||||
height: 4rem;
|
||||
}
|
||||
|
||||
.h-20 {
|
||||
height: 5rem;
|
||||
}
|
||||
|
@ -734,10 +707,6 @@ video {
|
|||
height: 100vh;
|
||||
}
|
||||
|
||||
.h-16 {
|
||||
height: 4rem;
|
||||
}
|
||||
|
||||
.w-11\/12 {
|
||||
width: 91.666667%;
|
||||
}
|
||||
|
@ -792,24 +761,20 @@ video {
|
|||
grid-template-columns: 1fr 100px;
|
||||
}
|
||||
|
||||
.grid-cols-\[auto_1fr\] {
|
||||
grid-template-columns: auto 1fr;
|
||||
}
|
||||
|
||||
.grid-cols-\[repeat\(4\2c _auto\)\] {
|
||||
grid-template-columns: repeat(4, auto);
|
||||
.grid-cols-\[1fr_70px\] {
|
||||
grid-template-columns: 1fr 70px;
|
||||
}
|
||||
|
||||
.grid-cols-\[1fr_auto\] {
|
||||
grid-template-columns: 1fr auto;
|
||||
}
|
||||
|
||||
.grid-cols-\[1fr_50px\] {
|
||||
grid-template-columns: 1fr 50px;
|
||||
.grid-cols-\[auto_1fr\] {
|
||||
grid-template-columns: auto 1fr;
|
||||
}
|
||||
|
||||
.grid-cols-\[1fr_70px\] {
|
||||
grid-template-columns: 1fr 70px;
|
||||
.grid-cols-\[repeat\(4\2c _auto\)\] {
|
||||
grid-template-columns: repeat(4, auto);
|
||||
}
|
||||
|
||||
.flex-row {
|
||||
|
@ -832,12 +797,12 @@ video {
|
|||
align-content: center;
|
||||
}
|
||||
|
||||
.items-center {
|
||||
align-items: center;
|
||||
.items-start {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.justify-items-center {
|
||||
justify-items: center;
|
||||
.items-center {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.gap-x-5 {
|
||||
|
@ -845,14 +810,14 @@ video {
|
|||
column-gap: 1.25rem;
|
||||
}
|
||||
|
||||
.gap-y-4 {
|
||||
row-gap: 1rem;
|
||||
}
|
||||
|
||||
.gap-y-3 {
|
||||
row-gap: 0.75rem;
|
||||
}
|
||||
|
||||
.gap-y-4 {
|
||||
row-gap: 1rem;
|
||||
}
|
||||
|
||||
.divide-y > :not([hidden]) ~ :not([hidden]) {
|
||||
--tw-divide-y-reverse: 0;
|
||||
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
||||
|
@ -896,14 +861,24 @@ video {
|
|||
border-color: hsl(231 11% 63% / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.border-light-gray {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: hsl(229 24% 87% / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.border-white {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(255 255 255 / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.border-light-gray {
|
||||
.border-strawberry-red {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: hsl(229 24% 87% / var(--tw-border-opacity));
|
||||
border-color: hsl(354 84% 57% / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.\!bg-light-blue {
|
||||
--tw-bg-opacity: 1 !important;
|
||||
background-color: hsl(206 94% 87% / var(--tw-bg-opacity)) !important;
|
||||
}
|
||||
|
||||
.bg-green-200 {
|
||||
|
@ -911,11 +886,19 @@ video {
|
|||
background-color: rgb(187 247 208 / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.bg-light-gray\/25 {
|
||||
background-color: hsl(229 24% 87% / 0.25);
|
||||
}
|
||||
|
||||
.bg-magnolia {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: hsl(217 100% 97% / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.bg-magnolia\/75 {
|
||||
background-color: hsl(217 100% 97% / 0.75);
|
||||
}
|
||||
|
||||
.bg-marine-blue {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: hsl(213 96% 18% / var(--tw-bg-opacity));
|
||||
|
@ -931,46 +914,10 @@ video {
|
|||
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.\!bg-red-500 {
|
||||
--tw-bg-opacity: 1 !important;
|
||||
background-color: rgb(239 68 68 / var(--tw-bg-opacity)) !important;
|
||||
}
|
||||
|
||||
.\!bg-white {
|
||||
--tw-bg-opacity: 1 !important;
|
||||
background-color: rgb(255 255 255 / var(--tw-bg-opacity)) !important;
|
||||
}
|
||||
|
||||
.\!bg-light-blue {
|
||||
--tw-bg-opacity: 1 !important;
|
||||
background-color: hsl(206 94% 87% / var(--tw-bg-opacity)) !important;
|
||||
}
|
||||
|
||||
.bg-light-gray {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: hsl(229 24% 87% / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.bg-light-gray\/50 {
|
||||
background-color: hsl(229 24% 87% / 0.5);
|
||||
}
|
||||
|
||||
.bg-light-gray\/25 {
|
||||
background-color: hsl(229 24% 87% / 0.25);
|
||||
}
|
||||
|
||||
.bg-magnolia\/75 {
|
||||
background-color: hsl(217 100% 97% / 0.75);
|
||||
}
|
||||
|
||||
.bg-sidebar-mobile {
|
||||
background-image: url("images/bg-sidebar-mobile.svg");
|
||||
}
|
||||
|
||||
.bg-auto {
|
||||
background-size: auto;
|
||||
}
|
||||
|
||||
.bg-cover {
|
||||
background-size: cover;
|
||||
}
|
||||
|
@ -1001,6 +948,11 @@ video {
|
|||
padding-right: 1.5rem;
|
||||
}
|
||||
|
||||
.px-8 {
|
||||
padding-left: 2rem;
|
||||
padding-right: 2rem;
|
||||
}
|
||||
|
||||
.py-20 {
|
||||
padding-top: 5rem;
|
||||
padding-bottom: 5rem;
|
||||
|
@ -1021,9 +973,12 @@ video {
|
|||
padding-bottom: 2rem;
|
||||
}
|
||||
|
||||
.px-3 {
|
||||
padding-left: 0.75rem;
|
||||
padding-right: 0.75rem;
|
||||
.pb-5 {
|
||||
padding-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.pl-5 {
|
||||
padding-left: 1.25rem;
|
||||
}
|
||||
|
||||
.pl-6 {
|
||||
|
@ -1034,18 +989,6 @@ video {
|
|||
padding-top: 0.75rem;
|
||||
}
|
||||
|
||||
.pl-4 {
|
||||
padding-left: 1rem;
|
||||
}
|
||||
|
||||
.pl-5 {
|
||||
padding-left: 1.25rem;
|
||||
}
|
||||
|
||||
.pb-5 {
|
||||
padding-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
@ -1082,6 +1025,11 @@ video {
|
|||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.\!text-marine-blue {
|
||||
--tw-text-opacity: 1 !important;
|
||||
color: hsl(213 96% 18% / var(--tw-text-opacity)) !important;
|
||||
}
|
||||
|
||||
.text-cool-gray {
|
||||
--tw-text-opacity: 1;
|
||||
color: hsl(231 11% 63% / var(--tw-text-opacity));
|
||||
|
@ -1102,51 +1050,25 @@ video {
|
|||
color: hsl(213 96% 18% / var(--tw-text-opacity));
|
||||
}
|
||||
|
||||
.text-white {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(255 255 255 / var(--tw-text-opacity));
|
||||
}
|
||||
|
||||
.\!text-marine-blue {
|
||||
--tw-text-opacity: 1 !important;
|
||||
color: hsl(213 96% 18% / var(--tw-text-opacity)) !important;
|
||||
}
|
||||
|
||||
.text-purplish-blue {
|
||||
--tw-text-opacity: 1;
|
||||
color: hsl(243 100% 62% / var(--tw-text-opacity));
|
||||
}
|
||||
|
||||
.text-magnolia {
|
||||
.text-white {
|
||||
--tw-text-opacity: 1;
|
||||
color: hsl(217 100% 97% / var(--tw-text-opacity));
|
||||
color: rgb(255 255 255 / var(--tw-text-opacity));
|
||||
}
|
||||
|
||||
.text-alabaster {
|
||||
.text-strawberry-red {
|
||||
--tw-text-opacity: 1;
|
||||
color: hsl(231 100% 99% / var(--tw-text-opacity));
|
||||
color: hsl(354 84% 57% / var(--tw-text-opacity));
|
||||
}
|
||||
|
||||
.underline {
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
|
||||
.accent-green-500 {
|
||||
accent-color: #22c55e;
|
||||
}
|
||||
|
||||
.accent-marine-blue {
|
||||
accent-color: hsl(213, 96%, 18%);
|
||||
}
|
||||
|
||||
.accent-pastel-blue {
|
||||
accent-color: hsl(228, 100%, 84%);
|
||||
}
|
||||
|
||||
.accent-light-blue {
|
||||
accent-color: hsl(206, 94%, 87%);
|
||||
}
|
||||
|
||||
.accent-purplish-blue {
|
||||
accent-color: hsl(243, 100%, 62%);
|
||||
}
|
||||
|
@ -1270,16 +1192,6 @@ html {
|
|||
transition-duration: 150ms;
|
||||
}
|
||||
|
||||
.checked\:bg-marine-blue:checked {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: hsl(213 96% 18% / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.checked\:bg-blue-500:checked {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(59 130 246 / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.checked\:after\:ml-\[1\.2rem\]:checked::after {
|
||||
content: var(--tw-content);
|
||||
margin-left: 1.2rem;
|
||||
|
@ -1290,16 +1202,6 @@ html {
|
|||
border-color: hsl(354 84% 57% / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.invalid\:border-red-500:invalid {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(239 68 68 / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.invalid\:border-green-500:invalid {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(34 197 94 / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.hover\:cursor-pointer:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
@ -1309,38 +1211,10 @@ html {
|
|||
border-color: hsl(243 100% 62% / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.hover\:border-green-700:hover {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(21 128 61 / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.hover\:border-red-700:hover {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(185 28 28 / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.hover\:bg-magnolia\/25:hover {
|
||||
background-color: hsl(217 100% 97% / 0.25);
|
||||
}
|
||||
|
||||
.hover\:bg-magnolia\/\[10\]:hover {
|
||||
background-color: hsl(217 100% 97% / 10);
|
||||
}
|
||||
|
||||
.hover\:bg-magnolia\/\[\.1\]:hover {
|
||||
background-color: hsl(217 100% 97% / .1);
|
||||
}
|
||||
|
||||
.hover\:bg-red-700:hover {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(185 28 28 / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.focus\:border-green-500:focus {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(34 197 94 / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.focus\:border-marine-blue:focus {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: hsl(213 96% 18% / var(--tw-border-opacity));
|
||||
|
@ -1351,24 +1225,6 @@ html {
|
|||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.focus\:outline-marine-blue:focus {
|
||||
outline-color: hsl(213, 96%, 18%);
|
||||
}
|
||||
|
||||
.focus\:outline-green-500:focus {
|
||||
outline-color: #22c55e;
|
||||
}
|
||||
|
||||
.active\:border-red-500:active {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(239 68 68 / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.active\:bg-red-500:active {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.peer:checked ~ .peer-checked\:border-purplish-blue {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: hsl(243 100% 62% / var(--tw-border-opacity));
|
||||
|
@ -1387,14 +1243,6 @@ html {
|
|||
background-color: hsl(217 100% 97% / 0.75);
|
||||
}
|
||||
|
||||
.peer:checked ~ .peer-checked\:bg-magnolia\/25 {
|
||||
background-color: hsl(217 100% 97% / 0.25);
|
||||
}
|
||||
|
||||
.peer:checked ~ .peer-checked\:bg-magnolia\/\[\.1\] {
|
||||
background-color: hsl(217 100% 97% / .1);
|
||||
}
|
||||
|
||||
.peer:checked ~ .peer-checked\:text-cool-gray {
|
||||
--tw-text-opacity: 1;
|
||||
color: hsl(231 11% 63% / var(--tw-text-opacity));
|
||||
|
@ -1406,17 +1254,12 @@ html {
|
|||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.md\:row-span-2 {
|
||||
grid-row: span 2 / span 2;
|
||||
}
|
||||
|
||||
.md\:row-span-1 {
|
||||
grid-row: span 1 / span 1;
|
||||
}
|
||||
|
||||
.md\:mx-10 {
|
||||
margin-left: 2.5rem;
|
||||
margin-right: 2.5rem;
|
||||
.md\:row-span-2 {
|
||||
grid-row: span 2 / span 2;
|
||||
}
|
||||
|
||||
.md\:mx-4 {
|
||||
|
@ -1424,18 +1267,13 @@ html {
|
|||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
.md\:my-10 {
|
||||
margin-top: 2.5rem;
|
||||
margin-bottom: 2.5rem;
|
||||
}
|
||||
|
||||
.md\:my-7 {
|
||||
margin-top: 1.75rem;
|
||||
margin-bottom: 1.75rem;
|
||||
}
|
||||
|
||||
.md\:ml-20 {
|
||||
margin-left: 5rem;
|
||||
.md\:ml-24 {
|
||||
margin-left: 6rem;
|
||||
}
|
||||
|
||||
.md\:mr-24 {
|
||||
|
@ -1446,16 +1284,8 @@ html {
|
|||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.md\:ml-8 {
|
||||
margin-left: 2rem;
|
||||
}
|
||||
|
||||
.md\:ml-10 {
|
||||
margin-left: 2.5rem;
|
||||
}
|
||||
|
||||
.md\:ml-24 {
|
||||
margin-left: 6rem;
|
||||
.md\:mt-2 {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.md\:mt-5 {
|
||||
|
@ -1478,6 +1308,14 @@ html {
|
|||
height: 3rem;
|
||||
}
|
||||
|
||||
.md\:h-20 {
|
||||
height: 5rem;
|
||||
}
|
||||
|
||||
.md\:h-40 {
|
||||
height: 10rem;
|
||||
}
|
||||
|
||||
.md\:h-\[568px\] {
|
||||
height: 568px;
|
||||
}
|
||||
|
@ -1490,28 +1328,8 @@ html {
|
|||
height: 100%;
|
||||
}
|
||||
|
||||
.md\:h-32 {
|
||||
height: 8rem;
|
||||
}
|
||||
|
||||
.md\:h-40 {
|
||||
height: 10rem;
|
||||
}
|
||||
|
||||
.md\:h-10 {
|
||||
height: 2.5rem;
|
||||
}
|
||||
|
||||
.md\:h-16 {
|
||||
height: 4rem;
|
||||
}
|
||||
|
||||
.md\:h-20 {
|
||||
height: 5rem;
|
||||
}
|
||||
|
||||
.md\:h-24 {
|
||||
height: 6rem;
|
||||
.md\:w-20 {
|
||||
width: 5rem;
|
||||
}
|
||||
|
||||
.md\:w-32 {
|
||||
|
@ -1542,14 +1360,14 @@ html {
|
|||
grid-template-columns: auto 1fr;
|
||||
}
|
||||
|
||||
.md\:grid-rows-\[repeat\(4\2c _auto\)\] {
|
||||
grid-template-rows: repeat(4, auto);
|
||||
}
|
||||
|
||||
.md\:grid-rows-\[1fr_auto_auto\] {
|
||||
grid-template-rows: 1fr auto auto;
|
||||
}
|
||||
|
||||
.md\:grid-rows-\[repeat\(4\2c _auto\)\] {
|
||||
grid-template-rows: repeat(4, auto);
|
||||
}
|
||||
|
||||
.md\:flex-row {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
@ -1570,8 +1388,8 @@ html {
|
|||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.md\:justify-between {
|
||||
justify-content: space-between;
|
||||
.md\:justify-center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.md\:gap-x-4 {
|
||||
|
@ -1583,10 +1401,6 @@ html {
|
|||
row-gap: 1.75rem;
|
||||
}
|
||||
|
||||
.md\:gap-y-4 {
|
||||
row-gap: 1rem;
|
||||
}
|
||||
|
||||
.md\:place-self-start {
|
||||
place-self: start;
|
||||
}
|
||||
|
@ -1612,6 +1426,10 @@ html {
|
|||
padding: 2.5rem;
|
||||
}
|
||||
|
||||
.md\:p-4 {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.md\:p-5 {
|
||||
padding: 1.25rem;
|
||||
}
|
||||
|
@ -1620,8 +1438,9 @@ html {
|
|||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.md\:p-4 {
|
||||
padding: 1rem;
|
||||
.md\:px-0 {
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
.md\:px-24 {
|
||||
|
@ -1634,14 +1453,13 @@ html {
|
|||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
.md\:py-4 {
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
.md\:px-6 {
|
||||
padding-left: 1.5rem;
|
||||
padding-right: 1.5rem;
|
||||
}
|
||||
|
||||
.md\:px-0 {
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
.md\:pb-10 {
|
||||
padding-bottom: 2.5rem;
|
||||
}
|
||||
|
||||
.md\:pb-2 {
|
||||
|
@ -1652,12 +1470,12 @@ html {
|
|||
padding-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.md\:pt-5 {
|
||||
padding-top: 1.25rem;
|
||||
.md\:pb-8 {
|
||||
padding-bottom: 2rem;
|
||||
}
|
||||
|
||||
.md\:pb-10 {
|
||||
padding-bottom: 2.5rem;
|
||||
.md\:pt-5 {
|
||||
padding-top: 1.25rem;
|
||||
}
|
||||
|
||||
.md\:text-4xl {
|
||||
|
@ -1670,19 +1488,13 @@ html {
|
|||
line-height: 1.5rem;
|
||||
}
|
||||
|
||||
.md\:text-2xl {
|
||||
font-size: 1.5rem;
|
||||
line-height: 2rem;
|
||||
.md\:text-lg {
|
||||
font-size: 1.125rem;
|
||||
line-height: 1.75rem;
|
||||
}
|
||||
|
||||
.md\:text-6xl {
|
||||
font-size: 3.75rem;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.md\:text-3xl {
|
||||
font-size: 1.875rem;
|
||||
line-height: 2.25rem;
|
||||
.md\:tracking-widest {
|
||||
letter-spacing: 0.1em;
|
||||
}
|
||||
|
||||
.md\:drop-shadow-2xl {
|
||||
|
|
|
@ -33,13 +33,14 @@
|
|||
</head>
|
||||
<body>
|
||||
<main class="grid place-content-center w-screen h-screen bg-magnolia">
|
||||
<section
|
||||
hx-get="/get-form"
|
||||
hx-trigger="load"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
<section hx-get="/get-form" hx-trigger="load" hx-swap="outerHTML">
|
||||
<!-- here be immediate hx-get for the form. to subscitute the body -->
|
||||
<img class="w-14 text-green-500 fill-current" th:src="'public/images/tail-spin.svg'" src="../public/images/tail-spin.svg" alt="loading..." />
|
||||
<img
|
||||
class="w-14 text-green-500 fill-current"
|
||||
th:src="'public/images/tail-spin.svg'"
|
||||
src="../public/images/tail-spin.svg"
|
||||
alt="loading..."
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section class="absolute top-0 end-0" id="new-session-control">
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
method="post"
|
||||
>
|
||||
<summary
|
||||
class="w-full h-44 bg-no-repeat bg-cover md:row-span-2 bg-sidebar-mobile marker:text-white md:bg-sidebar-desktop md:h-[568px] md:w-[274px]"
|
||||
class="w-full h-44 bg-no-repeat bg-cover md:row-span-2 md:tracking-widest bg-sidebar-mobile marker:text-white md:bg-sidebar-desktop md:h-[568px] md:w-[274px]"
|
||||
id="sidebar"
|
||||
th:fragment="stepsSummary(formData)"
|
||||
>
|
||||
|
@ -126,42 +126,81 @@
|
|||
<p class="py-3 text-cool-gray">
|
||||
Please provide your name, email address, and phone number.
|
||||
</p>
|
||||
<label for="name" class="pt-3 text-sm md:pt-5 md:pb-2 text-marine-blue"
|
||||
>Name</label
|
||||
<div class="contents">
|
||||
<label
|
||||
for="name"
|
||||
class="pt-3 text-sm md:pt-5 md:pb-2 text-marine-blue"
|
||||
>Name</label
|
||||
>
|
||||
<input
|
||||
id="name"
|
||||
th:value="${formData.userAnswers.step1.name}"
|
||||
name="name"
|
||||
type="text"
|
||||
required
|
||||
placeholder="e.g. Stephen King"
|
||||
class="p-1 px-4 h-10 text-sm font-semibold rounded border md:p-6 md:px-4 md:text-base md:rounded-lg focus:outline-none placeholder:text-cool-gray invalid:border-strawberry-red focus:border-marine-blue"
|
||||
/>
|
||||
</div>
|
||||
<div class="contents">
|
||||
<label
|
||||
for="email"
|
||||
class="pt-3 text-sm md:pt-5 md:pb-2 text-marine-blue"
|
||||
>Email Address</label
|
||||
>
|
||||
<input
|
||||
id="email"
|
||||
th:value="${formData.userAnswers.step1.email}"
|
||||
name="email"
|
||||
type="email"
|
||||
required
|
||||
placeholder="e.g. stephenking@lorem.com"
|
||||
class="p-1 px-4 h-10 text-sm font-semibold rounded border md:p-6 md:px-4 md:text-base md:rounded-lg focus:outline-none placeholder:text-cool-gray invalid:border-strawberry-red focus:border-marine-blue"
|
||||
/>
|
||||
</div>
|
||||
<!-- Following is email input field
|
||||
it has outer div that sets separate 'value' variable
|
||||
and innder div which denotes fragment, parametrized by this only variable
|
||||
now i should be able to render only this input field as fragment -->
|
||||
<div
|
||||
th:with="value=${formData.userAnswers.step1.phone},error=''"
|
||||
class="contents relative"
|
||||
>
|
||||
<input
|
||||
id="name"
|
||||
th:value="${formData.userAnswers.step1.name}"
|
||||
name="name"
|
||||
type="text"
|
||||
required
|
||||
placeholder="e.g. Stephen King"
|
||||
class="p-1 px-4 h-10 text-sm font-semibold rounded border md:p-6 md:px-4 md:text-base md:rounded-lg focus:outline-none placeholder:text-cool-gray invalid:border-strawberry-red focus:border-marine-blue"
|
||||
/>
|
||||
<label for="email" class="pt-3 text-sm md:pt-5 md:pb-2 text-marine-blue"
|
||||
>Email Address</label
|
||||
>
|
||||
<input
|
||||
id="email"
|
||||
th:value="${formData.userAnswers.step1.email}"
|
||||
name="email"
|
||||
type="email"
|
||||
required
|
||||
placeholder="e.g. stephenking@lorem.com"
|
||||
class="p-1 px-4 h-10 text-sm font-semibold rounded border md:p-6 md:px-4 md:text-base md:rounded-lg focus:outline-none placeholder:text-cool-gray invalid:border-strawberry-red focus:border-marine-blue"
|
||||
/>
|
||||
<label for="phone" class="pt-3 text-sm md:pt-5 md:pb-2 text-marine-blue"
|
||||
>Phone Number</label
|
||||
>
|
||||
<input
|
||||
id="phone"
|
||||
th:value="${formData.userAnswers.step1.phone}"
|
||||
name="phone"
|
||||
type="tel"
|
||||
required
|
||||
placeholder="e.g. +1 234 567 890"
|
||||
class="p-1 px-4 h-10 text-sm font-semibold rounded border md:p-6 md:px-4 md:text-base md:rounded-lg focus:outline-none placeholder:text-cool-gray invalid:border-strawberry-red focus:border-marine-blue"
|
||||
/>
|
||||
<div
|
||||
class="contents"
|
||||
hx-target="this"
|
||||
hx-swap="outerHTML"
|
||||
th:fragment="email-input (value,error)"
|
||||
>
|
||||
<label
|
||||
for="phone"
|
||||
class="pt-3 text-sm md:pt-5 md:pb-2 text-marine-blue"
|
||||
>Phone Number</label
|
||||
>
|
||||
<input
|
||||
id="phone"
|
||||
th:value="${value}"
|
||||
name="phone"
|
||||
type="tel"
|
||||
required
|
||||
placeholder="e.g. +1 234 567 890"
|
||||
class="p-1 px-4 h-10 text-sm font-semibold rounded border md:p-6 md:px-4 md:text-base md:rounded-lg focus:outline-none placeholder:text-cool-gray invalid:border-strawberry-red focus:border-marine-blue"
|
||||
th:classappend="${!error.isEmpty} ? 'border-strawberry-red' : ''"
|
||||
hx-post="/step1/phonenumber"
|
||||
hx-indicator="#ind"
|
||||
/>
|
||||
<div
|
||||
th:if="${error} != null"
|
||||
th:text="${error}"
|
||||
class="text-sm text-strawberry-red">Please enter valid phone number</div>
|
||||
<img
|
||||
id="ind"
|
||||
src="../public/images/tail-spin.svg"
|
||||
th:src="'public/images/tail-spin.svg'"
|
||||
class="absolute w-14 h-14 htmx-indicator"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 1 end -->
|
||||
</section>
|
||||
|
|
|
@ -136,18 +136,20 @@
|
|||
class="grid absolute inset-y-0 inset-x-0 place-content-center h-full rounded-lg border md:grid-cols-1 md:p-4 grid-cols-[auto_1fr] border-light-gray peer-checked:border-purplish-blue peer-checked:bg-magnolia/50 md:grid-rows-[1fr_auto_auto] hover:bg-magnolia/[.1] hover:border-purplish-blue"
|
||||
>
|
||||
<img
|
||||
class="row-span-2 place-self-center px-4 md:row-span-1 md:place-self-start md:px-0"
|
||||
class="place-self-center px-4 md:row-span-1 md:place-self-start md:px-0"
|
||||
th:src="${planType.iconPath}" src="../public/images/icon-arcade.svg" alt="" />
|
||||
<h2 th:text="${planType}" class="font-semibold text-marine-blue">Arcade</h2>
|
||||
<p
|
||||
th:text="|$${formData.planCost(planType)}/${formData.periodCostLabel}|"
|
||||
class="text-sm text-cool-gray"
|
||||
>
|
||||
$90/yr
|
||||
</p>
|
||||
<p th:if="${formData.userAnswers.step2.isYearly}" class="text-xs text-marine-blue">
|
||||
2 months free
|
||||
</p>
|
||||
<div class="flex flex-col items-start">
|
||||
<h2 th:text="${planType}" class="font-semibold text-marine-blue">Arcade</h2>
|
||||
<p
|
||||
th:text="|$${formData.planCost(planType)}/${formData.periodCostLabel}|"
|
||||
class="text-sm text-cool-gray"
|
||||
>
|
||||
$9/mo
|
||||
</p>
|
||||
<p th:if="${formData.userAnswers.step2.isYearly}" class="text-xs text-marine-blue">
|
||||
2 months free
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
|
@ -207,7 +209,7 @@
|
|||
role="switch"
|
||||
id="packageDuration"
|
||||
th:checked="${formData.userAnswers.step2.isYearly}"
|
||||
hx-get="/step2/planTypeInputs"
|
||||
hx-post="/step2/planTypeInputs"
|
||||
hx-target="#plan-type-inputs"
|
||||
hx-swap="outerHTML"
|
||||
/>
|
||||
|
|
|
@ -107,14 +107,14 @@
|
|||
<h1 class="text-2xl font-bold md:text-4xl text-marine-blue">
|
||||
Finishing up
|
||||
</h1>
|
||||
<p class="pt-3 pb-5 text-cool-gray">
|
||||
<p class="pt-3 pb-5 md:pb-8 text-cool-gray">
|
||||
Double-check everything looks OK before confirming.
|
||||
</p>
|
||||
<div
|
||||
class="flex flex-col px-3 w-full text-sm rounded-lg divide-y md:text-base bg-magnolia/75"
|
||||
class="flex flex-col w-full text-sm rounded-lg divide-y md:text-base bg-magnolia/75"
|
||||
id="selection-overview"
|
||||
>
|
||||
<div id="selected-plan" class="grid py-3 grid-cols-[1fr_auto]">
|
||||
<div id="selected-plan" class="grid p-3 md:p-6 grid-cols-[1fr_auto]">
|
||||
<h2 th:text="${formData.fullPlanName}"
|
||||
class="font-bold text-marine-blue"
|
||||
>Arcade (Monthly)</h2>
|
||||
|
@ -134,7 +134,7 @@
|
|||
>Change</a
|
||||
>
|
||||
</div>
|
||||
<div id="selected-addons" class="flex flex-col gap-y-4 py-3 mp-10"
|
||||
<div id="selected-addons" class="flex flex-col gap-y-4 p-3 md:p-6 mp-10"
|
||||
th:if="not ${formData.userAnswers.step3.addonsAsJava.isEmpty}"
|
||||
>
|
||||
<div
|
||||
|
@ -152,7 +152,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<section class="flex flex-row p-3 mt-5">
|
||||
<section class="flex flex-row p-3 mt-5 md:px-6">
|
||||
<p class="grow text-cool-gray">
|
||||
Total (per
|
||||
<span
|
||||
|
@ -162,7 +162,7 @@
|
|||
</p>
|
||||
<p
|
||||
th:text="|+$${formData.fullOrderPrice}/${formData.periodCostLabel}|"
|
||||
class="font-bold text-purplish-blue"
|
||||
class="font-bold md:text-lg text-purplish-blue"
|
||||
>
|
||||
$120
|
||||
</p>
|
||||
|
@ -180,7 +180,7 @@
|
|||
hx-swap="outerHTML"
|
||||
hx-target="#form-step"
|
||||
href="step3.html"
|
||||
class="ml-6 text-sm font-semibold md:pb-3 md:ml-20 md:text-base text-cool-gray"
|
||||
class="ml-6 text-sm font-semibold md:pb-3 md:ml-24 md:text-base text-cool-gray"
|
||||
hx-params="not form-confirmed"
|
||||
>Go Back</a
|
||||
>
|
||||
|
|
|
@ -97,12 +97,12 @@
|
|||
</summary>
|
||||
<section
|
||||
id="multipage-form-container"
|
||||
class="flex flex-col gap-y-4 items-center py-8 py-20 px-6 -mt-20 w-11/12 bg-white rounded-xl md:px-24 md:mt-0 md:w-full drop-shadow-xl md:drop-shadow-none"
|
||||
class="flex flex-col gap-y-4 items-center py-20 px-8 -mt-20 w-11/12 bg-white rounded-xl md:row-span-2 md:justify-center md:px-24 md:mt-0 md:w-full md:h-full drop-shadow-xl md:drop-shadow-none"
|
||||
>
|
||||
<!-- Step 5 start -->
|
||||
|
||||
<img src="../public/images/icon-thank-you.svg" alt="" class="mb-2 w-14 h-14" />
|
||||
<h2 class="text-2xl font-bold">Thank you!</h2>
|
||||
<img src="../public/images/icon-thank-you.svg" alt="" class="mb-2 w-14 h-14 md:w-20 md:h-20" />
|
||||
<h2 class="text-2xl font-bold md:mt-2 md:text-4xl text-marine-blue">Thank you!</h2>
|
||||
<p class="text-center text-cool-gray">
|
||||
Thanks for confirming your subscription! We hope you have fun
|
||||
using our platform. If you ever need support, please feel free
|
||||
|
|
|
@ -49,12 +49,10 @@ object Models {
|
|||
|
||||
final case class Answers(
|
||||
sessionId: String = "",
|
||||
currentStep: Int = 4,
|
||||
currentStep: Int = 1,
|
||||
step1: StepAnswers.Step1 = StepAnswers.Step1(),
|
||||
step2: StepAnswers.Step2 = StepAnswers.Step2(),
|
||||
step3: StepAnswers.Step3 = StepAnswers.Step3(
|
||||
addons = Addons.values.toSet
|
||||
),
|
||||
step3: StepAnswers.Step3 = StepAnswers.Step3(),
|
||||
step4: StepAnswers.Step4 = StepAnswers.Step4()
|
||||
) {
|
||||
// this is not enforced by compiler, sad, maintain by hand in html template files
|
||||
|
|
|
@ -8,7 +8,11 @@ import java.util.UUID
|
|||
import scala.jdk.CollectionConverters._
|
||||
import multistepform.Models.Answers
|
||||
import scala.annotation.internal.requiresCapability
|
||||
import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber.CountryCodeSource
|
||||
import com.google.i18n.phonenumbers.PhoneNumberUtil
|
||||
|
||||
import java.net.URLDecoder
|
||||
import scala.util.Try
|
||||
|
||||
case class Routes()(implicit cc: castor.Context, log: cask.Logger)
|
||||
extends cask.Routes {
|
||||
|
@ -103,9 +107,10 @@ case class Routes()(implicit cc: castor.Context, log: cask.Logger)
|
|||
// and that is not nice
|
||||
val userAnswers = Sessions.sessionReplies.getOrElse(id, Answers(id))
|
||||
|
||||
val submittedData = URLDecoder.decode(request.text() , "UTF-8")
|
||||
val submittedData = URLDecoder.decode(request.text(), "UTF-8")
|
||||
|
||||
val updatedAnswers = userAnswers.updateStep(stepNum, submittedData, nextStep)
|
||||
val updatedAnswers =
|
||||
userAnswers.updateStep(stepNum, submittedData, nextStep)
|
||||
|
||||
Sessions.sessionReplies.update(id, updatedAnswers)
|
||||
|
||||
|
@ -124,24 +129,76 @@ case class Routes()(implicit cc: castor.Context, log: cask.Logger)
|
|||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* This endpoint re-renders 'plan type inputs'
|
||||
* so that togglng monthly\yearly could redraw their html
|
||||
*/
|
||||
@cask.get("/step2/planTypeInputs")
|
||||
def getPlanTypeInputs(sessionId: cask.Cookie, isPackageYearly: Option[String] = None) = {
|
||||
@cask.post("/step1/phonenumber")
|
||||
def validateStep1PhoneNumber(request: cask.Request) = {
|
||||
val submittedData = URLDecoder.decode(request.text(), "UTF-8")
|
||||
println(
|
||||
s"getting data ${request.data} or ${request.text()} or $submittedData"
|
||||
)
|
||||
val fieldValues = submittedData
|
||||
.split("&")
|
||||
.filterNot(_.isEmpty())
|
||||
.map { field =>
|
||||
println(s"looking at field $field")
|
||||
val (name, value) = field.split("=").toList match {
|
||||
case List(name, value) => name -> value
|
||||
case name :: tail => name -> tail.headOption.getOrElse("")
|
||||
case Nil => ???
|
||||
}
|
||||
name -> value
|
||||
}
|
||||
.toMap
|
||||
|
||||
val name = fieldValues.getOrElse("name", "")
|
||||
val email = fieldValues.getOrElse("email", "")
|
||||
val phone = fieldValues.getOrElse("phone", "")
|
||||
|
||||
println(s"after parsing name=$name | email=$email | phone=$phone")
|
||||
|
||||
val phoneUtils = PhoneNumberUtil.getInstance()
|
||||
val phoneNum = Try(
|
||||
phoneUtils.parse(phone, CountryCodeSource.UNSPECIFIED.name())
|
||||
).toOption
|
||||
val isPhoneValid = phoneNum.map(phoneUtils.isValidNumber(_)).getOrElse(false)
|
||||
|
||||
val error = if (isPhoneValid) "" else "Please input valid phone number"
|
||||
|
||||
val context = new Context()
|
||||
context.setVariable("value", phone)
|
||||
context.setVariable("error", error)
|
||||
val inputDiv =
|
||||
templateEngine.process("step1", Set("email-input").asJava, context)
|
||||
|
||||
cask.Response(
|
||||
inputDiv,
|
||||
headers = Seq("Content-Type" -> "text/html;charset=UTF-8")
|
||||
)
|
||||
}
|
||||
|
||||
/** This endpoint re-renders 'plan type inputs' so that togglng monthly\yearly
|
||||
* could redraw their html
|
||||
*/
|
||||
@cask.post("/step2/planTypeInputs")
|
||||
def getPlanTypeInputs(sessionId: cask.Cookie, request: cask.Request) = {
|
||||
val id = sessionId.value
|
||||
val isPackageYearlyBool = isPackageYearly.contains("on")
|
||||
println(s"requesting plan type inputs for $id and $isPackageYearlyBool")
|
||||
val submittedData = URLDecoder.decode(request.text(), "UTF-8")
|
||||
println(s"requesting plan type inputs for $id and $request")
|
||||
Sessions.sessionReplies.get(id) match {
|
||||
case None =>
|
||||
cask.Response("Can't find answers for your session, please reload the page", 404)
|
||||
cask.Response(
|
||||
"Can't find answers for your session, please reload the page",
|
||||
404
|
||||
)
|
||||
case Some(answers) => {
|
||||
// here changing yearly/monthly part of state based on passed checkbox value
|
||||
// and selected plan
|
||||
// only for purposes of rendering the fragment
|
||||
// not persisting, unless next or previous buttons are pressed
|
||||
val withYearlyParamSet = answers.copy(step2 = answers.step2.copy(isYearly = isPackageYearlyBool))
|
||||
val formData = Models.FormData(withYearlyParamSet)
|
||||
val withYearlyParamSetAndSelectedPlan =
|
||||
answers.step2.fromFormData(submittedData)
|
||||
val updatedState =
|
||||
answers.copy(step2 = withYearlyParamSetAndSelectedPlan)
|
||||
val formData = Models.FormData(updatedState)
|
||||
val context = new Context()
|
||||
context.setVariable(formDataContextVarName, formData)
|
||||
val planTypesInputsHtml = templateEngine.process(
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
inherit pkgs sbt-derivation;
|
||||
lib = pkgs.lib;
|
||||
};
|
||||
multi-step-form = import ./15-multi-step-form/default.nix {
|
||||
inherit pkgs sbt-derivation;
|
||||
lib = pkgs.lib;
|
||||
};
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
|
@ -51,6 +55,9 @@
|
|||
packages.rock-paper-scissors = rock-paper-scissors.package;
|
||||
packages.rock-paper-scissors-image = rock-paper-scissors.image;
|
||||
nixosModules.rock-paper-scissors = rock-paper-scissors.module;
|
||||
packages.multi-step-form = multi-step-form.package;
|
||||
packages.multi-step-form-image = multi-step-form.image;
|
||||
nixosModules.multi-step-form = multi-step-form.module;
|
||||
});
|
||||
# see https://serokell.io/blog/practical-nix-flakes
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue