font picker style updated
This commit is contained in:
parent
821127b354
commit
2d4692911c
|
@ -1,63 +1,3 @@
|
||||||
Vue.component('icon', {
|
|
||||||
template: `
|
|
||||||
<div class="single-icon">
|
|
||||||
<span
|
|
||||||
v-bind:class="this.class"
|
|
||||||
v-on:click="copyToClipboard(utf8)"
|
|
||||||
class="actual-icon"
|
|
||||||
ref="icon"></span>
|
|
||||||
<span
|
|
||||||
class="copy-icon-popup"
|
|
||||||
v-bind:class="{ 'success': isCopied}"
|
|
||||||
ref="element">Copied!</span>
|
|
||||||
<p
|
|
||||||
class="icon-name"
|
|
||||||
v-on:click="copyToClipboard(span)"
|
|
||||||
ref="span">{{ this.name }}</p>
|
|
||||||
</div>
|
|
||||||
`,
|
|
||||||
props: ['name'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
utf8: '',
|
|
||||||
isCopied: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
class: function () {
|
|
||||||
return "brz9-icon-" + this.name;
|
|
||||||
},
|
|
||||||
span: function () {
|
|
||||||
return '<span class="brz9-icon-' + this.name + '"></span>';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
copyToClipboard(text) {
|
|
||||||
const textarea = document.createElement('textarea')
|
|
||||||
textarea.value = text
|
|
||||||
document.body.appendChild(textarea)
|
|
||||||
textarea.select()
|
|
||||||
document.execCommand('copy')
|
|
||||||
document.body.removeChild(textarea)
|
|
||||||
this.copyDone();
|
|
||||||
},
|
|
||||||
copyDone() {
|
|
||||||
this.isCopied = true;
|
|
||||||
this.$refs.element.addEventListener('animationend', () => {
|
|
||||||
this.isCopied = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
query = '.' + this.class
|
|
||||||
let span = document.querySelector(query)
|
|
||||||
let style = window.getComputedStyle(span, ':before')
|
|
||||||
let content = style.getPropertyValue('content')
|
|
||||||
console.log(content)
|
|
||||||
this.utf8 = content.replace('"', '').replace('"', '')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
Vue.component('fontdemo', {
|
Vue.component('fontdemo', {
|
||||||
template: `
|
template: `
|
||||||
<div class="single-font">
|
<div class="single-font">
|
||||||
|
@ -1396,5 +1336,6 @@ let vm = new Vue({
|
||||||
if (a.name > b.name) return 1
|
if (a.name > b.name) return 1
|
||||||
return 0
|
return 0
|
||||||
} )
|
} )
|
||||||
|
this.selection = this.typefaceList
|
||||||
}
|
}
|
||||||
}).$mount('#root')
|
}).$mount('#root')
|
||||||
|
|
|
@ -15,14 +15,17 @@
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<h3>Fonts</h3>
|
<h3>Fonts</h3>
|
||||||
<input v-model="testText" placeholder="Your text"/>
|
<input class="font-input" v-model="testText" placeholder="Your text"/>
|
||||||
<nav class="font-nav">
|
<nav class="font-nav">
|
||||||
<span class="style-pick" v-on:click="updateSelectedTags('graphic')">Graphic</span>
|
<span class="style-pick" v-on:click="updateSelectedTags('graphic')">Graphic</span>
|
||||||
</nav>
|
</nav>
|
||||||
<fontdemo v-for="font in this.selection" :typeface="font">{{ testText }}</fontdemo>
|
|
||||||
<h4>All the fonts</h4>
|
<h4>All the fonts</h4>
|
||||||
<fontdemo v-for="font in this.typefaceList" :typeface="font">{{ testText }}</fontdemo>
|
<div class="font-container">
|
||||||
|
<div class="font-content">
|
||||||
|
<fontdemo v-for="font in this.selection" :typeface="font">{{ testText }}</fontdemo>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -115,19 +115,36 @@ h2 {
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input.font-input {
|
||||||
width: 40vw;
|
width: 30vw;
|
||||||
background-color: rgba(0,0,0,0);
|
background-color: rgba(0,0,0,0);
|
||||||
border: none;
|
border: none;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
border-bottom: 5px solid var(--fg);
|
border-bottom: 5px solid var(--fg);
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
input:focus {
|
input:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav.font-nav {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav.font-nav span.style-pick {
|
||||||
|
color: var(--fg);
|
||||||
|
padding: 5px;
|
||||||
|
font-weight: 500;
|
||||||
|
border: 5px solid var(--fg);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav.font-nav span.style-pick.selected {
|
||||||
|
background-color: var(--fg);
|
||||||
|
color: black;
|
||||||
|
mix-blend-mode: lighten;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -166,4 +183,52 @@ div.single-font footer span.copy-css {
|
||||||
div.single-font footer span.copy-icon-popup {
|
div.single-font footer span.copy-icon-popup {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
translate: -30px;
|
translate: -30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-container {
|
||||||
|
position: relative;
|
||||||
|
max-height: 60vh;
|
||||||
|
overflow-y: scroll;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-content {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.font-container::-webkit-scrollbar-track
|
||||||
|
{
|
||||||
|
border-right: 5px solid var(--fg);
|
||||||
|
border-left: none;
|
||||||
|
background-color: rgba(0,0,0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-container::-webkit-scrollbar
|
||||||
|
{
|
||||||
|
width: 15px;
|
||||||
|
background-color: rgba(0,0,0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-container::-webkit-scrollbar-thumb
|
||||||
|
{
|
||||||
|
background-color: var(--fg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-container{
|
||||||
|
scrollbar-width: 15px;
|
||||||
|
scrollbar-color: var(--fg) rgba(255,255,255,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-container {
|
||||||
|
border-top: 5px solid var(--fg);
|
||||||
|
border-bottom: 5px solid var(--fg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-content {
|
||||||
|
margin-top: -5px;
|
||||||
|
margin-bottom: -20px;
|
||||||
|
overflow-y: hidden;
|
||||||
|
overflow-x: hidden;
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue