Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
Renaming some attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumebriday committed Jan 4, 2024
1 parent d0a8d62 commit 79efcc8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.0] - 2024-01-03

### Chore

- Renaming `card` target to `child`.
- Renaming `overlay` class to `glow-overlay`.
- Removing the `glow` attribute on the overlay.

## [0.2.0] - 2023-12-27

### Added
Expand Down
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ <h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:t
<section class="mt-16 space-y-12">
<div data-controller="glow" class="relative glow-capture">
<div
data-glow-target="card"
data-glow-target="child"
class="
glow glow:ring-1 glow:border-glow glow:ring-glow glow:bg-glow/[.15]
border-4 border-gray-400
Expand Down Expand Up @@ -225,12 +225,12 @@ <h2 class="font-bold text-2xl mb-4 text-gray-200 glow:text-glow/[.8]">Chicken Sh
</div>
</div>

<div data-glow-target="overlay" glow class="overlay" style="--glow-color: #f97316"></div>
<div data-glow-target="overlay" class="glow-overlay" style="--glow-color: #f97316"></div>
</div>

<div data-controller="glow" class="relative glow-capture">
<div
data-glow-target="card"
data-glow-target="child"
class="
glow glow:ring-1 glow:border-glow glow:ring-glow glow:bg-glow/[.15]
border-4 border-gray-400
Expand Down Expand Up @@ -289,12 +289,12 @@ <h2 class="font-bold text-2xl mb-4 text-gray-200 glow:text-glow/[.8]">
</div>
</div>

<div data-glow-target="overlay" glow class="overlay" style="--glow-color: #10b981"></div>
<div data-glow-target="overlay" class="glow-overlay" style="--glow-color: #10b981"></div>
</div>

<div data-controller="glow" class="relative glow-capture">
<div
data-glow-target="card"
data-glow-target="child"
class="
glow glow:ring-1 glow:border-glow glow:ring-glow glow:bg-glow/[.15]
border-4 border-gray-400
Expand Down Expand Up @@ -351,7 +351,7 @@ <h2 class="font-bold text-2xl mb-4 text-gray-200 glow:text-glow/[.8]">Vermicelli
</div>
</div>

<div data-glow-target="overlay" glow class="overlay" style="--glow-color: #3b82f6"></div>
<div data-glow-target="overlay" class="glow-overlay" style="--glow-color: #3b82f6"></div>
</div>
</section>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@tailwind components;
@tailwind utilities;

.overlay {
.glow-overlay {
--glow-size: 25rem;

position: absolute;
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Controller } from '@hotwired/stimulus'

export default class extends Controller<HTMLElement> {
declare cardTarget: HTMLElement
declare childTarget: HTMLElement
declare overlayTarget: HTMLElement

static targets = ['card', 'overlay']
static targets = ['child', 'overlay']

initialize (): void {
this.move = this.move.bind(this)
}

connect (): void {
this.overlayTarget.append(this.cardTarget.cloneNode(true))
this.overlayTarget.append(this.childTarget.cloneNode(true))

document.body.addEventListener('pointermove', this.move)
}
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {

plugins: [
plugin(({ addVariant }) => {
addVariant("glow", ".glow-capture [glow] &");
addVariant("glow", ".glow-capture .glow-overlay &");
},
{
theme: {
Expand Down

0 comments on commit 79efcc8

Please sign in to comment.