Compare commits

...

15 Commits

Author SHA1 Message Date
efim 73bd2eba84 feat(11): initial module with a service 2023-06-27 13:19:23 +00:00
efim e7594ef2eb feat: nix build enabled 2023-06-26 20:52:44 +00:00
efim ef63cd474f feat: adding assebly
run with
 java -jar ./target/scala-3.3.0/priceGrid-assembly-0.0.1.jar
build with
assebly command in sbt
2023-06-26 18:50:36 +00:00
efim 44340882ab feat: moving to sbt for building
it will be able to build into nix with sbt-derivation
oh well
2023-06-26 18:42:42 +00:00
efim dbe2cd47da feat: accepting port and host
using lihaoyi mainargs, yay
and running .main on custom cask.Main

had a problem with run arguments "port" and "host" having same name as
inner attributes of cask.Main and i guess infinite recursion when i
tried to reference outer args, the more you know
2023-06-26 16:43:05 +00:00
efim a5402c1fe2 refactor(11): allow passing routes configuration 2023-06-26 15:37:30 +00:00
efim e5210fb26f fix(11): style & sizes 2023-06-26 14:14:48 +00:00
efim 57e0347c53 feat(11): adding font from google fonts 2023-06-26 14:03:42 +00:00
efim 88fe55bf45 feat(11): styling for mobile and desktop 2023-06-26 13:58:59 +00:00
efim 5294516707 refactor(11): putting index.html into scalatags 2023-06-26 10:35:08 +00:00
efim 05cdea56de feat(11): adding static files and task style guide 2023-06-26 08:02:26 +00:00
efim 6fec3d54ee init(11): setting up tailwindcss 2023-06-26 06:55:28 +00:00
efim 4475943a98 init(11): simplest scala scaffolding 2023-06-26 06:55:23 +00:00
efim fd75be6abe feat: enabling TailwindCSS styling
with manual running of cli:
tailwindcss -i ./src/input.css -o ./dist/output.css --watch
2023-06-26 06:01:03 +00:00
efim 98d6f77014 feat: returning some basic pages 2023-06-25 19:47:09 +00:00
24 changed files with 699 additions and 19 deletions

11
.gitignore vendored
View File

@ -2,3 +2,14 @@
.scala-build/
.metals/
.direnv
*/dist/
/11-single-price-grid-component/.bloop/
*/project/project/
*/project/metals.sbt
*/project/.bloop
*/project/target/
*/target/
*/result
result

View File

@ -0,0 +1,12 @@
.bsp/
.scala-build/
.metals/
.direnv
*/dist/
/11-single-price-grid-component/.bloop/
*/project/project/
*/project/metals.sbt
*/project/.bloop
*/project/target/
*/target/

View File

View File

@ -0,0 +1,2 @@
version = "3.7.3"
runner.dialect = scala3

View File

@ -0,0 +1,111 @@
# Frontend Mentor - Single price grid component solution
This is a solution to the [Single price grid component challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/single-price-grid-component-5ce41129d0ff452fec5abbbc). 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:
- View the optimal layout for the component depending on their device's screen size
- See a hover state on desktop for the Sign Up call-to-action
### Screenshot
![](./screenshot.jpg)
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.**

View File

@ -0,0 +1,88 @@
# Frontend Mentor - Single price grid component
![Design preview for the Single price grid component coding challenge](./design/desktop-preview.jpg)
## 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 basic understanding of HTML and CSS.**
## The challenge
Your users should be able to:
- View the optimal layout for the component depending on their device's screen size
- See a hover state on desktop for the Sign Up call-to-action
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).
You will find all the required assets in the `/images` folder. The assets are already optimized.
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!** 🚀

View File

@ -0,0 +1,23 @@
scalaVersion := "3.3.0"
fork := true
ThisBuild / version := "0.0.1"
ThisBuild / organization := "industries.sunshine"
lazy val root = (project in file("."))
.settings(
name := "priceGrid",
assembly / mainClass := Some("pricegrid.App"),
libraryDependencies ++= Seq(
"com.lihaoyi" %% "cask" % "0.9.1",
"com.lihaoyi" %% "scalatags" % "0.12.0",
"com.lihaoyi" %% "mainargs" % "0.5.0"
),
libraryDependencies ++= Seq(
"com.lihaoyi" %% "cask" % "0.9.1" % Test,
"com.lihaoyi" %% "scalatags" % "0.12.0" % Test,
"com.lihaoyi" %% "mainargs" % "0.5.0" % Test
)
)

View File

@ -0,0 +1,72 @@
{ pkgs, lib, sbt-derivation }:
let
package = sbt-derivation.lib.mkSbtDerivation {
inherit pkgs;
# ...and the rest of the arguments
pname = "price-grid-app";
version = "0.0.1";
src = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
nativeBuildInputs = [ pkgs.nodePackages.tailwindcss ];
buildPhase = ''
sbt assembly
tailwindcss -i ./src/input.css -o ./output.css
'';
# css path different from ordinary development,
# because .gitignore makes it unavailable during nix build
# anyway copied to correct place
installPhase = ''
mkdir -p $out/bin
cp target/scala-*/priceGrid-assembly-*.jar $out/bin/priceGridApp.jar
mkdir -p $out/bin/dist
cp ./output.css $out/bin/dist/output.css
cp -r public $out/bin/public
'';
depsSha256 = "sha256-aWLqnPXvchtNqpSfXo5sWyK2QFNn1GqToy58cWrML3U=";
};
module = { config, pkgs, ... }:
let cfg = config.services.priceGridService;
in {
options.services.priceGridService = {
enable = lib.mkEnableOption "My service";
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.";
};
};
config = lib.mkIf cfg.enable {
users.groups.price-grid-app-group = { };
users.users.price-grid-app-user = {
isSystemUser = true;
group = "price-grid-app-group";
};
systemd.services.price-grid-app = {
description = "My Java Service";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
ExecStart =
"${pkgs.jdk}/bin/java -jar ${package}/bin/priceGridApp.jar -p ${toString cfg.port} --host ${cfg.host}";
Restart = "on-failure";
User = "price-grid-app-user";
Group = "price-grid-app-group";
};
};
};
};
in {
package = package;
module = module;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -0,0 +1 @@
sbt.version=1.9.0

View File

@ -0,0 +1 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.1")

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,20 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
html {
font-size: 16px;
}
.attribution {
font-size: 11px;
text-align: center;
}
.attribution a {
color: hsl(228, 45% 44%);
}
/* div, p, h1, h2 { */
/* outline: 1px solid red; */
/* } */

View File

@ -0,0 +1,42 @@
//> using dep com.lihaoyi::cask:0.9.1
//> using dep com.lihaoyi::scalatags:0.12.0
//> using dep com.lihaoyi::mainargs:0.5.0
package pricegrid
import scalatags.Text.all._
import scalatags.Text.tags2
import scalatags.Text.short
import mainargs.{main, arg, ParserForMethods}
object App {
@main
def run(@arg(name = "post", short = 'p', doc = "Port on which server will start serving.")
portArg: Int = 8080,
@arg(name = "host", doc = "Host on which server will start serving.")
hostArg: String = "localhost") = {
println(s"Will start server on ${hostArg}:${portArg}")
val server = new cask.Main {
override val allRoutes = Seq(AppRoutes())
override def port = portArg
override def host = hostArg
}
server.main(Array.empty)
}
def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args)
}
case class AppRoutes()(implicit cc: castor.Context,
log: cask.Logger) extends cask.Routes {
@cask.get("/")
def index() = Page.wholePageMarkup
@cask.staticFiles("/dist") // this is what path gets matched
def distFiles() = "dist"
@cask.staticFiles("/public") // this is what path gets matched
def publicFiles() = "public"
initialize()
}

View File

@ -0,0 +1,135 @@
package pricegrid
import scalatags.Text.all._
import scalatags.Text.tags2
object Page {
/**
* Page content - grid layout of separate elements
* contains grid control styles
*/
lazy val bodyMarkup = body(
`class` := "bg-neutral-gray w-screen h-screen px-7 py-16 drop-shadow-2xl",
`class` := "md:grid md:place-content-center",
div(
`class` := "grid md:grid-cols-2 md:auto-rows-min",
`class` := "md:h-[475px] md:w-[640px]",
joinOurCommunity(
`class` := "md:col-span-2 rounded-t-md",
),
signup(
`class` := "md:rounded-bl-md",
),
whyUs(
`class` := "rounded-b-md md:rounded-bl-none",
)
),
footerMarkup
)
lazy val joinOurCommunity = div(
`class` := "bg-white flex flex-col gap-y-4 p-6 py-7 ",
`class` := "md:px-10 md:gap-y-0",
h1(
`class` := "text-xl text-primary-cyan font-bold",
`class` := "md:text-2xl md:my-3",
"Join our community"
),
h2(
`class` := "text-sm text-primary-yellow font-bold",
`class` := "md:text-lg md:my-2",
"30-day, hassle-free money back guarantee"
),
p(
`class` := "text-xs text-grayish-blue leading-loose ",
`class` := "md:text-base md:leading-relaxed md:mb-2",
"""
Gain access to our full library of tutorials along with expert code reviews.
Perfect for any developers who are serious about honing their skills.
"""
)
)
lazy val signup = div(
`class` := "bg-bg-subscription text-white p-6 ",
`class` := "md:p-10",
h2(
`class` := "text-md font-bold mb-4 md:text-lg",
"Monthly Subscription"
),
div(
`class` := "flex flex-row items-center mb-2",
p(`class` := "text-3xl font-bold md:text-3xl", "$29"),
p(`class` := "font-extralight text-sm ml-3 text-neutral-gray", "per month")
),
p(`class` := "text-sm", "Full access for less than $1 a day"),
button(
`class` := "w-full bg-primary-yellow rounded-lg h-12 mt-7 drop-shadow-xl font-bold",
`class` := "md:text-md",
"Sign Up"
)
)
lazy val whyUs = div(
`class` := "bg-bg-why-us text-white p-6 md:text-lg",
`class` := "md:p-10",
h2(
`class` := "font-bold mb-3",
"Why Us"),
ul(
List(
" Tutorials by industry experts ",
" Peer & expert code review ",
" Coding exercises ",
" Access to our GitHub repos ",
" Community forum ",
" Flashcard decks ",
" New videos every week "
).map(linkText =>
li(
`class` := "text-xs text-neutral-gray pt-1 md:font-light md:text-sm md:leading-tight",
linkText)
)
)
)
lazy val wholePageMarkup = doctype("html")(
html(
lang := "en",
head(
meta(charset := "UTF-8"),
meta(
name := "viewport",
content := "width=device-width, initial-scale=1.0"
),
tags2.title("Frontend Mentor | Single Price Grid Component"),
link(
href := "https://fonts.googleapis.com/css2?family=Karla:wght@400;700&display=swap",
rel := "stylesheet",
),
link(
rel := "icon",
`type` := "image/png",
href := "/public/images/favicon-32x32.png"
),
link(rel := "stylesheet", href := "/dist/output.css")
),
bodyMarkup
)
)
lazy val footerMarkup = footer(
p(
cls := "attribution fixed bottom-0 inset-x-0",
"Challenge by ",
a(
href := "https://www.frontendmentor.io?ref=challenge",
target := "_blank",
"Frontend Mentor. "
),
"Coded by ",
a(href := "#", "Your Name Here")
)
)
}

View File

@ -0,0 +1,31 @@
# Front-end Style Guide
## Layout
The designs were created to the following widths:
- Mobile: 375px
- Desktop: 1440px
## Colors
### Primary
- Cyan: hsl(179, 62%, 43%)
- Bright Yellow: hsl(71, 73%, 54%)
### Neutral
- Light Gray: hsl(204, 43%, 93%)
- Grayish Blue: hsl(218, 22%, 67%)
## Typography
### Body Copy
- Font size: 16px
### Font
- Family: [Karla](https://fonts.google.com/specimen/Karla)
- Weights: 400, 700

View File

@ -0,0 +1,25 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.scala"],
theme: {
extend: {
fontFamily: {
'sans': ['Karla', 'sans-serif']
},
fontWeight: {
'normal': 400,
'bold': 700,
},
colors: {
'primary-cyan': 'hsl(179, 62%, 43%)',
'primary-yellow': 'hsl(71, 73%, 54%)',
'neutral-gray': 'hsl(204, 43%, 93%)',
'grayish-blue': 'hsl(218, 22%, 67%)',
'bg-subscription': 'hsl(179, 61%, 44%)',
'bg-why-us': 'hsl(179, 47%, 52%)',
}
},
},
plugins: [],
}

View File

@ -18,6 +18,21 @@
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1687695299,
@ -36,7 +51,29 @@
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"sbt-derivation": "sbt-derivation"
}
},
"sbt-derivation": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1675083208,
"narHash": "sha256-+sSFhSpV2jckr1qYlX/SaxQ6IdpagD6o4rru/3HAl0I=",
"owner": "zaninime",
"repo": "sbt-derivation",
"rev": "92d6d6d825e3f6ae5642d1cce8ff571c3368aaf7",
"type": "github"
},
"original": {
"owner": "zaninime",
"repo": "sbt-derivation",
"type": "github"
}
},
"systems": {

View File

@ -2,20 +2,31 @@
description = "learning htmx";
inputs.nixpkgs.url = "github:nixos/nixpkgs";
inputs.flake-utils.url = "github:numtide/flake-utils";
# add this line
inputs.sbt-derivation.url = "github:zaninime/sbt-derivation";
# recommended for first style of usage documented below, but not necessary
inputs.sbt-derivation.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.scala-cli
pkgs.sbt
pkgs.scalafmt
];
};
}
);
outputs = { self, nixpkgs, flake-utils, sbt-derivation }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
price-grid = import ./11-single-price-grid-component/default.nix {
inherit pkgs sbt-derivation;
lib = pkgs.lib;
};
in {
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.scala-cli
pkgs.sbt
pkgs.scalafmt
pkgs.nodePackages.tailwindcss
pkgs.jdk
];
};
packages.price-grid-app = price-grid.package;
nixosModules.price-grid-app = price-grid.module;
});
# see https://serokell.io/blog/practical-nix-flakes
}

View File

@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@ -1,15 +1,61 @@
//> using dep com.lihaoyi::cask:0.9.1
//> using dep com.softwaremill.quicklens::quicklens:1.9.4
//> using dep com.lihaoyi::pprint:0.8.1
//> using dep org.scalameta::munit:1.0.0-M1
//> using dep com.lihaoyi::scalatags:0.12.0
// import munit.FunSuite
package app
import scalatags.Text.all._
import scala.util.Random
import scalatags.Text.tags2
object Main extends cask.MainRoutes {
@cask.get("/")
def hello() = {
"Hello world!"
doctype("html")(
html(
head(
tags2.title("Trying out the starter page"),
meta(
charset := "UTF-8"
),
meta(
name := "viewport",
content := "width=device-width, initial-scale=1.0"
),
link(rel := "stylesheet", href := "/dist/output.css")
// title("Hello testing")
),
body(
cls := "bg-blue-50 grid place-content-center h-screen",
div(
h1(
cls := "text-2xl font-bold",
"This is it, the start"),
p("Let's keep going"),
ul(
Range(1, 15).map(index =>
li(a(s"article with number $index", href := s"/article/$index", cls := "underline text-blue-500"))
)
)
)
)
)
)
}
@cask.staticFiles("/dist")
def staticFileRoutes() = "/dist"
@cask.get("/article/:id")
def articlePage(id: Long) = {
doctype("html")(
html(
body(
h1(s"Reading article $id"),
p(Random.nextString(100))
)
)
)
}
@cask.post("/do-thing")

View File

@ -0,0 +1,9 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.scala"],
theme: {
extend: {},
},
plugins: [],
}