TimeglitchD
TimeglitchD
FFilament
Created by TimeglitchD on 8/17/2023 in #❓┊help
filamentphp/plugin-skeleton workflow test jobs failing (after fixing some errors)
Alright! To be fair I abandoned this a while ago, but I'm glad you solved it. Thank you!
6 replies
FFilament
Created by TimeglitchD on 10/5/2023 in #❓┊help
live() deletes my cropper instance, custom field
Okay, adding
wire:key="{{rand()}}"
wire:key="{{rand()}}"
to the x-dynamic-component seems to work in reinitializing the script! Now I just need to set it to the correct position 😄
5 replies
FFilament
Created by TimeglitchD on 10/5/2023 in #❓┊help
live() deletes my cropper instance, custom field
Ah, I can see now in the docs, live() basically rerenders the HTML, so I can only guess this is without the scripts... That's at least part of the solution.
5 replies
FFilament
Created by TimeglitchD on 9/6/2023 in #❓┊help
Refresh custom column after update to model
Solved it 🙂
<div x-data="{
shape: null,
canvas: null,
ctx: null,
size: 100,
init(){
this.shape = {{$getRecord()->id}}
this.canvas = $refs.colorProfilePreview
this.ctx = this.canvas.getContext('2d')
this.drawCanvas()
},
drawCanvas(){

this.ctx.clearRect(0,0,this.canvas.width, this.canvas.height)

{{-- border --}}
this.ctx.globalAlpha = 1

this.ctx.beginPath()
this.ctx.roundRect(3, 3,this.size-6 , this.size-6, [12])
this.ctx.fillStyle = '#fff'
this.ctx.fill()

this.ctx.beginPath()
this.ctx.roundRect(4, 4,this.size-8 , this.size-8, [11])
this.ctx.fillStyle = '#000'
this.ctx.fill()

{{-- base --}}

this.ctx.beginPath()
this.ctx.roundRect(5, 5,this.size-10 , this.size-10, [10])
this.ctx.fillStyle = '{{$getRecord()->baseColor->hex}}'
this.ctx.fill()

this.ctx.beginPath()
this.ctx.roundRect(10, 10,this.size-20 , this.size-20 , [5])

this.ctx.strokeStyle = '#000'
this.ctx.globalAlpha = .3
this.ctx.stroke()
this.ctx.globalAlpha = 1

{{-- sticker --}}

this.ctx.fillStyle = '{{$getRecord()->stickerColor->hex}}'
this.ctx.fill()

this.ctx.fillStyle = '{{$getRecord()->defaultColor->hex}}'
this.ctx.font = '20px sans-serif'
this.ctx.textBaseline = 'top'
this.ctx.textAlign = 'center'
this.ctx.fillText('text', 50, 20, 80)

{{-- arrow --}}

this.ctx.fillStyle = '{{$getRecord()->imageColor->hex}}'

this.ctx.beginPath()
this.ctx.moveTo(25, 65)
this.ctx.lineTo(40, 80)
this.ctx.lineTo(40, 50)
this.ctx.fill()
this.ctx.fillRect(40, 60 ,30 , 10)


}
}" x-init="drawCanvas">
<canvas x-ref="colorProfilePreview" width="100" height="100"></canvas>
</div>
<div x-data="{
shape: null,
canvas: null,
ctx: null,
size: 100,
init(){
this.shape = {{$getRecord()->id}}
this.canvas = $refs.colorProfilePreview
this.ctx = this.canvas.getContext('2d')
this.drawCanvas()
},
drawCanvas(){

this.ctx.clearRect(0,0,this.canvas.width, this.canvas.height)

{{-- border --}}
this.ctx.globalAlpha = 1

this.ctx.beginPath()
this.ctx.roundRect(3, 3,this.size-6 , this.size-6, [12])
this.ctx.fillStyle = '#fff'
this.ctx.fill()

this.ctx.beginPath()
this.ctx.roundRect(4, 4,this.size-8 , this.size-8, [11])
this.ctx.fillStyle = '#000'
this.ctx.fill()

{{-- base --}}

this.ctx.beginPath()
this.ctx.roundRect(5, 5,this.size-10 , this.size-10, [10])
this.ctx.fillStyle = '{{$getRecord()->baseColor->hex}}'
this.ctx.fill()

this.ctx.beginPath()
this.ctx.roundRect(10, 10,this.size-20 , this.size-20 , [5])

this.ctx.strokeStyle = '#000'
this.ctx.globalAlpha = .3
this.ctx.stroke()
this.ctx.globalAlpha = 1

{{-- sticker --}}

this.ctx.fillStyle = '{{$getRecord()->stickerColor->hex}}'
this.ctx.fill()

this.ctx.fillStyle = '{{$getRecord()->defaultColor->hex}}'
this.ctx.font = '20px sans-serif'
this.ctx.textBaseline = 'top'
this.ctx.textAlign = 'center'
this.ctx.fillText('text', 50, 20, 80)

{{-- arrow --}}

this.ctx.fillStyle = '{{$getRecord()->imageColor->hex}}'

this.ctx.beginPath()
this.ctx.moveTo(25, 65)
this.ctx.lineTo(40, 80)
this.ctx.lineTo(40, 50)
this.ctx.fill()
this.ctx.fillRect(40, 60 ,30 , 10)


}
}" x-init="drawCanvas">
<canvas x-ref="colorProfilePreview" width="100" height="100"></canvas>
</div>
4 replies
FFilament
Created by TimeglitchD on 8/16/2023 in #❓┊help
Using Vite and HMR without extending theme
Alright, thank you!
5 replies