This commit is contained in:
onezoroone 2026-05-20 11:25:09 +07:00
commit 2cc4c267e8
30 changed files with 2939 additions and 0 deletions

50
README.md Executable file
View File

@ -0,0 +1,50 @@
# THEME - RIPPLE 2022 - VSMOV CMS
## Demo
### Trang Chủ
![Alt text](https://i.ibb.co/M2SMFwf/RIPPLE-INDEX.png "Home Page")
### Trang Danh Sách Phim
![Alt text](https://i.ibb.co/6JwS6hy/RIPPLE-CATALOG.png "Catalog Page")
### Trang Thông Tin Phim
![Alt text](https://i.ibb.co/2h0FjyQ/RIPPLE-SINGLE.png "Single Page")
### Trang Xem Phim
![Alt text](https://i.ibb.co/dD00qPG/RIPPLE-EPISODE.png "Episode Page")
## Requirements
https://github.com/vsphim/vsmov-core
## Install
1. Tại thư mục của Project: `composer require vsmov/vsmov-ripple`
2. Kích hoạt giao diện trong Admin Panel
## Update
1. Tại thư mục của Project: `composer update vsmov/vsmov-ripple`
2. Re-Activate giao diện trong Admin Panel
## Note
- Một vài lưu ý quan trọng của các nút chức năng:
+ `Activate``Re-Activate` sẽ publish toàn bộ file js,css trong themes ra ngoài public của laravel.
+ `Reset` reset lại toàn bộ cấu hình của themes
## Document
### List
- Trang chủ: `display_label|relation|find_by_field|value|limit|show_more_url`
+ Ví dụ theo định dạng: `Phim bộ mới||type|series|12|/danh-sach/phim-bo`
+ Ví dụ theo định dạng: `Phim lẻ mới||type|single|12|/danh-sach/phim-le`
+ Ví dụ theo thể loại: `Phim hành động|categories|slug|hanh-dong|12|/the-loai/hanh-dong`
+ Ví dụ theo quốc gia: `Phim hàn quốc|regions|slug|han-quoc|12|/quoc-gia/han-quoc`
+ Ví dụ với các field khác: `Phim chiếu rạp||is_shown_in_theater|1|12|/danh-sach/phim-chieu-rap|`
- Danh sách hot: `Label|relation|find_by_field|value|sort_by_field|sort_algo|limit`
+ `Phim sắp chiếu||status|trailer|publish_year|desc|9`
+ `Top phim bộ||type|series|view_total|desc|9`
+ `Top phim lẻ||type|single|view_total|desc|9`
### Custom View Blade
- File blade gốc trong Package: `/vendor/hacoidev/vsmov-ripple/resources/views/ripple`
- Copy file cần custom đến: `/resources/views/vendor/themes/ripple`

32
composer.json Executable file
View File

@ -0,0 +1,32 @@
{
"name": "vsmov/vsmov-ripple",
"description": "VsMov's ripple theme",
"type": "library",
"authors": [
{
"name": "vsmov",
"email": "vsmov.dev@gmail.com"
}
],
"require": {
"laravel/framework": "^6|^7|^8",
"ckfinder/ckfinder-laravel-package": "v3.5.2.1",
"vsmov/vsmov-core": "^1.0.1"
},
"license": "MIT",
"autoload": {
"psr-4": {
"VsMov\\Ripple\\": "src/",
"VsMov\\Ripple\\Database\\Factories\\": "database/factories/",
"VsMov\\Ripple\\Database\\Seeders\\": "database/seeders/"
}
},
"extra": {
"laravel": {
"providers": [
"VsMov\\Ripple\\RippleServiceProvider"
]
}
},
"minimum-stability": "stable"
}

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,15 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="raty" horiz-adv-x="512">
<font-face units-per-em="512" ascent="480" descent="-32" />
<missing-glyph horiz-adv-x="512" />
<glyph unicode="&#x20;" d="" horiz-adv-x="256" />
<glyph unicode="&#xe600;" d="M256 16c-114.88 0-208 93.12-208 208s93.12 208 208 208 208-93.12 208-208-93.12-208-208-208zM351.376 284.656c3.904 3.904 3.904 10.256 0 14.16l-21.248 21.232c-3.904 3.904-10.256 3.904-14.16 0l-60.176-60.176-60.176 60.176c-3.904 3.904-10.256 3.904-14.16 0l-21.248-21.232c-3.904-3.904-3.904-10.256 0-14.16l60.192-60.192-60.192-60.16c-3.904-3.904-3.904-10.256 0-14.16l21.248-21.248c3.904-3.904 10.256-3.904 14.16 0l60.176 60.192 60.176-60.192c3.904-3.904 10.256-3.904 14.16 0l21.248 21.248c3.904 3.904 3.904 10.256 0 14.16l-60.192 60.16 60.192 60.192z" />
<glyph unicode="&#xe601;" d="M256 16c-114.88 0-208 93.12-208 208s93.12 208 208 208 208-93.12 208-208-93.12-208-208-208zM256 384c-88.352 0-160-71.648-160-160s71.648-160 160-160c88.368 0 160 71.648 160 160s-71.632 160-160 160zM328.592 167.44l-16.224-16.224c-2.976-2.976-7.808-2.976-10.8 0l-45.92 45.92-45.92-45.92c-2.992-2.976-7.808-2.976-10.8 0l-16.224 16.224c-2.976 2.976-2.976 7.808 0 10.8l45.936 45.904-45.936 45.92c-2.976 2.992-2.976 7.824 0 10.816l16.224 16.208c2.992 2.992 7.808 2.992 10.8 0l45.92-45.92 45.92 45.92c2.992 2.992 7.824 2.992 10.8 0l16.224-16.208c2.976-2.992 2.976-7.824 0-10.816l-45.936-45.92 45.936-45.904c2.976-2.992 2.976-7.84 0-10.8z" />
<glyph unicode="&#xf005;" d="M475.428 290.572q0-6.286-7.428-13.714l-103.714-101.143 24.572-142.857q0.286-2 0.286-5.714 0-6-3-10.143t-8.714-4.143q-5.428 0-11.428 3.428l-128.286 67.428-128.286-67.428q-6.285-3.428-11.428-3.428-6 0-9 4.143t-3 10.143q0 1.714 0.572 5.714l24.572 142.857-104 101.143q-7.143 7.714-7.143 13.714 0 10.572 16 13.143l143.428 20.857 64.286 130q5.428 11.714 14 11.714t14-11.714l64.286-130 143.429-20.857q16-2.572 16-13.143z" horiz-adv-x="476" />
<glyph unicode="&#xf006;" d="M324.857 188.572l87.428 84.857-120.572 17.715-54 109.143-54-109.143-120.572-17.714 87.428-84.857-20.857-120.286 108 56.857 107.714-56.857zM475.428 290.572q0-6.286-7.428-13.714l-103.714-101.143 24.572-142.857q0.286-2 0.286-5.714 0-14.286-11.714-14.286-5.428 0-11.428 3.428l-128.286 67.428-128.286-67.428q-6.285-3.428-11.428-3.428-6 0-9 4.143t-3 10.143q0 1.714 0.572 5.714l24.572 142.857-104 101.143q-7.143 7.714-7.143 13.714 0 10.572 16 13.143l143.428 20.857 64.286 130q5.428 11.714 14 11.714t14-11.714l64.286-130 143.429-20.857q16-2.572 16-13.143z" horiz-adv-x="476" />
<glyph unicode="&#xf123;" d="M338.857 202l73.428 71.428-120.572 17.714-8.572 17.143-45.428 92v-275.143l16.857-8.857 90.857-48-17.143 101.428-3.428 18.857zM468 276.857l-103.714-101.143 24.572-142.857q1.428-9.428-1.714-14.714t-9.714-5.286q-4.857 0-11.428 3.428l-128.286 67.428-128.286-67.428q-6.572-3.428-11.428-3.428-6.572 0-9.715 5.286t-1.715 14.714l24.572 142.857-104 101.143q-9.143 9.143-6.572 17t15.428 9.857l143.429 20.857 64.286 130q5.714 11.714 14 11.714 8 0 14-11.714l64.286-130 143.429-20.857q12.857-2 15.428-9.857t-6.857-17z" horiz-adv-x="476" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,46 @@
.cancel-on-png, .cancel-off-png, .star-on-png, .star-off-png, .star-half-png {
font-size: 2em;
}
@font-face {
font-family: "raty";
font-style: normal;
font-weight: normal;
src: url("./fonts/raty.eot");
src: url("./fonts/raty.eot?#iefix") format("embedded-opentype");
src: url("./fonts/raty.svg#raty") format("svg");
src: url("./fonts/raty.ttf") format("truetype");
src: url("./fonts/raty.woff") format("woff");
}
.cancel-on-png, .cancel-off-png, .star-on-png, .star-off-png, .star-half-png {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-family: "raty";
font-style: normal;
font-variant: normal;
font-weight: normal;
line-height: 1;
speak: none;
text-transform: none;
}
.cancel-on-png:before {
content: "\e600";
}
.cancel-off-png:before {
content: "\e601";
}
.star-on-png:before {
content: "\f005";
}
.star-off-png:before {
content: "\f006";
}
.star-half-png:before {
content: "\f123";
}

View File

@ -0,0 +1,777 @@
/*!
* Raty - A Star Rating Plugin
*
* The MIT License
*
* author: Washington Botelho
* github: wbotelhos/raty
* version: 3.1.0
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
module.exports = factory(require('jquery'));
} else {
factory(root.jQuery);
}
}(this, function($) {
'use strict';
$.raty = {
cancelButton: false,
cancelClass: 'raty-cancel',
cancelHint: 'Cancel this rating!',
cancelOff: 'cancel-off.png',
cancelOn: 'cancel-on.png',
cancelPlace: 'left',
click: undefined,
half: false,
halfShow: true,
hints: ['bad', 'poor', 'regular', 'good', 'gorgeous'],
iconRange: undefined,
iconRangeSame: false,
mouseout: undefined,
mouseover: undefined,
noRatedMsg: 'Not rated yet!',
number: 5,
numberMax: 20,
path: undefined,
precision: false,
readOnly: false,
round: { down: 0.25, full: 0.6, up: 0.76 },
score: undefined,
scoreName: 'score',
single: false,
space: true,
starHalf: 'star-half.png',
starOff: 'star-off.png',
starOn: 'star-on.png',
starType: 'img',
target: undefined,
targetFormat: '{score}',
targetKeep: false,
targetScore: undefined,
targetText: '',
targetType: 'hint'
};
$.fn.raty = function(options) {
return this.each(function() {
var instance = new $.raty.Raty(this, options);
return instance._create();
});
};
$.raty.Raty = (function() {
var Raty = function(element, options) {
this.element = element;
this.self = $(element);
this.opt = $.extend(true, {}, $.raty, options, this.self.data());
};
Raty.prototype = {
_create: function() {
this._executeCallbacks();
this._adjustNumber();
this._adjustHints();
this.opt.score = this._adjustedScore(this.opt.score);
if (this.opt.starType !== 'img') {
this._adjustStarName();
}
this._setPath();
this._createStars();
if (this.opt.cancelButton) {
this._createCancel();
}
if (this.opt.precision) {
this._adjustPrecision();
}
this._createScore();
this._apply(this.opt.score);
this._setTitle(this.opt.score);
this._target(this.opt.score);
if (this.opt.readOnly) {
this._lock();
} else {
this.element.style.cursor = 'pointer';
this._binds();
}
this.self.data('raty', this);
},
// TODO: model spec
_adjustedScore: function(score) {
if (score || score === 0) {
return this._between(score, 0, this.opt.number);
}
},
_adjustHints: function() {
if (!this.opt.hints) {
this.opt.hints = [];
}
if (!this.opt.halfShow && !this.opt.half) {
return;
}
var steps = this.opt.precision ? 10 : 2;
for (var i = 0; i < this.opt.number; i++) {
var group = this.opt.hints[i];
if (Object.prototype.toString.call(group) !== '[object Array]') {
group = [group];
}
this.opt.hints[i] = [];
for (var j = 0; j < steps; j++) {
var hint = group[j];
var last = group[group.length - 1];
if (last === undefined) {
last = null;
}
this.opt.hints[i][j] = hint === undefined ? last : hint;
}
}
},
_adjustNumber: function() {
this.opt.number = this._between(this.opt.number, 1, this.opt.numberMax);
},
_adjustPrecision: function() {
this.opt.half = true;
},
_adjustStarName: function() {
var replaces = ['cancelOff', 'cancelOn', 'starHalf', 'starOff', 'starOn'];
this.opt.path = '';
for (var i = 0; i < replaces.length; i++) {
this.opt[replaces[i]] = this.opt[replaces[i]].replace('.', '-');
}
},
// TODO: model spec
_apply: function(score) {
this._fill(score);
if (score) {
if (score > 0) {
this.scoreField.val(score);
}
this._roundStars(score);
}
},
_attributesForIndex: function(i) {
var name = this._nameForIndex(i);
var attributes = { alt: i, src: this.opt.path + this.opt[name] };
if (this.opt.starType !== 'img') {
attributes = { 'data-alt': i, 'class': this.opt[name] };
}
attributes.title = this._getHint(i);
return attributes;
},
_between: function(value, min, max) {
return Math.min(Math.max(parseFloat(value), min), max);
},
// TODO: model spec
_binds: function() {
if (this.cancelButton) {
this._bindOverCancel();
this._bindClickCancel();
this._bindOutCancel();
}
this._bindOver();
this._bindClick();
this._bindOut();
},
// TODO: model spec
_bindClick: function() {
var that = this;
this.stars.on('click.raty', function(evt) {
if (that.self.data('readonly')) {
return;
}
var execute = true;
var score = (that.opt.half || that.opt.precision) ? that.self.data('score') : (this.alt || $(this).data('alt'));
if (that.opt.half && !that.opt.precision) {
score = that._roundHalfScore(score);
}
if (that.opt.click) {
execute = that.opt.click.call(that.element, +score, evt);
}
if (execute || execute === undefined) {
that._apply(+score);
}
});
},
// TODO: model spec
_bindClickCancel: function() {
this.cancelButton.on('click.raty', function(evt) {
this.scoreField.removeAttr('value');
if (this.opt.click) {
this.opt.click.call(this.element, null, evt);
}
}.bind(this));
},
// TODO: model spec
_bindOut: function() {
this.self.on('mouseleave.raty', function(evt) {
var score = +this.scoreField.val() || undefined;
this._apply(score);
this._target(score, evt);
this._resetTitle();
if (this.opt.mouseout) {
this.opt.mouseout.call(this.element, score, evt);
}
}.bind(this));
},
// TODO: model spec
_bindOutCancel: function() {
var that = this;
this.cancelButton.on('mouseleave.raty', function(evt) {
var icon = that.opt.cancelOff;
if (that.opt.starType !== 'img') {
icon = that.opt.cancelClass + ' ' + icon;
}
that._setIcon(this, icon);
if (that.opt.mouseout) {
var score = +that.scoreField.val() || undefined;
that.opt.mouseout.call(that.element, score, evt);
}
});
},
// TODO: model spec
_bindOver: function() {
var that = this;
var action = that.opt.half ? 'mousemove.raty' : 'mouseover.raty';
this.stars.on(action, function(evt) {
var score = that._getScoreByPosition(evt, this);
that._fill(score);
if (that.opt.half) {
that._roundStars(score, evt);
that._setTitle(score, evt);
that.self.data('score', score);
}
that._target(score, evt);
if (that.opt.mouseover) {
that.opt.mouseover.call(that.element, score, evt);
}
});
},
// TODO: model spec
_bindOverCancel: function() {
var that = this;
this.cancelButton.on('mouseover.raty', function(evt) {
if (that.self.data('readonly')) {
return;
}
var starOff = that.opt.path + that.opt.starOff;
var icon = that.opt.cancelOn;
if (that.opt.starType === 'img') {
that.stars.attr('src', starOff);
} else {
icon = that.opt.cancelClass + ' ' + icon;
that.stars.attr('class', starOff);
}
that._setIcon(this, icon);
that._target(null, evt);
if (that.opt.mouseover) {
that.opt.mouseover.call(that.element, null);
}
});
},
// TODO: model spec
_buildScoreField: function() {
return $('<input />', { name: this.opt.scoreName, type: 'hidden' }).appendTo(this.self);
},
// TODO: model spec
_createCancel: function() {
var icon = this.opt.path + this.opt.cancelOff;
var button = $('<' + this.opt.starType + ' />', { title: this.opt.cancelHint, 'class': this.opt.cancelClass });
if (this.opt.starType === 'img') {
button.attr({ src: icon, alt: 'x' });
} else {
// TODO: use $.data
button.attr('data-alt', 'x').addClass(icon);
}
if (this.opt.cancelPlace === 'left') {
this.self.prepend('&#160;').prepend(button);
} else {
this.self.append('&#160;').append(button);
}
this.cancelButton = button;
},
// TODO: model spec
_createScore: function() {
var score = $(this.opt.targetScore);
this.scoreField = score.length ? score : this._buildScoreField();
},
_createStars: function() {
for (var i = 1; i <= this.opt.number; i++) {
var attributes = this._attributesForIndex(i);
$('<' + this.opt.starType + ' />', attributes).appendTo(this.element);
if (this.opt.space && i < this.opt.number) {
this.self.append('&#160;');
}
}
this.stars = this.self.children(this.opt.starType);
},
// TODO: model spec
_error: function(message) {
$(this).text(message);
$.error(message);
},
_executeCallbacks: function() {
var options = ['number', 'readOnly', 'score', 'scoreName', 'target', 'path'];
for (var i = 0; i < options.length; i++) {
if (typeof this.opt[options[i]] === 'function') {
var value = this.opt[options[i]].call(this.element);
if (value) {
this.opt[options[i]] = value;
} else {
delete this.opt[options[i]];
}
}
}
},
// TODO: model spec
_fill: function(score) {
var hash = 0;
if (this.opt.iconRangeSame && this.opt.iconRange) {
while (hash < this.opt.iconRange.length && this.opt.iconRange[hash].range < score) {
hash++;
}
}
for (var i = 1; i <= this.stars.length; i++) {
var icon;
var star = this.stars[i - 1];
var turnOn = this._turnOn(i, score);
if (this.opt.iconRange && this.opt.iconRange.length > hash) {
var irange = this.opt.iconRange[hash];
icon = this._getRangeIcon(irange, turnOn);
if (i <= irange.range) {
this._setIcon(star, icon);
}
if (i === irange.range) {
hash++;
}
} else {
icon = this.opt[turnOn ? 'starOn' : 'starOff'];
this._setIcon(star, icon);
}
}
},
_getDecimal: function(number, fractions) {
var decimal = number.toString().split('.')[1];
var result = 0;
if (decimal) {
result = parseInt(decimal.slice(0, fractions), 10);
if (decimal.slice(1, 5) === '9999') {
result++;
}
}
return result;
},
// TODO: model spec
_getRangeIcon: function(irange, turnOn) {
return turnOn ? irange.on || this.opt.starOn : irange.off || this.opt.starOff;
},
// TODO: model spec
_getScoreByPosition: function(evt, icon) {
var score = parseInt(icon.alt || icon.getAttribute('data-alt'), 10);
if (this.opt.half) {
var size = this._getWidth();
var percent = parseFloat((evt.pageX - $(icon).offset().left) / size);
score = score - 1 + percent;
}
return score;
},
// TODO: model spec
_getHint: function(score, evt) {
if (score !== 0 && !score) {
return this.opt.noRatedMsg;
}
var decimal = this._getDecimal(score, 1);
var integer = Math.ceil(score);
var group = this.opt.hints[(integer || 1) - 1];
var hint = group;
var set = !evt || this.isMove;
if (this.opt.precision) {
if (set) {
decimal = decimal === 0 ? 9 : decimal - 1;
}
hint = group[decimal];
} else if (this.opt.halfShow || this.opt.half) {
decimal = set && decimal === 0 ? 1 : decimal > 5 ? 1 : 0;
hint = group[decimal];
}
return hint === '' ? '' : hint || score;
},
// TODO: model spec
_getWidth: function() {
var width = this.stars[0].width || parseFloat(this.stars.eq(0).css('font-size'));
if (!width) {
this._error('Could not get the icon width!');
}
return width;
},
// TODO: model spec
_lock: function() {
var hint = this._getHint(this.scoreField.val());
this.element.style.cursor = '';
this.element.title = hint;
this.scoreField.prop('readonly', true);
this.stars.prop('title', hint);
if (this.cancelButton) {
this.cancelButton.hide();
}
this.self.data('readonly', true);
},
_nameForIndex: function(i) {
return this.opt.score && this.opt.score >= i ? 'starOn' : 'starOff';
},
// TODO: model spec
_resetTitle: function() {
for (var i = 0; i < this.opt.number; i++) {
this.stars[i].title = this._getHint(i + 1);
}
},
// TODO: model spec
_roundHalfScore: function(score) {
var integer = parseInt(score, 10);
var decimal = this._getDecimal(score, 1);
if (decimal !== 0) {
decimal = decimal > 5 ? 1 : 0.5;
}
return integer + decimal;
},
// TODO: model spec
_roundStars: function(score, evt) {
var name = this._starName(score, evt);
if (name) {
var icon = this.opt[name];
var star = this.stars[Math.ceil(score) - 1];
this._setIcon(star, icon);
} // Full down: [x.00 .. x.25]
},
// TODO: model spec
_setIcon: function(star, icon) {
star[this.opt.starType === 'img' ? 'src' : 'className'] = this.opt.path + icon;
},
_setPath: function() {
this.opt.path = this.opt.path || '';
if (this.opt.path && this.opt.path.slice(-1)[0] !== '/') {
this.opt.path += '/';
}
},
// TODO: model spec
_setTarget: function(target, score) {
if (score) {
score = this.opt.targetFormat.toString().replace('{score}', score);
}
if (target.is(':input')) {
target.val(score);
} else {
target.html(score);
}
},
// TODO: model spec
_setTitle: function(score, evt) {
if (score) {
var integer = parseInt(Math.ceil(score), 10);
var star = this.stars[integer - 1];
star.title = this._getHint(score, evt);
}
},
_starName: function(score, evt) {
var decimal = +(score % 1).toFixed(2);
if (evt || this.isMove) {
return decimal > 0.5 ? 'starOn' : 'starHalf';
}
if (decimal <= this.opt.round.down) { // Down: [x.00 ... x.25]
return;
}
if (this.opt.halfShow && decimal < this.opt.round.up) { // Half: [x.26 ... x.75]
return 'starHalf';
}
if (decimal < this.opt.round.full) { // Off: [x.26 .. x.6]
return 'starOff';
}
return 'starOn'; // Up: [x.26 ...] || [x.6 ...]
},
// TODO: model spec
_target: function(score, evt) {
if (this.opt.target) {
var target = $(this.opt.target);
if (!target.length) {
this._error('Target selector invalid or missing!');
}
var mouseover = evt && evt.type === 'mouseover';
if (score === undefined) {
score = this.opt.targetText;
} else if (score === null) {
score = mouseover ? this.opt.cancelHint : this.opt.targetText;
} else {
if (this.opt.targetType === 'hint') {
score = this._getHint(score, evt);
} else if (this.opt.precision) {
score = parseFloat(score).toFixed(1);
}
var mousemove = evt && evt.type === 'mousemove';
if (!mouseover && !mousemove && !this.opt.targetKeep) {
score = this.opt.targetText;
}
}
this._setTarget(target, score);
}
},
// TODO: model spec
_turnOn: function(i, score) {
return this.opt.single ? (i === score) : (i <= score);
},
// TODO: model spec
_unlock: function() {
this.element.style.cursor = 'pointer';
this.element.removeAttribute('title');
this.scoreField.removeAttr('readonly');
this.self.data('readonly', false);
this._resetTitle();
if (this.cancelButton) {
this.cancelButton.css('display', '');
}
},
// TODO: model spec
cancel: function(click) {
if (this.self.data('readonly') !== true) {
this[click ? 'click' : 'score'].call(this, null);
this.scoreField.removeAttr('value');
}
},
// TODO: model spec
click: function(score) {
if (this.self.data('readonly') !== true) {
score = this._adjustedScore(score);
this._apply(score);
if (this.opt.click) {
this.opt.click.call(this.element, score, $.Event('click'));
}
this._target(score);
}
},
// TODO: model spec
getScore: function() {
var score = [];
var value ;
value = this.scoreField.val();
score.push(value ? +value : undefined);
return (score.length > 1) ? score : score[0];
},
// TODO: model spec
move: function(score) {
var integer = parseInt(score, 10);
var decimal = this._getDecimal(score, 1);
if (integer >= this.opt.number) {
integer = this.opt.number - 1;
decimal = 10;
}
var width = this._getWidth();
var steps = width / 10;
var star = $(this.stars[integer]);
var percent = star.offset().left + steps * decimal;
var evt = $.Event('mousemove', { pageX: percent });
this.isMove = true;
star.trigger(evt);
this.isMove = false;
},
// TODO: model spec
readOnly: function(readonly) {
if (this.self.data('readonly') !== readonly) {
if (readonly) {
this.self.off('.raty').children(this.opt.starType).off('.raty');
this._lock();
} else {
this._binds();
this._unlock();
}
this.self.data('readonly', readonly);
}
},
// TODO: model spec
score: function() {
return arguments.length ? this.setScore.apply(this, arguments) : this.getScore();
},
setScore: function(score) {
if (this.self.data('readonly') !== true) {
score = this._adjustedScore(score);
this._apply(score);
this._target(score);
}
}
};
return Raty;
})();
}));

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,125 @@
@extends('themes::ripple.layout')
@php
$years = Cache::remember('all_years', \Backpack\Settings\app\Models\Setting::get('site_cache_ttl', 5 * 60), function () {
return \VsMov\Core\Models\Movie::select('publish_year')
->distinct()
->pluck('publish_year')
->sortDesc();
});
@endphp
@section('content')
<ul class="breadcrumb w-full px-2 py-2 mb-3 bg-[#151111] rounded-lg text-white">
<li class="inline hover:text-yellow-400" itemprop="itemListElement" itemscope=""
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="/" title="Xem phim">
<span itemprop="name">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-4 h-4 inline">
<path stroke-linecap="round" stroke-linejoin="round"
d="M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" />
</svg>
Xem phim »
</span>
</a>
<meta itemprop="position" content="1">
</li>
<li class="inline text-gray-400" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
<a itemprop="item" href="{{ url()->current() }}" title="{{ $section_name ?? 'Danh Sách Phim' }}">
<span itemprop="name">
{{ $section_name ?? 'Danh Sách Phim' }}
</span>
</a>
<meta itemprop="position" content="2">
</li>
</ul>
<div class="text-[#ddd] mb-3">
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3 mb-3">
<div class="block-search">
<select name="filter[sort]" form="form-search"
class="bg-black border border-black text-gray-300 text-sm rounded-md focus:ring-blue-500 focus:border-blue-500 block w-full p-1">
<option value="">Sắp xếp</option>
<option value="update" @if (isset(request('filter')['sort']) && request('filter')['sort'] == 'update') selected @endif>Thời gian cập nhật</option>
<option value="create" @if (isset(request('filter')['sort']) && request('filter')['sort'] == 'create') selected @endif>Thời gian đăng</option>
<option value="year" @if (isset(request('filter')['sort']) && request('filter')['sort'] == 'year') selected @endif>Năm sản xuất</option>
<option value="view" @if (isset(request('filter')['sort']) && request('filter')['sort'] == 'view') selected @endif>Lượt xem</option>
</select>
</div>
<div class="block-search">
<select name="filter[type]" form="form-search"
class="bg-black border border-black text-gray-300 text-sm rounded-md focus:ring-blue-500 focus:border-blue-500 block w-full p-1">
<option value="">Mọi định dạng</option>
<option value="series" @if (isset(request('filter')['type']) && request('filter')['type'] == 'series') selected @endif>Phim bộ</option>
<option value="single" @if (isset(request('filter')['type']) && request('filter')['type'] == 'single') selected @endif>Phim lẻ</option>
</select>
</div>
<div class="block-search">
<select name="filter[category]" form="form-search"
class="bg-black border border-black text-gray-300 text-sm rounded-md focus:ring-blue-500 focus:border-blue-500 block w-full p-1">
<option value="">Tất cả thể loại</option>
@foreach (\VsMov\Core\Models\Category::fromCache()->all() as $item)
<option value="{{ $item->id }}" @if ((isset(request('filter')['category']) && request('filter')['category'] == $item->id) ||
(isset($category) && $category->id == $item->id)) selected @endif>
{{ $item->name }}</option>
@endforeach
</select>
</div>
<div class="block-search">
<select name="filter[region]" form="form-search"
class="bg-black border border-black text-gray-300 text-sm rounded-md focus:ring-blue-500 focus:border-blue-500 block w-full p-1">
<option value="">Tất cả quốc gia</option>
@foreach (\VsMov\Core\Models\Region::fromCache()->all() as $item)
<option value="{{ $item->id }}" @if ((isset(request('filter')['region']) && request('filter')['region'] == $item->id) ||
(isset($region) && $region->id == $item->id)) selected @endif>
{{ $item->name }}</option>
@endforeach
</select>
</div>
<div class="block-search">
<select name="filter[year]" form="form-search"
class="bg-black border border-black text-gray-300 text-sm rounded-md focus:ring-blue-500 focus:border-blue-500 block w-full p-1">
<option value="">Tất cả năm</option>
@foreach ($years as $year)
<option value="{{ $year }}" @if (isset(request('filter')['year']) && request('filter')['year'] == $year) selected @endif>
{{ $year }}</option>
@endforeach
</select>
</div>
<div class="block-search grow">
<button type="submit" form="form-search"
class="w-full bg-red-600 hover:bg-opacity-80 p-2 rounded-md flex items-center justify-center">
<svg class="fill-current pointer-events-none text-white w-3 h-3" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20">
<path
d="M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z">
</path>
</svg>
</button>
</div>
</div>
</div>
<div class="section-heading flex bg-[#151111] rounded-lg p-0 mb-2">
<h1 class="inline p-1.5 bg-[red] rounded-l-lg h-text text-white">
{{ $section_name ?? 'Danh Sách Phim' }}
</h1>
</div>
@if (count($data))
@php
$key_section = 0;
@endphp
<div class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-3 mb-3">
@foreach ($data ?? [] as $key => $movie)
@include('themes::ripple.inc.movie_card')
@endforeach
</div>
@else
<div class="flex flex-row flex-wrap flex-grow h-50 mt-10">
<p class="w-full text-center text-white">Rất tiếc, không nội dung nào trùng khớp yêu cầu.</p>
</div>
@endif
{{ $data->appends(request()->all())->links("themes::ripple.inc.pagination") }}
@endsection

View File

@ -0,0 +1,549 @@
@extends('themes::ripple.layout')
@section('content')
<ul class="breadcrumb w-full px-2 py-2 mb-3 bg-[#151111] rounded-lg text-white">
<li class="inline hover:text-yellow-400" itemprop="itemListElement" itemscope=""
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="/" title="Xem phim">
<span itemprop="name">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-4 h-4 inline">
<path stroke-linecap="round" stroke-linejoin="round"
d="M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" />
</svg>
Xem phim »
</span>
</a>
<meta itemprop="position" content="1">
</li>
@foreach ($currentMovie->regions as $region)
<li class="inline hover:text-yellow-400" itemprop="itemListElement" itemscope=""
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="{{ $region->getUrl() }}" title="{{ $region->name }}">
<span itemprop="name">
{{ $region->name }} »
</span>
</a>
<meta itemprop="position" content="2">
</li>
@endforeach
@foreach ($currentMovie->categories as $category)
<li class="inline hover:text-yellow-400" itemprop="itemListElement" itemscope=""
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="{{ $category->getUrl() }}" title="{{ $category->name }}">
<span itemprop="name">
{{ $category->name }} »
</span>
</a>
<meta itemprop="position" content="2">
</li>
@endforeach
<li class="inline hover:text-yellow-400" itemprop="itemListElement" itemscope=""
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="{{ $currentMovie->getUrl() }}" title="{{ $currentMovie->name }}">
<span itemprop="name">
{{ $currentMovie->name }} »
</span>
</a>
<meta itemprop="position" content="3">
</li>
<li class="inline text-gray-400" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
<a itemprop="item" href="{{ url()->current() }}" title="Xem phim">
<span itemprop="name">
Xem phim
</span>
</a>
<meta itemprop="position" content="5">
</li>
</ul>
<div class="flex rounded-lg p-0 md:p-2 text-[#bbb] bg-[#1511116d] mb-2">
<div class="w-[120px] md:w-[145px] pr-0">
<div class="rounded-md w-full h-[fit-content] p-2">
<img class="w-full cursor-pointer rounded-md" style="aspect-ratio: 256/340"
src="{{ $currentMovie->getThumbUrl() }}" alt="" />
</div>
</div>
<div class="w-full pr-2">
<h1>
<span class="uppercase text-sm xl:text-xl text-[#dacb46] block font-bold">
<a href="{{ URL::current() }}"
title="Xem phim {{ $currentMovie->name }} - Tập {{ $episode->name }}">Xem phim
{{ $currentMovie->name }} - Tập {{ $episode->name }}</a>
</span>
</h1>
<h2>
<span class="text-gray-300 text-base">{{ $currentMovie->origin_name ?? '' }}</span>
<span class="text-gray-300 text-base"> ({{ $currentMovie->publish_year ?? 'Đang cập nhật...' }})</span>
</h2>
<article
class="w-auto h-[56px] md:h-[96px] overflow-y-auto rounded-lg text-[#bbb] bg-[#272727] bg-opacity-50 p-1 mt-1">
@if ($currentMovie->content)
<div class="whitespace-pre-wrap">{!! $currentMovie->content !!}</div>
@else
<p>Đang cập nhật ...</p>
@endif
</article>
</div>
</div>
@if ($currentMovie->showtimes && $currentMovie->showtimes != '')
<div class="mt-2.5 p-2 bg-[#1511116d] mb-1 rounded-lg text-gray-300">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6 inline animate-pulse">
<path stroke-linecap="round" stroke-linejoin="round"
d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5m-9-6h.008v.008H12v-.008zM12 15h.008v.008H12V15zm0 2.25h.008v.008H12v-.008zM9.75 15h.008v.008H9.75V15zm0 2.25h.008v.008H9.75v-.008zM7.5 15h.008v.008H7.5V15zm0 2.25h.008v.008H7.5v-.008zm6.75-4.5h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V15zm0 2.25h.008v.008h-.008v-.008zm2.25-4.5h.008v.008H16.5v-.008zm0 2.25h.008v.008H16.5V15z" />
</svg>
Lịch chiếu: <span class="text-yellow-500">{!! $currentMovie->showtimes !!}</span>
</div>
@endif
@if ($currentMovie->notify && $currentMovie->notify != '')
<div class="mt-2.5 p-2 bg-[#1511116d] mb-2 rounded-lg text-gray-300">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6 inline animate-pulse">
<path stroke-linecap="round" stroke-linejoin="round"
d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0M3.124 7.5A8.969 8.969 0 015.292 3m13.416 0a8.969 8.969 0 012.168 4.5" />
</svg>
Thông báo: <span class="text-red-500">{{ strip_tags($currentMovie->notify) }}</span>
</div>
@endif
<div class="h-content">
<div class="flex iframe w-full" style="aspect-ratio: 16 / 9;" id="player-wrapper"></div>
</div>
<div class="flex justify-between mt-1">
<div class="text-[#FDB813] mb-2 text-sm mt-2">Mẹo: Chọn Server hoặc Nguồn phát khác khi lỗi!</div>
<div class="bg-[#151111] hover:bg-red-600 items-center text-sm text-white shadow text-center py-1 px-2 rounded cursor-pointer self-center"
data-modal-toggle="report-modal">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" aria-hidden="true" class="w-5 h-5 inline">
<path stroke-linecap="round" stroke-linejoin="round"
d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z">
</path>
</svg><span class="hidden md:inline">Báo Lỗi</span>
</div>
</div>
<div id="report-modal" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full">
<div class="relative p-4 w-full max-w-md h-full md:h-auto">
<!-- Modal content -->
<div class="relative rounded-lg shadow bg-[#151111]">
<!-- Modal header -->
<div class="flex justify-between items-center p-5 rounded-t border-b border-gray-600">
<div class="text-xl font-medium text-red-600">
Báo lỗi phim
<p class="text-yellow-500">
{{ $currentMovie->name }}
</p>
</div>
<button type="button"
class="text-gray-400 bg-transparent rounded-lg text-sm p-1.5 ml-auto inline-flex items-center hover:bg-red-600 hover:text-white"
data-modal-toggle="report-modal" data>
<svg aria-hidden="true" class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
clip-rule="evenodd"></path>
</svg>
<span class="sr-only">Đóng</span>
</button>
</div>
<!-- Modal body -->
<div class="p-6 space-y-6">
<p class="text-base leading-relaxed text-gray-400">
<textarea id="report_message" class="w-full p-3 bg-[#272727] text-white focus:outline-none" rows="5"
placeholder="Hãy nhập nội dung lỗi để chúng mình sửa nhanh hơn...">Không tải được tập phim</textarea>
</p>
</div>
<div class="flex justify-end p-6 space-x-2 rounded-b border-t border-gray-600">
<button data-modal-toggle="report-modal" type="button" id="report_episode_btn"
class="text-white bg-red-600 hover:bg-red-600/80 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 focus:z-10">Gửi</button>
</div>
</div>
</div>
</div>
<div class="flex flex-wrap justify-center gap-1 py-3 text-white" id="stream-servers">
@foreach ($currentMovie->episodes->where('slug', $episode->slug)->where('server', $episode->server) as $server)
<a onclick="chooseStreamingServer(this)" data-type="{{ $server->type }}" data-id="{{ $server->id }}"
data-link="{{ $server->link }}"
class="streaming-server hover:cursor-pointer uppercase current bg-[#151111] hover:bg-red-600 hover:bg-opacity-80 shadow-md px-2 py-1 mr-1 rounded text-sm">Nguồn
phát #{{ $loop->index }}
</a>
@endforeach
</div>
<div class="my-3 p-2 md:flex justify-center items-center gap-x-2 bg-[#272727] rounded-sm">
<div id="movies-rating-star" class="flex"></div>
<div class="text-xs text-white align-middle">
({{ $currentMovie->getRatingStar() }}
sao
/
{{ $currentMovie->getRatingCount() }} đánh giá)
</div>
<div id="movies-rating-msg" class="text-[#FDB813] mb-2 font-bold text-sm mt-2"></div>
</div>
@foreach ($currentMovie->episodes->groupBy('server') as $server => $data)
<div class="flex flex-col my-3 mt-6 p-2 bg-[#272727] bg-opacity-50">
<h2 id="heading-{{ $loop->index }}">
<button class="flex justify-between w-full py-2 font-medium text-left text-slate-200 rounded-sm"
data-accordion-target="#body-{{ $loop->index }}">
<span>Danh sách tập: <span class="text-red-600">{{ $server }}</span></span>
<svg data-accordion-icon class="w-6 h-6 shrink-0" fill="currentColor" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
clip-rule="evenodd"></path>
</svg>
</button>
</h2>
<div id="body-{{ $loop->index }}" class="mt-2">
<div class="w-full grid grid-cols-4 md:grid-cols-6 lg:grid-cols-12 gap-2">
@foreach ($data->sortBy('name', SORT_NATURAL)->groupBy('name') as $name => $item)
<a class="episode grow text-center hover:cursor-pointer shadow text-white py-1 bg-[#151111] hover:bg-red-600 hover:bg-opacity-80 shadow-md rounded @if ($item->contains($episode)) bg-red-600 @endif"
title="{{ $name }}" href="{{ $item->first()->getUrl() }}">
{{ $name }}
</a>
@endforeach
</div>
</div>
</div>
@endforeach
<div class="mt-1.5">{!! $currentMovie->tags->map(function ($tag) {
return '<a class="bg-[#111] text-[#ccc] hover:text-white px-2 border-[#333] border-[1px]" href="' .
$tag->getUrl() .
'" title="' .
$tag->name .
'">' .
$tag->name .
'</a>';
})->implode(', ') !!}</div>
<div style="background-color: #fff" class="mt-2">
<div class="fb-comments w-full rounded-lg bg-white mt-2.5"
data-href="{{ $currentMovie->getUrl() }}" data-width="100%" data-numposts="5" data-colorscheme="dark"
data-lazy="true">
</div>
</div>
<div class="mt-2.5 p-3 bg-[#1511116d] mb-3 rounded-lg">
<h3 class="text-sm font-bold text-[#dacb46] uppercase mt-1.5 mb-3">
thể bản muốn xem
</h3>
<div class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-2">
@php
$key_section = 0;
@endphp
@foreach ($movie_related ?? [] as $key => $movie)
@include('themes::ripple.inc.movie_card')
@endforeach
</div>
</div>
@endsection
@section('footer')
@parent
<script src="/themes/ripple/player/js/p2p-media-loader-core.min.js"></script>
<script src="/themes/ripple/player/js/p2p-media-loader-hlsjs.min.js"></script>
<script src="/js/jwplayer-8.9.3.js"></script>
<script src="/js/hls.min.js"></script>
<script src="/js/jwplayer.hlsjs.min.js"></script>
{{-- Star Rating Plugins --}}
<script src="/themes/ripple/js/plugins/jquery-raty/jquery.raty.js"></script>
<link href="/themes/ripple/js/plugins/jquery-raty/jquery.raty.css" rel="stylesheet" type="text/css" />
<script>
var rated = false;
$('#movies-rating-star').raty({
score: {{ $currentMovie->getRatingStar() }},
number: 10,
numberMax: 10,
hints: ['quá tệ', 'tệ', 'không hay', 'không hay lắm', 'bình thường', 'xem được', 'có vẻ hay', 'hay',
'rất hay', 'siêu phẩm'
],
starOff: '/themes/ripple/js/plugins/jquery-raty/images/star-off.png',
starOn: '/themes/ripple/js/plugins/jquery-raty/images/star-on.png',
starHalf: '/themes/ripple/js/plugins/jquery-raty/images/star-half.png',
click: function(score, evt) {
if (rated) return
fetch("{{ route('movie.rating', ['movie' => $currentMovie->slug, 'episode' => $episode->slug]) }}", {
method: 'POST',
headers: {
"Content-Type": "application/json",
'X-CSRF-TOKEN': document.querySelector(
'meta[name="csrf-token"]')
.getAttribute(
'content')
},
body: JSON.stringify({
rating: score
})
});
rated = true;
$('#movies-rating-star').data('raty').readOnly(true);
$('#movies-rating-msg').html(`Bạn đã đánh giá ${score} sao cho phim này!`);
}
});
</script>
<script>
$(document).ready(function() {
$('html, body').animate({
scrollTop: $('#player-wrapper').offset().top - 60
}, 'slow');
});
</script>
<script>
var episode_id = {{ $episode->id }};
const wrapper = document.getElementById('player-wrapper');
const vastAds = "{{ Setting::get('jwplayer_advertising_file') }}";
function chooseStreamingServer(el) {
const type = el.dataset.type;
const link = el.dataset.link.replace(/^http:\/\//i, 'https://');
const id = el.dataset.id;
const newUrl =
location.protocol +
"//" +
location.host +
location.pathname.replace(`-${episode_id}`, `-${id}`);
history.pushState({
path: newUrl
}, "", newUrl);
episode_id = id;
Array.from(document.getElementsByClassName('streaming-server')).forEach(server => {
server.classList.remove('bg-red-600');
})
el.classList.add('bg-red-600')
renderPlayer(type, link, id);
}
function renderPlayer(type, link, id) {
if (type == 'embed') {
if (vastAds) {
wrapper.innerHTML = `<div id="fake_jwplayer"></div>`;
const fake_player = jwplayer("fake_jwplayer");
const objSetupFake = {
key: "{{ Setting::get('jwplayer_license') }}",
aspectratio: "16:9",
width: "100%",
file: "/themes/ripple/player/1s_blank.mp4",
volume: 100,
mute: false,
autostart: true,
advertising: {
tag: "{{ Setting::get('jwplayer_advertising_file') }}",
client: "vast",
vpaidmode: "insecure",
skipoffset: {{ (int) Setting::get('jwplayer_advertising_skipoffset') ?: 5 }}, // Bỏ qua quảng cáo trong vòng 5 giây
skipmessage: "Bỏ qua sau xx giây",
skiptext: "Bỏ qua"
}
};
fake_player.setup(objSetupFake);
fake_player.on('complete', function(event) {
$("#fake_jwplayer").remove();
wrapper.innerHTML = `<iframe width="100%" height="100%" src="${link}" frameborder="0" scrolling="no"
allowfullscreen="" allow='autoplay'></iframe>`
fake_player.remove();
});
fake_player.on('adSkipped', function(event) {
$("#fake_jwplayer").remove();
wrapper.innerHTML = `<iframe width="100%" height="100%" src="${link}" frameborder="0" scrolling="no"
allowfullscreen="" allow='autoplay'></iframe>`
fake_player.remove();
});
fake_player.on('adComplete', function(event) {
$("#fake_jwplayer").remove();
wrapper.innerHTML = `<iframe width="100%" height="100%" src="${link}" frameborder="0" scrolling="no"
allowfullscreen="" allow='autoplay'></iframe>`
fake_player.remove();
});
} else {
if (wrapper) {
wrapper.innerHTML = `<iframe width="100%" height="100%" src="${link}" frameborder="0" scrolling="no"
allowfullscreen="" allow='autoplay'></iframe>`
}
}
return;
}
if (type == 'm3u8' || type == 'mp4') {
wrapper.innerHTML = `<div id="jwplayer"></div>`;
const player = jwplayer("jwplayer");
const objSetup = {
key: "{{ Setting::get('jwplayer_license') }}",
aspectratio: "16:9",
width: "100%",
file: link,
playbackRateControls: true,
playbackRates: [0.25, 0.75, 1, 1.25],
sharing: {
sites: [
"reddit",
"facebook",
"twitter",
"googleplus",
"email",
"linkedin",
],
},
volume: 100,
mute: false,
logo: {
file: "{{ Setting::get('jwplayer_logo_file') }}",
link: "{{ Setting::get('jwplayer_logo_link') }}",
position: "{{ Setting::get('jwplayer_logo_position') }}",
},
advertising: {
tag: "{{ Setting::get('jwplayer_advertising_file') }}",
client: "vast",
vpaidmode: "insecure",
skipoffset: {{ (int) Setting::get('jwplayer_advertising_skipoffset') ?: 5 }}, // Bỏ qua quảng cáo trong vòng 5 giây
skipmessage: "Bỏ qua sau xx giây",
skiptext: "Bỏ qua"
}
};
if (type == 'm3u8') {
const segments_in_queue = 50;
var engine_config = {
debug: !1,
segments: {
forwardSegmentCount: 50,
},
loader: {
cachedSegmentExpiration: 864e5,
cachedSegmentsCount: 1e3,
requiredSegmentsPriority: segments_in_queue,
httpDownloadMaxPriority: 9,
httpDownloadProbability: 0.06,
httpDownloadProbabilityInterval: 1e3,
httpDownloadProbabilitySkipIfNoPeers: !0,
p2pDownloadMaxPriority: 50,
httpFailedSegmentTimeout: 500,
simultaneousP2PDownloads: 20,
simultaneousHttpDownloads: 2,
// httpDownloadInitialTimeout: 12e4,
// httpDownloadInitialTimeoutPerSegment: 17e3,
httpDownloadInitialTimeout: 0,
httpDownloadInitialTimeoutPerSegment: 17e3,
httpUseRanges: !0,
maxBufferLength: 300,
// useP2P: false,
},
};
if (Hls.isSupported() && p2pml.hlsjs.Engine.isSupported()) {
var engine = new p2pml.hlsjs.Engine(engine_config);
player.setup(objSetup);
jwplayer_hls_provider.attach();
p2pml.hlsjs.initJwPlayer(player, {
liveSyncDurationCount: segments_in_queue, // To have at least 7 segments in queue
maxBufferLength: 300,
loader: engine.createLoaderClass(),
});
} else {
player.setup(objSetup);
}
} else {
player.setup(objSetup);
}
const resumeData = 'OPCMS-PlayerPosition-' + id;
player.on('ready', function() {
if (typeof(Storage) !== 'undefined') {
if (localStorage[resumeData] == '' || localStorage[resumeData] == 'undefined') {
console.log("No cookie for position found");
var currentPosition = 0;
} else {
if (localStorage[resumeData] == "null") {
localStorage[resumeData] = 0;
} else {
var currentPosition = localStorage[resumeData];
}
console.log("Position cookie found: " + localStorage[resumeData]);
}
player.once('play', function() {
console.log('Checking position cookie!');
console.log(Math.abs(player.getDuration() - currentPosition));
if (currentPosition > 180 && Math.abs(player.getDuration() - currentPosition) >
5) {
player.seek(currentPosition);
}
});
window.onunload = function() {
localStorage[resumeData] = player.getPosition();
}
} else {
console.log('Your browser is too old!');
}
});
player.on('complete', function() {
if (typeof(Storage) !== 'undefined') {
localStorage.removeItem(resumeData);
} else {
console.log('Your browser is too old!');
}
})
function formatSeconds(seconds) {
var date = new Date(1970, 0, 1);
date.setSeconds(seconds);
return date.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1");
}
}
}
</script>
<script>
document.addEventListener("DOMContentLoaded", function() {
const episode = '{{ $episode->id }}';
let playing = document.querySelector(`[data-id="${episode}"]`);
if (playing) {
playing.click();
return;
}
const servers = document.getElementsByClassName('streaming-server');
if (servers[0]) {
servers[0].click();
}
});
</script>
<script>
document.getElementById('report_episode_btn').addEventListener('click', function() {
fetch(location.href, {
method: 'POST',
headers: {
"Content-Type": "application/json",
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute(
'content')
},
body: JSON.stringify({
message: document.getElementById('report_message')
.innerHTML ??
''
})
});
})
</script>
@endsection
@push('scripts')
{!! setting('site_scripts_facebook_sdk') !!}
@endpush

View File

@ -0,0 +1,49 @@
<a href="{{ $movie->getUrl() }}" class="block rounded-md overflow-hidden relative group" title="{{ $movie->name ?? '' }}">
<img
class="rounded-md group-hover:opacity-60 transition-all duration-500 transform group-hover:scale-110 @if ($key_section > 0 || ($key_section === 0 && $key > 3)) lazyload @endif"
data-src="{{ $movie->getThumbUrl() }}"
src="@if ($key_section > 0 || ($key_section === 0 && $key > 3)) data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 500'%3e%3c/svg%3e @else {{$movie->getThumbUrl()}} @endif"
alt="{{ $movie->name ?? '' }}"
/>
<span
class="absolute bottom-0 px-2 pb-2 pt-16 bg-gradient-to-t from-[#151111] rounded-md rounded-tl-none rounded-tr-none w-full text-white">
<div class="font-bold text-sm overflow-hidden overflow-ellipsis whitespace-nowrap">{{ $movie->name ?? '' }}
</div>
<div class="text-xs text-gray-300 italic overflow-hidden overflow-ellipsis whitespace-nowrap">
{{ $movie->origin_name }} ({{ $movie->publish_year }})
</div>
</span>
@if ($movie->type == 'series' && $movie->status == 'ongoing')
<span
class="absolute top-0 left-0 p-0.5 bg-red-600 text-white text-sm rounded-md rounded-bl-none rounded-tr-none">{{ $movie->episode_current }}</span>
<span
class="absolute bottom-12 right-0 p-0.5 bg-gradient-to-r from-cyan-500/50 to-blue-500/50 text-white text-sm rounded-md rounded-br-none rounded-tr-none">Đang chiếu</span>
@elseif ($movie->type == 'series' && $movie->status == 'completed')
<div class="absolute top-[7%] -left-[34%] text-white uppercase py-[2px] px-0 text-[9px] w-full text-center -rotate-45 bg-gradient-to-r from-pink-500 to-yellow-500">Trọn Bộ</div>
@endif
@if ($movie->status == 'trailer')
<div class="absolute top-[7%] -left-[34%] text-white uppercase py-[2px] px-0 text-[9px] w-full text-center -rotate-45 bg-gradient-to-r from-indigo-500">Sắp chiếu</div>
@endif
@if ($movie->is_recommended)
<div class="absolute top-0.5 right-0.5 p-0.5 bg-red-600 text-white rounded-full">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M15.362 5.214A8.252 8.252 0 0112 21 8.25 8.25 0 016.038 7.048 8.287 8.287 0 009 9.6a8.983 8.983 0 013.361-6.867 8.21 8.21 0 003 2.48z" />
<path stroke-linecap="round" stroke-linejoin="round"
d="M12 18a3.75 3.75 0 00.495-7.467 5.99 5.99 0 00-1.925 3.546 5.974 5.974 0 01-2.133-1A3.75 3.75 0 0012 18z" />
</svg>
<title>Phim hot</title>
</div>
@endif
<div class="absolute hidden top-1/3 left-1/3 animate-pulse group-hover:block">
<svg xmlns="http://www.w3.org/2000/svg" class="h-16 w-16 text-red-600" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2}
d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" />
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</div>
</a>

View File

@ -0,0 +1,25 @@
<a href="{{ $movie->getUrl() }}" class="block rounded-md overflow-hidden relative group" title="{{ $movie->name ?? '' }}">
<img class="rounded-md group-hover:opacity-60 transition-all duration-500 transform group-hover:bg-opacity-60"
style="aspect-ratio: 16/9" src="{{ $movie->getPosterUrl() }}" alt="{{ $movie->name ?? '' }}" />
<span
class="absolute bottom-0 px-2 pb-2 pt-16 bg-gradient-to-t from-[#151111] rounded-md rounded-tl-none rounded-tr-none w-full text-white">
<div class="font-bold text-sm text-[#dacb46] overflow-hidden overflow-ellipsis whitespace-nowrap">{{ $movie->name ?? '' }}
</div>
<div class="text-xs text-gray-300 italic overflow-hidden overflow-ellipsis whitespace-nowrap">
{{ $movie->origin_name }} ({{ $movie->publish_year }})
</div>
</span>
<span class="absolute top-0 left-0 p-0.5 bg-red-600 text-white text-sm rounded-md rounded-bl-none rounded-tr-none">{{ $movie->episode_current }}</span>
@if ($movie->status == 'ongoing')
<span class="absolute bottom-12 right-0 p-0.5 bg-gradient-to-r from-cyan-500/50 to-blue-500/50 text-white text-sm rounded-md rounded-br-none rounded-tr-none">Đang chiếu</span>
@endif
<div class="absolute hidden top-1/4 left-1/3 animate-pulse group-hover:block">
<svg xmlns="http://www.w3.org/2000/svg" class="h-16 w-16 text-red-600" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2}
d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" />
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</div>
</a>

View File

@ -0,0 +1,84 @@
@php
$logo = setting('site_logo', '');
$brand = setting('site_brand', '');
$title = isset($title) ? $title : setting('site_homepage_title', '');
@endphp
<nav class="w-full fixed top-0 py-2 bg-[#151111] border-gray-200 z-30">
<div class="container mx-auto px-4 md:px-8 xl:px-40 flex flex-wrap justify-between items-center">
<div class="w-2/5 md:w-1/5 flex items-center">
<a class="text-gray-100 text-base xl:text-xl no-underline hover:no-underline font-bold content-center" href="/">
@if ($logo)
{!! $logo !!}
@else
{!! $brand !!}
@endif
</a>
</div>
<button data-collapse-toggle="mobile-menu" type="button"
class="inline-flex justify-center items-center ml-3 rounded-lg md:hidden text-gray-400 hover:text-white focus:ring-gray-500"
aria-controls="mobile-menu-2" aria-expanded="false">
<span class="sr-only">Open main menu</span>
<svg class="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
clip-rule="evenodd"></path>
</svg>
</button>
<div class="hidden md:flex items-center w-full md:w-auto" id="mobile-menu">
<div class="relative mt-2 md:mt-0 mr-0 md:mr-4">
<form id="form-search" action="/">
<input type="search" name="search" placeholder="Tìm kiếm phim"
class="focus:bg-[#2b2821] w-full bg-[#212020] text-sm md:text-md text-white transition focus:border-gray-600 focus:outline-none rounded py-2 px-2 pl-10 appearance-none leading-normal"
value="{{ request('search') }}" />
<div class="absolute search-icon" style="top:0.75rem;left:1rem"><svg
class="fill-current pointer-events-none text-gray-400 w-4 h-4"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path
d="M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z">
</path>
</svg>
</div>
</form>
</div>
<ul class="flex flex-col md:flex-row md:text-sm bg-[#151111]">
@foreach ($menu as $item)
<li class="mr-6 my-2 md:my-0 dropdown relative group">
@if (count($item['children']))
<button data-dropdown-toggle="nav-dropdown-{{ $loop->index }}"
class="flex justify-between items-center py-2 pr-4 w-full font-medium text-slate-200 md:hover:text-blue-700 md:p-0 md:w-auto">
{{ $item->name }}
<svg class="ml-1 w-5 h-5" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
clip-rule="evenodd"></path>
</svg>
</button>
<div id="nav-dropdown-{{ $loop->index }}"
class="hidden z-20 w-[80vw] md:w-[50vw] xl:w-[35vw] font-normal divide-x shadow">
<ul class="py-1 text-sm text-slate-300 bg-[#151111] grid grid-cols-2 md:grid-cols-4 xl:grid-cols-5"
aria-labelledby="dropdownLargeButton">
@foreach ($item['children'] as $children)
<li class="inline-block p-1 truncate text-center">
<a href="{{ $children['link'] }}"
class="block py-2 hover:bg-slate-800">{{ $children['name'] }}</a>
</li>
@endforeach
</ul>
</div>
@else
<a href="{{ $item['link'] }}" class="flex items-center">
<span class="text-white">{{ $item['name'] }}</span>
</a>
@endif
</li>
@endforeach
</ul>
</div>
</div>
</nav>

View File

@ -0,0 +1,107 @@
@if ($paginator->hasPages())
<nav role="navigation" aria-label="{{ __('Pagination Navigation') }}" class="flex items-center justify-between">
<div class="flex justify-between flex-1 md:hidden">
@if ($paginator->onFirstPage())
<div></div>
{{-- <span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-[#151111] hover:bg-red-600 hover:bg-opacity-80 shadow-md cursor-default leading-5 rounded-md">
{!! __('pagination.previous') !!}
</span> --}}
@else
<a href="{{ $paginator->previousPageUrl() }}" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-white bg-[#151111] hover:bg-red-600 hover:bg-opacity-80 shadow-md leading-5 rounded-md">
{!! __('pagination.previous') !!}
</a>
@endif
@if ($paginator->hasMorePages())
<a href="{{ $paginator->nextPageUrl() }}" class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-white bg-[#151111] hover:bg-red-600 hover:bg-opacity-80 shadow-md leading-5 rounded-md">
{!! __('pagination.next') !!}
</a>
@else
{{-- <span class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-500 bg-[#151111] hover:bg-red-600 hover:bg-opacity-80 shadow-md cursor-default leading-5 rounded-md">
{!! __('pagination.next') !!}
</span> --}}
@endif
</div>
<div class="hidden md:flex-1 md:flex md:items-center md:justify-between">
<div>
<p class="text-sm text-white leading-5">
{!! __('Showing') !!}
@if ($paginator->firstItem())
<span class="font-medium">{{ $paginator->firstItem() }}</span>
{!! __('to') !!}
<span class="font-medium">{{ $paginator->lastItem() }}</span>
@else
{{ $paginator->count() }}
@endif
{!! __('of') !!}
<span class="font-medium">{{ $paginator->total() }}</span>
{!! __('results') !!}
</p>
</div>
<div>
<span class="relative z-0 inline-flex shadow-sm rounded-md">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
{{-- <span aria-disabled="true" aria-label="{{ __('pagination.previous') }}">
<span class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-[#151111] hover:bg-red-600 hover:bg-opacity-80 shadow-md cursor-default rounded-l-md leading-5" aria-hidden="true">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
</svg>
</span>
</span> --}}
@else
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-white bg-[#151111] hover:bg-red-600 hover:bg-opacity-80 shadow-md rounded-l-md leading-5focus:z-10 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150" aria-label="{{ __('pagination.previous') }}">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
</svg>
</a>
@endif
{{-- Pagination Elements --}}
@foreach ($elements as $element)
{{-- "Three Dots" Separator --}}
@if (is_string($element))
<span aria-disabled="true">
<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-white bg-[#151111] hover:bg-red-600 hover:bg-opacity-80 shadow-md cursor-default leading-5">{{ $element }}</span>
</span>
@endif
{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page == $paginator->currentPage())
<span aria-current="page">
<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-white bg-red-600 hover:bg-opacity-80 shadow-md cursor-default leading-5">{{ $page }}</span>
</span>
@else
<a href="{{ $url }}" class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-white bg-[#151111] hover:bg-red-600 hover:bg-opacity-80 shadow-md leading-5 focus:z-10 active:bg-gray-100 active:text-white transition ease-in-out duration-150" aria-label="{{ __('Go to page :page', ['page' => $page]) }}">
{{ $page }}
</a>
@endif
@endforeach
@endif
@endforeach
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<a href="{{ $paginator->nextPageUrl() }}" rel="next" class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-white bg-[#151111] hover:bg-red-600 hover:bg-opacity-80 shadow-md rounded-r-md leading-5 focus:z-10 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150" aria-label="{{ __('pagination.next') }}">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</a>
@else
{{-- <span aria-disabled="true" aria-label="{{ __('pagination.next') }}">
<span class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-[#151111] hover:bg-red-600 hover:bg-opacity-80 shadow-md cursor-default rounded-r-md leading-5" aria-hidden="true">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</span>
</span> --}}
@endif
</span>
</div>
</div>
</nav>
@endif

View File

@ -0,0 +1,119 @@
@extends('themes::ripple.layout')
@php
use VsMov\Core\Models\Movie;
$recommendations = Cache::remember('site.movies.recommendations', setting('site_cache_ttl', 5 * 60), function () {
return Movie::where('is_recommended', true)
->limit(get_theme_option('recommendations_limit', 10))
->get()
->sortBy([
function ($a, $b) {
return $a['name'] <=> $b['name'];
},
]);
});
$data = Cache::remember('site.movies.latest', setting('site_cache_ttl', 5 * 60), function () {
$lists = preg_split('/[\n\r]+/', get_theme_option('latest'));
$data = [];
foreach ($lists as $list) {
if (trim($list)) {
$list = explode('|', $list);
[$label, $relation, $field, $val, $limit, $link] = array_merge($list, ['Phim mới cập nhật', '', 'type', 'series', 8, '/']);
try {
$data[] = [
'label' => $label,
'data' => Movie::when($relation, function ($query) use ($relation, $field, $val) {
$query->whereHas($relation, function ($rel) use ($field, $val) {
$rel->where($field, $val);
});
})
->when(!$relation, function ($query) use ($field, $val) {
$query->where($field, $val);
})
->limit($limit)
->orderBy('updated_at', 'desc')
->get(),
'link' => $link ?: '#',
];
} catch (\Exception $e) {
}
}
}
return $data;
});
@endphp
@section('content')
@if (count($recommendations))
<div class="owl-carousel recommend-carousel owl-theme">
@foreach ($recommendations as $movie)
@include('themes::ripple.inc.movie_card_recommend')
@endforeach
</div>
@endif
<h1 class="h-text text-white uppercase mb-2">{{ $title }}</h1>
@foreach ($data as $key_section => $item)
<div class="mb-5 ">
<div class="section-heading flex bg-[#151111] rounded-lg p-0 mb-3 justify-between content-between">
<h2 class="inline p-1.5 bg-red-600 to-red-600 rounded-l-lg">
<span class="h-text text-white uppercase">{{ $item['label'] }}</span>
</h2>
<a class="inline uppercase self-center pr-3" href="{{ $item['link'] }}"><span
class="text-white hover:text-yellow-300">Xem
Thêm</span>
</a>
</div>
<div class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-2">
@foreach ($item['data'] ?? [] as $key => $movie)
@include('themes::ripple.inc.movie_card')
@endforeach
</div>
</div>
@endforeach
@endsection
@push("header")
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css">
@endpush
@push('scripts')
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<script>
$(document).ready(function() {
$(".recommend-carousel").owlCarousel({
items: 1,
center: false,
loop: true,
dots: false,
nav:true,
margin: 10,
stagePadding:0,
stageOuterClass: 'owl-stage-outer',
responsive: {
1280: {
items: 4
},
1024: {
items: 3
},
768: {
items: 2
},
},
scrollPerPage: true,
lazyLoad: true,
slideSpeed: 800,
paginationSpeed: 400,
stopOnHover: true,
autoplay: true,
navText: [
`<span style="display: none" aria-label="Previous"></span><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="absolute top-1/3 left-0 text-red-500 bg-gradient-to-r from-[#151111] w-8 h-8"><path stroke-linecap="round" stroke-linejoin="round" d="M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5" /></svg>`,
`<span style="display: none" aria-label="Next"></span><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="absolute top-1/3 right-0 text-red-500 bg-gradient-to-l from-[#151111] w-8 h-8"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5" /></svg>`],
});
});
</script>
@endpush

View File

@ -0,0 +1,120 @@
@extends('themes::layout')
@php
$menu = \VsMov\Core\Models\Menu::getTree();
$tops = Cache::remember('site.movies.tops', setting('site_cache_ttl', 5 * 60), function () {
$lists = preg_split('/[\n\r]+/', get_theme_option('hotest'));
$data = [];
foreach ($lists as $list) {
if (trim($list)) {
$list = explode('|', $list);
[$label, $relation, $field, $val, $sortKey, $alg, $limit] = array_merge($list, ['Phim hot', '', 'type', 'series', 'view_total', 'desc', 4]);
try {
$data[] = [
'label' => $label,
'data' => \VsMov\Core\Models\Movie::when($relation, function ($query) use ($relation, $field, $val) {
$query->whereHas($relation, function ($rel) use ($field, $val) {
$rel->where($field, $val);
});
})
->when(!$relation, function ($query) use ($field, $val) {
$query->where($field, $val);
})
->orderBy($sortKey, $alg)
->limit($limit)
->get(),
];
} catch (\Exception $e) {
# code
}
}
}
return $data;
});
@endphp
@push('header')
<link href="/themes/ripple/css/all.css" rel="stylesheet" type="text/css" />
@endpush
@section('body')
{{-- <body class="bg-[#1a1a1a] font-sans leading-normal tracking-normal"></body> --}}
@include('themes::ripple.inc.nav')
<div class="w-full pt-14">
<div class="container mx-auto px-4 md:px-8 xl:px-40 md:mt-4 mb-8 text-gray-800 leading-normal">
<div class="flex flex-row flex-wrap flex-grow mt-2">
@if (get_theme_option('ads_header'))
{!! get_theme_option('ads_header') !!}
@endif
</div>
<div class="flex flex-row flex-wrap flex-grow mt-2">
<div class="w-full lg:w-3/4 xl:w-3/4">
<div class="w-full">
@yield('content')
</div>
</div>
<div class="w-full lg:w-1/4 xl:w-1/4 pl-0 lg:pl-3 mt-3 lg:mt-0">
@foreach ($tops as $top)
<div class="rounded mb-3">
<div class="flex bg-[#151111] rounded-lg p-0 mb-0">
<div class="section-heading bg-red-600 rounded-l-lg">
<h3 class="px-2 py-1"><span
class="h-text text-white uppercase ">{{ $top['label'] }}</span></h3>
</div>
</div>
<div class="mt-2">
<ul class="list-movies">
@foreach ($top['data'] ?? [] as $movie)
<li>
<a href="{{ $movie->getUrl() }}"
class="flex bg-[#1511116d] rounded-lg w-15 h-20 my-2">
<img class="object-cover rounded-l-lg lazyload" style="aspect-ratio: 256 / 340"
data-src="{{ $movie->getThumbUrl() }}" src="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 500'%3e%3c/svg%3e" alt="{{ $movie->origin_name }} ({{ $movie->publish_year }})">
<div class="px-3 py-1 truncate">
<p
class="capitalize block overflow-hidden overflow-ellipsis whitespace-nowrap text-[#44e2ff] hover:text-yellow-300">
{{ $movie->name }}</p>
<p
class="text-gray-400 text-[12px] mt-[3px] italic block overflow-hidden overflow-ellipsis whitespace-nowrap">
{{ $movie->origin_name }} ({{ $movie->publish_year }})</p>
<p class="text-gray-400 text-[12px] mt-[3px] italic"><svg
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"
aria-hidden="true" class="w-4 h-4 inline">
<path stroke-linecap="round" stroke-linejoin="round"
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
<path stroke-linecap="round" stroke-linejoin="round"
d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z">
</path>
</svg> {{ $movie->view_total ?? 0 }} lượt xem</p>
</div>
</a>
</li>
@endforeach
</ul>
</div>
</div>
@endforeach
</div>
</div>
</div>
</div>
@endsection
@section('footer')
<footer class="w-full bg-[#151111] border-t border-[#2b2821] shadow">
<div class="container mx-auto py-8 px-8 xl:px-40">
{!! get_theme_option('footer') !!}
</div>
</footer>
<div class="relative">
<div class="container mx-auto px-4 md:px-8 xl:px-40 fixed bottom-0 right-0 left-0 z-40">
{!! get_theme_option('ads_catfish') !!}
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://unpkg.com/flowbite@1.6.4/dist/flowbite.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.3.2/lazysizes.min.js" integrity="sha512-q583ppKrCRc7N5O0n2nzUiJ+suUv7Et1JGels4bXOaMFQcamPk9HjdUknZuuFjBNs7tsMuadge5k9RzdmO+1GQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
{!! setting('site_scripts_google_analytics') !!}
@endsection

View File

@ -0,0 +1,298 @@
@extends('themes::ripple.layout')
@section('content')
<ul class="breadcrumb w-full px-2 py-2 mb-3 bg-[#151111] rounded-lg text-white">
<li class="inline hover:text-yellow-400" itemprop="itemListElement" itemscope=""
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="/" title="Xem phim">
<span itemprop="name">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-4 h-4 inline">
<path stroke-linecap="round" stroke-linejoin="round"
d="M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" />
</svg>
Xem phim »
</span>
</a>
<meta itemprop="position" content="1">
</li>
@foreach ($currentMovie->regions as $region)
<li class="inline hover:text-yellow-400" itemprop="itemListElement" itemscope=""
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="{{ $region->getUrl() }}" title="{{ $region->name }}">
<span itemprop="name">
{{ $region->name }} »
</span>
</a>
<meta itemprop="position" content="2">
</li>
@endforeach
@foreach ($currentMovie->categories as $category)
<li class="inline hover:text-yellow-400" itemprop="itemListElement" itemscope=""
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="{{ $category->getUrl() }}" title="{{ $category->name }}">
<span itemprop="name">
{{ $category->name }} »
</span>
</a>
<meta itemprop="position" content="2">
</li>
@endforeach
<li class="inline text-gray-400" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
<a itemprop="item" href="{{ $currentMovie->getUrl() }}" title="{{ $currentMovie->name }}">
<span itemprop="name">
{{ $currentMovie->name }}
</span>
</a>
<meta itemprop="position" content="3">
</li>
</ul>
@if ($currentMovie->showtimes && $currentMovie->showtimes != '')
<div class="mt-2.5 p-2 bg-[#1511116d] mb-1 rounded-lg text-gray-300">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6 inline animate-pulse">
<path stroke-linecap="round" stroke-linejoin="round"
d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5m-9-6h.008v.008H12v-.008zM12 15h.008v.008H12V15zm0 2.25h.008v.008H12v-.008zM9.75 15h.008v.008H9.75V15zm0 2.25h.008v.008H9.75v-.008zM7.5 15h.008v.008H7.5V15zm0 2.25h.008v.008H7.5v-.008zm6.75-4.5h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V15zm0 2.25h.008v.008h-.008v-.008zm2.25-4.5h.008v.008H16.5v-.008zm0 2.25h.008v.008H16.5V15z" />
</svg>
Lịch chiếu: <span class="text-yellow-500">{!! $currentMovie->showtimes !!}</span>
</div>
@endif
@if ($currentMovie->notify && $currentMovie->notify != '')
<div class="mt-2.5 p-2 bg-[#1511116d] mb-2 rounded-lg text-gray-300">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6 inline animate-pulse">
<path stroke-linecap="round" stroke-linejoin="round"
d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0M3.124 7.5A8.969 8.969 0 015.292 3m13.416 0a8.969 8.969 0 012.168 4.5" />
</svg>
Thông báo: <span class="text-red-500">{{ strip_tags($currentMovie->notify) }}</span>
</div>
@endif
<div class="flex flex-wrap flex-grow">
<div class="w-full sm:w-1/2 md:w-[fit-content] flex justify-center pr-0 sm:pr-3">
<div class="max-w-xs relative overflow-hidden container bg-[#1511116d] rounded-lg w-full md:w-[15em] h-[fit-content]">
<img class="w-full rounded-t-lg" style="aspect-ratio: 256/340" src="{{ $currentMovie->getThumbUrl() }}"
alt="{{ $currentMovie->name }} - {{ $currentMovie->origin_name }} ({{ $currentMovie->publish_year }})" />
@if ($currentMovie->is_copyright)
<div class="absolute top-[7%] -left-[34%] text-white uppercase py-[4px] px-0 text-[12px] w-full text-center -rotate-45 bg-gradient-to-r from-red-500">bản quyền</div>
@endif
<div class="flex py-3 justify-between">
<div class="w-full text-center space-x-2">
@if ($currentMovie->trailer_url)
<label for="trailer-modal"
class="modal-button bg-sky-500 hover:bg-opacity-80 text-gray-50 inline-block px-2 py-1 rounded cursor-pointer">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-4 h-4 inline">
<path stroke-linecap="round"
d="M15.75 10.5l4.72-4.72a.75.75 0 011.28.53v11.38a.75.75 0 01-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25h-9A2.25 2.25 0 002.25 7.5v9a2.25 2.25 0 002.25 2.25z" />
</svg>
Trailer
</label>
@endif
@if ($currentMovie->status != 'trailer' && count($currentMovie->episodes) && $currentMovie->episodes[0]['link'] != '')
<a class="bg-red-600 hover:bg-opacity-80 text-gray-50 inline-block px-2 py-1 rounded"
title="{{ $currentMovie->name }} - {{ $currentMovie->origin_name }} ({{ $currentMovie->publish_year }})"
href="{{ $currentMovie->episodes->sortBy([['server', 'asc']])->groupBy('server')->first()->sortByDesc('name', SORT_NATURAL)->groupBy('name')->last()->sortByDesc('type')->first()->getUrl() }}">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-4 h-4 inline">
<path stroke-linecap="round" stroke-linejoin="round"
d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 01-1.125-1.125M3.375 19.5h1.5C5.496 19.5 6 18.996 6 18.375m-3.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-1.5A1.125 1.125 0 0118 18.375M20.625 4.5H3.375m17.25 0c.621 0 1.125.504 1.125 1.125M20.625 4.5h-1.5C18.504 4.5 18 5.004 18 5.625m3.75 0v1.5c0 .621-.504 1.125-1.125 1.125M3.375 4.5c-.621 0-1.125.504-1.125 1.125M3.375 4.5h1.5C5.496 4.5 6 5.004 6 5.625m-3.75 0v1.5c0 .621.504 1.125 1.125 1.125m0 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m1.5-3.75C5.496 8.25 6 7.746 6 7.125v-1.5M4.875 8.25C5.496 8.25 6 8.754 6 9.375v1.5m0-5.25v5.25m0-5.25C6 5.004 6.504 4.5 7.125 4.5h9.75c.621 0 1.125.504 1.125 1.125m1.125 2.625h1.5m-1.5 0A1.125 1.125 0 0118 7.125v-1.5m1.125 2.625c-.621 0-1.125.504-1.125 1.125v1.5m2.625-2.625c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125M18 5.625v5.25M7.125 12h9.75m-9.75 0A1.125 1.125 0 016 10.875M7.125 12C6.504 12 6 12.504 6 13.125m0-2.25C6 11.496 5.496 12 4.875 12M18 10.875c0 .621-.504 1.125-1.125 1.125M18 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m-12 5.25v-5.25m0 5.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125m-12 0v-1.5c0-.621-.504-1.125-1.125-1.125M18 18.375v-5.25m0 5.25v-1.5c0-.621.504-1.125 1.125-1.125M18 13.125v1.5c0 .621.504 1.125 1.125 1.125M18 13.125c0-.621.504-1.125 1.125-1.125M6 13.125v1.5c0 .621-.504 1.125-1.125 1.125M6 13.125C6 12.504 5.496 12 4.875 12m-1.5 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M19.125 12h1.5m0 0c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h1.5m14.25 0h1.5" />
</svg>
Xem phim
</a>
@else
<div class="text-white">Đang cập nhật...</div>
@endif
</div>
</div>
</div>
</div>
@if ($currentMovie->trailer_url)
<input type="checkbox" id="trailer-modal" class="modal-toggle" />
<div class="modal">
<div class="modal-box relative bg-black/60">
<label for="trailer-modal"
class="btn btn-sm btn-circle bg-red-600 text-white absolute right-2 top-2"></label>
@php
parse_str(parse_url($currentMovie->trailer_url, PHP_URL_QUERY), $parse_url);
$trailer_url = $parse_url['v'];
@endphp
<iframe width="100%" height="315" src="https://www.youtube.com/embed/{{ $trailer_url }}"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
frameborder="0" scrolling="no" allowfullscreen></iframe>
</div>
</div>
@endif
<div class="w-full sm:w-1/2 md:grow mt-3 sm:mt-0">
<div class="w-full rounded-lg p-3 text-[#bbb] bg-[#1511116d]">
<h1>
<span class="uppercase text-sm xl:text-xl text-[#dacb46] block font-bold">
<a href="{{ $currentMovie->getUrl() }}" title="{{ $currentMovie->name }}">{{ $currentMovie->name }}</a>
</span>
</h1>
<h2>
<span class="text-gray-300 text-base">{{ $currentMovie->origin_name ?? '' }}</span>
<span class="text-gray-300 text-base"> ({{ $currentMovie->publish_year ?? 'Đang cập nhật...' }})</span>
</h2>
<div class="my-1">
<div class="flex-none lg:flex items-center">
<p class="flex items-center">
@foreach ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as $star)
@if ($currentMovie->getRatingStar() >= $star)
<svg aria-hidden="true" class="w-5 h-5 text-yellow-400" fill="currentColor"
viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<title>light star</title>
<path
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z">
</path>
</svg>
@else
<svg aria-hidden="true" class="w-5 h-5 text-gray-300" fill="currentColor"
viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<title>dark star</title>
<path
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z">
</path>
</svg>
@endif
@endforeach
</p>
<p class="text-xs text-white align-middle">
({{ $currentMovie->getRatingStar() }}
sao
/
{{ $currentMovie->getRatingCount() }} đánh giá)</p>
</div>
</div>
<div class="w-auto h-[fit-content] rounded-lg text-[#bbb] bg-[#272727] text-lg">
</div>
<dl class="mt-1">
<dt class="inline font-bold text-sm">Trạng thái:</dt>
<dd class="movie-dd inline ml-1 text-sm status text-red-600">{{ $currentMovie->getStatus() }}
</dd>
<br>
<dt class="inline font-bold text-sm">Thể loại:</dt>
<dd class="movie-dd inline ml-1 text-sm dd-cat">
{!! $currentMovie->categories->map(function ($category) {
return '<a class="text-[#44e2ff] hover:text-yellow-400 mr-1" href="' .
$category->getUrl() .
'" title="' .
$category->name .
'">' .
$category->name .
'</a>';
})->implode(', ') !!}
</dd><br>
<dt class="inline font-bold text-sm">Quốc gia:</dt>
<dd class="movie-dd inline ml-1 text-sm">
{!! $currentMovie->regions->map(function ($region) {
return '<a class="text-[#44e2ff] hover:text-yellow-400 mr-1" href="' .
$region->getUrl() .
'" title="' .
$region->name .
'">' .
$region->name .
'</a>';
})->implode(', ') !!}
</dd>
<br>
<dt class="inline font-bold text-sm">Năm:</dt>
<dd class="movie-dd inline ml-1 text-sm">
<a class="text-[#44e2ff] hover:text-yellow-400 mr-1" title="Phim mới {{ $currentMovie->publish_year }}"
href="{{ '/?' . urlencode('filter[year]') . '=' . $currentMovie->publish_year }}">{{ $currentMovie->publish_year ?? 'Đang cập nhật...' }}</a>
</dd><br>
<dt class="inline font-bold text-sm">Đạo diễn:</dt>
<dd class="movie-dd inline ml-1 text-sm">
{!! $currentMovie->directors->map(function ($director) {
return '<a class="text-[#44e2ff] hover:text-yellow-400 mr-1" href="' .
$director->getUrl() .
'" title="Đạo diễn ' .
$director->name .
'">' .
$director->name .
'</a>';
})->implode(', ') !!}
</dd><br>
<dt class="inline font-bold text-sm">Diễn viên:</dt>
<dd class="movie-dd inline ml-1 text-sm dd-actor">
{!! $currentMovie->actors->map(function ($actor) {
return '<a class="text-[#44e2ff] hover:text-yellow-400 mr-1" href="' .
$actor->getUrl() .
'" title="Diễn viên ' .
$actor->name .
'">' .
$actor->name .
'</a>';
})->implode(', ') !!}
</dd><br>
<dt class="inline font-bold text-sm">Thời lượng:</dt>
<dd class="movie-dd inline ml-1 text-sm">{{ $currentMovie->episode_time ?? 'Đang cập nhật...' }}
</dd><br>
<dt class="inline font-bold text-sm">Chất lượng:</dt>
<dd class="movie-dd inline ml-1 text-sm">{{ $currentMovie->quality ?? 'Đang cập nhật...' }}</dd>
<br>
<dt class="inline font-bold text-sm">Ngôn ngữ:</dt>
<dd class="movie-dd inline ml-1 text-sm">{{ $currentMovie->language ?? 'Đang cập nhật...' }}</dd>
<br>
<dt class="inline font-bold text-sm">Lượt xem:</dt>
<dd class="movie-dd inline ml-1 text-sm">
{{ number_format($currentMovie->view_total ?? 0) }} lượt</dd>
</dl>
</div>
</div>
</div>
<article class="mt-2.5 p-3 bg-[#1511116d] mb-3 rounded-lg">
<h2 class="text-sm font-bold text-[#dacb46] uppercase mt-1.5 mb-3">Nội dung phim</h2>
<div class="content text-white">
@if ($currentMovie->content)
<div class="whitespace-pre-wrap">{!! $currentMovie->content !!}</div>
@else
<p>Đang cập nhật ...</p>
@endif
</div>
<br>
<span class="mt-1.5">{!! $currentMovie->tags->map(function ($tag) {
return '<a class="bg-[#111] text-[#ccc] hover:text-white px-2 border-[#333] border-[1px]" href="' .
$tag->getUrl() .
'" title="' .
$tag->name .
'">' .
$tag->name .
'</a>';
})->implode(', ') !!}</span>
</article>
<div style="background-color: #fff" class="mt-2">
<div class="fb-comments w-full rounded-lg bg-white mt-2.5"
data-href="{{ $currentMovie->getUrl() }}" data-width="100%" data-numposts="5" data-colorscheme="dark"
data-lazy="true">
</div>
</div>
<div class="mt-2.5 p-3 bg-[#1511116d] mb-3 rounded-lg">
<h3 class="text-sm font-bold text-[#dacb46] uppercase mt-1.5 mb-3">
thể bản muốn xem
</h3>
<div class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-2">
@php
$key_section = 0;
@endphp
@foreach ($movie_related ?? [] as $key => $movie)
@include('themes::ripple.inc.movie_card')
@endforeach
</div>
</div>
@endsection
@push('scripts')
{!! setting('site_scripts_facebook_sdk') !!}
@endpush

57
routes/web.php Executable file
View File

@ -0,0 +1,57 @@
<?php
use Illuminate\Support\Facades\Route;
use VsMov\Ripple\Controllers\RippleController;
// --------------------------
// Custom Backpack Routes
// --------------------------
// This route file is loaded automatically by Backpack\Base.
// Routes you generate using Backpack\Generators will be placed here.
Route::group([
'middleware' => array_merge(
(array) config('backpack.base.web_middleware', 'web'),
),
], function () {
Route::get('/', [RippleController::class, 'index']);
Route::get(setting('site_routes_category', '/the-loai/{category}'), [RippleController::class, 'getMovieOfCategory'])
->where(['category' => '.+', 'id' => '[0-9]+'])
->name('categories.movies.index');
Route::get(setting('site_routes_region', '/quoc-gia/{region}'), [RippleController::class, 'getMovieOfRegion'])
->where(['region' => '.+', 'id' => '[0-9]+'])
->name('regions.movies.index');
Route::get(setting('site_routes_tag', '/tu-khoa/{tag}'), [RippleController::class, 'getMovieOfTag'])
->where(['tag' => '.+', 'id' => '[0-9]+'])
->name('tags.movies.index');
Route::get(setting('site_routes_types', '/danh-sach/{type}'), [RippleController::class, 'getMovieOfType'])
->where(['type' => '.+', 'id' => '[0-9]+'])
->name('types.movies.index');
Route::get(setting('site_routes_actors', '/dien-vien/{actor}'), [RippleController::class, 'getMovieOfActor'])
->where(['actor' => '.+', 'id' => '[0-9]+'])
->name('actors.movies.index');
Route::get(setting('site_routes_directors', '/dao-dien/{director}'), [RippleController::class, 'getMovieOfDirector'])
->where(['director' => '.+', 'id' => '[0-9]+'])
->name('directors.movies.index');
Route::get(setting('site_routes_episode', '/phim/{movie}/{episode}-{id}'), [RippleController::class, 'getEpisode'])
->where(['movie' => '.+', 'movie_id' => '[0-9]+', 'episode' => '.+', 'id' => '[0-9]+'])
->name('episodes.show');
Route::post(setting('site_routes_episode', '/phim/{movie}/{episode}-{id}'), [RippleController::class, 'reportEpisode'])
->where(['movie' => '.+', 'movie_id' => '[0-9]+', 'episode' => '.+', 'id' => '[0-9]+'])
->name('episodes.report');
Route::post(sprintf('/%s/{movie}/{episode}/rate', config('vsmov.routes.movie', 'phim')), [RippleController::class, 'rateMovie'])
->name('movie.rating');
Route::get(setting('site_routes_movie', '/phim/{movie}'), [RippleController::class, 'getMovieOverview'])
->where(['movie' => '.+', 'id' => '[0-9]+'])
->name('movies.show');
});

View File

@ -0,0 +1,288 @@
<?php
namespace VsMov\Ripple\Controllers;
use Backpack\Settings\app\Models\Setting;
use Illuminate\Http\Request;
use VsMov\Core\Models\Actor;
use VsMov\Core\Models\Catalog;
use VsMov\Core\Models\Category;
use VsMov\Core\Models\Director;
use VsMov\Core\Models\Episode;
use VsMov\Core\Models\Movie;
use VsMov\Core\Models\Region;
use VsMov\Core\Models\Tag;
use Illuminate\Support\Facades\Cache;
class RippleController
{
public function index(Request $request)
{
if ($request['search'] || $request['filter']) {
$data = Movie::when(!empty($request['filter']['category']), function ($movie) {
$movie->whereHas('categories', function ($categories) {
$categories->where('id', request('filter')['category']);
});
})->when(!empty($request['filter']['region']), function ($movie) {
$movie->whereHas('regions', function ($regions) {
$regions->where('id', request('filter')['region']);
});
})->when(!empty($request['filter']['year']), function ($movie) {
$movie->where('publish_year', request('filter')['year']);
})->when(!empty($request['filter']['type']), function ($movie) {
$movie->where('type', request('filter')['type']);
})->when(!empty($request['search']), function ($query) {
$query->where(function ($query) {
$query->where('name', 'like', '%' . request('search') . '%')
->orWhere('origin_name', 'like', '%' . request('search') . '%');
})->orderBy('name', 'desc');
})->when(!empty($request['filter']['sort']), function ($movie) {
if (request('filter')['sort'] == 'create') {
return $movie->orderBy('created_at', 'desc');
}
if (request('filter')['sort'] == 'update') {
return $movie->orderBy('updated_at', 'desc');
}
if (request('filter')['sort'] == 'year') {
return $movie->orderBy('publish_year', 'desc');
}
if (request('filter')['sort'] == 'view') {
return $movie->orderBy('view_total', 'desc');
}
})->paginate();
return view('themes::ripple.catalog', [
'data' => $data,
'search' => $request['search'],
'section_name' => "Tìm kiếm phim: $request->search"
]);
}
return view('themes::ripple.index', [
'title' => Setting::get('site_homepage_title')
]);
}
public function getMovieOverview(Request $request)
{
/** @var Movie */
$movie = Movie::fromCache()->find($request->movie ?: $request->id);
if (is_null($movie)) abort(404);
$movie->generateSeoTags();
$movie->increment('view_total', 1);
$movie->increment('view_day', 1);
$movie->increment('view_week', 1);
$movie->increment('view_month', 1);
$movie_related_cache_key = 'movie_related:' . $movie->id;
$movie_related = Cache::get($movie_related_cache_key);
if(is_null($movie_related)) {
$movie_related = $movie->categories[0]->movies()->inRandomOrder()->limit(get_theme_option('movie_related_limit', 10))->get();
Cache::put($movie_related_cache_key, $movie_related, setting('site_cache_ttl', 5 * 60));
}
return view('themes::ripple.single', [
'currentMovie' => $movie,
'title' => $movie->getTitle(),
'movie_related' => $movie_related
]);
}
public function getEpisode(Request $request)
{
$movie = Movie::fromCache()->find($request->movie ?: $request->movie_id)->load('episodes');
if (is_null($movie)) abort(404);
/** @var Episode */
$episode_id = $request->id;
$episode = $movie->episodes->when($episode_id, function ($collection, $episode_id) {
return $collection->where('id', $episode_id);
})->firstWhere('slug', $request->episode);
if (is_null($episode)) abort(404);
$episode->generateSeoTags();
$movie->increment('view_total', 1);
$movie->increment('view_day', 1);
$movie->increment('view_week', 1);
$movie->increment('view_month', 1);
$movie_related_cache_key = 'movie_related:' . $movie->id;
$movie_related = Cache::get($movie_related_cache_key);
if(is_null($movie_related)) {
$movie_related = $movie->categories[0]->movies()->inRandomOrder()->limit(get_theme_option('movie_related_limit', 10))->get();
Cache::put($movie_related_cache_key, $movie_related, setting('site_cache_ttl', 5 * 60));
}
return view('themes::ripple.episode', [
'currentMovie' => $movie,
'movie_related' => $movie_related,
'episode' => $episode,
'title' => $episode->getTitle()
]);
}
public function reportEpisode(Request $request, $movie, $slug, $id)
{
$movie = Movie::fromCache()->find($movie)->load('episodes');
$episode = $movie->episodes->when($id, function ($collection, $id) {
return $collection->where('id', $id);
})->firstWhere('slug', $slug);
$episode->update([
'report_message' => request('message', ''),
'has_report' => true
]);
return response([], 204);
}
public function rateMovie(Request $request, $movie, $slug)
{
$movie = Movie::fromCache()->find($movie)->load('episodes');
$movie->refresh()->increment('rating_count', 1, [
'rating_star' => $movie->rating_star + ((int) request('rating') - $movie->rating_star) / ($movie->rating_count + 1)
]);
return response([], 204);
}
public function getMovieOfCategory(Request $request)
{
/** @var Category */
$category = Category::fromCache()->find($request->category ?: $request->id);
if (is_null($category)) abort(404);
$category->generateSeoTags();
$movies = $category->movies()->orderBy('created_at', 'desc')->paginate(get_theme_option('per_page_limit'));
return view('themes::ripple.catalog', [
'data' => $movies,
'category' => $category,
'title' => $category->seo_title ?: $category->getTitle(),
'section_name' => "Phim thể loại $category->name"
]);
}
public function getMovieOfRegion(Request $request)
{
/** @var Region */
$region = Region::fromCache()->find($request->region ?: $request->id);
if (is_null($region)) abort(404);
$region->generateSeoTags();
$movies = $region->movies()->orderBy('created_at', 'desc')->paginate(get_theme_option('per_page_limit'));
return view('themes::ripple.catalog', [
'data' => $movies,
'region' => $region,
'title' => $region->seo_title ?: $region->getTitle(),
'section_name' => "Phim quốc gia $region->name"
]);
}
public function getMovieOfActor(Request $request)
{
/** @var Actor */
$actor = Actor::fromCache()->find($request->actor ?: $request->id);
if (is_null($actor)) abort(404);
$actor->generateSeoTags();
$movies = $actor->movies()->orderBy('created_at', 'desc')->paginate(get_theme_option('per_page_limit'));
return view('themes::ripple.catalog', [
'data' => $movies,
'person' => $actor,
'title' => $actor->getTitle(),
'section_name' => "Diễn viên $actor->name"
]);
}
public function getMovieOfDirector(Request $request)
{
/** @var Director */
$director = Director::fromCache()->find($request->director ?: $request->id);
if (is_null($director)) abort(404);
$director->generateSeoTags();
$movies = $director->movies()->orderBy('created_at', 'desc')->paginate(get_theme_option('per_page_limit'));
return view('themes::ripple.catalog', [
'data' => $movies,
'person' => $director,
'title' => $director->getTitle(),
'section_name' => "Đạo diễn $director->name"
]);
}
public function getMovieOfTag(Request $request)
{
/** @var Tag */
$tag = Tag::fromCache()->find($request->tag ?: $request->id);
if (is_null($tag)) abort(404);
$tag->generateSeoTags();
$movies = $tag->movies()->orderBy('created_at', 'desc')->paginate(get_theme_option('per_page_limit'));
return view('themes::ripple.catalog', [
'data' => $movies,
'tag' => $tag,
'title' => $tag->getTitle(),
'section_name' => "Tags: $tag->name"
]);
}
public function getMovieOfType(Request $request)
{
/** @var Catalog */
$catalog = Catalog::fromCache()->find($request->type ?: $request->id);
if (is_null($catalog)) abort(404);
$catalog->generateSeoTags();
$cache_key = 'catalog:' . $catalog->id . ':page:' . ($request['page'] ?: 1);
$movies = Cache::get($cache_key);
if(is_null($movies)) {
$value = explode('|', trim($catalog->value));
[$relation_config, $field, $val, $sortKey, $alg] = array_merge($value, ['', 'is_copyright', 0, 'created_at', 'desc']);
$relation_config = explode(',', $relation_config);
[$relation_table, $relation_field, $relation_val] = array_merge($relation_config, ['', '', '']);
try {
$movies = \VsMov\Core\Models\Movie::when($relation_table, function ($query) use ($relation_table, $relation_field, $relation_val, $field, $val) {
$query->whereHas($relation_table, function ($rel) use ($relation_field, $relation_val, $field, $val) {
$rel->where($relation_field, $relation_val)->where(array_combine(explode(",", $field), explode(",", $val)));
});
})->when(!$relation_table, function ($query) use ($field, $val) {
$query->where(array_combine(explode(",", $field), explode(",", $val)));
})
->orderBy($sortKey, $alg)
->paginate($catalog->paginate);
Cache::put($cache_key, $movies, setting('site_cache_ttl', 5 * 60));
} catch (\Exception $e) {}
}
return view('themes::ripple.catalog', [
'data' => $movies,
'section_name' => "Danh sách $catalog->name"
]);
}
}

168
src/RippleServiceProvider.php Executable file
View File

@ -0,0 +1,168 @@
<?php
namespace VsMov\Ripple;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class RippleServiceProvider extends ServiceProvider
{
public function register()
{
$this->setupDefaultThemeCustomizer();
}
public function boot()
{
$this->loadViewsFrom(__DIR__ . '/../resources/views/', 'themes');
$this->publishes([
__DIR__ . '/../resources/assets' => public_path('themes/ripple')
], 'ripple-assets');
}
protected function setupDefaultThemeCustomizer()
{
config(['themes' => array_merge(config('themes', []), [
'ripple' => [
'name' => 'Ripple',
'author' => 'vsmov.dev@gmail.com',
'package_name' => 'vsmov/vsmov-ripple',
'publishes' => ['ripple-assets'],
'preview_image' => '',
'options' => [
[
'name' => 'recommendations_limit',
'label' => 'Recommended movies limit',
'type' => 'number',
'value' => 10,
'wrapperAttributes' => [
'class' => 'form-group col-md-4',
],
'tab' => 'List'
],
[
'name' => 'per_page_limit',
'label' => 'Pages limit',
'type' => 'number',
'value' => 20,
'wrapperAttributes' => [
'class' => 'form-group col-md-4',
],
'tab' => 'List'
],
[
'name' => 'movie_related_limit',
'label' => 'Movies related limit',
'type' => 'number',
'value' => 10,
'wrapperAttributes' => [
'class' => 'form-group col-md-4',
],
'tab' => 'List'
],
[
'name' => 'latest',
'label' => 'Danh sách mới cập nhật',
'type' => 'code',
'hint' => 'display_label|relation|find_by_field|value|limit|show_more_url',
'value' => "Phim chiếu rạp||is_shown_in_theater|1|10|/danh-sach/phim-chieu-rap\r\nPhim bộ mới||type|series|10|/danh-sach/phim-bo\r\nPhim lẻ mới||type|single|10|/danh-sach/phim-le",
'attributes' => [
'rows' => 5
],
'tab' => 'List'
],
[
'name' => 'hotest',
'label' => 'Danh sách hot',
'type' => 'code',
'hint' => 'Label|relation|find_by_field|value|sort_by_field|sort_algo|limit',
'value' => "Top sắp chiếu||status|trailer|publish_year|desc|4\r\nTop phim bộ||type|series|view_total|desc|4\r\nTop phim lẻ||type|single|view_total|desc|4",
'attributes' => [
'rows' => 5
],
'tab' => 'List'
],
[
'name' => 'additional_css',
'label' => 'Additional CSS',
'type' => 'code',
'value' => "",
'tab' => 'Custom CSS'
],
[
'name' => 'body_attributes',
'label' => 'Body attributes',
'type' => 'text',
'value' => "class='bg-[#1a1a1a] font-sans leading-normal tracking-normal'",
'tab' => 'Custom CSS'
],
[
'name' => 'additional_header_js',
'label' => 'Header JS',
'type' => 'code',
'value' => "",
'tab' => 'Custom JS'
],
[
'name' => 'additional_body_js',
'label' => 'Body JS',
'type' => 'code',
'value' => "",
'tab' => 'Custom JS'
],
[
'name' => 'additional_footer_js',
'label' => 'Footer JS',
'type' => 'code',
'value' => "",
'tab' => 'Custom JS'
],
[
'name' => 'footer',
'label' => 'Footer',
'type' => 'code',
'value' => <<<EOT
<div class="w-full mx-auto flex flex-wrap">
<div class="flex w-full">
<div class="px-2"><span class="font-bold text-gray-100">Giới Thiệu...</span>
<p class="text-gray-300 text-sm">Xem phim online chất lượng cao miễn phí với phụ đề tiếng
việt - thuyết minh - lồng tiếng, nhiều thể loại phim phong phú, đặc sắc,
nhiều bộ phim hay nhất - mới nhất.</p>
<p class="text-gray-300 text-sm">Website với giao diện trực quan, thuận tiện,
tốc độ tải nhanh, ít quảng cáo hứa hẹn sẽ đem lại những trải nghiệm tốt cho người dùng.
</p>
</div>
</div>
<div class="flex">
<div class="px-2 space-x-2">
<a class="text-[#44e2ff] hover:text-yellow-300" href="#">Liên Hệ</a>
<a class="text-[#44e2ff] hover:text-yellow-300" href="/ban-quyen">Khiếu nại bản quyền</a>
</div>
</div>
</div>
EOT,
'tab' => 'Custom HTML'
],
[
'name' => 'ads_header',
'label' => 'Ads header',
'type' => 'code',
'value' => <<<EOT
<img src="" alt="">
EOT,
'tab' => 'Ads'
],
[
'name' => 'ads_catfish',
'label' => 'Ads catfish',
'type' => 'code',
'value' => <<<EOT
<img src="" alt="">
EOT,
'tab' => 'Ads'
]
],
]
])]);
}
}

BIN
src/screenshot.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 KiB