Skip to content

Instantly share code, notes, and snippets.

@wysRocket
Created July 11, 2023 20:07
Show Gist options
  • Select an option

  • Save wysRocket/a1e258931986957fe02399a626cdc5d2 to your computer and use it in GitHub Desktop.

Select an option

Save wysRocket/a1e258931986957fe02399a626cdc5d2 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<head>
<script type="module" src="./motion-carousel.js"></script>
<style>
body {
margin: 0;
height: 100vh;
width: 100vw;
font-family: sans-serif;
display: flex;
justify-content: center;
align-items: center;
}
</style>
</head>
<body>
<motion-carousel></motion-carousel>
</body>
{
"dependencies": {
"lit": "^2.7.4",
"@lit-labs/motion": "^1.0.3"
}
}
import {css} from 'lit';
export const styles = [
css`
.container {
display: flex;
align-items: center;
justify-content: center;
--size: 50vw;
width: calc(var(--size) + 80px);
gap: 8px;
border-radius: 8px;
padding: 8px;
overflow: hidden;
border: 4px solid #002071;
background: #e1e2e1;
}
.card {
background: #e1e2e1;
border-radius: 8px;
border: 1px solid #002071;
height: var(--size);
min-width: var(--size);
padding: 8px;
will-change: transform;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: var(--size);
cursor: pointer;
user-select: none;
}
`,
];
{
"files": {
"motion-carousel.ts": {
"position": 0
},
"styles.ts": {
"position": 1
},
"index.html": {
"position": 2
},
"package.json": {
"position": 3,
"hidden": true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment