- Notifications
You must be signed in to change notification settings - Fork328
Dan hp update components#1394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
8 commits Select commitHold shift + click to select a range
451eb14
add components for new homepage
chillenberger464bad7
components for homepage
chillenbergerb6e441f
Merge branch 'master' into dan-hp-update-components
chillenbergerdc79cc3
fix bug
chillenbergerdf92273
remove dead code
chillenberger84526bd
Merge branch 'master' into dan-hp-update-components
chillenbergerefb4e27
put timed back on carousel
chillenberger6aa4ec1
fmt and lint
chillenbergerFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
10 changes: 10 additions & 0 deletionspgml-dashboard/src/components/cards/marketing/mod.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// This file is automatically generated. | ||
// You shouldn't modify it manually. | ||
// src/components/cards/marketing/slider | ||
pub mod slider; | ||
pub use slider::Slider; | ||
// src/components/cards/marketing/twitter_testimonial | ||
pub mod twitter_testimonial; | ||
pub use twitter_testimonial::TwitterTestimonial; |
56 changes: 56 additions & 0 deletionspgml-dashboard/src/components/cards/marketing/slider/mod.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
use pgml_components::component; | ||
use sailfish::TemplateOnce; | ||
#[derive(TemplateOnce, Default, Clone)] | ||
#[template(path = "cards/marketing/slider/template.html")] | ||
pub struct Slider { | ||
title: String, | ||
link: String, | ||
image: String, | ||
bullets: Vec<String>, | ||
state: String, | ||
} | ||
impl Slider { | ||
pub fn new() -> Slider { | ||
Slider { | ||
title: String::new(), | ||
link: String::new(), | ||
image: String::new(), | ||
bullets: Vec::new(), | ||
state: String::new(), | ||
} | ||
} | ||
pub fn title(mut self, title: &str) -> Self { | ||
self.title = title.to_string(); | ||
self | ||
} | ||
pub fn link(mut self, link: &str) -> Self { | ||
self.link = link.to_string(); | ||
self | ||
} | ||
pub fn image(mut self, image: &str) -> Self { | ||
self.image = image.to_string(); | ||
self | ||
} | ||
pub fn bullets(mut self, bullets: Vec<String>) -> Self { | ||
self.bullets = bullets; | ||
self | ||
} | ||
pub fn active(mut self) -> Self { | ||
self.state = String::from("active"); | ||
self | ||
} | ||
pub fn disabled(mut self) -> Self { | ||
self.state = String::from("disabled"); | ||
self | ||
} | ||
} | ||
component!(Slider); |
57 changes: 57 additions & 0 deletionspgml-dashboard/src/components/cards/marketing/slider/slider.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
div[data-controller="cards-marketing-slider"] { | ||
.card { | ||
display: flex; | ||
max-width: 440px; | ||
padding: 38px 24px; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 24px; | ||
border-radius: 20px; | ||
transition: transform 0.3s; | ||
width: 440px; | ||
height: 100%; | ||
min-height: 550px; | ||
background: #{$gray-700}; | ||
&.disabled { | ||
transform: scale(0.9); | ||
background: #{$gray-800} !important; | ||
min-height: 492px; | ||
} | ||
} | ||
@include media-breakpoint-down(sm) { | ||
.card, .card.disabled { | ||
width: 100%; | ||
} | ||
} | ||
.card-body { | ||
gap: 24px; | ||
} | ||
.link { | ||
display: flex; | ||
width: fit-content; | ||
} | ||
} | ||
.disabled { | ||
div[data-controller="cards-marketing-slider"] { | ||
.card { | ||
transform: scale(0.9); | ||
background: #{$gray-800} !important; | ||
min-height: 492px; | ||
.card-body, .title { | ||
color: #{$gray-300}; | ||
} | ||
.link { | ||
visibility: hidden; | ||
} | ||
} | ||
} | ||
} | ||
23 changes: 23 additions & 0 deletionspgml-dashboard/src/components/cards/marketing/slider/template.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<% | ||
use crate::components::icons::Checkmark; | ||
%> | ||
<div data-controller="cards-marketing-slider"> | ||
<div class="card <%- state %>"> | ||
<div class="card-body d-flex flex-column p-0 w-100"> | ||
<img class="img-fluid" src="<%- image %>" alt="feature image"> | ||
<div class="d-flex gap-3 flex-column h-100"> | ||
<h5 class="title"><%- title %></h5> | ||
<ul class="list-group gap-3"> | ||
<% for bullet in bullets {%> | ||
<div class="d-flex flex-row align-items-center gap-2"> | ||
<%+ Checkmark::new().active() %><div class="d-flex align-items-center gap-2"><%- bullet %></div> | ||
</div> | ||
<% } %> | ||
</ul> | ||
<% if link.len() > 0 {%> | ||
<a class="link mt-auto btn btn-tertiary goto-arrow-hover-trigger p-0" href="<%- link %>">Learn More <span class="material-symbols-outlined goto-arrow-shift-animation">arrow_forward</span></a> | ||
<% } %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
51 changes: 51 additions & 0 deletionspgml-dashboard/src/components/cards/marketing/twitter_testimonial/mod.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use pgml_components::component; | ||
use sailfish::TemplateOnce; | ||
#[derive(TemplateOnce, Default, Clone)] | ||
#[template(path = "cards/marketing/twitter_testimonial/template.html")] | ||
pub struct TwitterTestimonial { | ||
statement: String, | ||
image: String, | ||
name: String, | ||
handle: String, | ||
verified: bool, | ||
} | ||
impl TwitterTestimonial { | ||
pub fn new() -> TwitterTestimonial { | ||
TwitterTestimonial { | ||
statement: String::from("src/components/cards/marketing/twitter_testimonial"), | ||
image: String::new(), | ||
name: String::new(), | ||
handle: String::new(), | ||
verified: false, | ||
} | ||
} | ||
pub fn statement(mut self, statement: &str) -> Self { | ||
self.statement = statement.to_owned(); | ||
self | ||
} | ||
pub fn image(mut self, image: &str) -> Self { | ||
self.image = image.to_owned(); | ||
self | ||
} | ||
pub fn name(mut self, name: &str) -> Self { | ||
self.name = name.to_owned(); | ||
self | ||
} | ||
pub fn handle(mut self, handle: &str) -> Self { | ||
self.handle = handle.to_owned(); | ||
self | ||
} | ||
pub fn verified(mut self) -> Self { | ||
self.verified = true; | ||
self | ||
} | ||
} | ||
component!(TwitterTestimonial); |
20 changes: 20 additions & 0 deletionspgml-dashboard/src/components/cards/marketing/twitter_testimonial/template.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<% | ||
use crate::components::icons::Twitter as twitter_icon; | ||
use crate::components::icons::Checkmark; | ||
%> | ||
<div data-controller="cards-marketing-twitter-testimonial"> | ||
<div class="card card-dark gap-2 rounded-4"> | ||
<p class="text-soft-white"><%- statement %></p> | ||
<div class="d-flex flex-row justify-content-between align-items-center"> | ||
<div class="d-flex flex-row gap-2"> | ||
<img src="<%= image %>" alt="<%= name %>" class="rounded-circle" style="width: 42px; height: 42px;"> | ||
<div class="d-flex flex-column text-white-300"> | ||
<div class="d-flex flex-row gap-1"><p class="m-0"><%- name %></p><% if verified {%><%+ Checkmark::new().twitter() %><% } %></div> | ||
<p class="m-0">@<%- handle %></p> | ||
</div> | ||
</div> | ||
<%+ twitter_icon::new() %> | ||
</div> | ||
</div> | ||
</div> |
6 changes: 6 additions & 0 deletionspgml-dashboard/src/components/cards/marketing/twitter_testimonial/twitter_testimonial.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
div[data-controller="cards-marketing-twitter-testimonial"] { | ||
.card { | ||
padding: 32px 24px; | ||
min-width: 288px; | ||
} | ||
} |
3 changes: 3 additions & 0 deletionspgml-dashboard/src/components/cards/mod.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletionspgml-dashboard/src/components/carousel/carousel.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -4,45 +4,4 @@ div[data-controller="carousel"] { | ||
transition-property: margin-left; | ||
transition-duration: 700ms; | ||
} | ||
} |
51 changes: 24 additions & 27 deletionspgml-dashboard/src/components/carousel/carousel_controller.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.