Ticker BBCode

Mixed forum with code snippets, guides and styles
Post Reply
User avatar
Stoker
Site Admin
Site Admin
Posts: 3558
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Ticker BBCode

Post by Stoker »

Ticker BBCode

The Ticker BBCode let you insert at ticker in your posts.

Demo: BBCode:

Code: Select all

[ticker]{TEXT}[/ticker]
HTML:

Code: Select all

<aside class="ticker">
<div class="ticker__inner">
<p>{TEXT}</p>
</div>
</aside>
Helpline:

Code: Select all

Ticker: [ticker]Put Your text here[/ticker]
Example:

Code: Select all

[ticker]Lorem ipsum dolor sit amet, consectetuer adipiscing elit.[/ticker]
Now, to make this work we need some css.
You can add it to the bottom of your styles colours.css

Code: Select all

/** Ticker **/
.ticker {
  --ticker-duration: 20s;
  z-index: 10;
  overflow: hidden;
  padding: 0.5rem;
}

.ticker__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  animation-name: ticker;
  animation-duration: var(--ticker-duration);
  text-align: center;
  width: max-content;
  padding-left: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .ticker__inner {
    flex-wrap: wrap;
    white-space: inherit;
    padding-left: 0;
    width: auto;
  }
}

.ticker__inner p {
  margin: 0 2rem;
}

@keyframes ticker {
  0% {
    transform: translate3d(0%, 0, 0);
  }

  100% {
    transform: translate3d(-100%, 0, 0);
  }
}
This piece controls the speed:

Code: Select all

  --ticker-duration: 20s;
Save, upload and refresh
Board rules! No PM support
User avatar
Steve
BBCoder VI
BBCoder VI
Posts: 863
Joined: 05 Mar 2010, 01:10
BBCodes: 2000
Favourite BBCode: p**n tube
Favourite MOD: Non of Stokers

Re: Ticker BBCode

Post by Steve »

Can't you add the CSS via the style tag in html?
Steve wrote: 14 Nov 2024, 16:45 It's happy bastard day!
User avatar
Stoker
Site Admin
Site Admin
Posts: 3558
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Ticker BBCode

Post by Stoker »

Steve wrote: 13 Dec 2024, 22:24 Can't you add the CSS via the style tag in html?
And if you use the BBCodes more than once per page?
Board rules! No PM support
User avatar
Steve
BBCoder VI
BBCoder VI
Posts: 863
Joined: 05 Mar 2010, 01:10
BBCodes: 2000
Favourite BBCode: p**n tube
Favourite MOD: Non of Stokers

Re: Ticker BBCode

Post by Steve »

The Ticker BBCode let you insert at ticker in your posts.

Demo:


The Ticker BBCode let you insert at ticker in your posts.

Demo:
Steve wrote: 14 Nov 2024, 16:45 It's happy bastard day!
User avatar
Stoker
Site Admin
Site Admin
Posts: 3558
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Ticker BBCode

Post by Stoker »

Stoker wrote: 13 Dec 2024, 22:36
Steve wrote: 13 Dec 2024, 22:24 Can't you add the CSS via the style tag in html?
And if you use the BBCodes more than once per page?
Then the html would be added in style several times. We dont want that Stoker :thumb: 8-) :D
Board rules! No PM support
Post Reply