Error/Success (with header)
Ready
This template shows how to build a simple responsive error view using Duet’s components. The same template can be used for success views as well by changing the illustration.
Hint: Press F
on your keyboard to view both templates and components in fullscreen and
ESC
to exit the fullscreen mode. You can also open the template in
a new browser window.
<!DOCTYPE html>
<html class="duet-bg-gradient duet-sticky-footer" lang="fi">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>LähiTapiola</title>
<link rel="stylesheet" href="https://cdn.duetds.com/api/fonts/1.3.13/lib/localtapiola.css" integrity="sha384-5JYmtSD7nykpUvSmTW1CHMoBDkBZUpUmG0vuh+NUVtZag3F75Kr7+/JU3J7JV6Wq" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.duetds.com/api/css/1.4.13/lib/duet.min.css" integrity="sha384-uK6FZ3yd5W1eAGo327m3oQXJRKnKy/vRlc8luY/5O9R/uQ+chsrpxcJkMba2/vaB" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.duetds.com/api/tokens/2.0.30/lib/tokens.custom-properties.css" integrity="sha384-arb0dRY7eabL9qYMLabGqlrgO9p75pZ9lvaqh3xpLpNUUW6KBtRjKqkSwBv3HyLp" crossorigin="anonymous" />
<script type="module" src="/components/duet.esm.js"></script>
<script nomodule src="/components/duet.js"></script>
</head>
<body>
<duet-header language="fi" skip-to-id="#content" contact="Ota yhteyttä" current-href="/vakuutukset/"></duet-header>
<duet-layout center id="content">
<div slot="main" class="duet-text-center">
<duet-card variation="plain" padding="x-small">
<img src="https://arielsalminen.com/work/duet-design-system/assets/img/illustrations/placeholder-dark.svg"
alt="Kuvitus" style="max-width:358px;width:70%;height:auto;"/>
<duet-spacer size="large"></duet-spacer>
<duet-heading level="h1">Jokin meni pieleen, pahoittelemme</duet-heading>
<duet-paragraph variation="intro">
Palvelussamme olevan häiriön vuoksi kaikki toiminnallisuudet eivät juuri nyt ole käytössäsi.
Yritä myöhemmin uudelleen tai ole yhteydessä asiakaspalveluumme.
</duet-paragraph>
<duet-spacer size="x-small"></duet-spacer>
<duet-button fixed variation="primary" url="#" icon="navigation-arrow-left">
Palaa takaisin
</duet-button>
</duet-card>
</div>
</duet-layout>
<duet-footer variation="simple"></duet-footer>
<script>
// Save references to components we want to adjust below
var header = document.querySelector("duet-header")
var footer = document.querySelector("duet-footer")
// Set the header main navigation items
header.items = [
{ label: 'Etusivu', href: '#' },
{ label: 'Vakuutukset', href: '/vakuutukset/' },
{ label: 'Vahinkoasiat', href: '#' },
{ label: 'Säästöt ja sijoitukset', href: '#' },
{ label: 'Laskut', href: '#', badge: true },
{ label: 'Viestit', href: '#' }
]
// Set the contact menu items
header.contactItems = [
{ label: "Lähetä viesti", href: "/work/duet-design-system/viestit/laheta" },
{ label: "Avaa chat", href: "/work/duet-design-system/chat/" },
{ label: "Yhteystiedot", href: "/work/duet-design-system/yhteystiedot/" }
]
// Set the language menu items
header.languageItems = [
{ label: "Suomeksi", country: "fi", href: "/work/duet-design-system/?lang=fi" },
{ label: "På Svenska", country: "sv", href: "/work/duet-design-system/?lang=sv" },
{ label: "In English", country: "en", href: "/work/duet-design-system/?lang=en" }
]
// Set label and href for session link
header.session = {
label: "Kirjaudu ulos",
href: "/work/duet-design-system/?logout",
type: "logout"
}
// Set label and href for user profile link
header.user = {
label: "Laura",
href: "/work/duet-design-system/?userId=1234"
}
// Listen for change events inside the header
header.addEventListener("duetChange", function(ev) {
var event = ev.detail.originalEvent
var data = ev.detail.data
if (data.href !== "#content") {
event.preventDefault()
}
})
// Set the help menu items in footer
footer.menu = [
{ label: 'Turvallisuus ja käyttöehdot', href: '#' },
{ label: 'Evästeet', href: '#' },
{ label: 'Henkilötietojen käsittely', href: '#' },
]
</script>
</body>
</html>
Integration
To install this template’s dependencies into your project, run:
npm install @duetds/components
npm install @duetds/css
npm install @duetds/fonts
For further guidelines, please see each package’s documentation.
Tutorials
Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:
Tutorials
Abstract
TutorialsBuilding Layouts
TutorialsCreating Custom Patterns
TutorialsServer Side Rendering
TutorialsSharing Prototypes
TutorialsVS Code
TutorialsZeplin
TutorialsUsing CLI Tools
TutorialsUsage With Markdown
Troubleshooting
If you experience any issues while using a template, please head over to the Support page for more guidelines and help.