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:
@@ -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>
|
||||||
|
@@ -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) => {
|
||||||
|
Reference in New Issue
Block a user