Aggiunte tante cose relative al profilo utente

This commit is contained in:
2022-06-13 02:36:31 +02:00
parent 39ad130e81
commit 1d61efeda0
11 changed files with 298 additions and 145 deletions
+4 -8
View File
@@ -1,14 +1,10 @@
JS_SOURCES = src/utenti.js
JS_BUNDLES = $(patsubst src/%.js, dist/%.min.js, $(JS_SOURCES))
JS_SOURCES = src/utenti.js src/profilo.js
.PHONY: all
all: $(JS_BUNDLES)
dist/%.min.js: src/%.js
rollup -c rollup.config.js $<
all: $(JS_SOURCES)
rollup -c
.PHONY: debug
debug:
@echo "JS_SOURCES = $(JS_SOURCES)"
@echo "JS_BUNDLES = $(JS_BUNDLES)"
@echo "JS_SOURCES = $(JS_SOURCES)"
+13 -6
View File
@@ -1,6 +1,4 @@
import { defineConfig } from 'rollup'
// import resolve from '@rollup/plugin-node-resolve'
import { terser } from 'rollup-plugin-terser'
export default defineConfig([
@@ -16,9 +14,18 @@ export default defineConfig([
'fuse.js': 'Fuse',
},
},
plugins: [
// resolve(),
terser(),
],
plugins: [terser()],
},
{
input: 'src/profilo.js',
external: ['alpinejs'],
output: {
file: 'dist/profilo.min.js',
format: 'iife',
globals: {
alpinejs: 'Alpine',
},
},
plugins: [terser()],
},
])
+16
View File
@@ -0,0 +1,16 @@
import Alpine from 'alpinejs'
Alpine.data('profilo', () => ({
init() {
console.log('Profilo!')
},
}))
Alpine.data('passwordForm', () => ({
password: '',
passwordAgain: '',
passwordSame: true,
onUpdate() {
this.passwordSame = this.password === this.passwordAgain
},
}))