Skip to main content

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.


Open in new 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.jsdelivr.net/npm/@duetds/fonts@latest/lib/localtapiola.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@duetds/css@latest/lib/duet.min.css" />
<script type="module" src="https://cdn.jsdelivr.net/npm/@duetds/components@3.2.0/lib/duet/duet.esm.js"></script>
<script nomodule src="https://cdn.jsdelivr.net/npm/@duetds/components@3.2.0/lib/duet/duet.js"></script>
</head>
<body>
<duet-header
language="fi"
skip-to-id="#content"
contact="Ota yhteyttä"
current-href="/"
items="[
{ label: 'Etusivu', href: '/' },
{ label: 'Vakuutukset', href: '#' },
{ label: 'Vahinkoasiat', href: '#' },
{ label: 'Säästöt ja sijoitukset', href: '#' },
{ label: 'Laskut', href: '#', badge: true },
{ label: 'Viestit', href: '#' }
]"
>

</duet-header>
<duet-layout center header-distance="with-links" id="content">
<div slot="main" class="duet-text-center">
<duet-card variation="plain" padding="x-small">
<img src="https://www.duetds.com/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"
menu="[
{ label: 'Turvallisuus ja käyttöehdot', href: '#' },
{ label: 'Evästeet', href: '#' },
{ label: 'Henkilötietojen käsittely', href: '#' },
]"
>

</duet-footer>
<script>
// Save references to components we want to adjust below
var header = document.querySelector("duet-header")

// Set the contact menu items
header.contactItems = [
{ label: "Lähetä viesti", href: "/viestit/laheta" },
{ label: "Avaa chat", href: "/chat/" },
{ label: "Yhteystiedot", href: "/yhteystiedot/" }
]

// Set the language menu items
header.languageItems = [
{ label: "Suomeksi", country: "fi", href: "/?lang=fi" },
{ label: "På Svenska", country: "sv", href: "/?lang=sv" },
{ label: "In English", country: "en", href: "/?lang=en" }
]

// Set label and href for session link
header.session = {
label: "Kirjaudu ulos",
href: "/?logout",
type: "logout"
}

// Set label and href for user profile link
header.user = {
label: "Laura",
href: "/?userId=1234"
}

// Listen for change events inside the header
header.addEventListener("duetChange", function(ev) {
var event = ev.detail.originalEvent
event.preventDefault()
})
</script>
</body>
</html>

Integration

To install this template’s dependencies into your project, run:

npm install @duetds/components --save-dev
npm install @duetds/css --save-dev
npm install @duetds/fonts --save-dev

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

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Server Side Rendering


Troubleshooting

If you experience any issues while using a template, please head over to the Support page for more guidelines and help.