mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 13:21:41 -05:00
samples
This commit is contained in:
@@ -9,7 +9,7 @@ function changeColor() {
|
||||
document.documentElement.style.setProperty("--shifting-color-1", "rgb(" + parseInt(colors[0] + regularAdjust) + "," + parseInt(colors[1] + regularAdjust) + "," + parseInt(colors[2] + regularAdjust) + ")")
|
||||
var lightColors = indexToColor(currentColorIndex + lightLead)
|
||||
document.documentElement.style.setProperty("--shifting-color-1-light", "rgb(" + parseInt(lightColors[0] + lightAdjust) + "," + parseInt(lightColors[1] + lightAdjust) + "," + parseInt(lightColors[2] + lightAdjust) + ")")
|
||||
currentColorIndex += 153 / 60 //The second number is how many seconds it takes to do a full loop
|
||||
currentColorIndex += 153 / 180 //The second number is how many seconds it takes to do a full loop
|
||||
}
|
||||
function indexToColor(colorIndex) {
|
||||
var red = 0, green = 0, blue = 0
|
||||
|
@@ -883,6 +883,7 @@ function textCodeTutorial() {
|
||||
|
||||
// //textCodeTutorial()
|
||||
textCodeTutorial()
|
||||
loadSampleImages()
|
||||
|
||||
|
||||
|
||||
@@ -900,3 +901,34 @@ function filterFramePicker(classToShow) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function loadSampleImages() {
|
||||
var availableSamples = 6;
|
||||
var samplesToLoad = [0,0,0];
|
||||
for (var i = 1; i <= samplesToLoad.length; i ++) {
|
||||
var sampleImage = new Image()
|
||||
sampleImage.customVarIndex = i;
|
||||
var randomIndex = 0;
|
||||
sampleImage.onload = function() {
|
||||
document.getElementById(("sample" + this.customVarIndex)).src = this.src;
|
||||
}
|
||||
while(samplesToLoad[i - 1] == 0) {
|
||||
randomIndex = Math.floor(Math.random() * (availableSamples)) + 1;
|
||||
if (!samplesToLoad.includes(randomIndex)) {
|
||||
samplesToLoad[i - 1] = randomIndex;
|
||||
}
|
||||
}
|
||||
sampleImage.src = "data/site/images/samples/" + randomIndex + ".png";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user