prova / index.html
Markin075's picture
Add 2 files
3e8cdc0 verified
Raw History Blame Contribute Delete
7.55 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vue 3 + Naive UI Hello World</title>
<script src="https://cdn.tailwindcss.com"></script>
<!-- Import Vue 3 -->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<!-- Import Naive UI -->
<script src="https://unpkg.com/naive-ui"></script>
<link rel="stylesheet" href="https://unpkg.com/naive-ui@2.34.3/dist/style.css">
<style>
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
background-color: #f8fafc;
}
.container {
max-width: 1200px;
}
.gradient-text {
background: linear-gradient(45deg, #4f46e5, #9333ea);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
</style>
</head>
<body class="min-h-screen flex items-center justify-center p-4">
<div id="app" class="container mx-auto">
<n-card class="shadow-lg rounded-xl overflow-hidden" hoverable>
<template #cover>
<div class="h-32 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 flex items-center justify-center">
<h1 class="text-4xl font-bold text-white">Vue 3 + Naive UI</h1>
</div>
</template>
<div class="p-6">
<n-space vertical>
<n-h1 class="gradient-text">Hello World!</n-h1>
<n-p class="text-gray-600">
This is a simple Vue 3 application using Naive UI components.
</n-p>
<n-divider />
<n-space>
<n-button @click="showNotification" type="primary" size="large" round>
<template #icon>
<n-icon><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 13V11H19V13H5Z"></path></svg></n-icon>
</template>
Click Me!
</n-button>
<n-button @click="toggleTheme" type="info" size="large" ghost>
<template #icon>
<n-icon><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 18C8.68629 18 6 15.3137 6 12C6 8.68629 8.68629 6 12 6C15.3137 6 18 8.68629 18 12C18 15.3137 15.3137 18 12 18ZM12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16ZM11 1H13V4H11V1ZM11 20H13V23H11V20ZM3.51472 4.92893L4.92893 3.51472L7.05025 5.63604L5.63604 7.05025L3.51472 4.92893ZM16.9497 18.364L18.364 16.9497L20.4853 19.0711L19.0711 20.4853L16.9497 18.364ZM19.0711 3.51472L20.4853 4.92893L18.364 7.05025L16.9497 5.63604L19.0711 3.51472ZM5.63604 16.9497L7.05025 18.364L4.92893 20.4853L3.51472 19.0711L5.63604 16.9497ZM23 11V13H20V11H23ZM4 11V13H1V11H4Z"></path></svg></n-icon>
</template>
Toggle Theme
</n-button>
</n-space>
<n-divider />
<n-input v-model:value="message" type="text" placeholder="Type something..." />
<n-p class="text-gray-700">
You typed: <span class="font-semibold">{{ message }}</span>
</n-p>
<n-progress type="line" :percentage="progress" :indicator-placement="'inside'" processing />
<n-button @click="increaseProgress" type="success" size="small">
Increase Progress
</n-button>
</n-space>
</div>
<template #footer>
<div class="bg-gray-50 px-6 py-3 text-center text-gray-500 text-sm">
Made with ❤️ using Vue 3 and Naive UI
</div>
</template>
</n-card>
</div>
<script>
const { createApp, ref } = Vue;
const { NButton, NH1, NP, NDivider, NSpace, NInput, NProgress, NIcon, NCard, useNotification, useLoadingBar, useDialog, useMessage } = NaiveUI;
createApp({
components: {
NButton,
NH1,
NP,
NDivider,
NSpace,
NInput,
NProgress,
NIcon,
NCard
},
setup() {
const message = ref('');
const progress = ref(10);
const darkTheme = ref(false);
const notification = useNotification();
const loadingBar = useLoadingBar();
const showNotification = () => {
notification.success({
title: 'Hello!',
content: 'You clicked the button!',
duration: 3000,
});
loadingBar.start();
setTimeout(() => {
loadingBar.finish();
}, 1000);
};
const toggleTheme = () => {
darkTheme.value = !darkTheme.value;
document.documentElement.classList.toggle('dark', darkTheme.value);
notification.info({
title: 'Theme Changed',
content: darkTheme.value ? 'Dark mode activated' : 'Light mode activated',
duration: 2000,
});
};
const increaseProgress = () => {
progress.value = Math.min(progress.value + 10, 100);
if (progress.value === 100) {
notification.success({
title: 'Completed!',
content: 'You reached 100%!',
duration: 3000,
});
}
};
return {
message,
progress,
showNotification,
toggleTheme,
increaseProgress
};
}
})
.use(NaiveUI)
.mount('#app');
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Markin075/prova" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>