Added basic color design functions
This commit is contained in:
68
src/App.vue
68
src/App.vue
@@ -1,28 +1,60 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<img alt="Vue logo" src="./assets/logo.png">
|
||||
<Designer msg="Midari profile designer"/>
|
||||
</div>
|
||||
<v-app>
|
||||
<v-app-bar
|
||||
app
|
||||
color="primary"
|
||||
dark
|
||||
>
|
||||
<div class="d-flex align-center">
|
||||
<v-img
|
||||
alt="Vuetify Logo"
|
||||
class="shrink mr-2"
|
||||
contain
|
||||
src="https://cdn.vuetifyjs.com/images/logos/vuetify-logo-dark.png"
|
||||
transition="scale-transition"
|
||||
width="40"
|
||||
/>
|
||||
|
||||
<span class="mr-2">Midari Profile Designer</span>
|
||||
</div>
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn
|
||||
href="https://mnz.gg"
|
||||
target="_blank"
|
||||
text
|
||||
>
|
||||
<span class="mr-2">mnz.gg</span>
|
||||
<v-icon>mdi-open-in-new</v-icon>
|
||||
</v-btn>
|
||||
</v-app-bar>
|
||||
|
||||
<v-main>
|
||||
<Designer/>
|
||||
</v-main>
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Designer from './components/Designer.vue'
|
||||
import Designer from './components/Designer';
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
Designer
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
#app {
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
margin-top: 60px;
|
||||
components: {
|
||||
Designer,
|
||||
},
|
||||
|
||||
data: () => ({
|
||||
}),
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.v-color-picker__alpha {
|
||||
display: none;
|
||||
}
|
||||
.v-color-picker__hue {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
1
src/assets/logo.svg
Normal file
1
src/assets/logo.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 87.5 100"><defs><style>.cls-1{fill:#1697f6;}.cls-2{fill:#7bc6ff;}.cls-3{fill:#1867c0;}.cls-4{fill:#aeddff;}</style></defs><title>Artboard 46</title><polyline class="cls-1" points="43.75 0 23.31 0 43.75 48.32"/><polygon class="cls-2" points="43.75 62.5 43.75 100 0 14.58 22.92 14.58 43.75 62.5"/><polyline class="cls-3" points="43.75 0 64.19 0 43.75 48.32"/><polygon class="cls-4" points="64.58 14.58 87.5 14.58 43.75 100 43.75 62.5 64.58 14.58"/></svg>
|
||||
|
After Width: | Height: | Size: 539 B |
@@ -5,40 +5,108 @@
|
||||
HELO
|
||||
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
|
||||
</p>
|
||||
<div class="profile-container">
|
||||
<div class="profile">
|
||||
<svg class="overlay-panels" width="100%" height="100%" viewBox="0 0 800 500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g>
|
||||
<g id="TopBar" transform="matrix(7.20721,0,0,1.325,-79.2793,-24.85)">
|
||||
<rect x="11" y="58" width="111" height="40" style="fill-opacity:0.75;"/>
|
||||
</g>
|
||||
<g id="MainCard" transform="matrix(2.3908,0,0,3.80899,-63.8046,-414.112)">
|
||||
<path d="M130,148.662C130,147.193 128.1,146 125.759,146L47.241,146C44.9,146 43,147.193 43,148.662L43,232.338C43,233.807 44.9,235 47.241,235L125.759,235C128.1,235 130,233.807 130,232.338L130,148.662Z" style="fill-opacity:0.75;"/>
|
||||
</g>
|
||||
<g id="Description" transform="matrix(5.86207,0,0,1.07865,-0.0689655,-15.4831)">
|
||||
<path d="M130,155.792C130,150.388 129.193,146 128.198,146L44.802,146C43.807,146 43,150.388 43,155.792L43,225.208C43,230.612 43.807,235 44.802,235L128.198,235C129.193,235 130,230.612 130,225.208L130,155.792Z" style="fill-opacity:0.75;"/>
|
||||
</g>
|
||||
<g id="Badges" transform="matrix(5.86207,0,0,1.07865,-0.0689655,83.5169)">
|
||||
<path d="M130,156.173C130,150.558 129.161,146 128.128,146L44.872,146C43.839,146 43,150.558 43,156.173L43,224.827C43,230.442 43.839,235 44.872,235L128.128,235C129.161,235 130,230.442 130,224.827L130,156.173Z" style="fill-opacity:0.75;"/>
|
||||
</g>
|
||||
<g id="Showcase" transform="matrix(5.86207,0,0,1.58427,-0.0689655,108.697)">
|
||||
<path d="M130,152.767C130,149.032 129.181,146 128.171,146L44.829,146C43.819,146 43,149.032 43,152.767L43,228.233C43,231.968 43.819,235 44.829,235L128.171,235C129.181,235 130,231.968 130,228.233L130,152.767Z" style="fill-opacity:0.75;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<div class="overlay-icons"></div>
|
||||
<img class="user-image" src="../assets/user.webp" alt="">
|
||||
<div class="flex-container"> <!-- ToDo: fix container -->
|
||||
<div id="preview" class="flex-item">
|
||||
<h3>Preview</h3>
|
||||
<div class="profile-container">
|
||||
<div class="profile" :style="{backgroundColor: backgroundColor}">
|
||||
<svg class="overlay-panels" width="100%" height="100%" viewBox="0 0 800 500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g>
|
||||
<g id="TopBar" transform="matrix(7.20721,0,0,1.325,-79.2793,-24.85)" :style="{fill:panelColor}">
|
||||
<rect x="11" y="58" width="111" height="40" style="fill-opacity:0.75;"/>
|
||||
</g>
|
||||
<g id="MainCard" transform="matrix(2.3908,0,0,3.80899,-63.8046,-414.112)" :style="{fill:panelColor}">
|
||||
<path d="M130,148.662C130,147.193 128.1,146 125.759,146L47.241,146C44.9,146 43,147.193 43,148.662L43,232.338C43,233.807 44.9,235 47.241,235L125.759,235C128.1,235 130,233.807 130,232.338L130,148.662Z" style="fill-opacity:0.75;"/>
|
||||
</g>
|
||||
<g id="Description" transform="matrix(5.86207,0,0,1.07865,-0.0689655,-15.4831)" :style="{fill:panelColor}">
|
||||
<path d="M130,155.792C130,150.388 129.193,146 128.198,146L44.802,146C43.807,146 43,150.388 43,155.792L43,225.208C43,230.612 43.807,235 44.802,235L128.198,235C129.193,235 130,230.612 130,225.208L130,155.792Z" style="fill-opacity:0.75;"/>
|
||||
</g>
|
||||
<g id="Badges" transform="matrix(5.86207,0,0,1.07865,-0.0689655,83.5169)" :style="{fill:panelColor}">
|
||||
<path d="M130,156.173C130,150.558 129.161,146 128.128,146L44.872,146C43.839,146 43,150.558 43,156.173L43,224.827C43,230.442 43.839,235 44.872,235L128.128,235C129.161,235 130,230.442 130,224.827L130,156.173Z" style="fill-opacity:0.75;"/>
|
||||
</g>
|
||||
<g id="Showcase" transform="matrix(5.86207,0,0,1.58427,-0.0689655,108.697)" :style="{fill:panelColor}">
|
||||
<path d="M130,152.767C130,149.032 129.181,146 128.171,146L44.829,146C43.819,146 43,149.032 43,152.767L43,228.233C43,231.968 43.819,235 44.829,235L128.171,235C129.181,235 130,231.968 130,228.233L130,152.767Z" style="fill-opacity:0.75;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<div class="overlay-icons"></div>
|
||||
<img class="user-image" src="../assets/user.webp" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<h3>Background</h3>
|
||||
<v-color-picker style="margin: 0 auto;"
|
||||
v-model="backgroundColor"
|
||||
hide-inputs
|
||||
canvas-height="300"
|
||||
value="f2dadd"
|
||||
dot-size="25"
|
||||
swatches-max-height="100"
|
||||
elevation="5"
|
||||
show-swatches
|
||||
mode="hexa"
|
||||
></v-color-picker>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<h3>Panels</h3>
|
||||
<v-color-picker style="margin: 0 auto;"
|
||||
v-model="panelColor"
|
||||
hide-inputs
|
||||
canvas-height="300"
|
||||
value="f2dadd"
|
||||
dot-size="25"
|
||||
swatches-max-height="100"
|
||||
elevation="5"
|
||||
show-swatches
|
||||
mode="hexa"
|
||||
></v-color-picker>
|
||||
</div>
|
||||
<div class="flex-item" id="commands">
|
||||
<h3>Commands</h3>
|
||||
<div class="command">
|
||||
<span class="code">mep b {{backgroundColor.substring(1,7)}}</span>
|
||||
<input type="hidden" id="bg" :value="'mep b '+backgroundColor.substring(1,7)">
|
||||
<v-btn @click.stop.prevent="copyColor('bg')">Copy</v-btn>
|
||||
</div>
|
||||
<div class="command">
|
||||
<span class="code">mep t {{panelColor.substring(1,7)}}</span>
|
||||
<input type="hidden" id="panel" :value="'mep t ' + panelColor.substring(1,7)">
|
||||
<v-btn @click.stop.prevent="copyColor('panel')">Copy</v-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'Designer',
|
||||
props: {
|
||||
msg: String
|
||||
}
|
||||
},
|
||||
data: ()=>({
|
||||
panelColor: '00ff00',
|
||||
backgroundColor: '000fff'
|
||||
}),
|
||||
methods: {
|
||||
copyColor (qs) {
|
||||
let testingCodeToCopy = document.querySelector('#'+qs)
|
||||
testingCodeToCopy.setAttribute('type', 'text') // 不是 hidden 才能複製
|
||||
testingCodeToCopy.select()
|
||||
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
} catch (err) {
|
||||
console.log("Failed to copy!");
|
||||
}
|
||||
|
||||
/* unselect the range */
|
||||
testingCodeToCopy.setAttribute('type', 'hidden')
|
||||
window.getSelection().removeAllRanges()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -51,8 +119,9 @@ export default {
|
||||
resize: horizontal;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
height: calc(100vh - 16px);
|
||||
//height: calc(45vh - 16px);
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.profile {
|
||||
@@ -86,11 +155,40 @@ export default {
|
||||
opacity: 100%;
|
||||
}
|
||||
|
||||
.flex-container {
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-evenly;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.flex-item {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
#preview {
|
||||
order: -1;
|
||||
//flex-basis: 50%;
|
||||
}
|
||||
#commands {
|
||||
flex-basis: 30%;
|
||||
}
|
||||
.command {
|
||||
margin: 20px;
|
||||
}
|
||||
button {
|
||||
margin-left: 15px;
|
||||
}
|
||||
g {
|
||||
fill: green;
|
||||
fill: v-bind(panelColor);
|
||||
}
|
||||
h3 {
|
||||
margin: 40px 0 0;
|
||||
text-align: center;
|
||||
}
|
||||
ul {
|
||||
list-style-type: none;
|
||||
|
||||
151
src/components/HelloWorld.vue
Normal file
151
src/components/HelloWorld.vue
Normal file
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<v-container>
|
||||
<v-row class="text-center">
|
||||
<v-col cols="12">
|
||||
<v-img
|
||||
:src="require('../assets/logo.svg')"
|
||||
class="my-3"
|
||||
contain
|
||||
height="200"
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<v-col class="mb-4">
|
||||
<h1 class="display-2 font-weight-bold mb-3">
|
||||
Welcome to Vuetify
|
||||
</h1>
|
||||
|
||||
<p class="subheading font-weight-regular">
|
||||
For help and collaboration with other Vuetify developers,
|
||||
<br>please join our online
|
||||
<a
|
||||
href="https://community.vuetifyjs.com"
|
||||
target="_blank"
|
||||
>Discord Community</a>
|
||||
</p>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
class="mb-5"
|
||||
cols="12"
|
||||
>
|
||||
<h2 class="headline font-weight-bold mb-3">
|
||||
What's next?
|
||||
</h2>
|
||||
|
||||
<v-row justify="center">
|
||||
<a
|
||||
v-for="(next, i) in whatsNext"
|
||||
:key="i"
|
||||
:href="next.href"
|
||||
class="subheading mx-3"
|
||||
target="_blank"
|
||||
>
|
||||
{{ next.text }}
|
||||
</a>
|
||||
</v-row>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
class="mb-5"
|
||||
cols="12"
|
||||
>
|
||||
<h2 class="headline font-weight-bold mb-3">
|
||||
Important Links
|
||||
</h2>
|
||||
|
||||
<v-row justify="center">
|
||||
<a
|
||||
v-for="(link, i) in importantLinks"
|
||||
:key="i"
|
||||
:href="link.href"
|
||||
class="subheading mx-3"
|
||||
target="_blank"
|
||||
>
|
||||
{{ link.text }}
|
||||
</a>
|
||||
</v-row>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
class="mb-5"
|
||||
cols="12"
|
||||
>
|
||||
<h2 class="headline font-weight-bold mb-3">
|
||||
Ecosystem
|
||||
</h2>
|
||||
|
||||
<v-row justify="center">
|
||||
<a
|
||||
v-for="(eco, i) in ecosystem"
|
||||
:key="i"
|
||||
:href="eco.href"
|
||||
class="subheading mx-3"
|
||||
target="_blank"
|
||||
>
|
||||
{{ eco.text }}
|
||||
</a>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'HelloWorld',
|
||||
|
||||
data: () => ({
|
||||
ecosystem: [
|
||||
{
|
||||
text: 'vuetify-loader',
|
||||
href: 'https://github.com/vuetifyjs/vuetify-loader',
|
||||
},
|
||||
{
|
||||
text: 'github',
|
||||
href: 'https://github.com/vuetifyjs/vuetify',
|
||||
},
|
||||
{
|
||||
text: 'awesome-vuetify',
|
||||
href: 'https://github.com/vuetifyjs/awesome-vuetify',
|
||||
},
|
||||
],
|
||||
importantLinks: [
|
||||
{
|
||||
text: 'Documentation',
|
||||
href: 'https://vuetifyjs.com',
|
||||
},
|
||||
{
|
||||
text: 'Chat',
|
||||
href: 'https://community.vuetifyjs.com',
|
||||
},
|
||||
{
|
||||
text: 'Made with Vuetify',
|
||||
href: 'https://madewithvuejs.com/vuetify',
|
||||
},
|
||||
{
|
||||
text: 'Twitter',
|
||||
href: 'https://twitter.com/vuetifyjs',
|
||||
},
|
||||
{
|
||||
text: 'Articles',
|
||||
href: 'https://medium.com/vuetify',
|
||||
},
|
||||
],
|
||||
whatsNext: [
|
||||
{
|
||||
text: 'Explore components',
|
||||
href: 'https://vuetifyjs.com/components/api-explorer',
|
||||
},
|
||||
{
|
||||
text: 'Select a layout',
|
||||
href: 'https://vuetifyjs.com/getting-started/pre-made-layouts',
|
||||
},
|
||||
{
|
||||
text: 'Frequently Asked Questions',
|
||||
href: 'https://vuetifyjs.com/getting-started/frequently-asked-questions',
|
||||
},
|
||||
],
|
||||
}),
|
||||
}
|
||||
</script>
|
||||
@@ -1,8 +1,10 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import vuetify from './plugins/vuetify'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
new Vue({
|
||||
render: h => h(App),
|
||||
vuetify,
|
||||
render: h => h(App)
|
||||
}).$mount('#app')
|
||||
|
||||
8
src/plugins/vuetify.js
Normal file
8
src/plugins/vuetify.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import Vue from 'vue';
|
||||
import Vuetify from 'vuetify/lib/framework';
|
||||
|
||||
Vue.use(Vuetify);
|
||||
|
||||
export default new Vuetify({
|
||||
theme: {dark: true}
|
||||
});
|
||||
Reference in New Issue
Block a user