Skip to content

Commit 629859d

Browse files
committed
project added
1 parent 033c602 commit 629859d

File tree

15 files changed

+1535
-0
lines changed

15 files changed

+1535
-0
lines changed

about.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
/**
4+
** about.php
5+
** @version 1.0
6+
** @author en0ndev
7+
*/
8+
/*
9+
This file is part of Custom Profile Avatar.
10+
11+
Custom Profile Avatar is free software: you can redistribute it and/or modify
12+
it under the terms of the GNU General Public License as published by
13+
the Free Software Foundation, either version 3 of the License, or
14+
(at your option) any later version.
15+
16+
Custom Profile Avatar is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
GNU General Public License for more details.
20+
21+
You should have received a copy of the GNU General Public License
22+
along with Custom Profile Avatar. If not, see <https://www.gnu.org/licenses/>.
23+
*/
24+
defined('ABSPATH') || exit; // Exit if accessed directly
25+
26+
$template = "<div class='about'><p class='big'>Custom Profile Avatar</p>";
27+
$template .= "<p>Version: 1.0</p>";
28+
$template .= "<p>Developer: en0ndev</p>";
29+
$template .= "<a target='_blank' href='https://www.youtube.com/channel/UC3CSOAThanO-LvYKFwJ24RQ'>My YouTube Channel</a></div>";
30+
31+
use template\page__template;
32+
33+
$page = new page__template;
34+
35+
$page->get__template("About", $template, 0);

assets/css/style.css

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
/**
2+
** File: style.css
3+
** Version: 1.0
4+
** Author: en0ndev
5+
6+
This file is part of Custom Profile Avatar.
7+
8+
Plugin Name: Custom Profile Avatar
9+
Plugin URI: http://wordpress.org/plugins/
10+
Description: Change profile avatar to your custom avatar.
11+
Author: en0ndev
12+
Version: 1.0
13+
Author URI: https://github.com/en0ndev
14+
15+
Custom Profile Avatar is free software: you can redistribute it and/or modify
16+
it under the terms of the GNU General Public License as published by
17+
the Free Software Foundation, either version 3 of the License, or
18+
(at your option) any later version.
19+
20+
Custom Profile Avatar is distributed in the hope that it will be useful,
21+
but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23+
GNU General Public License for more details.
24+
25+
You should have received a copy of the GNU General Public License
26+
along with Custom Profile Avatar. If not, see <https://www.gnu.org/licenses/>.
27+
*/
28+
29+
body {
30+
background: #ddd;
31+
user-select: none;
32+
line-height: 30px;
33+
}
34+
35+
#author__by {
36+
background: #000;
37+
padding: 5px 20px;
38+
border-radius: 30px;
39+
box-shadow: 1px 1px 5px 1px #000;
40+
position: absolute;
41+
left: 15px;
42+
bottom: 15px;
43+
font-family: 'Ubuntu', sans-serif;
44+
}
45+
46+
#author__by a {
47+
font-size: 16px;
48+
color: #ddd;
49+
text-decoration: none;
50+
}
51+
52+
#author__by .bold {
53+
color: #fff;
54+
font-weight: 700;
55+
}
56+
57+
#author__by .bold:hover {
58+
padding-bottom: 1px;
59+
border-bottom: 2px solid #fff;
60+
}
61+
62+
.main__area,
63+
.inner__area {
64+
display: flex;
65+
align-items: center;
66+
justify-content: center;
67+
flex-direction: column;
68+
text-align: center;
69+
}
70+
71+
.main__area h1,
72+
.main__area h2,
73+
.main__area h3,
74+
.main__area h4,
75+
.main__area h5,
76+
.main__area h6,
77+
.inner__area,
78+
.inner__area img,
79+
input[type="button"],
80+
#save,
81+
.remove {
82+
box-shadow: 1px 1px 5px 1px rgba(0, 0, 0, 0.3);
83+
}
84+
85+
.inner__area {
86+
width: 800px;
87+
height: 400px;
88+
background: #f8f8f8;
89+
border-radius: 20px;
90+
}
91+
92+
.main__area h1,
93+
.main__area h2,
94+
.main__area h3,
95+
.main__area h4,
96+
.main__area h5,
97+
.main__area h6 {
98+
font-size: 22pt;
99+
background: #000;
100+
color: #fff;
101+
padding: 10px 30px;
102+
border-radius: 15px;
103+
margin-top: .7em;
104+
margin-bottom: .7em;
105+
}
106+
107+
.inner__area h2 {
108+
width: 95%;
109+
text-align: center;
110+
padding: 20px 0;
111+
background: #000;
112+
}
113+
114+
.inner__area img {
115+
border-radius: 60%;
116+
transition: opacity .5s;
117+
width: 110px;
118+
height: 110px;
119+
}
120+
121+
.inner__area img:hover {
122+
opacity: .9;
123+
}
124+
125+
.main__area input[type="button"],
126+
#save {
127+
width: 125px;
128+
height: 50px;
129+
border: none;
130+
border-radius: 5px;
131+
outline: none;
132+
color: #fff;
133+
background: #000;
134+
transition: background-color .5s, color .5s;
135+
cursor: pointer;
136+
margin-top: .8em;
137+
margin-bottom: .8em;
138+
font-size: 15px;
139+
}
140+
141+
.main__area input[type="button"]:hover,
142+
#save:hover {
143+
color: #000;
144+
background: #fff;
145+
}
146+
147+
.hidden {
148+
display: none;
149+
}
150+
151+
.user__avatar {
152+
position: relative;
153+
}
154+
155+
.remove {
156+
background: red;
157+
border-radius: 60%;
158+
width: 35px;
159+
height: 35px;
160+
position: absolute;
161+
right: -5px;
162+
cursor: pointer;
163+
justify-content: center;
164+
align-items: center;
165+
display: inline-flex;
166+
transition: transform .5s;
167+
}
168+
169+
.remove:hover {
170+
transform: translateY(-3px);
171+
}
172+
173+
.remove:after {
174+
content: "";
175+
background-image: url(../img/remove.png);
176+
background-size: 100% 100%;
177+
width: 20px;
178+
height: 20px;
179+
box-shadow: none;
180+
display: inline-block;
181+
}
182+
183+
.about>p,
184+
.about>a {
185+
font-size: 15px;
186+
font-weight: 500;
187+
}
188+
189+
.about>.big {
190+
font-size: 20px;
191+
font-weight: 600;
192+
}
193+
194+
#notf {
195+
position: absolute;
196+
right: 15px;
197+
top: 15px;
198+
box-shadow: 2px 2px 5px 1px rgba(0, 0, 0, .3);
199+
padding: 10px 2em;
200+
border-radius: 5px;
201+
color: #000;
202+
background: #fff;
203+
font-weight: 500;
204+
font-size: 16px;
205+
}
206+
207+
.scs {
208+
border-left: 7px solid rgb(5, 131, 60);
209+
}
210+
211+
.err {
212+
border-left: 7px solid rgb(170, 14, 14);
213+
}

assets/img/icon.png

6.36 KB
Loading

assets/img/remove.png

7.08 KB
Loading

assets/js/modules.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/**
2+
** File: modules.js
3+
** Version: 1.0
4+
** Author: en0ndev
5+
This file is part of Custom Profile Avatar.
6+
7+
Plugin Name: Custom Profile Avatar
8+
Plugin URI: http://wordpress.org/plugins/
9+
Description: Change profile avatar to your custom avatar.
10+
Author: en0ndev
11+
Version: 1.0
12+
Author URI: https://github.com/en0ndev
13+
14+
Custom Profile Avatar is free software: you can redistribute it and/or modify
15+
it under the terms of the GNU General Public License as published by
16+
the Free Software Foundation, either version 3 of the License, or
17+
(at your option) any later version.
18+
19+
Custom Profile Avatar is distributed in the hope that it will be useful,
20+
but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
GNU General Public License for more details.
23+
24+
You should have received a copy of the GNU General Public License
25+
along with Custom Profile Avatar. If not, see <https://www.gnu.org/licenses/>.
26+
*/
27+
28+
jQuery(document).ready(function($) {
29+
var mediaUploader;
30+
$('#change').click(function(e) {
31+
e.preventDefault();
32+
// If the uploader object has already been created, reopen the dialog
33+
if (mediaUploader) {
34+
mediaUploader.open();
35+
return;
36+
}
37+
// Extend the wp.media object
38+
mediaUploader = wp.media.frames.file_frame = wp.media({
39+
title: 'Choose Your Custom Profile Avatar',
40+
button: {
41+
text: 'Choose'
42+
},
43+
multiple: false,
44+
library: {
45+
type: ['image']
46+
},
47+
});
48+
// When a file is selected, grab the URL and set it as the text field's value
49+
mediaUploader.on('select', function() {
50+
attachment = mediaUploader.state().get('selection').first().toJSON();
51+
$('.user__avatar > .avatar').attr('src', attachment.url);
52+
$('input[name="avatar__val"]').attr('value', attachment.url);
53+
if (!$('.user__avatar').children().hasClass('remove')) { $('.user__avatar > .avatar').after('<div class="remove"></div>') };
54+
});
55+
// Open the uploader dialog
56+
mediaUploader.open();
57+
});
58+
$(document).on('click', '.remove', function() {
59+
var pull = $('#pull > img').attr('src');
60+
$('.user__avatar .avatar').attr('src', pull);
61+
$('input[name="avatar__val"]').removeAttr('value');
62+
$(this).remove();
63+
});
64+
});

index.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/*
4+
Plugin Name: Custom Profile Avatar
5+
Plugin URI: http://wordpress.org/plugins/
6+
Description: Change profile avatar to your custom avatar.
7+
Author: en0ndev
8+
Version: 1.0
9+
Author URI: https://github.com/en0ndev
10+
11+
This file is part of Custom Profile Avatar.
12+
13+
Custom Profile Avatar is free software: you can redistribute it and/or modify
14+
it under the terms of the GNU General Public License as published by
15+
the Free Software Foundation, either version 3 of the License, or
16+
(at your option) any later version.
17+
18+
Custom Profile Avatar is distributed in the hope that it will be useful,
19+
but WITHOUT ANY WARRANTY; without even the implied warranty of
20+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+
GNU General Public License for more details.
22+
23+
You should have received a copy of the GNU General Public License
24+
along with Custom Profile Avatar. If not, see <https://www.gnu.org/licenses/>.
25+
*/
26+
27+
require_once __DIR__ . '/modules/menu_setup.php';
28+
require_once __DIR__ . '/modules/admin_menu_join.php';
29+
require_once __DIR__ . '/modules/admin_footer.php';
30+
require_once __DIR__ . '/modules/template.php';
31+
require_once __DIR__ . '/modules/chooser.php';
32+
require_once __DIR__ . '/modules/get_avatar.php';

main.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
/**
4+
** main.php
5+
** @version 1.0
6+
** @author en0ndev
7+
*/
8+
/*
9+
This file is part of Custom Profile Avatar.
10+
11+
Custom Profile Avatar is free software: you can redistribute it and/or modify
12+
it under the terms of the GNU General Public License as published by
13+
the Free Software Foundation, either version 3 of the License, or
14+
(at your option) any later version.
15+
16+
Custom Profile Avatar is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
GNU General Public License for more details.
20+
21+
You should have received a copy of the GNU General Public License
22+
along with Custom Profile Avatar. If not, see <https://www.gnu.org/licenses/>.
23+
*/
24+
defined('ABSPATH') || exit; // Exit if accessed directly
25+
26+
$template = "<div class='user__avatar'>" . htmlspecialchars_decode(get__avatar__new()) . "</div>";
27+
$template .= "<input type='text' class='hidden' name='avatar__val' value='" . get__value() . "' />";
28+
$template .= "<input id='change' type='button' value='" . esc_html__("Change Avatar") . "' /></div>";
29+
$template .= "<input id='save' type='submit' name='save__avatar' value='" . esc_html__("Save") . "' />";
30+
31+
use template\page__template;
32+
33+
$page = new page__template;
34+
35+
$page->get__template("Settings", $template, 1);

0 commit comments

Comments
 (0)