Last active
June 18, 2026 23:05
-
-
Save vdeemann/bb280c2200423bfdaedc426f83ff9d20 to your computer and use it in GitHub Desktop.
A backup copy of Deepcut.fm Screen in Center Thing https://thompsn.com/turntable/centerscreen/screenthing.js?v=1.1 for https://70s.neader.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| setTimeout(function() { | |
| playlist.loadList(); | |
| }, 5000); | |
| function thingvote(c) { | |
| var f = $.sha1(turntable.user.attributes.roomId + c + turntable.topViewController.currentSong._id); | |
| var d = $.sha1(Math.random() + ""); | |
| var e = $.sha1(Math.random() + ""); | |
| turntable.sendMessage({ | |
| api: "room.vote", | |
| roomid: turntable.user.attributes.roomId, | |
| val: c, | |
| vh: f, | |
| th: d, | |
| ph: e | |
| }); | |
| }; | |
| let lastChatter = null; | |
| let lastMid = null; | |
| function thinginit(cold) { | |
| $($(".screen-link")[1]).hide(); | |
| if (cold && turntable.topViewController.currentSong) $(".point-display").text(turntable.topViewController.users[turntable.topViewController.currentSong.djid].attributes.points.toLocaleString("en-US") + " things"); | |
| if (cold) $($(".screen-link")[0]).prepend("<div style=\"left: 398px; top: -94px; width: 450px; height:220px;background-image:url(https://thompsn.com/turntable/centerscreen/ttthing.gif);background-color:#000;border:1px solid #ccc;position: absolute;position: absolute;text-align: center;overflow: hidden;\" id=\"screeeeenbg\"></div>"); | |
| // $("#screeeeenbg").css("background-image", "url(" + turntable.topViewController.currentSong.metadata.coverart + ")"); | |
| // if (turntable.topViewController.currentSong.metadata.source == "sc") $("#screeeeenbg").css("background-image", "url(" + turntable.topViewController.currentSong.metadata.coverart.replace('-large', '-t500x500') + ")"); | |
| $("#screeeeenbg").css("background-position", "center"); | |
| $("#screeeeenbg").css("background-size", "contain"); | |
| $("#screeeeenbg").css("background-repeat", "no-repeat"); | |
| ROOMMANAGER.sceneBackground.areSideScreensVisible = false; | |
| ROOMMANAGER.sceneBackground.set(); | |
| let oldCamera = ROOMMANAGER.cameraPosition; | |
| oldCamera.x = 0; | |
| ROOMMANAGER.setCameraPosition(oldCamera); | |
| if (turntable.topViewController.currentSong) { | |
| thingstarted = turntable.topViewController.currentSong.starttime; | |
| thingduration = turntable.topViewController.currentSong.metadata.length; | |
| $("#thingtitle").text(turntable.current_title); | |
| $("#thingartist").text(turntable.current_artist); | |
| } | |
| } | |
| function thingsnag() { | |
| const sh = $.sha1(Math.random() + ""); | |
| const fh = $.sha1(Math.random() + ""); | |
| const i = [turntable.user.id, turntable.topViewController.currentSong.djid, turntable.topViewController.currentSong._id, turntable.user.attributes.roomId, | |
| 'queue', 'board', 'false', 'false', sh | |
| ]; | |
| const vh = $.sha1(i.join('/')); | |
| turntable.sendMessage({ | |
| api: "snag.add", | |
| roomid: turntable.user.attributes.roomId, | |
| djid: turntable.topViewController.currentSong.djid, | |
| songid: turntable.topViewController.currentSong._id, | |
| site: "queue", | |
| location: "board", | |
| in_queue: "false", | |
| blocked: "false", | |
| vh, | |
| sh, | |
| fh | |
| }); | |
| turntable.sendMessage({ | |
| api: "playlist.add", | |
| playlist_name: playlist.activePlaylist, | |
| song_dict: { | |
| fileid: turntable.topViewController.currentSong._id | |
| }, | |
| index: -1 | |
| }); | |
| setTimeout(function() { | |
| playlist.loadList(); | |
| }, 2000); | |
| } | |
| $("head").append("<style>#scwidget{display: none !important;} .message:nth-child(odd) { background-color: unset !important; } .message{ background-color: transparent !important; }.screen-link{z-index:4 !important; display:block !important;} #thingup, #thingdown, #thingsnag{fill:#777;} #thingup, #thingdown{ margin-right: 4px; } #footer{text-align:left !important; color:#999 !important;} .screen-content img { display: none !important; } iframe.screen-content { width: 450px; height:220px; } .screen-content{ left: 399px; top: -94px; width: 448px; height:220px; } .board.room-view-board.song-playing {display: none;}</style>"); | |
| $("#footer").html("<div style=\"float:left; width: calc(100% - 150px); white-space: nowrap; text-overflow: ellipsis; overflow: hidden;\"><span id=\"thingartist\">artist</span> - <span id=\"thingtitle\">thing</span></div><div id=\"thingtimer\" style=\"width: 75px; float: none; position: absolute; right: 74px;\">TIMER</div><div style=\"float:right; width:56px;\"><span id=\"thingup\"><svg style=\"margin-top: -4px; width: 15px; display: inline-block; vertical-align: middle; height: 14px; cursor: pointer;\" xmlns=\"http://www.w3.org/2000/svg\" height=\"48\" viewBox=\"0 96 960 960\" width=\"48\"><path d=\"M721 936H254V424l278-288 33 26q11 8 14.5 18t3.5 23v10l-45 211h322q23 0 41.5 18.5T920 484v82q0 11-2.5 25.5T910 617L794 885q-9 21-29.5 36T721 936ZM194 424v512H80V424h114Z\"/></svg></span><span id=\"thingdown\"><svg style=\"margin-top: -4px; width: 15px; display: inline-block; vertical-align: middle; height: 14px; cursor: pointer;\" xmlns=\"http://www.w3.org/2000/svg\" height=\"48\" viewBox=\"0 96 960 960\" width=\"48\"><path d=\"M239 216h467v512l-278 288-33-26q-11-8-14.5-18t-3.5-23v-10l45-211H100q-23 0-41.5-18.5T40 668v-82q0-11 2.5-25.5T50 535l116-268q9-21 29.5-36t43.5-15Zm527 512V216h114v512H766Z\"/></svg></span><span id=\"thingsnag\"><svg style=\"margin-top: -4px; width: 15px; display: inline-block; vertical-align: middle; height: 14px; cursor: pointer;\" xmlns=\"http://www.w3.org/2000/svg\" height=\"48\" viewBox=\"0 96 960 960\" width=\"48\"><path d=\"m480 935-41-37q-106-97-175-167.5t-110-126Q113 549 96.5 504T80 413q0-90 60.5-150.5T290 202q57 0 105.5 27t84.5 78q42-54 89-79.5T670 202q89 0 149.5 60.5T880 413q0 46-16.5 91T806 604.5q-41 55.5-110 126T521 898l-41 37Z\"/></svg></span></div><div style=\"bottom: 0; left: 0; width: 100%; position:absolute; height: 2px; background-color: #dba928;\" id=\"thingprogbar\"></div>") | |
| thinginit(true); | |
| turntable.socket.on('message', function(rawdata) { | |
| try { | |
| var data = JSON.parse(rawdata); | |
| if (data.command) { | |
| if (data.command == "newsong") { | |
| lastChatter = null; | |
| $("#thingup").css("fill", "#777"); | |
| $("#thingdown").css("fill", "#777"); | |
| $("#thingsnag").css("fill", "#777"); | |
| thinginit(); | |
| } else if (data.command == "registered") { | |
| setTimeout(function() { | |
| // RE-INIT the things! | |
| thinginit(true); | |
| }, 2000); | |
| } else if (data.command == "update_votes") { | |
| $(".point-display").text(turntable.topViewController.users[turntable.topViewController.currentSong.djid].attributes.points.toLocaleString("en-US") + " things"); | |
| if (data.room.metadata.votelog[0][0] == turntable.user.id) { | |
| if (data.room.metadata.votelog[0][1] == "up") { | |
| $("#thingup").css("fill", "#1abf00"); | |
| $("#thingdown").css("fill", "#777"); | |
| } else { | |
| $("#thingdown").css("fill", "#ff1010"); | |
| $("#thingup").css("fill", "#777"); | |
| } | |
| } | |
| } else if (data.command == "speak") { | |
| if (data.userid == lastChatter) { | |
| // do thing | |
| $("[data-mid='" + data.mid + "']").find(".avatar").hide(); | |
| $("[data-mid='" + data.mid + "']").css("margin-top", "-10px"); | |
| $("[data-mid='" + data.mid + "']").find(".speaker").hide(); | |
| $("[data-mid='" + lastMid + "']").css("border-bottom", "none"); | |
| } | |
| lastMid = data.mid; | |
| lastChatter = data.userid; | |
| if (data.text) { | |
| if (data.text.substring(0, 4) == "/me ") { | |
| lastChatter = null; | |
| } | |
| } | |
| } else if (data.command == "booted_user") { | |
| lastChatter = null; | |
| } else if (data.command == "emoji") { | |
| /* | |
| var groups = $("[data-mid='"+data.mid+"']").find(".emojiGroup"); | |
| for (let i = 0; i < groups.length; i++) { | |
| let emoji = $(groups[i]).find(".emojiType").text(); | |
| if (emoji == data.emoji) { | |
| let title = $(groups[i]).prop("title"); | |
| title = title + "\n" + data.name; | |
| $(groups[i]).prop("title", title); | |
| } | |
| } | |
| */ | |
| } | |
| } | |
| } catch (e) { | |
| console.log(e); | |
| } | |
| }); | |
| $("#thingup").on("click", function() { | |
| thingvote("up"); | |
| $("#thingup").css("fill", "#1abf00"); | |
| $("#thingdown").css("fill", "#777"); | |
| }); | |
| $("#thingdown").on("click", function() { | |
| thingvote("down"); | |
| $("#thingdown").css("fill", "#ff1010"); | |
| $("#thingup").css("fill", "#777"); | |
| }); | |
| $("#thingsnag").on("click", function() { | |
| thingsnag(); | |
| $("#thingsnag").css("fill", "#fb5874"); | |
| }); | |
| setInterval(function() { | |
| var timeSince = Date.now() - (thingstarted * 1000); | |
| var timeLeft = (thingduration * 1000) - timeSince; | |
| var thingseconds = Math.floor((timeLeft / 1000) % 60); | |
| var thingminutes = Math.floor((timeLeft / 1000) / 60); | |
| var thingseconds2 = Math.floor((timeSince / 1000) % 60); | |
| var thingminutes2 = Math.floor((timeSince / 1000) / 60); | |
| if (thingseconds < 10) thingseconds = "0" + thingseconds; | |
| if (thingminutes < 10) thingminutes = "0" + thingminutes; | |
| if (thingseconds2 < 10) thingseconds2 = "0" + thingseconds2; | |
| if (thingminutes2 < 10) thingminutes2 = "0" + thingminutes2; | |
| $("#thingtimer").text(thingminutes2 + ":" + thingseconds2 + " | " + thingminutes + ":" + thingseconds); | |
| var percent = (timeSince / (thingduration * 1000)) * 100; | |
| $("#thingprogbar").css("background", "linear-gradient(90deg, #dba928 " + percent + "%, transparent " + percent + "%)"); | |
| var match = window.location.href.match(/https:\/\/deepcut.live\/profile\/(.*)/); | |
| var match2 = window.location.href.match(/https:\/\/deepcut.live\/profile\/(.*)\/(.*)/); | |
| if (match && !match2) { | |
| var theuser = match[1]; | |
| if (turntable.topViewController.users[match[1]].attributes.avatarId == 3000) { | |
| let custhead = turntable.topViewController.users[match[1]].attributes.custom_avatar.images.hf.replace("/roommanager_assets/avatars/3000/headfront", "").replace(".png", ""); | |
| let custscreen = turntable.topViewController.users[match[1]].attributes.custom_avatar.images.sf.replace("/roommanager_assets/avatars/3000/screenfront", "").replace(".png", ""); | |
| let custbody = turntable.topViewController.users[match[1]].attributes.custom_avatar.images.bf.replace("/roommanager_assets/avatars/3000/bodyfront", "").replace(".png", ""); | |
| var coolimg = "https://thompsn.com/turntable/customavatar?h=" + custhead + "&s=" + custscreen + "&b=" + custbody; | |
| $(".profile-images").find("img").attr("src", coolimg) | |
| } | |
| } | |
| }, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment