Counter

Size
2,601 Kb
Views
48,576

How do I make an counter?

Experimenting with VueJS.. What is a counter? How do you make a counter? This script and codes were developed by Quincy Soeliman on 22 July 2022, Friday.

Counter Previews

Counter - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Counter</title> <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>
<link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="app"> <span v-on:click="downvote" class="downvote"><i class="fa fa-minus"></i></span> <p v-bind:style="{ color: color }">{{ count }}</p> <span v-on:click="upvote" class="upvote"><i class="fa fa-plus"></i></span>
</div> <script src='http://vuejs.org/js/vue.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Counter - Script Codes CSS Codes

html { height: 100%;
}
body { display: flex; justify-content: center; align-items: center; background: #2480B2; min-height: 100%;
}
#app { display: flex; justify-content: center; align-items: center;
}
#app span { display: flex; justify-content: center; align-items: center; width: 50px; height: 50px; color: #FFF3F2; border-radius: 50%; background: #4E8BB2; box-shadow: 2px 2px #0B75B2; transition: all 0.2s ease-in-out;
}
#app span i { font-size: 20px;
}
#app span:hover { cursor: pointer; background: #4187B2;
}
#app p { font-size: 50px; margin: 0; padding: 0 30px; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
}
#app p:hover { cursor: pointer;
}

Counter - Script Codes JS Codes

new Vue({ el: '#app', data: { count: 0, color: 'white' }, methods: { downvote: function() { if (!this.count) { this.color = '#B2261B'; } this.count--; }, upvote: function() { this.count++; if (this.count >= 0) { this.color = 'white'; } } }
});
Counter - Script Codes
Counter - Script Codes
Home Page Home
Developer Quincy Soeliman
Username quincysoeliman
Uploaded July 22, 2022
Rating 3
Size 2,601 Kb
Views 48,576
Do you need developer help for Counter?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Quincy Soeliman (quincysoeliman) Script Codes
Create amazing Facebook ads with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!