Skip to content

Commit

Permalink
[minor] add no signs of life default error
Browse files Browse the repository at this point in the history
  • Loading branch information
electrovir committed Nov 4, 2023
1 parent 46313bd commit 5d48a28
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 11 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/toniq-nft-frame-mono-repo-root",
"version": "2.0.1",
"version": "2.1.0",
"private": true,
"license": "MIT",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion packages/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/toniq-nft-frame-demo",
"version": "2.0.1",
"version": "2.1.0",
"private": true,
"license": "MIT",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/toniq-nft-frame-scripts",
"version": "2.0.1",
"version": "2.1.0",
"private": true,
"scripts": {
"compile": "virmator compile && npm run execute",
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/toniq-nft-frame-tests",
"version": "2.0.1",
"version": "2.1.0",
"private": true,
"license": "MIT",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion packages/toniq-nft-frame/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/toniq-nft-frame",
"version": "2.0.1",
"version": "2.1.0",
"homepage": "https://github.com/Toniq-Labs/nft-frame",
"bugs": {
"url": "https://github.com/Toniq-Labs/nft-frame/issues"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import {BioniqRobot100Icon, ToniqIcon} from '@toniq-labs/design-system';
import {css, defineElementNoInputs, html} from 'element-vir';

export const ToniqDefaultError = defineElementNoInputs({
tagName: 'toniq-default-error',
styles: css`
:host {
display: flex;
background-color: #f9f6fe;
color: #8a2be2;
flex-direction: column;
align-items: center;
justify-content: center;
max-width: 100%;
max-height: 100%;
width: 100%;
height: 100%;
font-family: 'Inconsolata', monospace;
/**
* The size at which the image should suddenly take up the full container
*/
--switch-at: 200px;
}
.icon-wrapper {
aspect-ratio: 1 / 1;
height: 100%;
max-width: 100%;
}
.wrapper {
position: relative;
display: flex;
justify-content: center;
width: 100%;
height: max(min(100%, var(--switch-at)), calc(100% - var(--switch-at)));
}
.description {
margin: 0;
position: absolute;
top: 100%;
width: 100%;
box-sizing: border-box;
padding: 0 32px;
}
${ToniqIcon} {
height: 100%;
width: 100%;
}
`,
renderCallback() {
return html`
<div class="wrapper">
<div class="icon-wrapper">
<${ToniqIcon.assign({
icon: BioniqRobot100Icon,
fitContainer: true,
})}></${ToniqIcon}>
</div>
<p class="description">This image shows no signs of life.</p>
</div>
`;
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {toniqNftFrameTagName} from '../toniq-nft-frame-tag-name';
import {Dimensions, clampDimensions, scaleToConstraints} from '../util/dimensions';
import {MutatedClassesEnum} from './mutated-classes';
import {shouldAllowInteraction} from './nft-interactions';
import {ToniqDefaultError} from './toniq-default-error.element';
import {defaultToniqNtState} from './toniq-nft-frame-state';

export enum ToniqNftFrameSlotName {
Expand Down

0 comments on commit 5d48a28

Please sign in to comment.