{{ content }}
27 |
28 |
29 |
36 |
--------------------------------------------------------------------------------
/src/services/events.js:
--------------------------------------------------------------------------------
1 | import { camelCase, map } from 'lodash'
2 | import Vue from 'vue'
3 |
4 | export default new Vue({
5 |
6 | methods: {
7 |
8 | formatEventName (...eventNameParts) {
9 | return map(eventNameParts, (eventNamePart) => {
10 | return camelCase(eventNamePart)
11 | }).join(':')
12 | },
13 |
14 |
15 |
16 | // These are passed to Vue's internal event API
17 |
18 | addListener (eventName, callback) {
19 | return this.$on(eventName, callback)
20 | },
21 |
22 | removeListener (eventName, callback) {
23 | return this.$off(eventName, callback)
24 | },
25 |
26 | emit (eventName, ...payload) {
27 | return this.$emit(eventName, ...payload)
28 | }
29 |
30 | }
31 |
32 | })
33 |
--------------------------------------------------------------------------------
/src/styles/keyframes/keyframes-pulse.scss:
--------------------------------------------------------------------------------
1 | @keyframes pulse {
2 |
3 | 0%,
4 | 100% {
5 | opacity: 1;
6 | }
7 |
8 | 50% {
9 | opacity: 0;
10 | }
11 |
12 | }
13 |
14 | @keyframes pulse-delayed {
15 |
16 | 0%,
17 | 40%,
18 | 100% {
19 | opacity: 1;
20 | }
21 |
22 | 20% {
23 | opacity: 0;
24 | }
25 |
26 | }
27 |
28 | @keyframes pulse-scale {
29 |
30 | 0%,
31 | 100% {
32 | opacity: 1;
33 | transform: scale(1);
34 | }
35 |
36 | 50% {
37 | opacity: 0;
38 | transform: scale(0);
39 | }
40 |
41 | }
42 |
43 | @keyframes pulse-scale-delayed {
44 |
45 | 0%,
46 | 40%,
47 | 100% {
48 | opacity: 1;
49 | transform: scale(1);
50 | }
51 |
52 | 20% {
53 | opacity: 0;
54 | transform: scale(0);
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/unit/components/snippets/ExternalLink.spec.js:
--------------------------------------------------------------------------------
1 | import { mount } from 'vue-test-utils'
2 | import { ExternalLink } from '@components'
3 |
4 | describe('ExternalLink.vue', () => {
5 |
6 | describe('should render relative src', () => {
7 |
8 | const url = '//foo'
9 | const wrapper = mount(ExternalLink, {
10 | propsData: {
11 | href: url
12 | }
13 | })
14 |
15 | it('as ', () => {
16 | expect(wrapper.contains('a')).toBeTruthy()
17 | })
18 |
19 | it('with href', () => {
20 | expect(wrapper.vm.$el.getAttribute('href')).toEqual(url)
21 | })
22 |
23 | it('with target', () => {
24 | expect(wrapper.vm.$el.getAttribute('target')).toEqual('_blank')
25 | })
26 |
27 | it('with rel', () => {
28 | expect(wrapper.vm.$el.getAttribute('rel')).toEqual('nofollow')
29 | })
30 |
31 | })
32 |
33 | })
34 |
--------------------------------------------------------------------------------
/src/config/tooling/svgo.js:
--------------------------------------------------------------------------------
1 | // https://github.com/karify/external-svg-sprite-loader/blob/master/index.js
2 | // NOTE: normally SVGO wants its configuration values in a really weird format, but we will normalize it later
3 | module.exports = {
4 | removeViewBox: false,
5 | removeTitle: true,
6 | convertColors: {
7 | names2hex: true,
8 | rgb2hex: true,
9 | shorthex: true,
10 | shortname: true,
11 |
12 | // Convert this color code in fills/strokes/etc. to currentColor (used to generate mono-capable assets)
13 | // NOTE: must be exact, case-sensitive match before any other conversions
14 | // Assets must be authored with this in mind
15 | // https://github.com/svg/svgo/blob/master/plugins/_collections.js#L2527
16 | // https://github.com/svg/svgo/blob/master/plugins/convertColors.js#L61
17 | currentColor: '#FF00FF'
18 |
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/components/containers/Page.vue:
--------------------------------------------------------------------------------
1 |
32 |
33 |
34 | Thanks for using Bellevue! This is a full-featured frontend project template for modern single-page applications built on Vue.js and Webpack.
102 | 103 |
119 |
120 |
126 |
137 |
144 |
145 |
156 | 157 | 158 |
159 | 160 | |
169 | {{ 4.5 | ceil }} | 170 |
|
173 | {{ 4.5 | floor }} | 174 |
|
177 | {{ 4.5 | round }} | 178 |
|
181 | {{ 4.52383 | decimal }} | 182 |
|
185 | {{ 8 | decimal }} | 186 |
191 | {{ 8.2123123 | decimal }} 192 | {{ 8.2123123 | decimal(0) }} 193 | {{ 8.2123123 | decimal(4) }} 194 |
195 | 196 |
197 |
206 | Network: {{ isOffline ? 'offline' : 'online' }} 207 |
208 | 209 |210 | Time: {{ time }} 211 |
212 | 213 |214 | Viewport: {{ width }} × {{ height }} px 215 |
216 | 217 |
218 |
237 |
257 | 258 | 259 |
260 | 261 |
262 |
{{ key }}