Compare commits

...

15 Commits

Author SHA1 Message Date
efim fadc0c42be feat: installing htmx and toggling card size 2023-06-30 10:03:42 +00:00
efim 3e00aa5f3d feat(13): rest route get single testimonial card
not ideal, that i need separate file, even though i can use the fragment
from the main file.

and having th:eac in same place as th:fragment means rendering that
fragment and passing element over which i'm iterating doesn't help if
collection is empty
2023-06-30 03:44:41 +00:00
efim c9195759a8 feat(13): dynamic grid desktop layout 2023-06-29 19:30:12 +00:00
efim 36b91cd5d1 feat(13): desktop grid styling 2023-06-29 19:09:30 +00:00
efim 4248d1b047 feat(13): encoding data on server 2023-06-29 18:18:33 +00:00
efim 657d7c7407 feat: repeating dynamic testimonial section 2023-06-29 16:59:55 +00:00
efim 951d364380 feat: styling statically all other testimonials 2023-06-29 16:13:05 +00:00
efim 71be19c677 feat: styled first testimony as static page
bg - relative from 'output.css'
image - relative from templates/index.html

ideally i'll figure out how to lay out things, so that relative paths
would be same as paths during deploy
2023-06-29 15:54:47 +00:00
efim ec8c8bb678 feat: setting up mess of thymeleaf.
had problems with th:fragment, getting errors
Caused by: ognl.OgnlException: source is null for getProperty(null, "text")

now will try to style the page as if it's static page, and then add
thymeleaf things
2023-06-29 15:23:47 +00:00
efim 7fac41488c feat: project to play with simpler fragments
my problem was - thinking that th:fragment is not rendered
but it is, and i get null poniter error, because argument is not there

the object under name used in fragment should already be available, for
example take out of th:each
2023-06-29 15:20:59 +00:00
efim 2dff41f428 feat(13): style guide into config 2023-06-29 12:13:18 +00:00
efim d181064165 feat(13): setting up tailwindcss 2023-06-29 11:35:03 +00:00
efim df09abd9a4 feat(13) adding exercise resources 2023-06-29 11:32:14 +00:00
efim d35bf9735c feat(13): starting simple web server 2023-06-28 15:35:34 +00:00
efim 28f2cf281a init(13): new sbt project, main args 2023-06-28 15:24:03 +00:00
34 changed files with 841 additions and 0 deletions

View File

View File

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

View File

@ -0,0 +1,110 @@
# Frontend Mentor - Testimonials grid section solution
This is a solution to the [Testimonials grid section challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/testimonials-grid-section-Nnw6J7Un7). 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 site depending on their device's screen size
### 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,91 @@
# Frontend Mentor - Testimonials grid section
![Design preview for the Testimonials grid section 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 challenge is to build out this testimonials grid section 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:
- View the optimal layout for the site depending on their device's screen size
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,15 @@
ThisBuild / scalaVersion := "3.2.2"
fork := true
ThisBuild / version := "0.0.1"
ThisBuild / organization := "industries.sunshine"
lazy val root = (project in file("."))
.settings(
name := "testimonials-grid-section",
libraryDependencies ++= Seq(
"com.lihaoyi" %% "cask" % "0.9.1",
"com.lihaoyi" %% "mainargs" % "0.5.0",
"org.thymeleaf" % "thymeleaf" % "3.1.1.RELEASE",
)
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

View File

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

View File

@ -0,0 +1,3 @@
addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.1")

@ -0,0 +1 @@
Subproject commit ca03dabed11016f83ab09e18dc783e7e70d4ffc5

View File

@ -0,0 +1 @@
<svg width="104" height="102" xmlns="http://www.w3.org/2000/svg"><path d="M104 102V59.727H84.114c0-5.871.689-11.182 2.068-15.933 1.379-4.75 3.42-9.287 6.125-13.61C95.01 25.86 98.909 22.257 104 19.375V0c-9.758 4.27-17.712 9.874-23.864 16.813-6.151 6.939-10.712 14.545-13.681 22.818C63.485 47.904 62 59.941 62 75.74V102h42zm-62 0V59.727H22.114c0-5.871.689-11.182 2.068-15.933 1.379-4.75 3.42-9.287 6.125-13.61C33.01 25.86 36.909 22.257 42 19.375V0c-9.652 4.27-17.58 9.874-23.784 16.813C12.01 23.752 7.424 31.358 4.455 39.631 1.485 47.904 0 59.941 0 75.74V102h42z" fill="#A775F1" fill-rule="nonzero"/></svg>

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
html {
font-size: 13px;
}

View File

@ -0,0 +1,195 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- displays site properly based on user's device -->
<link href="/dist/output.css" rel="stylesheet" />
<link href="../../../../dist/output.css" rel="stylesheet" th:remove="all" />
<link
rel="icon"
type="image/png"
sizes="32x32"
href="public/images/favicon-32x32.png"
/>
<link href="https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:wght@500;600&display=swap"
rel="stylesheet"
/>
<title>Frontend Mentor | [Challenge Name Here]</title>
<script type="text/javascript" src="public/deps/htmx/dist/htmx.min.js"></script>
<!-- Feel free to remove these styles or customise in your own stylesheet 👍 -->
<style>
.attribution {
font-size: 11px;
text-align: center;
}
.attribution a {
color: hsl(228, 45%, 44%);
}
</style>
</head>
<body class="grid grid-flow-col-dense place-content-center bg-light-grayish-blue">
<div class="py-20 px-7 space-y-7 min-h-screen text-white md:grid md:gap-[30px] md:py-0 md:px-0 h-max max-w-[1200px] md:grid-cols-[repeat(auto-fill,_255px)] md:auto-rows-[280px] md:mt-[160px] md:space-y-0">
<section
th:fragment="testimonialSection(testimonials)"
th:each="testimonial : ${testimonials}"
th:classappend="${testimonial.additionalSizeClasses} + ' ' + ${testimonial.additionalColorClasses}"
class="py-7 px-10 flex flex-col justify-between rounded-xl first:bg-[url('../public/images/bg-pattern-quotation.svg')] bg-no-repeat bg-[right_2rem_top] drop-shadow "
th:id="${testimonial.id}"
th:hx-get="'/testimonial/' + ${testimonial.id} + '?nextOrientation=' + ${testimonial.followupOrientation}"
hx-swap="outerHTML"
>
<div class="flex items-center">
<img
alt="Avatar image"
src="../../../../public/images/image-daniel.jpg"
th:src="${testimonial.avatarUrl}"
class="mr-5 w-10 h-10 rounded-full border-2 border-gray-400"
/>
<div class="grow">
<h1
th:text="${testimonial.author}"
>Daniel Clifford</h1>
<p class="text-sm opacity-50">Verified Graduate</p>
</div>
</div>
<h2 class="text-2xl"
th:text="${testimonial.header}"
>
I received a job offer mid-course, and the subjects I learned were
current, if not more so, in the company I joined. I honestly feel I
got every pennys worth.
</h2>
<p class="opacity-[70%] pb-2 leading-snug"
th:text="${testimonial.text}"
>
“ I was an EMT for many years before I joined the bootcamp. Ive been
looking to make a transition and have heard some people who had an
amazing experience here. I signed up for the free intro course and
found it incredibly fun! I enrolled shortly thereafter. The next 12
weeks was the best - and most grueling - time of my life. Since
completing the course, Ive successfully switched careers, working as
a Software Engineer at a VR startup. ”
</p>
</section>
<section
th:remove="all"
class="py-7 px-10 flex flex-col justify-between rounded-xl bg-very-dark-grayish-blue first:bg-[url('../public/images/bg-pattern-quotation.svg')] bg-no-repeat bg-[right_2rem_top] drop-shadow"
>
<div class="flex items-center">
<img
alt="Avatar image"
src="../../../../public/images/image-jonathan.jpg"
class="mr-5 w-10 h-10 rounded-full border-2 border-gray-400"
/>
<div class="grow">
<h1>Jonathan Walters</h1>
<p class="text-sm opacity-50">Verified Graduate</p>
</div>
</div>
<h2 class="text-2xl">
The team was very supportive and kept me motivated
</h2>
<p class="opacity-[70%] pb-2 leading-snug">
“ I started as a total newbie with virtually no coding skills. I now
work as a mobile engineer for a big company. This was one of the best
investments Ive made in myself. ”
</p>
</section>
<section
th:remove="all"
class="py-7 px-10 flex flex-col justify-between rounded-xl bg-white text-very-dark-blackish-blue first:bg-[url('../public/images/bg-pattern-quotation.svg')] bg-no-repeat bg-[right_2rem_top] drop-shadow"
>
<div class="flex items-center">
<img
alt="Avatar image"
src="../../../../public/images/image-jeanette.jpg"
class="mr-5 w-10 h-10 rounded-full border-2 border-gray-400"
/>
<div class="grow">
<h1>Jeanette Harmon</h1>
<p class="text-sm leading-snug opacity-50">Verified Graduate</p>
</div>
</div>
<h2 class="text-2xl">An overall wonderful and rewarding experience</h2>
<p class="opacity-[70%] pb-2 leading-snug">
“ Thank you for the wonderful experience! I now have a job I really
enjoy, and make a good living while doing something I love. ”
</p>
</section>
<section
th:remove="all"
class="py-7 px-10 flex flex-col justify-between rounded-xl bg-very-dark-blackish-blue text-white first:bg-[url('../public/images/bg-pattern-quotation.svg')] bg-no-repeat bg-[right_2rem_top] drop-shadow md:col-span-2"
>
<div class="flex items-center">
<img
alt="Avatar image"
src="../../../../public/images/image-patrick.jpg"
class="mr-5 w-10 h-10 rounded-full border-2 border-gray-400"
/>
<div class="grow">
<h1>Patrick Abrams</h1>
<p class="text-sm leading-snug opacity-50">Verified Graduate</p>
</div>
</div>
<h2 class="text-2xl">
Awesome teaching support from TAs who did the bootcamp themselves.
Getting guidance from them and learning from their experiences was
easy.
</h2>
<p class="opacity-[70%] pb-2 leading-snug">
“ The staff seem genuinely concerned about my progress which I find
really refreshing. The program gave me the confidence necessary to be
able to go out in the world and present myself as a capable junior
developer. The standard is above the rest. You will get the personal
attention you need from an incredible community of smart and amazing
people. ”
</p>
</section>
<section
th:remove="all"
class="py-7 px-10 flex flex-col justify-between rounded-xl bg-white text-very-dark-blackish-blue first:bg-[url('../public/images/bg-pattern-quotation.svg')] bg-no-repeat bg-[right_2rem_top] drop-shadow md:row-span-2 md:row-start-1 md:col-end-[-1]"
>
<div class="flex items-center">
<img
alt="Avatar image"
src="../../../../public/images/image-kira.jpg"
class="mr-5 w-10 h-10 rounded-full border-2 border-gray-400"
/>
<div class="grow">
<h1>Kira Whittle</h1>
<p class="text-sm opacity-50">Verified Graduate</p>
</div>
</div>
<h2 class="text-2xl">
Such a life-changing experience. Highly recommended!
</h2>
Quis hendrerit dolor magna eget est lorem ipsum dolor sit amet, consectetur adipiscing elit pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis! Nam libero justo, laoreet sit amet cursus sit amet, dictum sit amet justo donec.
<p class="opacity-[70%] pb-2 leading-snug">
“ Before joining the bootcamp, Ive never written a line of code. I
needed some structure from professionals who can help me learn
programming step by step. I was encouraged to enroll by a former
student of theirs who can only say wonderful things about the program.
The entire curriculum and staff did not disappoint. They were very
hands-on and I never had to wait long for assistance. The agile team
project, in particular, was outstanding. It took my learning to the
next level in a way that no tutorial could ever have. In fact, Ive
often referred to it during interviews as an example of my developent
experience. It certainly helped me land a job as a full-stack
developer after receiving multiple offers. 100% recommend! ”
</p>
</section>
</div>
<div class="fixed inset-x-0 bottom-0 attribution">
Challenge by
<a href="https://www.frontendmentor.io?ref=challenge" target="_blank"
>Frontend Mentor</a
>. Coded by <a href="#">Your Name Here</a>.
</div>
</body>
</html>

View File

@ -0,0 +1,3 @@
<section
th:replace="index::testimonialSection(testimonials=${selectedTestimonials})">
</section>

View File

@ -0,0 +1,86 @@
package testimonialsgrid
import mainargs.{main, arg, ParserForMethods}
import cask.main.Routes
import org.thymeleaf.context.Context
import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver
import org.thymeleaf.TemplateEngine
import scala.jdk.CollectionConverters._
object Main {
@main def run(
@arg(
name = "port",
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"
): Unit = {
println(s"Will start server on ${hostArg}:${portArg}")
val server = new cask.Main {
override def allRoutes: Seq[Routes] = Seq(AppRoutes())
override def port: Int = portArg
override def host: String = 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 {
val templateResolver = new ClassLoaderTemplateResolver()
templateResolver.setPrefix("templates/");
templateResolver.setSuffix(".html")
templateResolver.setTemplateMode("HTML5")
val templateEngine = new TemplateEngine()
templateEngine.setTemplateResolver(templateResolver)
@cask.get("/")
def index() = {
val context = new Context()
context.setVariable(
"testimonials",
Testimonial.sameAsRequested.asJava
)
val result = templateEngine.process("index", context)
cask.Response(
result,
headers = Seq("Content-Type" -> "text/html;charset=UTF-8")
)
}
@cask.get("/testimonial/:id")
def getTestimonial(id: String, nextOrientation: Int) = {
println(s"got params $nextOrientation")
val context = new Context()
// wow, i need copy because attributes are vars and not vals,
// didn't have to think about this in a long long time
val foundTestimonial =
Testimonial.sameAsRequested.find(_.id == id).get.copy()
foundTestimonial.setNextSizeClass(nextOrientation)
println(
s"should change size and orientation : $foundTestimonial "
)
context.setVariable("selectedTestimonials", List(foundTestimonial).asJava)
val result = templateEngine.process("testimonialSection", context)
cask.Response(
result,
headers = Seq("Content-Type" -> "text/html;charset=UTF-8")
)
}
@cask.staticFiles("/dist")
def distFiles() = "dist"
@cask.staticFiles("/public")
def publicFiles() = "public"
initialize()
}
}

View File

@ -0,0 +1,143 @@
package testimonialsgrid
import scala.beans.BeanProperty
import java.util.UUID
import scala.util.Random
final case class Testimonial(
@BeanProperty var avatarUrl: String,
@BeanProperty var author: String,
@BeanProperty var header: String,
@BeanProperty var text: String,
@BeanProperty var id: String,
@BeanProperty var additionalColorClasses: String,
@BeanProperty var additionalSizeClasses: String,
@BeanProperty var followupOrientation: Int = 0,
sequentSizeClasses: List[String] = List("")
) {
def setNextSizeClass(key: Int): Unit = {
println(s"searching next for $key in $sequentSizeClasses")
val nextOrientationIndex = (key + 1) % sequentSizeClasses.size
this.additionalSizeClasses = sequentSizeClasses(nextOrientationIndex)
this.followupOrientation = nextOrientationIndex
}
}
object Testimonial {
val colorful = List(
new Testimonial(
"public/images/image-patrick.jpg",
"Leopold",
" Odio facilisis mauris sit amet massa vitae tortor condimentum lacinimport java.util.UUID ia quis vel eros donec ac odio tempor orci dapibus ultrices. ",
" Nibh sed pulvinar proin gravida hendrerit? Massa tincidunt nunc pulvinar sapien et ligula libero nunc!",
UUID.randomUUID().toString(),
"bg-red-500",
""
),
new Testimonial(
"public/images/image-jonathan.jpg",
"Aragorn",
" Eleifend donec pretium vulputate sapien nec sagittis aliquam malesuada bibendum! ",
" Egestas fringilla phasellus faucibus scelerisque eleifend! Dignissim enim, sit amet venenatis urna cursus eget nunc scelerisque viverra mauris, in aliquam sem fringilla ut morbi tincidunt augue interdum velit euismod in! ",
UUID.randomUUID().toString(),
"bg-blue-500",
"md:col-span-2"
),
new Testimonial(
"public/images/image-jeanette.jpg",
"Jeanatte Mamamia",
" Id venenatis a, condimentum vitae sapien pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas sed tempus, urna et pharetra pharetra! ",
" Amet nulla facilisi morbi tempus iaculis urna, id volutpat lacus laoreet non curabitur gravida arcu ac tortor dignissim convallis aenean et tortor. Lorem dolor, sed viverra ipsum nunc aliquet bibendum? ",
UUID.randomUUID().toString(),
"bg-green-200 text-black",
"md:row-span-2"
),
new Testimonial(
"public/images/image-kira.jpg",
"Mamma mia",
" Id venenatis a, condimentum vitae sapien pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas sed tempus, urna et pharetra pharetra! ",
""" Quis hendrerit dolor magna eget est lorem ipsum dolor sit amet, consectetur adipiscing elit pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis! Nam libero justo, laoreet sit amet cursus sit amet, dictum sit amet justo donec.
""",
UUID.randomUUID().toString(),
"bg-amber-200 text-black",
"md:col-span-2"
)
)
val sameAsRequested = List(
new Testimonial(
"public/images/image-daniel.jpg",
"Daniel Clifford",
"""I received a job offer mid-course, and the subjects I learned were current, if not more so,
in the company I joined. I honestly feel I got every pennys worth.
""",
""" I was an EMT for many years before I joined the bootcamp. Ive been looking to make a
transition and have heard some people who had an amazing experience here. I signed up
for the free intro course and found it incredibly fun! I enrolled shortly thereafter.
The next 12 weeks was the best - and most grueling - time of my life. Since completing
the course, Ive successfully switched careers, working as a Software Engineer at a VR startup.
""",
UUID.randomUUID().toString(),
"bg-moderate-violet",
"md:col-span-2",
sequentSizeClasses = List("md:row-span-2", "md:col-span-2")
),
new Testimonial(
"public/images/image-jonathan.jpg",
"Jonathan Walters",
" The team was very supportive and kept me motivated ",
""" " Egestas fringilla phasellus faucibus scelerisque eleifend! Dignissim enim, sit amet venenatis urna cursus eget nunc scelerisque viverra mauris, in aliquam sem fringilla ut morbi tincidunt augue interdum velit euismod in! ",
""",
UUID.randomUUID().toString(),
"bg-very-dark-grayish-blue",
"md:col-span-1"
),
new Testimonial(
"public/images/image-jeanette.jpg",
"Jeanette Harmon",
"An overall wonderful and rewarding experience",
""" Thank you for the wonderful experience! I now have a job I really enjoy, and make a good living
while doing something I love.
""",
UUID.randomUUID().toString(),
"bg-white text-very-dark-blackish-blue",
"md:col-span-1"
),
new Testimonial(
"public/images/image-patrick.jpg",
"Patrick Abrams",
""" " Eleifend donec pretium vulputate sapien nec sagittis aliquam malesuada bibendum! ",
""",
""" The staff seem genuinely concerned about my progress which I find really refreshing. The program
gave me the confidence necessary to be able to go out in the world and present myself as a capable
junior developer. The standard is above the rest. You will get the personal attention you need from
an incredible community of smart and amazing people.
""",
UUID.randomUUID().toString(),
"bg-very-dark-blackish-blue",
"md:col-span-2",
sequentSizeClasses = List("md:row-span-2", "md:col-span-2")
),
new Testimonial(
"public/images/image-kira.jpg",
"Kira Whittle",
" Such a life-changing experience. Highly recommended! ",
""" Before joining the bootcamp, Ive never written a line of code. I
needed some structure from professionals who can help me learn
programming step by step. I was encouraged to enroll by a former
student of theirs who can only say wonderful things about the program.
The entire curriculum and staff did not disappoint. They were very
hands-on and I never had to wait long for assistance. The agile team
project, in particular, was outstanding. It took my learning to the
next level in a way that no tutorial could ever have. In fact, Ive
often referred to it during interviews as an example of my developent
experience. It certainly helped me land a job as a full-stack
developer after receiving multiple offers. 100% recommend!
""",
UUID.randomUUID().toString(),
"bg-white text-very-dark-blackish-blue",
"md:row-span-2 md:col-end-[-1] md:row-start-1",
sequentSizeClasses = List("md:row-span-2","md:col-span-2")
)
)
}

View File

@ -0,0 +1,8 @@
package example
class ExampleSuite extends munit.FunSuite:
test("addition") {
assert(1 + 1 == 2)
}
end ExampleSuite

View File

@ -0,0 +1,38 @@
# Front-end Style Guide
## Layout
The designs were created to the following widths:
- Mobile: 375px
- Desktop: 1440px
## Colors
### Primary
Moderate violet: hsl(263, 55%, 52%)
Very dark grayish blue: hsl(217, 19%, 35%)
Very dark blackish blue: hsl(219, 29%, 14%)
White: hsl(0, 0%, 100%)
### Neutral
Light gray: hsl(0, 0%, 81%)
Light grayish blue: hsl(210, 46%, 95%)
Note for text colors:
1. "Verified Graduate" has the same color as the person's name with 50% opacity
2. Review paragraphs inside the quotations have the same color as well, but are at 70% opacity
## Typography
### Body Copy
- Font size: 13px
### Font
- Family: [Barlow Semi Condensed](https://fonts.google.com/specimen/Barlow+Semi+Condensed)
- Weights: 500, 600

View File

@ -0,0 +1,24 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{html,scala}"],
theme: {
extend: {
colors: {
'moderate-violet': 'hsl(263, 55%, 52%)',
'very-dark-grayish-blue': 'hsl(217, 19%, 35%)',
'very-dark-blackish-blue': 'hsl(219, 29%, 14%)',
'light-gray': 'hsl(0, 0%, 81%)',
'light-grayish-blue': 'hsl(210, 46%, 95%)',
},
fontFamily: {
'sans': ['Barlow Semi Condensed', 'sans-serif'], // This will set Roboto as the default sans font
},
fontWeight: {
'normal': 400,
'bold': 500,
}
},
},
plugins: [],
}

View File

View File

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

View File

@ -0,0 +1,9 @@
val toolkitV = "0.1.7"
val toolkit = "org.scala-lang" %% "toolkit" % toolkitV
val toolkitTest = "org.scala-lang" %% "toolkit-test" % toolkitV
ThisBuild / scalaVersion := "3.2.2"
libraryDependencies += toolkit
libraryDependencies += (toolkitTest % Test)
libraryDependencies += "org.thymeleaf" % "thymeleaf" % "3.1.1.RELEASE"

View File

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

View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Good Thymes Virtual Grocery</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div th:remove="all">
<section th:fragment="mySection(dateVar, person)" >
This is text
<p th:text="${dateVar}">
and this should be dinamic
</p>
<p th:text="${person}">
and this for the person
</p>
<p th:text="${me.firstName}">
and this for the outer state
</p>
</section>
</div>
<div th:remove="all">
<div th:fragment="myDiv" >
anohter fragment
<p th:text="${onevar}">
here should use onevar
</p>
</div>
</div>
<h2>here check myDiv fragment</h2>
<div th:replace="::myDiv" th:with="onevar=${me}"></div>
<div th:replace="::myDiv (onevar=${me})"></div>
<h2>here check secion fragment</h2>
<section th:replace=":: mySection(${today}, ${me})">
</section>
<p>Today is: <span th:text="${today}">13 February 2011</span></p>
<p>Testing class: <span th:text="${me.firstName}">John Doe</span></p>
</body>
</html>

View File

@ -0,0 +1,4 @@
package example
@main def main(args: String*): Unit =
println(s"Hello ${args.mkString}")

View File

@ -0,0 +1,47 @@
package example
import org.thymeleaf.context.Context
import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver
import org.thymeleaf.TemplateEngine
import java.io.Writer
import java.io.PrintWriter
import java.io.File
import org.thymeleaf.exceptions.TemplateEngineException
import org.thymeleaf.templateresolver.TemplateResolution
import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver
import java.text.SimpleDateFormat
import java.util.Date
object TestTemplate extends App {
val now = new SimpleDateFormat("dd MMMM YYYY - HH:mm").format(new Date())
import scala.beans.BeanProperty
class Person(
@BeanProperty var firstName: String,
@BeanProperty var lastName: String
) {
override def toString = s"Person: $firstName $lastName"
}
val ctx = new Context()
ctx.setVariable("today", now)
ctx.setVariable("me", new Person("Efim", "Nefedov"))
val templateResolver = new ClassLoaderTemplateResolver()
templateResolver.setPrefix("templates/");
templateResolver.setSuffix(".html")
templateResolver.setTemplateMode("HTML5")
val templateEngine = new TemplateEngine()
templateEngine.setTemplateResolver(templateResolver)
templateEngine.setTemplateResolver(templateResolver)
val writer = new PrintWriter(System.out)
val result = templateEngine.process("home", ctx)
// VIEW RESULTS
val text = new String(result.getBytes())
println("TEXT: " + text)
}

View File

@ -0,0 +1,8 @@
package example
class ExampleSuite extends munit.FunSuite:
test("addition") {
assert(1 + 1 == 2)
}
end ExampleSuite