npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@markusantonwolf/ta-foodtrucks

v2.1.1

Published

TA-Foodtrucks plugin shows the next food truck and street food dates in your area based on Craftplaces API. You can customize the endpoints to get all dates for a specific vendor, for a specific city or just for a location you are interested in. The light

Downloads

135

Readme

TA-Foodtruck

TA-Foodtrucks uses the Craftplaces Api demo data to show the next food truck and street food dates in your area. You can customize the endpoints to get all dates for a specific vendor, for a specific city or just for a location you are interested in.

TA-Foodtrucks is 100% customizable and has endless animation options. You can use TA-Foodtrucks as a stand-alone version as well as a part of your Alpine JS and Tailwind CSS project. TA-Foodtrucks is designed to fit in every project, in every grid and in every flexbox so please try it out and if you have some feedback - leave me a message: @markusantonwolf / Twitter.

Demo

REALWORLD

You can see a real world example on this page: https://api.craftplaces.com/en/benefits

Features

  • Supports loading animation
  • Locale support for time, date and numbers
  • Translations for relative dates
  • Timezone support
  • Weekday support - relative and absolute
  • Error messages as template customizable
  • All options are customizable!!!
  • Small file size JS + CSS: 7.8 kByte
  • Alpine JS + TA-Foodtrucks bundle size: 30.4 kByte
  • Use of Alpine JS and Tailwind CSS

CDN

TA-Foodtrucks

<script src="https://cdn.jsdelivr.net/gh/markusantonwolf/ta-foodtrucks@latest/dist/scripts/ta-foodtrucks.min.js"></script>

Alpine JS + TA-Foodtrucks

<script
    src="https://cdn.jsdelivr.net/gh/markusantonwolf/ta-foodtrucks@latest/dist/scripts/alpine-ta-foodtrucks.min.js"
    defer
></script>

Installation

1. Install the Tailwind CSS Custom Color Palette plugin:

# Install using npm
npm install --save-dev @markusantonwolf/ta-foodtrucks

# Install using yarn
yarn add -D @markusantonwolf/ta-foodtrucks

2. Add it to your tailwind.config.js file:

// tailwind.config.js
module.exports = {
    // ...
    plugins: [require('@markusantonwolf/ta-foodtrucks')],
    // ...
}

3. Use it > 🌮

Options

All options you can define

You can define all options as data attributes - like this example.

<div
    class="ta-foodtrucks"
    x-data="taFoodtrucks()"
    x-init="init()"
    x-cloak
    data-endpoint="https://api.craftplaces.com/api/v1/dip/location/twodays"
    data-locale="en-US"
    data-min-height="10rem"
    data-duration="1000"
    data-today="Today"
    data-tomorrow="Tomorrow"
    data-seperator=" - "
    data-suffix=""
>
</div>

Alternativly you can define all options as an object inside the init() function - like this example.

init({
    
    // define your Craftplaces API endpoint
    endpoint: 'https://api.craftplaces.com/api/v1/dip/location/twodays',
    
    // define a translation for the relative date
    today: 'Today',

    // define a translation for the relative date
    tomorrow: 'Tomorrow',

    // define a locale for the visitor - shows the right dates and numbers
    locale: 'en-US',

    // seperator between start and end time
    seperator: ' - ',

    // suffix after end time
    suffix: '',
})

Functions and data


    // Gives you the information if the data is valid and can be used.
    initialized: false,

    // Gives you the information if the data is loading.
    loading: false,

    // Gives you the information if there are dates to show.
    has_dates: false,

    //  Gives you the information if there was an error while fetching the data from the Craftplaces API.
    error: false,

    //  Gives you all dates provided by the Craftplaces API.
    dates: [],

    // get the start time for the index - dates[index]
    getStartTime(index)

    // get the end time for the index - dates[index]
    getEndTime(index)

    // get the start and end time for the index - dates[index] - seperator and suffix
    // will be default if there is no definition in the function call
    getTime(index, seperator = null, suffix = null)

    // get the timezone for this index - dates[index]
    getTimezone(index)

    // get the weekday and define if relative or not
    getWeekday(index, relative = false)

    // get locale day for the index - dates[index]
    getDay(index)

    // get street, number and city for the index - dates[index]
    getAddress(index)

    // get what3words link for the index - dates[index]
    getWhat3WordsLink(index)

    // get google maps link for the index - dates[index]
    getGoogleMapsLink(index)

In the following example you can see all available options (default values) for the TA-Foodtrucks plugin for Tailwind CSS. To add your own configuration add taFoodtrucksto themeand variants. Your new settings will be merged with the default settings. To change the plugin behaviour in terms of how it adds the new classes as utilities you can add these options as objects to the default function.

// tailwind.config.js
module.exports = {
    // ...
    theme: {
        // ...
        taFoodtrucks: {
            debug: false, // shows the new component classes in the console while building
            export: false, // writes the new component classes into files ./public/utilities.css & /public/keyframes.css
        },
        // ...
    },
    variants: {
        // ...
        taFoodtrucks: ["responsive"], // empty the array if you don't need a responsive variant
        // ...
    },
    // ...
    plugins: [require('@markusantonwolf/ta-foodtrucks')],
    // ...
}

All TA StyledPlugins

  • TA-Gallery - An image gallery with endless animation options.
  • TA-Pagination - A content pagination solution.
  • TA-Youtube - A YouTube video wrapper with auto playback and aspect ratio for the video player.
  • TA-Analytics - A plugin for every website that needs to have an easy and customizable Google Analytics “blocker”.
  • TA-Foodtrucks - A plugin to show the next food truck and street food dates in your area.

Local development

// To install dev dependencies run:

npm install

// To start the development server run and go to http://localhost:9999/:

npm run serve

// To make a development build run:

npm run develop

// To make a production build run:

npm run build

Licence

TA Foodtrucks is released under the MIT license & supports modern environments.

Copyright

© 2021 Markus A. Wolf https://www.markusantonwolf.com