1
0
mirror of https://github.com/morris/vanilla-todo.git synced 2025-08-10 08:04:11 +02:00

switch icon cdn, add preconnect, move module preload up

This commit is contained in:
Morris Brodersen
2023-11-26 14:31:16 +01:00
parent 6a640515b2
commit c91b27980e
2 changed files with 18 additions and 15 deletions

View File

@@ -9,19 +9,7 @@
<title>VANILLA TODO</title> <title>VANILLA TODO</title>
<link rel="stylesheet" href="styles/base.css" /> <link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="stylesheet" href="styles/app-button.css" />
<link rel="stylesheet" href="styles/app-collapsible.css" />
<link rel="stylesheet" href="styles/app-date-picker.css" />
<link rel="stylesheet" href="styles/app-footer.css" />
<link rel="stylesheet" href="styles/app-header.css" />
<link rel="stylesheet" href="styles/app-icon.css" />
<link rel="stylesheet" href="styles/todo-app.css" />
<link rel="stylesheet" href="styles/todo-custom-list.css" />
<link rel="stylesheet" href="styles/todo-day.css" />
<link rel="stylesheet" href="styles/todo-frame.css" />
<link rel="stylesheet" href="styles/todo-item-input.css" />
<link rel="stylesheet" href="styles/todo-item.css" />
<link rel="modulepreload" href="scripts/AppCollapsible.js" /> <link rel="modulepreload" href="scripts/AppCollapsible.js" />
<link rel="modulepreload" href="scripts/AppDraggable.js" /> <link rel="modulepreload" href="scripts/AppDraggable.js" />
@@ -39,6 +27,20 @@
<link rel="modulepreload" href="scripts/TodoList.js" /> <link rel="modulepreload" href="scripts/TodoList.js" />
<link rel="modulepreload" href="scripts/TodoStore.js" /> <link rel="modulepreload" href="scripts/TodoStore.js" />
<link rel="modulepreload" href="scripts/util.js" /> <link rel="modulepreload" href="scripts/util.js" />
<link rel="stylesheet" href="styles/base.css" />
<link rel="stylesheet" href="styles/app-button.css" />
<link rel="stylesheet" href="styles/app-collapsible.css" />
<link rel="stylesheet" href="styles/app-date-picker.css" />
<link rel="stylesheet" href="styles/app-footer.css" />
<link rel="stylesheet" href="styles/app-header.css" />
<link rel="stylesheet" href="styles/app-icon.css" />
<link rel="stylesheet" href="styles/todo-app.css" />
<link rel="stylesheet" href="styles/todo-custom-list.css" />
<link rel="stylesheet" href="styles/todo-day.css" />
<link rel="stylesheet" href="styles/todo-frame.css" />
<link rel="stylesheet" href="styles/todo-item-input.css" />
<link rel="stylesheet" href="styles/todo-item.css" />
</head> </head>
<body> <body>
<div class="todo-app"></div> <div class="todo-app"></div>

View File

@@ -1,4 +1,5 @@
export const BASE_URL = 'https://unpkg.com/@primer/octicons@19.8.0/build/svg/'; export const BASE_URL =
'https://cdn.jsdelivr.net/npm/@primer/octicons@19.8.0/build/svg';
const cache = {}; const cache = {};
@@ -12,7 +13,7 @@ export function AppIcon(el) {
let promise = cache[id]; let promise = cache[id];
if (!promise) { if (!promise) {
promise = cache[id] = fetch(`${BASE_URL}${id}.svg`).then((r) => r.text()); promise = cache[id] = fetch(`${BASE_URL}/${id}.svg`).then((r) => r.text());
} }
promise.then((svg) => { promise.then((svg) => {