Skip to content

Commit

Permalink
Feat/form modal (#44)
Browse files Browse the repository at this point in the history
* feat: form modal

* style: update
  • Loading branch information
xuliwenwenwen authored Nov 15, 2024
1 parent 5119858 commit b0d57aa
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 17 deletions.
26 changes: 20 additions & 6 deletions pingcap-jp/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
module.exports = {
tabWidth: 2,
useTabs: false,
singleQuote: true,
jsxSingleQuote: false,
printWidth: 100,
trailingComma: 'none'
tabWidth: 4,
useTabs: true,
singleQuote: true,
jsxSingleQuote: false,
printWidth: 100,
trailingComma: 'none',
overrides: [
{
files: '*.scss',
options: {
singleQuote: false
}
},
{
files: '*.css',
options: {
singleQuote: false
}
}
]
};
6 changes: 3 additions & 3 deletions pingcap-jp/css/blocks/tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
cursor: pointer;
i {
font-size: 4rem;
color: #2e33b4;
color: #2C80CE;
}
h5 {
font-size: 14px;
Expand All @@ -212,7 +212,7 @@
margin-bottom: 0;
}
&.active {
background-color: #2e33b4;
background-color: #2C80CE;
h5,
p,
i {
Expand Down Expand Up @@ -241,7 +241,7 @@
}
}
h3 {
border-bottom: 1px solid #3a40e1;
border-bottom: 1px solid #2c80ce;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pingcap-jp/css/scaffold/buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ input[type="submit"],
left: 0;
right: 0;
bottom: -100%;
width: 30px;
height: 30px;
width: 34px;
height: 34px;
border-radius: 50%;
margin: auto;
background: #dc150b;
Expand Down
2 changes: 1 addition & 1 deletion pingcap-jp/css/scaffold/typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ span {
h1 {
font-weight: var(--font-weight-semibold);
font-size: 36px;
line-height: 100%;
line-height: 125%;
color: var(--h1-color);
@include media-min($medium) {
font-size: clamp(36px, 3.65vw, 52px);
Expand Down
4 changes: 4 additions & 0 deletions pingcap-jp/css/vendor/hubspot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
}
}

ul[role="checkbox"] {
list-style: none;
}

input[type="text"],
input[type="number"],
input[type="tel"],
Expand Down
23 changes: 18 additions & 5 deletions pingcap-jp/js/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class App {
templates: {
frontPage: null,
activityPage: null,
aiPage: null,
aiPage: null
},
blocks: {
testimonials: [],
Expand Down Expand Up @@ -122,6 +122,16 @@ class App {
`.trim()
});

const hubspotTriggerEl = Array.from(document.querySelectorAll('.js--trigger-form-modal'));
if (hubspotTriggerEl.length && typeof window.hbspt === 'undefined') {
const script = document.createElement('script');
script.src = '//js.hsforms.net/forms/v2.js';
script.type = 'text/javascript';
script.async = true;

document.head.appendChild(script);
}

/**
* Setup event delegators
*/
Expand Down Expand Up @@ -263,9 +273,13 @@ class App {
});

// posts list - ebook whitepaper
Array.from(document.querySelectorAll('.posts-list-ebook-whitepaper')).forEach((postsListEbookWhitepaperEl) => {
this.instances.components.postsListEbookWhitepaper.push(new PostsListEbookWhitepaper(postsListEbookWhitepaperEl));
});
Array.from(document.querySelectorAll('.posts-list-ebook-whitepaper')).forEach(
(postsListEbookWhitepaperEl) => {
this.instances.components.postsListEbookWhitepaper.push(
new PostsListEbookWhitepaper(postsListEbookWhitepaperEl)
);
}
);

// posts list - case study
Array.from(document.querySelectorAll('.posts-list-case-study')).forEach(
Expand Down Expand Up @@ -313,7 +327,6 @@ class App {
this.instances.templates.aiPage = new AIPage(aiPageEl);
}


const tidbPage = document.querySelector('.tmpl-tidb');
if (tidbPage) {
this.loadRepoInfo();
Expand Down

0 comments on commit b0d57aa

Please sign in to comment.