Skip to content

Commit

Permalink
add sbb clock
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreKoepke committed Feb 26, 2025
1 parent 68817e3 commit 3e76ad7
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 3 deletions.
3 changes: 2 additions & 1 deletion frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"src/assets"
],
"styles": [
"src/styles.scss"
"src/styles.scss",
"node_modules/@sbb-esta/lyne-elements/standard-theme.css"
],
"scripts": [],
"server": "src/main.server.ts",
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@angular/platform-server": "^17.1.0",
"@angular/router": "^17.1.0",
"@angular/ssr": "^17.1.2",
"@sbb-esta/lyne-elements": "^2.3.0",
"express": "^4.18.2",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@
</button>
}
</div>


<div class="panel">
<sbb-clock></sbb-clock>
</div>
9 changes: 9 additions & 0 deletions frontend/src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@

.panel {
position: fixed;
width: 20vw;
min-width: 100px;
max-width: 300px;
right: 10px;
bottom: 10vh;
}

.container {
padding-bottom: 10vh;
}
Expand Down
12 changes: 11 additions & 1 deletion frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import {ChangeDetectionStrategy, Component, HostListener, Inject, PLATFORM_ID, Signal} from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
CUSTOM_ELEMENTS_SCHEMA,
HostListener,
Inject,
PLATFORM_ID,
Signal
} from '@angular/core';
import {NavigationEnd, Router, RouterOutlet} from '@angular/router';
import {toSignal} from "@angular/core/rxjs-interop";
import {filter, map, Subscription, timer} from "rxjs";
import {isPlatformBrowser} from "@angular/common";
import '@sbb-esta/lyne-elements/clock.js'

@Component({
selector: 'app-root',
Expand All @@ -11,6 +20,7 @@ import {isPlatformBrowser} from "@angular/common";
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppComponent {
title = 'home-system';
Expand Down
1 change: 1 addition & 0 deletions frontend/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {bootstrapApplication} from '@angular/platform-browser';
import {appConfig} from './app/app.config';
import {AppComponent} from './app/app.component';
import '@sbb-esta/lyne-elements/clock.js'

bootstrapApplication(AppComponent, appConfig)
.catch((err) => console.error(err));
61 changes: 60 additions & 1 deletion frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,26 @@
resolved "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz"
integrity sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==

"@lit-labs/observers@^2.0.5":
version "2.0.5"
resolved "https://registry.yarnpkg.com/@lit-labs/observers/-/observers-2.0.5.tgz#fd23bb4a8fa3e72bf56a7f4aa5e2071188c888bb"
integrity sha512-DYHc3XhNgfl9RoDFMz99OvnElWIU7ncNga1tYd/9Wez4NOsMDRXsSD6LjFfpHCVfzZic6MdlVfB7+iIuWXl5Ng==
dependencies:
"@lit/reactive-element" "^1.0.0 || ^2.0.0"
lit-html "^3.2.0"

"@lit-labs/ssr-dom-shim@^1.2.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.3.0.tgz#a28799c463177d1a0b0e5cefdc173da5ac859eb4"
integrity sha512-nQIWonJ6eFAvUUrSlwyHDm/aE8PBDu5kRpL0vHMg6K8fK3Diq1xdPjTnsJSwxABhaZ+5eBi1btQB5ShUTKo4nQ==

"@lit/reactive-element@^1.0.0 || ^2.0.0", "@lit/reactive-element@^2.0.4":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-2.0.4.tgz#8f2ed950a848016383894a26180ff06c56ae001b"
integrity sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==
dependencies:
"@lit-labs/ssr-dom-shim" "^1.2.0"

"@ljharb/through@^2.3.12":
version "2.3.13"
resolved "https://registry.npmjs.org/@ljharb/through/-/through-2.3.13.tgz"
Expand Down Expand Up @@ -1705,6 +1725,15 @@
resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.4.tgz#e2a9d1fd56524103a6cc8a54404d9d3ebc73c454"
integrity sha512-LTw1Dfd0mBIEqUVCxbvTE/LLo+9ZxVC9k99v1v4ahg9Aak6FpqOfNu5kRkeTAn0wphoC4JU7No1/rL+bBCEwhg==

"@sbb-esta/lyne-elements@^2.3.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@sbb-esta/lyne-elements/-/lyne-elements-2.3.0.tgz#ee3dc18e0debb37e7653be5ef2adcc6037346ca3"
integrity sha512-FZI8Ct/4ffXp6e16hau4KJjz9I2+P3zDkqQQ+fv0mbYmKtrJZWo6z1huAovnzj+hMQn9YZRVhRgZlIqm5wIAzQ==
dependencies:
"@lit-labs/observers" "^2.0.5"
lit "^3.2.1"
tslib "^2.8.1"

"@schematics/[email protected]":
version "17.3.11"
resolved "https://registry.npmjs.org/@schematics/angular/-/angular-17.3.11.tgz"
Expand Down Expand Up @@ -1932,6 +1961,11 @@
dependencies:
"@types/node" "*"

"@types/trusted-types@^2.0.2":
version "2.0.7"
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11"
integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==

"@types/ws@^8.5.5":
version "8.5.13"
resolved "https://registry.npmjs.org/@types/ws/-/ws-8.5.13.tgz"
Expand Down Expand Up @@ -4164,6 +4198,31 @@ lines-and-columns@^1.1.6:
resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==

lit-element@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-4.1.1.tgz#07905992815076e388cf6f1faffc7d6866c82007"
integrity sha512-HO9Tkkh34QkTeUmEdNYhMT8hzLid7YlMlATSi1q4q17HE5d9mrrEHJ/o8O2D0cMi182zK1F3v7x0PWFjrhXFew==
dependencies:
"@lit-labs/ssr-dom-shim" "^1.2.0"
"@lit/reactive-element" "^2.0.4"
lit-html "^3.2.0"

lit-html@^3.2.0:
version "3.2.1"
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-3.2.1.tgz#8fc49e3531ee5947e4d93e8a5aa642ab1649833b"
integrity sha512-qI/3lziaPMSKsrwlxH/xMgikhQ0EGOX2ICU73Bi/YHFvz2j/yMCIrw4+puF2IpQ4+upd3EWbvnHM9+PnJn48YA==
dependencies:
"@types/trusted-types" "^2.0.2"

lit@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/lit/-/lit-3.2.1.tgz#d6dd15eac20db3a098e81e2c85f70a751ff55592"
integrity sha512-1BBa1E/z0O9ye5fZprPtdqnc0BFzxIxTTOO/tQFmyC/hj1O3jL4TfmLBw0WEwjAokdLwpclkvGgDJwTIh0/22w==
dependencies:
"@lit/reactive-element" "^2.0.4"
lit-element "^4.1.0"
lit-html "^3.2.0"

loader-runner@^4.2.0:
version "4.3.0"
resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz"
Expand Down Expand Up @@ -5904,7 +5963,7 @@ [email protected]:
resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==

tslib@^2.1.0, tslib@^2.3.0:
tslib@^2.1.0, tslib@^2.3.0, tslib@^2.8.1:
version "2.8.1"
resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz"
integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==
Expand Down

0 comments on commit 3e76ad7

Please sign in to comment.