Skip to content

Commit

Permalink
Data bubble navigation (canonical#1056)
Browse files Browse the repository at this point in the history
  • Loading branch information
carkod authored Oct 19, 2023
1 parent ecb3da9 commit c6dc06f
Show file tree
Hide file tree
Showing 11 changed files with 358 additions and 134 deletions.
1 change: 0 additions & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
],
"ignoreFiles": ["static/sass/_hljs.scss"],
"rules": {
"order/properties-alphabetical-order": true,
"no-invalid-position-at-import-rule": null,
"scss/at-mixin-pattern": null,
"declaration-empty-line-before": null,
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
"watch-js": "watch -p 'static/js/**/!(*.test)*.{jsx,ts,tsx}' -c 'node build.js'",
"build": "yarn run build-css && yarn run build-js",
"build-css": "sass static/sass/styles.scss static/css/styles.css --load-path=node_modules --style=compressed && postcss --map false --use autoprefixer --replace 'static/css/**/*.css'",
"build-js": "node build.js && yarn run build-cookie-policy && yarn run build-fuse && yarn run build-latest-news",
"build-js": "node build.js && yarn run build-cookie-policy && yarn run build-fuse && yarn run build-latest-news && yarn run build-global-nav",
"build-cookie-policy": "mkdir -p static/js/modules/cookie-policy && cp node_modules/@canonical/cookie-policy/build/js/cookie-policy.js static/js/modules/cookie-policy",
"build-latest-news": "mkdir -p static/js/modules/latest-news && cp node_modules/@canonical/latest-news/dist/latest-news.js static/js/modules/latest-news",
"build-fuse": "mkdir -p static/js/modules/fuse && cp node_modules/fuse.js/dist/fuse.js static/js/modules/fuse",
"build-global-nav": "mkdir -p static/js/modules/global-nav && cp node_modules/@canonical/global-nav/dist/global-nav.js static/js/modules/global-nav",
"format-python": "black --line-length 79 webapp tests",
"format-prettier": "prettier -w 'static/js/*.{js,jsx,ts,tsx}' 'static/sass/*.scss'",
"lint-python": "flake8 --extend-ignore=E203 webapp tests && black --check --line-length 79 webapp tests",
Expand All @@ -25,6 +26,7 @@
"dependencies": {
"@canonical/cookie-policy": "3.5.0",
"@canonical/latest-news": "1.4.1",
"@canonical/global-nav": "3.6.1",
"@testing-library/cypress": "9.0.0",
"autoprefixer": "10.4.13",
"concurrently": "7.6.0",
Expand Down
115 changes: 115 additions & 0 deletions static/sass/_pattern_global-nav.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
@mixin canonical-p-global-nav {
.global-nav__row {
max-width: $grid-max-width;
}

// Using id to override inherited styles from Vanilla and project
#g-navigation {
background-color: $color-dark;
height: 2rem;
line-height: 1rem;

@media screen and (max-width: $breakpoint-large - 1) {
.p-navigation__nav {
height: 100vh;
left: 0;
padding-top: 0.5rem;
position: relative;
top: -1rem;
width: 100%;
}
}

.p-global-nav-anchors {
@extend %small-text;

color: $color-mid-light;
font-weight: $font-weight-thin;
padding-top: 0.3rem;
padding-bottom: 0;
text-decoration: none;
}

.p-navigation__nav {
background-color: $color-dark;
}

#all-canonical-link {
@extend .p-global-nav-anchors;
}

@media screen and (min-width: $breakpoint-large - 1) {
padding-left: 0;
}

.p-navigation__banner {
@media screen and (max-width: $breakpoint-small) {
padding-left: 1rem;
}
}

.global-nav__header-link-anchor {
padding: 0.5rem auto 0.5rem 1.5rem;

&::after {
color: $color-mid-light;
top: 0.5rem;
}

@media screen and (max-width: $breakpoint-large - 1) {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
padding-left: 1.5rem;
}
}

.p-navigation__dropdown {
background-color: $color-dark;
}
}

#all-canonical-mobile {
.p-navigation__dropdown-item {
padding-left: 1.5rem;
}

.global-nav__header-link-anchor::after {
color: $color-mid-light;
top: 0.8rem;
}
}

.global-nav {
@media screen and (max-width: $breakpoint-large - 1) {
position: relative;

}
}

.global-nav-dropdown {
top: 1.5rem;
}

.p-navigation__toggle--open, .p-navigation__toggle--close {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}

.data-fabric-menu {
padding-left: 0;
padding-right: 0;

.p-navigation__toggle--open {
margin-top: 0;
padding-top: 0.5rem;
}
}

.global-nav-dropdown.show-content {
top: 1.9rem;
}

#all-canonical-desktop {
background-color: $color-dark;
}
}
12 changes: 10 additions & 2 deletions static/sass/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
@import "@canonical/cookie-policy/build/css/cookie-policy";

$color-brand: #7c355d;
$color-dark: $colors--dark-theme--background-default;
$color-tabs-active-bar: $colors--light-theme--text-default;
$nudge--small: 0.55rem;
$p-small-lh-diff: map-get($line-heights, default-text) -
Expand All @@ -22,6 +21,7 @@ $p-small-lh-diff: map-get($line-heights, default-text) -
@import "pattern_navigation";
@import "pattern_search-panel";
@import "pattern_careers-progression";
@import "pattern_global-nav";

@include vanilla;
@include vf-p-icon-status-waiting;
Expand All @@ -42,6 +42,7 @@ $p-small-lh-diff: map-get($line-heights, default-text) -
@include canonical-p-search-panel;
@include canonical-u-footer-align-bottom;
@include canonical-p-careers-progression;
@include canonical-p-global-nav;

.js-find-a-partner__partner {
// find-a-partner search
Expand Down Expand Up @@ -786,4 +787,11 @@ $p-small-lh-diff: map-get($line-heights, default-text) -
float: right;
position: sticky;
}
}
}

// /data UX requirement align to the left for smaller devices
.p-data-logos {
@media screen and (min-width: $breakpoint-large - 1) {
text-align: right;
}
}
4 changes: 2 additions & 2 deletions templates/data/_form-data-kafka.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h2 class="p-heading--4 u-sv1" id="modal-title"><strong>Talk to our Apache Kafka
</div>
<div class="col">
<div class="js-pagination js-pagination--1">
<form action="https://ubuntu.com/marketo/submit" method="post" id="mktoForm_5505" class="modal-form p-form p-form--stacked">
<form action="https://ubuntu.com/marketo/submit" method="post" id="mktoForm_5522" class="modal-form p-form p-form--stacked">
<div class="u-sv2">
<h3 class="p-heading--5">Tell us more about your Kafka use case</h3>
<textarea id="Comments_from_lead__c" name="Comments_from_lead__c" aria-label="Anything you'd like to communicate about your needs or interests?" rows="3" placeholder="Anything you'd like to communicate about your needs or interests?"></textarea>
Expand Down Expand Up @@ -65,7 +65,7 @@ <h3 class="p-heading--5">How should we get in touch?</h3>

<div class="u-hide">
<input type="hidden" aria-hidden="true" aria-label="hidden field" name="returnURL" value="{{ returnURL }}" />
<input type="hidden" aria-hidden="true" aria-label="hidden field" name="formid" value="5505" />
<input type="hidden" aria-hidden="true" aria-label="hidden field" name="formid" value="5522" />
<input type="hidden" aria-hidden="true" aria-label="hidden field" name="Consent_to_Processing__c" value="yes" />
<input type="hidden" aria-hidden="true" aria-label="hidden field" name="acquisition_url" id="acquisition_url" value="{{ request.url }}" />
<input type="hidden" aria-hidden="true" aria-label="hidden field" name="utm_campaign" id="utm_campaign" value="" />
Expand Down
4 changes: 2 additions & 2 deletions templates/data/_form-data-opensearch.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h2 class="p-heading--1" id="modal-title">Talk to our OpenSearch&reg; experts</h
</div>
<div class="col">
<button class="p-modal__close p-modal-close-button" aria-controls="data-spark-modal" aria-label="Close active modal" style="margin-top: 0;">Close</button>
<form id action="https://ubuntu.com/marketo/submit" method="post" id="mktoForm_5505" class="modal-form p-form p-form--stacked">
<form id action="https://ubuntu.com/marketo/submit" method="post" id="mktoForm_5520" class="modal-form p-form p-form--stacked">
<h3 class="p-heading--5">Tell us more about your OpenSearch&reg; use case</h3>
<textarea id="Comments_from_lead__c" name="Comments_from_lead__c" aria-label="Anything you'd like to communicate about your needs or interests?" rows="3" placeholder="Anything you'd like to communicate about your needs or interests?"></textarea>
<h3 class="p-heading--5" id="modal-description">How should we get in touch?</h3>
Expand Down Expand Up @@ -45,7 +45,7 @@ <h3 class="p-heading--5" id="modal-description">How should we get in touch?</h3>

<div class="u-hide">
<input type="hidden" aria-hidden="true" aria-label="hidden field" name="returnURL" value="{{ returnURL }}" />
<input type="hidden" aria-hidden="true" aria-label="hidden field" name="formid" value="5505" />
<input type="hidden" aria-hidden="true" aria-label="hidden field" name="formid" value="5520" />
<input type="hidden" aria-hidden="true" aria-label="hidden field" name="Consent_to_Processing__c" value="yes" />
<input type="hidden" aria-hidden="true" aria-label="hidden field" name="acquisition_url" id="acquisition_url" value="{{ request.url }}" />
<input type="hidden" aria-hidden="true" aria-label="hidden field" name="utm_campaign" id="utm_campaign" value="" />
Expand Down
129 changes: 80 additions & 49 deletions templates/data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,79 +82,110 @@ <h2>Advanced automation for your most critical data</h2>
</div>
</div>
<div class="row">
<div class="col-start-large-4 col-9 col-start-medium-3 col-medium-4">
<div class="p-logo-section u-align-text--right">
<div class="col-12">
<div class="p-logo-section p-data-logos">
<div class="p-logo-section__items">
<div class="p-logo-section__item">
<a href="/data/kafka">
{{
image (
url="https://assets.ubuntu.com/v1/c2d27381-kafka.png",
alt="",
width="228",
height="256",
hi_def=True,
loading="lazy",
attrs={"class": "p-logo-section__logo"}
) | safe
}}
</a>
</div>
<div class="p-logo-section__item">
<a href="/data/spark">
<div class="p-logo-section__item">
{{
image (
url="https://assets.ubuntu.com/v1/6e18d17f-apache-spark-logo.png",
alt="",
width="150",
url="https://assets.ubuntu.com/v1/24c6bf62-postgre-sql.png",
alt="PostgreSQL",
width="356",
height="256",
hi_def=True,
loading="lazy",
attrs={"class": "p-logo-section__logo"}
) | safe
}}
</a>
<hr class="p-rule">
<p class="u-align-text--left">
<a class="off-screen" href="/data/docs/postgresql/iaas">Learn more<span class="u-off-screen"> about PostgreSQL</span>&nbsp;&rsaquo;</a>
</p>
</div>
<div class="p-logo-section__item">
<a href="/data/opensearch">
<div class="p-logo-section__item">
{{
image (
url="https://assets.ubuntu.com/v1/8a6fdaab-opensearch-logo.png",
alt="",
width="319",
height="256",
url="https://assets.ubuntu.com/v1/0c7a5744-mysql-logo.png",
alt="MySQL",
width="490",
height="512",
hi_def=True,
loading="lazy",
attrs={"class": "p-logo-section__logo"}
) | safe
}}
</a>
<hr class="p-rule">
<p class="u-align-text--left">
<a class="off-screen" href="/data/docs/mysql/iaas">Learn more <span class="u-off-screen"> about MySQL</span>&nbsp;&rsaquo;</a>
</p>
</div>
<div class="p-logo-section__item">
<div class="p-logo-section__item">
{{
image (
url="https://assets.ubuntu.com/v1/662c72e2-mongodb.png",
alt="MongoDB",
width="425",
height="512",
hi_def=True,
loading="lazy",
attrs={"class": "p-logo-section__logo"}
) | safe
}}
<hr class="p-rule">
<p class="u-align-text--left">
<a class="off-screen" href="/data/mongodb">Learn more<span class="u-off-screen"> about MongoDB</span>&nbsp;&rsaquo;</a>
</p>
</div>
<div class="p-logo-section__item">
{{
image (
url="https://assets.ubuntu.com/v1/24c6bf62-postgre-sql.png",
alt="",
width="356",
url="https://assets.ubuntu.com/v1/6e18d17f-apache-spark-logo.png",
alt="Spark",
width="150",
height="256",
hi_def=True,
loading="lazy",
attrs={"class": "p-logo-section__logo"}
) | safe
}}
<hr class="p-rule">
<p class="u-align-text--left">
<a class="off-screen" href="/data/spark">Learn more<span class="u-off-screen"> about Spark</span>&nbsp;&rsaquo;</a>
</p>
</div>
<div class="p-logo-section__item">
{{
image (
url="https://assets.ubuntu.com/v1/24e7e1e9-mysql-logo.png",
alt="",
width="183",
height="256",
hi_def=True,
loading="lazy",
attrs={"class": "p-logo-section__logo"}
) | safe
}}
{{
image (
url="https://assets.ubuntu.com/v1/c2d27381-kafka.png",
alt="Kafka",
width="228",
height="256",
hi_def=True,
loading="lazy",
attrs={"class": "p-logo-section__logo"}
) | safe
}}
<hr class="p-rule">
<p class="u-align-text--left">
<a class="off-screen" href="/data/kafka">Learn more<span class="u-off-screen"> about Kafka</span>&nbsp;&rsaquo;</a>
</p>
</div>
<div class="p-logo-section__item" style="margin-right: 0;">
{{
image (
url="https://assets.ubuntu.com/v1/8a6fdaab-opensearch-logo.png",
alt="OpenSearch",
width="319",
height="256",
hi_def=True,
loading="lazy",
attrs={"class": "p-logo-section__logo"}
) | safe
}}
<hr class="p-rule">
<p class="u-align-text--left">
<a class="off-screen" href="/data/opensearch">Learn more<span class="u-off-screen"> about OpenSearch</span>&nbsp;&rsaquo;</a>
</p>
</div>
</div>
</div>
Expand All @@ -178,7 +209,7 @@ <h2>Run data-intensive workloads across clouds</h2>
</div>
</div>
<div class="row">
<div class="col-start-large-4 col-9 col-start-medium-3 col-medium-4">
<div class="col-12 col-medium-6">
<div class="p-logo-section u-align-text--right">
<div class="p-logo-section__items">
<div class="p-logo-section__item">
Expand Down Expand Up @@ -223,10 +254,10 @@ <h2>Run data-intensive workloads across clouds</h2>
<div class="p-logo-section__item">
{{
image (
url="https://assets.ubuntu.com/v1/8fb612cd-kubernetes-logomark-logo.png",
url="https://assets.ubuntu.com/v1/cd1a01d0-kubernetes-logomark-logo.png",
alt="Kubernetes",
width="68",
height="256",
width="606",
height="384",
hi_def=True,
loading="lazy",
attrs={"class": "p-logo-section__logo"}
Expand Down
Loading

0 comments on commit c6dc06f

Please sign in to comment.