Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't use the function twice #17

Open
pisteuralpin opened this issue Jul 2, 2023 · 5 comments
Open

I can't use the function twice #17

pisteuralpin opened this issue Jul 2, 2023 · 5 comments

Comments

@pisteuralpin
Copy link

I'm using the function like this but for both the displayed text is "••••••••••••••••••••"

.windows-viewport.loaded .viewport-locked .password {
	@include typed(
		"••••••••••••••••••••",
		null,
		(delay: 2, caret-width: 2px, caret-space: 2px, iterations: 0)
	);
}

#about-presentation {
	@include typed(
		"text",
		(type: .1), (caret-width: 2px, caret-space: 2px)
	);
}
@brandonmcconnell
Copy link
Owner

@pisteuralpin Could you create a reproducible example of this online (maybe codepen.io) where I can troubleshoot the issue?

@HansKing98
Copy link

You need to use a different 'name' ,
like this,

.my-typed {
	padding: 0 0 0 3px;
    background-color:blue;

	&::before { font-weight: 400; }
	@include typed(
            "Happy",
            "Angry"
        (   type: .07,pause-typed: 2,delete: .08,pause-deleted: 1),
        (   
            name: "my-typewriter-9999", 
            caret: true,caret-speed: .75,caret-width: 2px,caret-color: currentColor,caret-space: .1ch,
            delay: 1,iterations: infinite,
        )

	);
}
.my-typed2 {
	padding: 0 0 0 3px;
    background-color:blue;

	&::before { font-weight: 400; }
	@include typed(
            "Happy2",
            "Angry2"
        (   type: .07,pause-typed: 2,delete: .08,pause-deleted: 1),
        (   
            name: "my-typewriter-9999-2", 
            caret: true,caret-speed: .75,caret-width: 2px,caret-color: currentColor,caret-space: .1ch,
            delay: 1,iterations: infinite,
        )

	);
}

@brandonmcconnell
Copy link
Owner

@HansKing98

You need to use a different 'name'

Theoretically, you should be able to use this package as much as you want without ever using a name, since it should automatically iterate the index with each instance. The only caveat to this, is it likely resets between different files, so if you're using this on two different SCSS sheets, they both get pulled onto the same page, you may have conflicting names.

@pisteuralpin could you please try the suggested solution from @HansKing98 above, and let me know if it works. If it does, this might be a bug in the package I need to resolve. Let me know what you find, and maybe we can investigate this together.

@pisteuralpin
Copy link
Author

Hey @HansKing98, thank you it seems to work.
@brandonmcconnell if you have some questions to investigate this bug don't hesitate

@brandonmcconnell
Copy link
Owner

@pisteuralpin glad it worked!

Could you drop me an email address or some other mode of contact I can reach you at, so we can set up a call to diagnose and resolve the root issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants