Initial commit: caddy static file server workspace
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
45
caddy/www/lit_with_animate_css.html
Normal file
45
caddy/www/lit_with_animate_css.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Lit with Animate.css</title>
|
||||
<!-- 引入 Animate.css -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
|
||||
<!-- 引入 Lit -->
|
||||
<script type="module" src="https://cdn.jsdelivr.net/npm/lit@2.8.0/+esm"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 自訂元件 -->
|
||||
<my-component></my-component>
|
||||
|
||||
<script type="module">
|
||||
import { LitElement, html, css } from 'https://cdn.jsdelivr.net/npm/lit@2.8.0/+esm';
|
||||
|
||||
class MyComponent extends LitElement {
|
||||
// 禁用 Shadow DOM
|
||||
createRenderRoot() {
|
||||
return this; // 將元件渲染在 Light DOM 中
|
||||
}
|
||||
|
||||
static styles = css`
|
||||
.animate__animated {
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
margin-top: 100px;
|
||||
}
|
||||
`;
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<div class="animate__animated animate__bounce">
|
||||
Hello, Animate.css with Lit!
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('my-component', MyComponent);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user