Boson.php
244 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePress\Core\Themes\Shortcode\Editprofile; |
| 4 | |
| 5 | use ProfilePress\Core\Themes\Shortcode\EditProfileThemeInterface; |
| 6 | |
| 7 | class Boson implements EditProfileThemeInterface |
| 8 | { |
| 9 | public function get_name() |
| 10 | { |
| 11 | return 'Boson'; |
| 12 | } |
| 13 | |
| 14 | public function success_message() |
| 15 | { |
| 16 | return '<div class="profilepress-edit-profile-status">Changes saved</div>'; |
| 17 | } |
| 18 | |
| 19 | public function get_structure() |
| 20 | { |
| 21 | return <<<CODE |
| 22 | <div class="boson-container"> |
| 23 | <div class="edit-profile"> |
| 24 | <h1>Edit Profile</h1> |
| 25 | <p> |
| 26 | <label for="id-username">Username</label> |
| 27 | [edit-profile-username id="id-username" placeholder="username" class="edit-profile-name"] |
| 28 | </p> |
| 29 | |
| 30 | <p> |
| 31 | <label for="id-password">Password</label> |
| 32 | [edit-profile-password id="id-password" placeholder="password" class="edit-profile-passkey"] |
| 33 | </p> |
| 34 | |
| 35 | <p> |
| 36 | <label for="id-email">Email Address</label> |
| 37 | [edit-profile-email id="id-email" placeholder="Email" class="reg-email"] |
| 38 | </p> |
| 39 | |
| 40 | <p> |
| 41 | <label for="id-website">Website</label> |
| 42 | [edit-profile-website class="reg-website" placeholder="Website" id="id-website"] |
| 43 | </p> |
| 44 | |
| 45 | <p> |
| 46 | <label for="id-nickname">Nickname</label> |
| 47 | [edit-profile-nickname class="remember-me" placeholder="Nickname" id="id-nickname"] |
| 48 | </p> |
| 49 | |
| 50 | <p class="avatar"> |
| 51 | [pp-user-avatar] |
| 52 | [pp-remove-avatar-button label="Delete" class="removed"] |
| 53 | </p> |
| 54 | |
| 55 | <p> |
| 56 | <label for="id-avatar">Profile Picture</label> |
| 57 | [edit-profile-avatar id="id-avatar"] |
| 58 | </p> |
| 59 | |
| 60 | <p> |
| 61 | [pp-user-cover-image] <br><br> |
| 62 | [pp-remove-cover-image-button label="Delete" class="removed"] |
| 63 | </p> |
| 64 | |
| 65 | <p> |
| 66 | <label for="cover-image">Cover Photo</label> |
| 67 | [edit-profile-cover-image id="cover-image"] |
| 68 | </p> |
| 69 | |
| 70 | <p> |
| 71 | <label for="display-name">Display Name</label> |
| 72 | [edit-profile-display-name class="display-name" placeholder="Display Name" id="display-name"] |
| 73 | </p> |
| 74 | |
| 75 | <p> |
| 76 | <label for="id-firstname">First Name</label> |
| 77 | [edit-profile-first-name class="remember-me" id="id-firstname" placeholder="First Name"] |
| 78 | </p> |
| 79 | |
| 80 | <p> |
| 81 | <label for="id-lastname">Last Name</label> |
| 82 | [edit-profile-last-name class="remember-me" id="id-lastname" placeholder="Last Name"] |
| 83 | </p> |
| 84 | |
| 85 | <p style="text-align:center"> |
| 86 | [edit-profile-submit value="Save Profile"] |
| 87 | </p> |
| 88 | |
| 89 | </div> |
| 90 | </div> |
| 91 | CODE; |
| 92 | |
| 93 | } |
| 94 | |
| 95 | public function get_css() |
| 96 | { |
| 97 | return <<<CSS |
| 98 | /* css class for the form generated errors */ |
| 99 | .profilepress-edit-profile-status { |
| 100 | color: #555; |
| 101 | font-size: 15px; |
| 102 | font-weight: bold; |
| 103 | margin: 10px; |
| 104 | box-sizing: border-box; |
| 105 | max-width: 350px; |
| 106 | width: 100%; |
| 107 | text-align: center; |
| 108 | } |
| 109 | /* Boson form CSS */ |
| 110 | |
| 111 | .boson-container { |
| 112 | box-sizing: border-box; |
| 113 | max-width: 400px; |
| 114 | width: 100%; |
| 115 | } |
| 116 | .boson-container a { |
| 117 | color: #527881; |
| 118 | text-decoration: underline; |
| 119 | text-align: center; |
| 120 | } |
| 121 | .boson-container .edit-profile { |
| 122 | position: relative; |
| 123 | padding: 20px 20px 20px; |
| 124 | box-sizing: border-box; |
| 125 | width: 100%; |
| 126 | background: white; |
| 127 | border-radius: 3px; |
| 128 | -webkit-box-shadow: 0 0 200px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3); |
| 129 | box-shadow: 0 0 200px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3); |
| 130 | } |
| 131 | .boson-container > .edit-profile h1 { |
| 132 | margin: -20px -20px 21px; |
| 133 | line-height: 40px; |
| 134 | font-size: 15px; |
| 135 | font-weight: bold; |
| 136 | color: #555; |
| 137 | text-align: center; |
| 138 | text-shadow: 0 1px white; |
| 139 | background: #f3f3f3; |
| 140 | border-bottom: 1px solid #cfcfcf; |
| 141 | border-radius: 3px 3px 0 0; |
| 142 | background-image: -webkit-linear-gradient(top, whiteffd, #eef2f5); |
| 143 | background-image: -moz-linear-gradient(top, whiteffd, #eef2f5); |
| 144 | background-image: -o-linear-gradient(top, whiteffd, #eef2f5); |
| 145 | background-image: linear-gradient(to bottom, whiteffd, #eef2f5); |
| 146 | -webkit-box-shadow: 0 1px whitesmoke; |
| 147 | box-shadow: 0 1px whitesmoke; |
| 148 | } |
| 149 | .boson-container > .edit-profile p { |
| 150 | margin: 20px 0; |
| 151 | font-size: 16px; |
| 152 | color: #555; |
| 153 | } |
| 154 | .boson-container > .edit-profile input[type=text], .boson-container > .edit-profile input[type=email], .boson-container > .edit-profile input[type=password], .boson-container > .edit-profile select { |
| 155 | width: 100%; |
| 156 | } |
| 157 | |
| 158 | .boson-container > .edit-profile p.submit { |
| 159 | text-align: center; |
| 160 | } |
| 161 | :-moz-placeholder { |
| 162 | color: #c9c9c9 !important; |
| 163 | font-size: 13px; |
| 164 | } |
| 165 | ::-webkit-input-placeholder { |
| 166 | color: #ccc; |
| 167 | font-size: 13px; |
| 168 | } |
| 169 | .boson-container > .edit-profile input[type=text], .boson-container > .edit-profile input[type=email], .boson-container > .edit-profile input[type=password], .boson-container > .edit-profile select { |
| 170 | margin: 5px; |
| 171 | padding: 0 10px; |
| 172 | height: 34px; |
| 173 | color: #404040; |
| 174 | background: white; |
| 175 | border: 1px solid; |
| 176 | border-color: #c4c4c4 #d1d1d1 #d4d4d4; |
| 177 | border-radius: 2px; |
| 178 | outline: 5px solid #eff4f7; |
| 179 | -moz-outline-radius: 3px; |
| 180 | -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12); |
| 181 | box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12); |
| 182 | -webkit-box-sizing: border-box; |
| 183 | -moz-box-sizing: border-box; |
| 184 | box-sizing: border-box; |
| 185 | } |
| 186 | .boson-container > .edit-profile input[type=text]:focus, .boson-container > .edit-profile input[type=email]:focus, .boson-container > .edit-profile select:focus, .boson-container > .edit-profile input[type=password]:focus { |
| 187 | border-color: #7dc9e2; |
| 188 | outline-color: #dceefc; |
| 189 | outline-offset: 0; |
| 190 | } |
| 191 | |
| 192 | .boson-container > .edit-profile input[type=submit], .boson-container > .edit-profile button.removed { |
| 193 | cursor: pointer; |
| 194 | padding: 1px 18px; |
| 195 | height: 30px; |
| 196 | font-size: 12px; |
| 197 | font-weight: bold; |
| 198 | color: #527881; |
| 199 | text-shadow: 0 1px #e3f1f1; |
| 200 | background: #cde5ef; |
| 201 | border: 1px solid; |
| 202 | border-color: #b4ccce #b3c0c8 #9eb9c2; |
| 203 | border-radius: 16px; |
| 204 | outline: 0; |
| 205 | -webkit-box-sizing: content-box; |
| 206 | -moz-box-sizing: content-box; |
| 207 | box-sizing: content-box; |
| 208 | background-image: -webkit-linear-gradient(top, #edf5f8, #cde5ef); |
| 209 | background-image: -moz-linear-gradient(top, #edf5f8, #cde5ef); |
| 210 | background-image: -o-linear-gradient(top, #edf5f8, #cde5ef); |
| 211 | background-image: linear-gradient(to bottom, #edf5f8, #cde5ef); |
| 212 | -webkit-box-shadow: inset 0 1px white, 0 1px 2px rgba(0, 0, 0, 0.15); |
| 213 | box-shadow: inset 0 1px white, 0 1px 2px rgba(0, 0, 0, 0.15); |
| 214 | } |
| 215 | .boson-container > .edit-profile input[type=submit]:active { |
| 216 | background: #cde5ef; |
| 217 | border-color: #9eb9c2 #b3c0c8 #b4ccce; |
| 218 | -webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.2); |
| 219 | box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.2); |
| 220 | } |
| 221 | |
| 222 | |
| 223 | .boson-container > .edit-profile button.removed { |
| 224 | width: auto; |
| 225 | } |
| 226 | |
| 227 | .boson-container > .edit-profile input[type=submit] { |
| 228 | width: 80%; |
| 229 | } |
| 230 | |
| 231 | |
| 232 | .boson-container .avatar img { |
| 233 | border-radius: 50%; |
| 234 | display: block; |
| 235 | height: 190px; |
| 236 | margin: 0 auto 10px; |
| 237 | padding: 2px; |
| 238 | text-align: center; |
| 239 | width: 190px; |
| 240 | } |
| 241 | CSS; |
| 242 | |
| 243 | } |
| 244 | } |