Skip to content

Commit

Permalink
Merge pull request #1
Browse files Browse the repository at this point in the history
feat: backdrop-filter
  • Loading branch information
kolirt authored Apr 15, 2024
2 parents 9586227 + afc84ef commit ebdf532
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 44 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ app.use(createModal({
},
overlayStyle: {
'background-color': 'rgba(0, 0, 0, .5)',
'backdrop-filter': 'blur(5px)',
'z-index': 200
}
}))
Expand Down
Binary file added bun.lockb
Binary file not shown.
45 changes: 23 additions & 22 deletions examples/vite/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import App from './App.vue'
import App from "./App.vue";

import { createModal } from '@kolirt/vue-modal'
import Notifications from '@kyvg/vue3-notification'
import 'bootstrap/dist/css/bootstrap.min.css'
import { createApp } from 'vue'
import { createModal } from "@kolirt/vue-modal";
import Notifications from "@kyvg/vue3-notification";
import "bootstrap/dist/css/bootstrap.min.css";
import { createApp } from "vue";

const app = createApp(App)
const app = createApp(App);

app.use(Notifications)
app.use(Notifications);

app.use(
createModal({
transitionTime: 200,
animationType: 'slideDown',
modalStyle: {
padding: '5rem 2rem',
align: 'center',
'z-index': 201
},
overlayStyle: {
'background-color': 'rgba(0, 0, 0, .5)',
'z-index': 200
}
})
)
createModal({
transitionTime: 200,
animationType: "slideDown",
modalStyle: {
padding: "5rem 2rem",
align: "center",
"z-index": 201,
},
overlayStyle: {
"background-color": "rgba(0, 0, 0, .5)",
"backdrop-filter": "blur(5px)",
"z-index": 200,
},
}),
);

app.mount('#app')
app.mount("#app");
45 changes: 23 additions & 22 deletions examples/vue-cli-service/src/main.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import { createModal } from '@kolirt/vue-modal'
import Notifications from '@kyvg/vue3-notification'
import 'bootstrap/dist/css/bootstrap.min.css'
import { createApp } from 'vue'
import { createModal } from "@kolirt/vue-modal";
import Notifications from "@kyvg/vue3-notification";
import "bootstrap/dist/css/bootstrap.min.css";
import { createApp } from "vue";

import App from './App.vue'
import App from "./App.vue";

const app = createApp(App)
const app = createApp(App);

app.use(Notifications)
app.use(Notifications);

app.use(
createModal({
transitionTime: 200,
animationType: 'slideDown',
modalStyle: {
padding: '5rem 2rem',
align: 'center',
'z-index': 201
},
overlayStyle: {
'background-color': 'rgba(0, 0, 0, .5)',
'z-index': 200
}
})
)
createModal({
transitionTime: 200,
animationType: "slideDown",
modalStyle: {
padding: "5rem 2rem",
align: "center",
"z-index": 201,
},
overlayStyle: {
"background-color": "rgba(0, 0, 0, .5)",
"backdrop-filter": "blur(5px)",
"z-index": 200,
},
}),
);

app.mount('#app')
app.mount("#app");
5 changes: 5 additions & 0 deletions lib/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const state = reactive<Options>({
},
overlayStyle: {
'background-color': 'rgba(0, 0, 0, 0.9)',
'backdrop-filter': 'blur(5px)',
'z-index': 200
}
})
Expand Down Expand Up @@ -51,4 +52,8 @@ export function setOptions(newOptions: Options): void {
// @ts-ignore
state.overlayStyle['background-color'] = newOptions.overlayStyle['background-color']
}
if (newOptions?.overlayStyle?.['backdrop-filter']) {
// @ts-ignore
state.overlayStyle['backdrop-filter'] = newOptions.overlayStyle['backdrop-filter']
}
}
1 change: 1 addition & 0 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type ModalStyle = {
}
export type OverlayStyle = {
'background-color'?: string
'backdrop-filter'?: string
'z-index'?: number
}

Expand Down

0 comments on commit ebdf532

Please sign in to comment.