Giter Site home page Giter Site logo

markusantonwolf / ta-youtube Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 1.0 1.42 MB

A light-weight, responsive and mobile first YouTube / Vimeo video wrapper with auto playback and aspect ratio for the video player.

Home Page: https://ta-styled-plugins.com/ta-youtube/

License: MIT License

JavaScript 86.22% HTML 9.24% CSS 4.54%
tailwind-css tailwindcss alpine-js alpinejs front-end front-end-development

ta-youtube's Introduction

TA-YouTube - mobile first video wrapper with aspect ratio

A light-weight, responsive and mobile first YouTube / Vimeo video wrapper with auto playback and aspect ratio for the video player. Runs with Alpine.js V2 and Alpine.js V3

Demos, Documentation and Examples

Documentation

Getting started

Examples

Configuration

Tailwind CSS plugin

alpine.js Docs (V3)

Features

  • No privacy issues - User has to click before video plays
  • Remembers visitor - Stores if visitor clicked to accept
  • Transitions - You can use a great animated preview image
  • Autoplay mode - Optional and if user already accepted
  • Based on Alpine JS - Small footprint and Vue JS inspired, like Tailwind for JavaScript
  • Runs with Alpine.js V2 and Alpine.js V3
  • 100% Tailwind CSS - Rapidly build modern websites without leaving your HTML

Install

From npm: Install the package.

# Install using npm

npm install --save-dev @markusantonwolf/ta-gallery

# Install using yarn

yarn add -D @markusantonwolf/ta-gallery

Inside tailwind.config.js: Add the plugin to your tailwind css config file.

// tailwind.config.js

const ta_youtube_safelist = require('./node_modules/@markusantonwolf/ta-youtube/src/plugin/safelist')

module.exports = {
    purge: {
        // ...
        options: {
            safelist: [...ta_youtube_safelist],
        },
        // ...
    },
    // ...
    theme: {
        // ...
        taYoutube: {
            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: {
        // ...
        taYoutube: ['responsive'], // empty the array if you don't need a responsive variant
        // ...
    },
    // ...
    plugins: [
        require('@markusantonwolf/ta-youtube')({
            respectPrefix: true, // respect prefix option in config: true (default) | false
            respectImportant: true, // respect important option in config: true (default) | false
        }),
    ],
}

More TA-Styled-Plugins

  • TA-Styled-Plugins - Explore all Tailwind CSS and Alpine JS styled plugins and learn how to enhance your website fast and easy.

Local development

// To install dev dependencies run:

npm install

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

npm run serve

// To make a development build run:

npm run develop

// To make a production build run:

npm run build

Copyright

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

ta-youtube's People

Contributors

dependabot[bot] avatar markusantonwolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rafszul

ta-youtube's Issues

taYoutube is not defined

Hi there. I'm trying to follow the documentation and got error:

Alpine Expression Error: taYoutube is not defined

I'm using @jeffreyvr/tailwindcss-tailpress with app.js (defer) script:

import Alpine from 'alpinejs'
window.Alpine = Alpine
Alpine.start()

Should I declare window.taYoutube = ? before Alpine.start() manually?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.