Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- "use strict";
- var chat = document.getElementById('chat');
- var counter = 0;
- var multiplier = 10;
- function rainbowBitches(node) {
- if (node.classList && node.classList.contains('message') && !node.classList.contains('pending')) {
- var content = node.querySelectorAll('.content');
- [].forEach.call(content, function(cnode) {
- cnode.style.color = 'hsl(' + counter + ', 100%,50%)';
- counter += multiplier;
- });
- }
- }
- [].forEach.call(chat.querySelectorAll('.user-container .message'), rainbowBitches);
- new MutationObserver(function(records) {
- records.forEach(function(record) {
- [].forEach.call(record.addedNodes, rainbowBitches);
- });
- }).observe(chat, {
- childList: true,
- subtree: true
- });
- }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement