Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="BellNotification">
	<div class="countNotifications">0</div>
	<svg xmlns="http://www.w3.org/2000/svg" class="Bell" viewBox="0 0 120 152">
	<path class="BellTongue" d="M80 131a18 18 0 0 1-36 0"/>
	<path class="BellCap" d="M103 79V60a41 41 0 0 0-29-39 12 12 0 1 0-24 0 41 41 0 0 0-28 39v19a55 55 0 0 0-15 33 4 4 0 0 0 4 4h102a4 4 0 0 0 4-4 55 55 0 0 0-14-33z"/>
</svg>
	<input type="range" id="valueNotifications" max="11" value="0">
</div>

              
            
!

CSS

              
                *
	padding: 0
	margin: 0
	font-family: sans-serif

body
	background-color: #FFEC26
	height: 100vh
	display: flex
	justify-content: center
	align-items: center

.BellNotification
	width: 150px
	display: block
	margin: 50px auto
	position: relative
	& svg
		width: 100%

.countNotifications
	position: absolute
	z-index: 2
	width: 40px
	height: 40px
	line-height: 40px
	text-align: center
	color: #fff
	right: 20%
	
	background-color: #F45B69
	border-radius: 50%

.BellTongue,
.BellCap
	fill: none
	stroke: #0D2296
	stroke-linecap: round
	stroke-linejoin: round
	stroke-width: 7

.Bell
	transform: rotate(-25deg)


.BellTongue
	transform: translate(-20%, -4px)

.activeNotificationAnimation
	& .BellTongue
		animation: moveTongueBell .2s linear 4 alternate

@keyframes moveTongueBell
	from
		transform: translate(-20%, -4px)
	to
		transform: translate(20%, -4px)
	
	
input[type="range"]
	margin: auto
	width: 100%
	height: 5px
	border-radius: 20px
	background-color: #0D2296
	-webkit-appearance: none
	
input[type="range"]:focus
	outline: none

input[type=range]::-webkit-slider-thumb
	width: 20px
	height: 20px
	background: #F45B69
	border-radius: 100%
	-webkit-appearance: none

#valueNotifications
	margin-top: 50px 

@media screen and (max-width: 500px)
	.BellNotification
		width: 100px
              
            
!

JS

              
                let bell = document.querySelector('.BellNotification'),
		range= document.querySelector('#valueNotifications');

let addCount = () => {
	let counterNot = bell.querySelector('.countNotifications');
	if(range.value > 9) {
		counterNot.textContent = '9+'
	}else{
		counterNot.textContent = range.value
	}
	
}

let addAnimationBell = () => {
	bell.classList.add('activeNotificationAnimation');
	bell.addEventListener('animationend', () => {
		bell.classList.remove('activeNotificationAnimation');
	})
	window.navigator.vibrate(200)
}

range.addEventListener('change', () => {
	addCount()
	addAnimationBell()
})
              
            
!
999px

Console