Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 174 additions & 0 deletions app/views/current/layouts/layout-search-sticky.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
<!--
This is the main layout where you can:
- change the header and footer
- add custom CSS and JavaScript
-->
{% extends "prototype-kit-template.njk" %}
{% block head %}
<link href="/css/main.css" rel="stylesheet">
<style>
/* ── Sticky slim bar (shown on scroll) ── */
.app-search-sticky {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
background-color: #005EB8; /* nhsuk-colour("blue") */
padding: 24px 0; /* nhsuk-spacing(4) */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* nhsuk-spacing(1) nhsuk-spacing(2) */
}

.app-search-sticky.is-visible {
display: block;
}

.app-search-sticky__form {
display: flex;
align-items: center;
gap: 16px; /* nhsuk-spacing(3) */
width: 100%;
}

.app-search-sticky .nhsuk-label {
color: #ffffff; /* nhsuk-colour("white") */
white-space: nowrap;
margin-bottom: 0;
}

.app-search-sticky .nhsuk-input {
margin-bottom: 0;
flex: 1;
}

.app-search-sticky .nhsuk-button {
margin-bottom: 0;
white-space: nowrap;
}
</style>
{% endblock %}

{% block header %}
{{ header({
logo: {
href: "/",
ariaLabel: "Search and evaluate medical technologies"
},
service: {
text: "Search and evaluate medical technologies",
href: "/"
},
account: {
items: [
{
text: "Kelvin Simpson (Regional Manager)",
icon: true
},
{
text: "Log out",
href: "#"
}
]
},
navigation: {
items: [
{
text: "Dashboard",
href: "dashboard"
},
{
text: "",
href: "#"
},
{
text: "Search",
href: "search"
}
]
}
}) }}

<!-- ── Full hero (visible at top) ── -->
<div class="nhsuk-hero" id="search-hero">
<div class="nhsuk-width-container nhsuk-hero--border">
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">
<div class="nhsuk-hero__wrapper">
<h1 class="nhsuk-heading-xl nhsuk-u-margin-bottom-3">Search</h1>
<h3 class="nhsuk-heading-s">Search and evaluate medical technologies</h3>
<div class="nhsuk-form-group">
<form action="search-results" method="get" novalidate="">
<div class="nhsuk-form-group nhsuk-u-margin-bottom-0">
<label class="nhsuk-label" for="q">
Search by product, category or supplier
</label>
<input class="nhsuk-input nhsuk-input--width-20" id="q" name="q" type="search" value="">
<button class="nhsuk-button nhsuk-button--reverse nhsuk-u-margin-left-2 app-button--small nhsuk-u-margin-bottom-0" data-module="nhsuk-button" type="submit" data-nhsuk-button-init="">
Search
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>

<!-- ── Sticky slim bar (appears on scroll) ── -->
<div class="app-search-sticky" id="search-sticky" role="search" aria-label="Sticky search">
<div class="nhsuk-width-container">
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">
<form action="search-results" method="get" novalidate="" class="app-search-sticky__form">
<label class="nhsuk-label nhsuk-u-margin-bottom-0" for="q-sticky">Search</label>
<input class="nhsuk-input nhsuk-u-margin-bottom-0" id="q-sticky" name="q" type="search" value="" placeholder="Search by product, category or supplier" aria-label="Search by product, category or supplier">
<button class="nhsuk-button nhsuk-button--reverse app-button--small nhsuk-u-margin-bottom-0" type="submit">
Search
</button>
</form>
</div>
</div>
</div>
</div>

{% endblock %}

{% block footer %}
{% include "includes/footer.html" %}
{% endblock %}

{% block bodyEnd %}
<script src="/nhsuk-frontend/nhsuk-frontend.min.js" type="module"></script>
<script type="module">
import { initAll } from '/nhsuk-frontend/nhsuk-frontend.min.js'
initAll()
</script>

<script>
(function () {
var hero = document.getElementById('search-hero');
var sticky = document.getElementById('search-sticky');

if (!hero || !sticky) return;

function onScroll() {
var heroBottom = hero.getBoundingClientRect().bottom;
// Show sticky bar once the hero has scrolled fully out of view
if (heroBottom <= 0) {
sticky.classList.add('is-visible');
} else {
sticky.classList.remove('is-visible');
}
}

window.addEventListener('scroll', onScroll, { passive: true });
})();
</script>

{% block scripts %}
{% include "includes/scripts.html" %}
{% block pageScripts %}{% endblock %}
{% endblock %}
{% endblock %}
96 changes: 51 additions & 45 deletions app/views/current/search-results-viz-all.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,52 +134,58 @@ <h2 class="nhsuk-contents-list__title nhsuk-u-font-size-16">Subcategory</h2>
<h3 class="nhsuk-heading-s nhsuk-u-margin-bottom-1">Supplier market share</h3>
<p class="nhsuk-body-s nhsuk-u-secondary-text-color nhsuk-u-margin-bottom-4">Advanced dressings only &middot; 52 products</p>

<div class="app-pie-wrap" style="display:flex;flex-direction:row;align-items:center;gap:20px;">
<svg class="app-pie-svg" width="140" height="140" viewBox="0 0 140 140" aria-hidden="true" style="flex-shrink:0;">
<path d="M70 70 L70 10 A60 60 0 0 1 118 103 Z" fill="#005eb8"/>
<path d="M70 70 L118 103 A60 60 0 0 1 42 127 Z" fill="#007f3b"/>
<path d="M70 70 L42 127 A60 60 0 0 1 14 56 Z" fill="#ffb81c"/>
<path d="M70 70 L14 56 A60 60 0 0 1 70 10 Z" fill="#aeb7bd"/>
<circle cx="70" cy="70" r="32" fill="#fff"/>
<text x="70" y="66" text-anchor="middle" font-size="18" font-weight="700" fill="#212b32">52</text>
<text x="70" y="80" text-anchor="middle" font-size="10" fill="#000000">products</text>
</svg>
<!-- REPLACE the entire app-pie-wrap div in search-results-viz-all.html with this -->

<div class="app-pie-wrap" style="display:flex;flex-direction:row;align-items:center;gap:12px;">

<!-- Chart: exactly 50% of the card width -->
<svg class="app-pie-svg" viewBox="0 0 140 140" aria-hidden="true" style="flex:0 0 50%;max-width:50%;height:auto;">
<path d="M70 70 L70 10 A60 60 0 0 1 118 103 Z" fill="#005eb8"/>
<path d="M70 70 L118 103 A60 60 0 0 1 42 127 Z" fill="#007f3b"/>
<path d="M70 70 L42 127 A60 60 0 0 1 14 56 Z" fill="#ffb81c"/>
<path d="M70 70 L14 56 A60 60 0 0 1 70 10 Z" fill="#aeb7bd"/>
<circle cx="70" cy="70" r="32" fill="#fff"/>
<text x="70" y="66" text-anchor="middle" font-size="18" font-weight="700" fill="#212b32">52</text>
<text x="70" y="80" text-anchor="middle" font-size="10" fill="#000000">products</text>
</svg>

<!-- Legend: remaining 50% -->
<div class="app-supplier-legend" style="flex:0 0 50%;min-width:0;">
<div class="app-supplier-legend__item">
<div class="app-supplier-legend__swatch" style="background:#005eb8;"></div>
<div class="app-supplier-legend__body">
<p class="nhsuk-body-s nhsuk-u-margin-bottom-0"><strong>Smith and Nephew</strong></p>
<p class="nhsuk-body-s nhsuk-u-secondary-text-color nhsuk-u-margin-bottom-1">38% &middot; 20 products</p>
<div class="app-supplier-bar-track"><div class="app-supplier-bar-fill" style="width:100%;background:#005eb8;"></div></div>
</div>
</div>
<div class="app-supplier-legend__item">
<div class="app-supplier-legend__swatch" style="background:#007f3b;"></div>
<div class="app-supplier-legend__body">
<p class="nhsuk-body-s nhsuk-u-margin-bottom-0"><strong>M&ouml;lnlycke Health Care</strong></p>
<p class="nhsuk-body-s nhsuk-u-secondary-text-color nhsuk-u-margin-bottom-1">29% &middot; 15 products</p>
<div class="app-supplier-bar-track"><div class="app-supplier-bar-fill" style="width:76%;background:#007f3b;"></div></div>
</div>
</div>
<div class="app-supplier-legend__item">
<div class="app-supplier-legend__swatch" style="background:#ffb81c;"></div>
<div class="app-supplier-legend__body">
<p class="nhsuk-body-s nhsuk-u-margin-bottom-0"><strong>ConvaTec</strong></p>
<p class="nhsuk-body-s nhsuk-u-secondary-text-color nhsuk-u-margin-bottom-1">21% &middot; 11 products</p>
<div class="app-supplier-bar-track"><div class="app-supplier-bar-fill" style="width:55%;background:#ffb81c;"></div></div>
</div>
</div>
<div class="app-supplier-legend__item">
<div class="app-supplier-legend__swatch" style="background:#aeb7bd;"></div>
<div class="app-supplier-legend__body">
<p class="nhsuk-body-s nhsuk-u-margin-bottom-0"><strong>Others</strong></p>
<p class="nhsuk-body-s nhsuk-u-secondary-text-color nhsuk-u-margin-bottom-1">12% &middot; 6 products</p>
<div class="app-supplier-bar-track"><div class="app-supplier-bar-fill" style="width:32%;background:#aeb7bd;"></div></div>
</div>
</div>
</div>

<div class="app-supplier-legend" style="flex:1;min-width:0;">
<div class="app-supplier-legend__item">
<div class="app-supplier-legend__swatch" style="background:#005eb8;"></div>
<div class="app-supplier-legend__body">
<p class="nhsuk-body-s nhsuk-u-margin-bottom-0"><strong>Smith+Nephew</strong></p>
<p class="nhsuk-body-s nhsuk-u-secondary-text-color nhsuk-u-margin-bottom-1">38% &middot; 20 products</p>
<div class="app-supplier-bar-track"><div class="app-supplier-bar-fill" style="width:100%;background:#005eb8;"></div></div>
</div>
</div>
<div class="app-supplier-legend__item">
<div class="app-supplier-legend__swatch" style="background:#007f3b;"></div>
<div class="app-supplier-legend__body">
<p class="nhsuk-body-s nhsuk-u-margin-bottom-0"><strong>M&ouml;lnlycke Health Care</strong></p>
<p class="nhsuk-body-s nhsuk-u-secondary-text-color nhsuk-u-margin-bottom-1">29% &middot; 15 products</p>
<div class="app-supplier-bar-track"><div class="app-supplier-bar-fill" style="width:76%;background:#007f3b;"></div></div>
</div>
</div>
<div class="app-supplier-legend__item">
<div class="app-supplier-legend__swatch" style="background:#ffb81c;"></div>
<div class="app-supplier-legend__body">
<p class="nhsuk-body-s nhsuk-u-margin-bottom-0"><strong>ConvaTec</strong></p>
<p class="nhsuk-body-s nhsuk-u-secondary-text-color nhsuk-u-margin-bottom-1">21% &middot; 11 products</p>
<div class="app-supplier-bar-track"><div class="app-supplier-bar-fill" style="width:55%;background:#ffb81c;"></div></div>
</div>
</div>
<div class="app-supplier-legend__item">
<div class="app-supplier-legend__swatch" style="background:#aeb7bd;"></div>
<div class="app-supplier-legend__body">
<p class="nhsuk-body-s nhsuk-u-margin-bottom-0"><strong>Others</strong></p>
<p class="nhsuk-body-s nhsuk-u-secondary-text-color nhsuk-u-margin-bottom-1">12% &middot; 6 products</p>
<div class="app-supplier-bar-track"><div class="app-supplier-bar-fill" style="width:32%;background:#aeb7bd;"></div></div>
</div>
</div>
</div>
</div>
</div>

</div>
</div>
Expand Down
Loading