swiftuikit / marquee Goto Github PK
View Code? Open in Web Editor NEWA powerful implementation of Marquee(scrolling text or label) in SwiftUI, which supports any content view, including text(label), image, video, etc.
License: MIT License
A powerful implementation of Marquee(scrolling text or label) in SwiftUI, which supports any content view, including text(label), image, video, etc.
License: MIT License
Love this plugin, it's exactly what I'm looking for. I've got 4 tickers stacked, I have the duration set to 20000 as I"m looking for a very very slow ticker.
Here's the problem, with it sliding in from the right, it takes about a minute to reach:
Of course, it's an extremely slow ticker. But I would like it to start from the position left aligned and slide from there, e.g.
also, when the text ends, you get a long blank period before the text repeats. Any way of reducing this gap to zero so that the text is continuous?
I'm happy to roll up my sleeves and have a go at updating the code if you can give me some pointers and I could submit a PR.
One other thing FYI I am occasionally getting some flickering and data cut off with long text - this one counts from item 1 to item 100:
I have this code:
VStack(alignment: .leading) {
Marquee {
Text("Tag \(viewModel.courseDay.indexRank) - \(viewModel.courseDay.title ?? "KEIN TITEL GEGEBEN!")") //TODO: add marqueeText to entire app
.font(.headline)
.fontWeight(.semibold)
.foregroundColor(.primary)
}.marqueeDuration(9)
Text(viewModel.courseDay.description ?? "")
.font(.body)
.fontWeight(.light)
.foregroundColor(.secondary)
}
.padding(.all, 16)
Been looking for something like this for ages tonight but ive found an annoying bug? when I run the ForEach with the code below the marquee restarts the instant the first text hits the edge of the frame.
Im trying to create a Marquee of game resutls but the second the edge of the first one hits the edge of the box it restarts the loop.
Marquee { HStack{ ForEach(function.lastTen(), id: \.matchRecord.id) {index in HStack { Text("\(function.playerName(for: index.matchRecord.playerId))") Text("VS") Text("\(index.winnerName)") Image(systemName: "trophy.fill") } .padding(.trailing, 50) .font(.system(size: 20)) .foregroundColor(.white) } } } .frame(width: 200, height: 50) .background(Color.mint.opacity(0.8)) .marqueeDuration(duration)
If I run the code below without the external HStack however it loops round perfectlly like expected, but now my ForEach loop is displaying stacked ontop of each other not horizontally.
This is neat; thanks for sharing.
There's a couple features that I think would make this even better.
Have a delay paramter, so that the text starts in the initial idle alignment position, and only starts to move after the delay has been met.
Have a repeats parameter that allows for the setting of the number or repeats, including infinity.
It looks like this PR woud take care of the delay bit.
At the moment when there is a change in content and therefore size of content, resetAnimation doesn't get called and it cause unexpected behaviour.
@CatchZeng is this repo/package still maintained?
I opened two PRs over a year ago with no response. I love using this package in my own Apps, and I also add some fixes and additional features to it and wanted to give it back to the community. However, it's hard to do so if there is no maintainer.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.