Skip to content

Commit eb8a9ae

Browse files
committed
Project description ready
1 parent 01f4876 commit eb8a9ae

27 files changed

+4482
-3
lines changed

css/style.min.css

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fonts/dosis.woff

33.1 KB
Binary file not shown.

fonts/dosis.woff2

26.1 KB
Binary file not shown.

fonts/shadowsintolighttwo.woff

39.3 KB
Binary file not shown.

fonts/shadowsintolighttwo.woff2

32.6 KB
Binary file not shown.

images/Logo Poziome.png

70.6 KB
Loading

images/add.png

12.9 KB
Loading

images/back.jpg

224 KB
Loading

images/generator_logo.png

91.2 KB
Loading

images/logo_KSB.png

25.8 KB
Loading

images/ptaszek_reversed.png

32.7 KB
Loading

images/stars.png

3.33 KB
Loading

index.html

+6-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@
2525
<div class="generator_logo">
2626
</div>
2727
<p>
28-
Ideą aplikacji jest rozwiązanie problemu, z którym spotykam się grając w zespole muzycznym! Bardzo często, przed koncertem, zespół stara się przygotować listę piosenek, które odegrane zostaną na koncercie - ustawić je w odpowiedniej kolejności, wybrać którą piosenką zacząć, którą skończyć, co zagrać na bis, ile piosenek w ogóle uwzględnić, w zależności od czasu trwania koncertu, ilości setów, itd., jednocześnie przy ustalaniu kolejności, uwzględniane są takie własności piosenek, jak tempo, to czy dana piosenka jest hitem(ulubionym przez ludzi) itd. Niektóre piosenki grywamy tylko na prywatnych, zamkniętych imprezach, podczas gdy na normalnym koncercie raczej ich nie uwzględniamy, skupiając się na autorskim materiale. Zatem możliwość automatycznego wygenerowania listy uzględniającej wszystkie takie kryteria jest wspaniałym udogodnieniem!
28+
Ideą aplikacji jest rozwiązanie problemu, z którym spotykam się grając w zespole muzycznym! Przed koncertem trzeba stworzyć listę piosenek, ustawić je w odpowiedniej kolejności, wybrać którą piosenką zacząć, którą skończyć, co zagrać na bis, ile piosenek w ogóle uwzględnić, w zależności od czasu trwania koncertu, ilości setów, itd. Jednocześnie, przy ustalaniu kolejności uwzględniane są takie własności piosenek, jak tempo, to czy dana piosenka jest hitem (ulubionym przez ludzi)itd. Niektóre piosenki grane są tylko na prywatnych, zamkniętych imprezach, podczas gdy na normalnym koncercie raczej ich nie uwzględniamy, skupiając się na autorskim materiale. Zatem możliwość automatycznego wygenerowania listy uwzględniającej wszystkie takie kryteria jest wspaniałym udogodnieniem!<br><br>
29+
<span class='link'>
30+
Kod do obejrzenia:
31+
<a href="https://github.com/drabikowy/SetList-Generator-">https://github.com/drabikowy/SetList-Generator-
32+
</a>
33+
</span>
2934
</p>
3035
</div>
3136
</section>

js/basic.js

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// funkcja losująca liczbę z danego przedziału:
2+
function getRandom (min, max){
3+
4+
return Math.floor(Math.random() * (max - min +1)) + min;
5+
};
6+
7+
// losowe ustawienie elementów tablicy:
8+
function shuffle(array) {
9+
var j, x, i;
10+
for (i = array.length; i; i--) {
11+
j = Math.floor(Math.random() * i);
12+
x = array[i - 1];
13+
array[i - 1] = array[j];
14+
array[j] = x;
15+
}
16+
return array;
17+
}
18+
19+
// Definicja funkcji do wrzucania elementu w dane miejsce tablicy:
20+
Array.prototype.insert = function (index, item) {
21+
this.splice(index, 0, item);
22+
};
23+
24+
// Funkcja sprawdza czas trwania setlisty (będzie to potrzebne aby przerwać generowanie, jeśli setlista przekroczy wymagany czas);
25+
function checkDuration(list){
26+
var time = 0;
27+
for(var i=0; i<list.length; i++){
28+
time += list[i].duration;
29+
}
30+
return time;
31+
}
32+
33+
function checkPrevious(setlist,quantity,prop,value){
34+
if (setlist.length>quantity){
35+
for (var i=setlist.length-quantity; i<quantity; i++) {
36+
if(setlist[i][prop] == value){
37+
return true;
38+
}
39+
}
40+
} else {
41+
return false;
42+
}
43+
}
44+
45+
// Funkcja rozszerzająca jQuery o funkcję umożliwiającą korzystanie z biblioteki css - animateCss
46+
$.fn.extend({
47+
animateCss: function (animationName) {
48+
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
49+
this.addClass('animated ' + animationName).one(animationEnd, function() {
50+
$(this).removeClass('animated ' + animationName);
51+
});
52+
}
53+
});
54+
55+
// Funkcja do animowanego obracania elementów
56+
$.fn.animateRotate = function(startAngle, endAngle, duration, easing, complete){
57+
return this.each(function(){
58+
var elem = $(this);
59+
60+
$({deg: startAngle}).animate({deg: endAngle}, {
61+
duration: duration,
62+
easing: easing,
63+
step: function(now){
64+
elem.css({
65+
'-moz-transform':'rotate('+now+'deg)',
66+
'-webkit-transform':'rotate('+now+'deg)',
67+
'-o-transform':'rotate('+now+'deg)',
68+
'-ms-transform':'rotate('+now+'deg)',
69+
'transform':'rotate('+now+'deg)'
70+
});
71+
},
72+
complete: complete || $.noop
73+
});
74+
});
75+
};

js/jquery-ui.min.js

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/jquery.ui.touch-punch.js

+180
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
/*!
2+
* jQuery UI Touch Punch 0.2.3
3+
*
4+
* Copyright 2011–2014, Dave Furfero
5+
* Dual licensed under the MIT or GPL Version 2 licenses.
6+
*
7+
* Depends:
8+
* jquery.ui.widget.js
9+
* jquery.ui.mouse.js
10+
*/
11+
(function ($) {
12+
13+
// Detect touch support
14+
$.support.touch = 'ontouchend' in document;
15+
16+
// Ignore browsers without touch support
17+
if (!$.support.touch) {
18+
return;
19+
}
20+
21+
var mouseProto = $.ui.mouse.prototype,
22+
_mouseInit = mouseProto._mouseInit,
23+
_mouseDestroy = mouseProto._mouseDestroy,
24+
touchHandled;
25+
26+
/**
27+
* Simulate a mouse event based on a corresponding touch event
28+
* @param {Object} event A touch event
29+
* @param {String} simulatedType The corresponding mouse event
30+
*/
31+
function simulateMouseEvent (event, simulatedType) {
32+
33+
// Ignore multi-touch events
34+
if (event.originalEvent.touches.length > 1) {
35+
return;
36+
}
37+
38+
event.preventDefault();
39+
40+
var touch = event.originalEvent.changedTouches[0],
41+
simulatedEvent = document.createEvent('MouseEvents');
42+
43+
// Initialize the simulated mouse event using the touch event's coordinates
44+
simulatedEvent.initMouseEvent(
45+
simulatedType, // type
46+
true, // bubbles
47+
true, // cancelable
48+
window, // view
49+
1, // detail
50+
touch.screenX, // screenX
51+
touch.screenY, // screenY
52+
touch.clientX, // clientX
53+
touch.clientY, // clientY
54+
false, // ctrlKey
55+
false, // altKey
56+
false, // shiftKey
57+
false, // metaKey
58+
0, // button
59+
null // relatedTarget
60+
);
61+
62+
// Dispatch the simulated event to the target element
63+
event.target.dispatchEvent(simulatedEvent);
64+
}
65+
66+
/**
67+
* Handle the jQuery UI widget's touchstart events
68+
* @param {Object} event The widget element's touchstart event
69+
*/
70+
mouseProto._touchStart = function (event) {
71+
72+
var self = this;
73+
74+
// Ignore the event if another widget is already being handled
75+
if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
76+
return;
77+
}
78+
79+
// Set the flag to prevent other widgets from inheriting the touch event
80+
touchHandled = true;
81+
82+
// Track movement to determine if interaction was a click
83+
self._touchMoved = false;
84+
85+
// Simulate the mouseover event
86+
simulateMouseEvent(event, 'mouseover');
87+
88+
// Simulate the mousemove event
89+
simulateMouseEvent(event, 'mousemove');
90+
91+
// Simulate the mousedown event
92+
simulateMouseEvent(event, 'mousedown');
93+
};
94+
95+
/**
96+
* Handle the jQuery UI widget's touchmove events
97+
* @param {Object} event The document's touchmove event
98+
*/
99+
mouseProto._touchMove = function (event) {
100+
101+
// Ignore event if not handled
102+
if (!touchHandled) {
103+
return;
104+
}
105+
106+
// Interaction was not a click
107+
this._touchMoved = true;
108+
109+
// Simulate the mousemove event
110+
simulateMouseEvent(event, 'mousemove');
111+
};
112+
113+
/**
114+
* Handle the jQuery UI widget's touchend events
115+
* @param {Object} event The document's touchend event
116+
*/
117+
mouseProto._touchEnd = function (event) {
118+
119+
// Ignore event if not handled
120+
if (!touchHandled) {
121+
return;
122+
}
123+
124+
// Simulate the mouseup event
125+
simulateMouseEvent(event, 'mouseup');
126+
127+
// Simulate the mouseout event
128+
simulateMouseEvent(event, 'mouseout');
129+
130+
// If the touch interaction did not move, it should trigger a click
131+
if (!this._touchMoved) {
132+
133+
// Simulate the click event
134+
simulateMouseEvent(event, 'click');
135+
}
136+
137+
// Unset the flag to allow other widgets to inherit the touch event
138+
touchHandled = false;
139+
};
140+
141+
/**
142+
* A duck punch of the $.ui.mouse _mouseInit method to support touch events.
143+
* This method extends the widget with bound touch event handlers that
144+
* translate touch events to mouse events and pass them to the widget's
145+
* original mouse event handling methods.
146+
*/
147+
mouseProto._mouseInit = function () {
148+
149+
var self = this;
150+
151+
// Delegate the touch handlers to the widget's element
152+
self.element.bind({
153+
touchstart: $.proxy(self, '_touchStart'),
154+
touchmove: $.proxy(self, '_touchMove'),
155+
touchend: $.proxy(self, '_touchEnd')
156+
});
157+
158+
// Call the original $.ui.mouse init method
159+
_mouseInit.call(self);
160+
};
161+
162+
/**
163+
* Remove the touch event handlers
164+
*/
165+
mouseProto._mouseDestroy = function () {
166+
167+
var self = this;
168+
169+
// Delegate the touch handlers to the widget's element
170+
self.element.unbind({
171+
touchstart: $.proxy(self, '_touchStart'),
172+
touchmove: $.proxy(self, '_touchMove'),
173+
touchend: $.proxy(self, '_touchEnd')
174+
});
175+
176+
// Call the original $.ui.mouse destroy method
177+
_mouseDestroy.call(self);
178+
};
179+
180+
})(jQuery);

js/song_base.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//Tworzę konstruktor klasy Song, który posłuży do dodawania piosenek do bazy:
33

44
// każda piosenka zawierać będzie nstępujące właściwości:
5-
5+
//
66
// title - tytuł piosenki
77
// duration - czas trwania (s)
88
// mustBe - (true/false) - określenie czy dana piosenka musi być uwzględniona w liście
@@ -13,7 +13,7 @@
1313
// bis - (true/false/'only') - czy dana piosenka może być zagrana na bis, 'only' oznacza że nadaje się tylko na bis
1414
// only - ('event'/'concert'/false) - czy ma być uwzględniana tylko na imprezach zamkniętych czy tylko na koncertach, czy zawsze
1515
// specialCondition - true/false - niektóre piosenki nie powinny występować po innych, albo w pierwszej części koncertu// jeżeli false - brak warunku, jeżeli true - piosenka nie może być wstawiona - domyślnie parametr przyjmie funkcję false, ale jeżeli piosenka ma jakieś szczególne warunki to zostanie on zmieniony na true za pomocą poniższej metody: conditionCheck
16-
//conditionCheck (method) - domyślnie brak;
16+
// conditionCheck (method) - domyślnie brak;
1717

1818

1919

package.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*ZAPISYWANIE WYMAGANYCH PACZEK POPRZEZ --save-def*/
2+
3+
4+
{
5+
"name": "generator",
6+
"version": "1.0.0",
7+
"description": "",
8+
"main": "gulpfile.js",
9+
"dependencies": {
10+
"browser-sync": "^2.18.2",
11+
"gulp": "^3.9.1",
12+
"gulp-jshint": "^2.0.2",
13+
"gulp-sass": "^2.3.2",
14+
"gulp-sourcemaps": "^2.2.0",
15+
"jquery-ui": "^1.12.1",
16+
"jshint": "^2.9.4"
17+
},
18+
"devDependencies": {
19+
"gulp": "^3.9.1"
20+
},
21+
"scripts": {
22+
"test": "echo \"Error: no test specified\" && exit 1"
23+
},
24+
"repository": {
25+
"type": "git",
26+
"url": "git+https://github.com/drabikowy/SetList-Generator-.git"
27+
},
28+
"author": "",
29+
"license": "ISC",
30+
"bugs": {
31+
"url": "https://github.com/drabikowy/SetList-Generator-/issues"
32+
},
33+
"homepage": "https://github.com/drabikowy/SetList-Generator-#readme"
34+
}

php/addSongs.php

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
//echo 'test!';
4+
5+
//host, user, passs, db
6+
$mysqli = new mysqli("localhost", "root", "", "generator_ksb");
7+
if(!$mysqli->connect_errno) {
8+
9+
//wymuszam utf8
10+
$mysqli->query("set names 'utf8'");
11+
12+
13+
$data = $_POST;
14+
var_dump ($data);
15+
$keys = array_keys($data);
16+
17+
$values_empty = array();
18+
foreach($keys as $k) {
19+
$values_empty[] = '?';
20+
}
21+
22+
$values = array();
23+
foreach($data as & $d) {
24+
$values[] = & $d;
25+
}
26+
27+
$types = '';
28+
foreach($keys as $t) {
29+
$types .= 's';
30+
}
31+
$sql = "INSERT INTO songs(".implode(',', $keys).") VALUES (".implode(',',$values_empty).")";
32+
//echo $sql;
33+
$insert = $mysqli->prepare($sql);
34+
//var_dump($insert);
35+
$params = array_merge(array($types), $values);
36+
call_user_func_array(array($insert, "bind_param"), $params);
37+
38+
if($insert->execute()) {
39+
echo 'ok';
40+
} else {
41+
// echo 'error';
42+
var_dump ($_POST);
43+
}
44+
45+
$insert->close();
46+
}

0 commit comments

Comments
 (0)