@rettangoli/sites 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
1
+ {% if footer %}
2
+ <rtgl-view d="h" h="30vh"></rtgl-view>
3
+ <rtgl-view h="1" w="f"></rtgl-view>
4
+ <rtgl-view g="lg" d="h" p="lg" md-w="100vw" lg-w="768" w="1024" pv="xl">
5
+ <rtgl-view g="xl" flex="1" ah="sm">
6
+ <a href="/" aria-label="Home" style="display: contents; text-decoration: none; color: inherit;"><rtgl-image h="{{ footer.logo.height }}"
7
+ w="{{ footer.logo.width }}" src="{{ footer.logo.src }}" alt="{{ footer.logo.alt | default: 'Company logo' }}">
8
+ </rtgl-image></a>
9
+ <rtgl-view d="h" g="l" av="c">
10
+ {%- for social in footer.social -%}
11
+ <a href="{{ social.href }}" target="_blank" rel="noreferrer" aria-label="Visit our {{ social.name }} page"
12
+ style="display: contents; text-decoration: none; color: inherit;">
13
+ <rtgl-svg h-cur="p" f="on-su" svg="{{ social.svg }}" wh="20">
14
+ </rtgl-svg>
15
+ </a>
16
+ {%- endfor -%}
17
+ </rtgl-view>
18
+ </rtgl-view>
19
+
20
+ <rtgl-view d="h" flex="2">
21
+ {%- for feature in footer.columns -%}
22
+ <rtgl-view d="h" flex="1" ah="c">
23
+ <rtgl-view g="lg">
24
+ {%- for link in feature.links -%}
25
+ <rtgl-text s="bm" c="on-suv"> <a href="{{ link.href }}" {% if link.newTab %}target="_blank" rel="noreferrer" {%
26
+ endif %}> <u> {{ link.text }} </u></a> </rtgl-text>
27
+ {%- endfor -%}
28
+ </rtgl-view>
29
+ </rtgl-view>
30
+ {%- endfor -%}
31
+ </rtgl-view>
32
+
33
+ </rtgl-view>
34
+ {% endif %}
@@ -0,0 +1,41 @@
1
+ <meta charset="utf-8" />
2
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
3
+ <title>{{ title }}</title>
4
+ <meta name="description" content="{{ og.description }}" />
5
+ <link rel="canonical" href="{{ baseUrl | append: url }}" />
6
+ <link rel="icon" type="image/x-icon" href="/public/favicon.png">
7
+
8
+ <!-- Open Graph tags -->
9
+ <meta property="og:title" content="{{ og.title | default: title }}" />
10
+ <meta property="og:description" content="{{ og.description }}" />
11
+ <meta property="og:site_name" content="{{ og.siteName }}" />
12
+ <meta property="og:type" content="{{ og.type }}" />
13
+ <meta property="og:url" content="{{ baseUrl | append: url }}" />
14
+ <meta property="og:image" content="{{ og.image }}" />
15
+ <meta property="og:image:width" content="{{ og.imageWidth | default: '1200' }}" />
16
+ <meta property="og:image:height" content="{{ og.imageHeight | default: '630' }}" />
17
+ <meta property="og:image:alt" content="{{ og.imageAlt }}" />
18
+ <meta property="og:image:type" content="{{ og.imageType }}" />
19
+
20
+ <!-- Twitter Card tags -->
21
+ <meta name="twitter:card" content="{{ twitter.card | default: 'summary_large_image' }}" />
22
+ <meta name="twitter:title" content="{{ og.title }}" />
23
+ <meta name="twitter:description" content="{{ og.description }}" />
24
+ <meta name="twitter:image" content="{{ og.image }}" />
25
+ <meta name="twitter:image:alt" content="{{ og.imageAlt }}" />
26
+
27
+ <!-- Styles and scripts -->
28
+ <script src="/public/rtgl-icons.js"></script>
29
+ <script src="https://cdn.jsdelivr.net/npm/construct-style-sheets-polyfill@3.1.0/dist/adoptedStyleSheets.min.js"></script>
30
+ <script src="https://cdn.jsdelivr.net/npm/@rettangoli/ui@0.1.0-rc2/dist/rettangoli-iife-ui.min.js"></script>
31
+ <script>
32
+ window.addEventListener('DOMContentLoaded', () => {
33
+ if (location.hash) {
34
+ const el = document.getElementById(location.hash.substring(1));
35
+ if (el) {
36
+ el.scrollIntoView({ behavior: 'auto' });
37
+ }
38
+ }
39
+ });
40
+ </script>
41
+ <link href="/public/theme.css" rel="stylesheet" />
@@ -0,0 +1,113 @@
1
+ <script type="module" defer>
2
+ import { html, render } from 'https://cdn.jsdelivr.net/npm/uhtml@4.7.0/+esm'
3
+ const RettangoliTable = ({ render, html, baseClass }) => {
4
+ const MyClass = baseClass || HTMLElement;
5
+ return class RettangoliTable extends MyClass {
6
+ columns = [];
7
+ rows = [];
8
+
9
+ constructor() {
10
+ super();
11
+ this.shadow = this.attachShadow({ mode: "closed" });
12
+ }
13
+
14
+ connectedCallback() {
15
+ render(this.shadow, this.render);
16
+ }
17
+
18
+ static get observedAttributes() {
19
+ return ["key", "wh", "w", "h", "hidden", "s-w", "s-h", "s-d"];
20
+ }
21
+
22
+ attributeChangedCallback(name, oldValue, newValue) {
23
+ setTimeout(() => {
24
+ render(this.shadow, this.render);
25
+ }, 0);
26
+ }
27
+
28
+ render = () => {
29
+ const columnsAttribute = this.getAttribute('columns')
30
+ const rowsAttribute = this.getAttribute('rows')
31
+ const columns = this.columns || columnsAttribute ? JSON.parse(decodeURIComponent(columnsAttribute)) : [];
32
+ const rows = this.rows || rowsAttribute ? JSON.parse(decodeURIComponent(rowsAttribute)) : [];
33
+
34
+ if (columns.length === 0) {
35
+ return html`
36
+ <rtgl-view h="f" w="f" bgc="su">
37
+ <rtgl-text s="ll">No data</rtgl-text>
38
+ </rtgl-view>
39
+ `;
40
+ }
41
+
42
+ return html`
43
+ <rtgl-view sh h="calc(100vh - 48px)" w="calc(100vw - 200px - 32px)">
44
+ <rtgl-view
45
+ bgc="bg"
46
+ d="h"
47
+ style="flex-wrap: nowrap; position: sticky; top: 0; z-index: 2;"
48
+ >
49
+ ${columns.map((column, index) => {
50
+ const isFirst = index === 0;
51
+ const style = isFirst
52
+ ? "overflow-wrap: anywhere; position: sticky; left: 0; z-index: 3;"
53
+ : "overflow-wrap: anywhere; ";
54
+ return html`
55
+ <rtgl-view
56
+ ph="m"
57
+ pv="s"
58
+ h="f"
59
+ bgc="bg"
60
+ w=${column.width}
61
+ style=${style}
62
+ bwl=${isFirst ? "xs" : ""}
63
+ bwr="xs"
64
+ bwb="xs"
65
+ bwt="xs"
66
+ >
67
+ <rtgl-text s="ll">${column.label}</rtgl-text>
68
+ </rtgl-view>
69
+ `;
70
+ })}
71
+ </rtgl-view>
72
+
73
+ <rtgl-view bgc="ov">
74
+ ${rows.map(
75
+ (row) => html`
76
+ <rtgl-view d="h" style="flex-wrap: nowrap;">
77
+ ${columns.map((column, index) => {
78
+ const isFirst = index === 0;
79
+ const style = isFirst
80
+ ? "overflow-wrap: anywhere; position: sticky; left: 0; z-index: 1;"
81
+ : "overflow-wrap: anywhere; ";
82
+ return html`
83
+ <rtgl-view
84
+ ph="m"
85
+ pv="s"
86
+ h="f"
87
+ bgc="bg"
88
+ w=${column.width}
89
+ bwr="xs"
90
+ bwl=${isFirst ? "xs" : ""}
91
+ bwb="xs"
92
+ style=${style}
93
+ >
94
+ <rtgl-text s="bs">${row[column.key]}</rtgl-text>
95
+ </rtgl-view>
96
+ `;
97
+ })}
98
+ </rtgl-view>
99
+ `
100
+ )}
101
+ </rtgl-view>
102
+ </rtgl-view>
103
+ `;
104
+ };
105
+ };
106
+ };
107
+
108
+ customElements.define('rtgl-table', RettangoliTable({
109
+ render,
110
+ html
111
+ }))
112
+
113
+ </script>
@@ -0,0 +1,11 @@
1
+ <rtgl-view pos="abs" cor="top" ah="c" bgc="bg">
2
+ <rtgl-view md-w="100vw" lg-w="768" w="1024">
3
+ <rtgl-navbar start="{{ navbar.start | json-escaped }}" id="navbar">
4
+ {% if navbar.right %}
5
+ <rtgl-view slot="right">
6
+ {{ navbar.right }}
7
+ </rtgl-view>
8
+ {% endif %}
9
+ </rtgl-navbar>
10
+ </rtgl-view>
11
+ </rtgl-view>