I'm using the neon-animation component to animate an element. It works fine, except I'd like to take it a step further.
Here is my animation configuration that works.
animationConfig: {
value: function() {
return {
entry: {
name: 'slide-down-animation',
node: this.$.target
},
exit: {
name: 'fade-out-animation',
node: this.$.target
}
}
}
}
I'd like to combine two animations for both the entry and the exit, but I can't figure out how to do that. Here is an idea of what I thought might work, but didn't:
animationConfig: {
value: function() {
return {
entry: {
name: [ 'slide-down-animation', 'fade-in-animation' ],
node: this.$.target
},
exit: {
name: [ 'slide-up-animation', 'fade-out-animation' ],
node: this.$.target
}
}
}
}
I would like this element to both slide and fade at the same time. Anyone know how to do this?
I found the documentation.
Here is the documentation URL: https://elements.polymer-project.org/guides/using-neon-animations#configuration-multiple
Here is a working example:
animationConfig: {
value: function() {
return {
entry: [
{
name: 'slide-down-animation',
node: this.$.target
},
{
name: 'fade-in-animation',
node: this.$.target
}
],
exit: [
{
name: 'slide-up-animation',
node: this.$.target
},
{
name: 'fade-out-animation',
node: this.$.target
}
]
}
}
}
Related
So it's been a while since I updated my Gatsby blog site, over 2 years and now when I updated all the packages, I noticed the markdown options have changed.
Orginally when I used this code, it would show all my blog post accurately with the correct images etc.
export const query = graphql`
{
allMdx(
filter: { fileAbsolutePath: { regex: "/posts/" } }
sort: { order: DESC, fields: frontmatter___date }
limit: 6
) {
nodes {
frontmatter {
alt
title
path
slug
date(formatString: "MMMM Do, YYYY")
image {
childImageSharp {
fluid {
...GatsbyImageSharpFluid
}
}
}
}
id
}
}
}
`
However, now I tried to choose the options based on what I found from graphql that looks similar to my previous options
Here's the new updated code
export const query = graphql`
{
allMdx(
filter: { body: { regex: "/posts/" } }
sort: { order: DESC, fields: frontmatter___date }
limit: 6
) {
nodes {
frontmatter {
alt
title
path
slug
date(formatString: "MMMM Do, YYYY")
image {
childImageSharp {
gatsbyImageData(layout: FULL_WIDTH)
}
}
}
id
}
}
}
`
However, this code only displays 2 post on my home page and doesn't show any of the images when I need all 6 to display and showcase all the images.
When I run the queries in graphql it only displays the 2 blog post data so I don't know which option to choose to reshow the same things I had before I updated my site with the new versions of gatsby
Here's my gatsby-config file
plugins: [
`gatsby-plugin-image`,
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`,
{
resolve: "gatsby-plugin-react-svg",
options: {
rule: {
include: /static/,
},
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `GatsbyJS`,
short_name: `GatsbyJS`,
start_url: `/`,
background_color: `#f7f0eb`,
theme_color: `#a2466c`,
display: `standalone`,
icon: `src/images/fav-1.png`,
icon_options: {
purpose: `any maskable`,
},
},
},
"gatsby-plugin-offline",
`gatsby-plugin-mdx`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
`gatsby-plugin-styled-components`,
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-plugin-sitemap`,
options: {
query: `
{
site {
siteMetadata {
siteUrl
}
}
allSitePage {
nodes {
path
}
}
}`,
resolveSiteUrl: ({ site }) => {
//Alternatively, you may also pass in an environment variable (or any location) at the beginning of your `gatsby-config.js`.
return site.siteMetadata.siteUrl
},
serialize: ({ site, allSitePage }) =>
allSitePage.nodes.map(node => {
return {
url: `${site.siteMetadata.siteUrl}${node.path}`,
changefreq: `weekly`,
priority: 0.7,
}
}),
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `posts`,
path: `${__dirname}/src/posts`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `resources`,
path: `${__dirname}/src/resources`,
},
},
// {
// resolve: "gatsby-plugin-page-creator",
// options: {
// path: `${__dirname}/src/posts`,
// },
// },
{
resolve: `gatsby-plugin-mdx`,
options: {
extensions: [`.md`, `.mdx`],
gatsbyRemarkPlugins: [{ resolve: "gatsby-remark-images" }],
},
},
{
resolve: `gatsby-plugin-google-fonts`,
options: {
fonts: [`nunito\:400s,700`],
display: "swap",
},
},
{
resolve: `gatsby-plugin-mdx`,
options: {
gatsbyRemarkPlugins: [
{
resolve: `gatsby-remark-prismjs`,
options: {
classPrefix: "language-",
inlineCodeMarker: null,
aliases: {},
showLineNumbers: false,
noInlineHighlight: false,
languageExtensions: [
{
language: "superscript",
extend: "javascript",
definition: {
superscript_types: /(SuperType)/,
},
insertBefore: {
function: {
superscript_keywords: /(superif|superelse)/,
},
},
},
],
// Customize the prompt used in shell output
// Values below are default
prompt: {
user: "root",
host: "localhost",
global: false,
},
// By default the HTML entities <>&'" are escaped.
// Add additional HTML escapes by providing a mapping
// of HTML entities and their escape value IE: { '}': '{' }
escapeEntities: {},
},
},
],
},
},
],
UPDATE: For index.js when I use this graph ql query I can finally see my images and the last 6 blog post I set, but not sure what I was supposed to input for the frontmatter so I just left it with empty {}
{
allMdx(
filter: { frontmatter: {} }
sort: { order: DESC, fields: frontmatter___date }
limit: 6
) {
nodes {
id
frontmatter {
title
path
slug
alt
date(formatString: "MMMM Do, YYYY")
image {
childImageSharp {
fluid {
src
}
}
}
}
}
}
}
I am try to create vue barchart & using apexChartData.
Here is my code
export default{
components: {
VueApexCharts
},
data () {
return {
barChart: {
series: [{
data: []
}],
chartOptions: {
plotOptions: {
bar: {
horizontal: true
}
},
dataLabels: {
enabled: false
},
xaxis: {
categories: []
}
}
}
},
methods: {
myFunction() {
this.$vs.loading();
axios.get("/api/auth/nameofapi").then(response => {
this.barChart.series[0].data = response.data[0]['data'];
this.barChart.chartOptions.xaxis.categories = response.data[1]['categories'];
this.$vs.loading.close();
}).catch(error => {
this.$vs.loading.close()
this.errorResponse(error);
});
}
},
mounted () {
this.myFunction();
}
}
My API Response payload like
[{"data":[4,1]},{"categories":["xyz","abc"]}]
After doing this bar chart is not loading, i am not sure where i am doing mistake, sorry for repeating this post if already exist but i just post what i am facing.
Any Help
Thanks in advance
I've read a lot of comments about it, but I didn't resolve my problem.
So my navigation code looks like this
export function pushScreens() {
Navigation.setRoot({
root: {
sideMenu: {
id: 'sideMenu',
left: {
visible: true,
component: {
id: 'Drawer',
name: SIDE_DRAWER,
},
},
center: {
bottomTabs: {
children: [{
stack: {
children: [{
component: {
name: HOME_SCREEN,
passProps: {
text: 'Home'
},
}
}],
options: {
bottomTab: {
text: 'Home',
icon: HomeIcon,
testID: 'FIRST_TAB_BAR_BUTTON'
},
}
}
},
{
component: {
name: PROFILE_SCREEN,
passProps: {
text: 'Profile'
},
options: {
bottomTab: {
text: 'Profile',
icon: HomeIcon,
testID: 'SECOND_TAB_BAR_BUTTON'
},
}
}
},
{
component: {
name: POSTS_SCREEN,
passProps: {
text: 'Posts'
},
options: {
bottomTab: {
text: 'Posts',
icon: HomeIcon,
testID: 'SECOND_TAB_BAR_BUTTON'
}
}
}
}]
}
}
}
}
});
}
I can pull the drawer from the left side of the screen by default, but how I could add the icon for that?
On the view that you wish to have the hamburger button, add:
static get options() {
topBar: {
leftButtons: [
{
color: colors.white,
id: TOOLBAR_HUMBERGER_BUTTON_ID,
icon: require("../resources/hamburger_topBar_button.png")
}
]
};
return topBar;
}
and then handle it like every other button of topBar:
navigationButtonPressed({ buttonId }) {
if (buttonId == TOOLBAR_HUMBERGER_BUTTON_ID) {
Navigation.mergeOptions(SIDEMENU_ID, {
sideMenu: {
left: {
visible: true
}
}
});
}
}
I have a graphql server, and I am trying to implement a query that will update the client with a list of nodes.
In nodes.js I have:
export const nodes = {
"nodes": [
{id: 1, "name": 'building_1', "hasStrobe": true},
{id: 2, "name": 'building_2', "hasStrobe": false},
{id: 3, "name": 'building_3', "hasStrobe": true}
]
}
My query in schema.js is as follows:
const Query = new GraphQLObjectType({
name: 'Query',
description: 'Root query object',
fields() {
return {
message: {
type: Message,
resolve() {
return getMessage();
},
},
system: {
type: System,
resolve() {
return getSystemInfo();
},
},
nodes: {
type: Nodes,
resolve() {
//console.log(nodes.nodes)
return nodes.nodes;
}
},
// alert: {
// type: Alert,
// resolve() {
// return 'poke';
// }
// }
};
},
});
And my Nodes type is as follows:
const Nodes = new GraphQLObjectType({
name: 'Nodes',
description: 'List of zone nodes and their capabilities.',
fields() {
return {
nodes: {
type: GraphQLString,
resolve(msg) {
console.log(msg)
return msg;
}
},
}
}
});
When the query is run, it logs nodes.nodes correctly to the console:
[ { id: 1, name: 'building_1', hasStrobe: true },
{ id: 2, name: 'building_2', hasStrobe: false },
{ id: 3, name: 'building_3', hasStrobe: true } ]
While the query output is:
{
"data": {
"system": {
"uname": "4.11.5-2-ck-haswell\n",
"time": "Thu Jun 22 2017 17:39:29 GMT-0500 (CDT)"
},
"nodes": {
"nodes": "[object Object],[object Object],[object Object]"
}
}
}
I'm unsure of how to process the data array in a way that will work to output the nodes.
i want to add a background to a list that is in a tab panel. but as soon as i make the layout fit, the background disappears...if i remove layout, the list disappears..
the list only seems to appear when the layout is fit...
can any one help out?
plz thanks...
**************************** Bollist.js **********************
Ext.define('tabla.view.Bollist',
{
extend:'Ext.Panel',
xtype:'Bollist',
config:{
title:'Bols',
iconCls:'music2',
layout:'fit',
items:[
{
xtype:'list',
store:'BolStore',
itemTpl:'{name}'
}
]
}
});
*************** Main.js **************
Ext.define("tabla.view.Main", {
extend: 'Ext.tab.Panel',
requires: [
'Ext.TitleBar',
'Ext.dataview.List'
],
config: {
tabBarPosition: 'bottom',
items: [
{
style:{
backgroundImage:'url(resources/images/bg.png)',
backgroundRepeat:'repeat',
backgroundPosition:'center',
backgroundSize:'cover'
},
xtype:'home'
},
{
style:{
background:'red',
backgroundRepeat:'repeat',
backgroundPosition:'center',
backgroundSize:'cover'
},
xtype:'Bollist'
}
]
}
});
Ext.define('tabla.store.BolStore',{
extend:'Ext.data.Store',
config:
{
model:'tabla.model.Bol',
data:[
{ name: 'Na/Ta' },
{ name: 'Ti' },
{ name: 'Tin' },
{ name: 'Ri'},
{ name: 'Ge' },
{ name: 'Ka/Kat'},
{ name: 'Dha'},
{ name: 'Dhi'},
{ name: 'Dhin'},
{ name: 'Toon'}
]
}
});
Try this approach this is working for me.
Remove style from your list :
style:{
background:'red',
backgroundRepeat:'repeat',
backgroundPosition:'center',
backgroundSize:'cover'
}
Add CSS file in your index.html like this :
<link href="app.css" rel="stylesheet" type="text/css" />
In your app.css add the following code :
.x-list
{
background:'red';
}
Hope this helps.